# Contradiction in maximum entropy principle

The maximum entropy principle states that at equilibrium entropy is maximized. However I found this principle paradoxical because in pure thermodynamics entropy is defined only for equilibrium states. How is it possible?

Edit: Some answers below suggest that entropy can be defined also for state out of equilibrium. This remove the contradiction, the equilibrium is just the state of maximum entropy.

However i'm not convinced that this is the the answer i was looking for. Consider, for example, the free expansion of a gas. Will the gas occupy the entire available volume? of course yes but let's prove it using the maximum entropy principle: because the energy is constant $$dU=TdS-PdV=0$$ from which $$dS/dV=P/T>0$$. Then the maximum entropy is reached when the volume is maximized.

Why is this different from defining entropy for a system out of equilibrium? Because when we write $$dU=TdS-PdV$$ we are writing differences between equilibrium states. $$dS=S(V+dV,U)-S(V,U)$$ is the difference between the entropy if the system is in equilibrium at volume $$V+dV$$ and the entropy if the system is in equilibrium at volume $$V$$. If we would define the entropy $$S'$$ for the system out of the equilibrium, then $$dS'\neq dS$$.

Attempt of an answer: I think that when a parameter (for example volume) can freely change we have to consider the system in equilibrium for every possible value of the parameter and then choose as the true physical equilibrium the value of the parameter in which entropy is maximized

• Please provide a source in which context this is stated. Are you familiar with the concept of information entropy? Commented Oct 14, 2021 at 7:19
• There are different ways to define entropy, e.g., see this answer: physics.stackexchange.com/a/669707/247642 Commented Oct 14, 2021 at 9:31
• Do you want an answer from the perspective of thermodynamics, or statistical mechanics. Commented Oct 15, 2021 at 16:30
• Thermodynamics please Commented Oct 15, 2021 at 17:15

There are many thermodynamic quantities that can be well-defined for out-of-equilibrium as well as equilibrium states. Internal energy, volume and entropy are a few.

We define entropy in general by asserting that it is the sum of the entropies of all the parts of a system. Then you can take the parts small enough that each is in internal equilibrium, yet large enough that thermodynamics still applies (I am giving a thermodynamic answer here). The thermodynamic limit allows both requirements to be satisfied simultaneously.

Note that when each part is in internal equilibrium we don't necessarily have an equilibrium state overall because the different parts may not be in equilibrium with each other.

There is a difficulty with cases where a thermodynamic limit may be unclear or too great an approximation. For example in a highly irregular case such as turbulent flow it may not be possible to find parts that are large enough to be treated accurately in a thermodynamic limit (the limit of large numbers of microstates). In such cases one may adopt the statistical definition $$S = -k_{\rm B} \sum p_i \ln p_i$$. The standard approach is to assert that this is a definition, and one then gives arguments to show that such a definition agrees with the thermodynamic statement $$dS = dQ_{\rm rev}/T$$ in the thermodynamic limit.

• Previously i considered this answer satisfying, however i've recently thought to an example that makes this answer less satisfactory. I edited the question according to my new doubts about it. Commented Jun 25, 2022 at 17:53

The following is from a thermodynamics perspective, rather than statistical mechanics.

I've read that equilibrium is the state at which entropy has a maximum.

I believe you are referring to the maximum entropy principle. If so, from a thermodynamics perspective, the maximum entropy principle states that for an isolated system (a system for which there is no energy or mass transfer with the surroundings) the entropy is maximized at equilibrium. (See https://en.wikipedia.org/wiki/Principle_of_minimum_energy#:~:text=The%20maximum%20entropy%20principle%3A%20For,energy%20is%20minimized%20at%20equilibrium.)

However I found this definition paradoxical because on books entropy is usually defined only for equilibrium states

Yes, entropy is a (equilibrium) thermodynamics state property. But I don't believe there is a paradox.

For an isolated system if the system is not in internal equilibrium, entropy is not maximized. Only when it comes to internal equilibrium is entropy maximized. And if it is not in internal equilibrium it can only be brought to internal equilibrium as a result of an irreversible process, which by definition generates (increases) entropy.

Take the often used example of the free expansion of an ideal gas into a vacuum. The system consists of an ideal gas and a vacuum separated by a partition bounded by a rigid, thermally insulated vessel. So we have an isolated system (no work, heat, or mass transfer with the surroundings). The gas (one part of the system) is initially in internal equilibrium and the vacuum (the other part of the system) is in internal equilibrium, but the gas and the vacuum are not in equilibrium with each other due to the pressure and temperature difference (temperature of a perfect vacuum being zero).

In order to bring the two parts of the system into equilibrium, an opening in the partition is created and the gas allowed to freely expand into the vacuum until equilibrium is established. The process is irreversible and entropy is generated (entropy increases). For the process, $$\Delta U=0$$ and for an ideal gas $$\Delta T=0$$. The change in entropy can be calculated by assuming a reversible isothermal path connecting the initial and final states of the system. The entropy of the new state of the system is now maximized.

Hope this helps.

• You say "entropy is a (equilibrium) thermodynamics state property" and "if the system is not in internal equilibrium, entropy is not maximized". But if system is not in internal equilibrium entropy is not defined. I see a paradox in saying entropy is both not at max and not defined Commented Oct 18, 2021 at 9:32
• I was referring to different parts of a system not being in equilibrium with one another but individually in internal equilibrium, like the example I gave. See the third paragraph of Andrew Steene's answer. In that example the gas was initially in internal equilibrium with some initial entropy. Commented Oct 18, 2021 at 10:48
• The total system doesn't have an entropy if it' not at equilibrium, and if it has it then is always maximized because it's in equilibrium. Moreover the system made by two parts as you described I think it's in equilibrium, indeed you need to modify the system (removing the separating wall) to let the system evolve in a new equilibrium. Commented Oct 18, 2021 at 13:05
• If the two parts of the system were in equilibrium with one another, nothing would happen if the partition is removed. It appears no matter what I (or Andrew Steen said in his 3rd paragraph) say, it appears you will remain unconvinced. That's OK, but I see no point in continuing the discussion. Hope you find the answer you are looking for. Commented Oct 18, 2021 at 13:50
• Equilibrium means that a system remains unchanged over time. The statements 'two subsystems are in equilibrium with each other' makes no sense. Both susbsystems, and the global system, are at equilibrium. If you remove the barrier, they are no longer in equilibrium, but they are also not isolated anymore since you interacted with the barrier, so the whole analysis becomes useless. I find the question is good and shines a light on some very unclear aspects of thermodynamics. Commented Jul 25, 2022 at 11:26

From the paper Entropy and Time by Arieh Ben-Naim:

Unfortunately, there is no general definition of equilibrium which applies to all systems. Callen [35*,36**], introduced the existence of the equilibrium state as a postulate. He also emphasized that any definition of an equilibrium state is necessarily circular.

I don't know if that view is universal, but certainly you can talk about the entropy of a nonequilibrium system in the way that Andrew Steane said (summing up the entropies of the parts, with the assumption that each test volume is well-described by whatever distribution and with the assumption that the entropy is extensive). So I think your answer is correct and that there are many assumptions baked into the word "equilibrium".

*35. Callen H.B. Thermodynamics. John Wiley and Sons; New York, NY, USA: 1960

**36. Callen H.B. Thermodynamics and an Introduction to Thermostatistics. 2nd ed. John Wiley and Sons; Hoboken, NJ, USA: 1985.

Boltezmans entropy equation is what is used for equilibrium situations, thats what the OP has no doubt read in a book, i.e. like this.

However, Boltezeman cannot be used in non-equilibrium systems, for that you need to use Shannons entropy equation. That the resolution to the OP's 'paradox'.

For more on the connection between entropy definitions, see my answer