# How can Entropy be maximal when it is undefined everywhere else?

This question is about classical thermodynamics.

I learned that when an isolated system is not in equilibrium, its thermodynamic variables such as Entropy are undefined.

I also learned that when an isolated system is in equilibrium, its Entropy is maximized.

However, both statements together don't make sense. How can a value be maximized, when everywhere else it is undefined? It's not smaller everywhere else, it's undefined! It can't be maximal or minimal because there isn't anything else nearby to compare it with.

So how am I supposed to interpret these statements?

• I don't know exactly where Ed Sheeran is at the moment; but I'm quite sure Neptune is further from the Sun than he is. Just because you don't know a precise value doesn't mean that you can't bound it to some degree. Jul 27 at 14:56
• @Flater Unknown is not undefined. Jul 27 at 23:43

Your question is an interesting one. One way of addressing this is to subscribe to the idea that, even in non-equilibrium situations, the state variables such as U, H, S, etc. can be defined and calculated locally (per unit mass or unit volume) based on the local conditions of temperature, pressure, species concentrations, and specific volume; this assumes that locally, the material is approximately at thermodynamic equilibrium. Then one can integrate over the entire mass of material to obtain the overall values of the state variable. This is what we do in engineering all the time. Following this approach, a non-equilibrium isolated system would evolve from a state of lower entropy to higher entropy.

Note that this is what is tacitly done when we minimize the Gibbs free energy with respect to conversion in deriving the relationship for the equilibrium constant of a reaction. The intermediate states along the curve of G vs conversion are not chemical equilibrium states.

Boltzmann and Shannon entropies
There exist different definitions of entropy that are not exactly equivalent (see, e.g., this answer). Thus, Boltzmann entropy, defined via $$S=k\log\Omega,$$ indeed does not make sense when we are talking about non-equilibrium state, since the statistical weight $$\Omega$$ implies that all the states are equiprobable. However, its generalization in information science, Shannon entropy, can be defined for an arbitrary state: $$S=-\sum_ip_i\log p_i.$$ (For equiprobable microstates the two definitions are identical.)

Gibbs entropy
Gibbs entropy is defined as a function of state, satisfying Gibbs inequality: $$dS\geq \oint\frac{\delta Q}{T}.$$
Strictly speaking, this inequality does not state that we know the entropy of non-equilibrium states, but only that we know the entropy of the initial and final equilibrium states, and how this change of entropy is related to the path connecting these states.

Entropy as extremum principle
Finally, Gibbs defined entropy as a function of state that is maximized in an equilibrium state. In this sense, the entropy should be though of as an equivalent of an action functional in classical mechanics - what is important here is not that all the values of entropy/action could be realizable (they are usually not), but that the values of the observed variables are determined by maximizing/minimizing this function/functional.

Entropy production
Finally, in the context of non-equilibrium thermodynamics one does extend the definition of entropy to non-equilibrium states, speaking of the entropy production. See
Entropy production in non-equilibrium systems: physical interpretation?
Maximum Principle vs. Minimum Principle in Non-equilibrium Thermodynamics

As you wrote, entropy is undefined in non-equilibrium conditions. However, one can compare entropy in different equilibrium states of the same system. That is a meaningful comparison, and in particular, one can compare the entropy value in conditions characterized by the same values of the thermodynamic variables but different constraints. That is where we look for the maximum of the entropy to establish which of the various systems corresponds to the equilibrium state spontaneously reached when constraints are relaxed.

I learned that when an isolated system is not in equilibrium, its thermodynamic variables such as Entropy are undefined. I also learned that when an isolated system is in equilibrium, its Entropy is maximized. However, both statements together don't make sense.

It seems your question boils down to the following: Is it possible for an isolated system to be initially in equilibrium but where the entropy of the system is not maximized.

In order to answer this question and reconcile the two statements you presented, perhaps instead of asking whether or not an isolated system is in equilibrium, we should be asking whether or not the potential for disequilibrium exists in an isolated system due to some constraint in the system. If the potential for disequilibrium exists, and it is possible to realize that potential, the initial entropy of the system is not maximized. This is somewhat in line with @GeorgioP answer when it referred to "equilibrium state spontaneously reached when constraints are relaxed".

Example:

Consider a rigid thermally insulated vessel with no openings. The vessel is initially divided in half by a rigid thermally insulated barrier with no openings. Each half of the vessel contains a gas at different constant pressure and temperature. Consider the system to be the contents of the vessel (making it an isolated system) comprised of two sub systems initially isolated from one another, each internally in equilibrium.

Since the temperature, pressure and volume of each sub system is constant (not changing in time), each sub systems is internally in equilibrium. Thus the entropy of each subsystem is defined. The total entropy of the system is then defined as the sum of the entropies of the subsystems.

Question: Is the above described system in equilibrium?

1. On the one hand, if we define equilibrium as the condition where the thermodynamic variables of the system are not changing in time, our system would be considered in equilibrium.

2. On the other hand, if we define equilibrium as the condition where the thermodynamic variables (temperature and pressure) are the same throughout the system, our system would not be considered in equilibrium.

We do know, however, that if an opening were created in the internal constraint (barrier) by some means internal to the isolated system disequilibrium would exist resulting in an irreversible expansion of the higher pressure gas into the lower pressure gas generating entropy. Once equilibrium is reestablished, entropy would be maximized. In short, we know that a realizable potential for disequilibrium theoretically exists.

Hope this helps.

Equilibrium thermodynamics employs a special idealization to deal with non equilibrium states. It goes as follows:

Take a box with energy $$E$$, volume $$V$$ and number of particles $$N$$. The system is internal equilibrium. Next, divide it into two parts $$(E_1,V_1,N_1)$$ and $$(E_2, V_2,N_2)$$, with $$E_1+E_2=E$$, $$V_1+V_2=V$$ and $$N_1+N_2=N$$. Each part is internal equilibrium but not necessarily in equilibrium with each other. Entropy is defined in both parts and in the unpartitioned box. Thermodynamics says $$S(E,V,N) \geq S(E_1,V_1,N_1)+S(E_2,V_2,N_2)$$ If this holds as an exact equality we say that the parts and the whole are in equilibrium: if we remove the partition that divides the box we will observe no macroscopic changes. If it holds as an inequality thenthe parts represent a non equilibrium partitioning of the whole: removing the partition will result in macroscopic change of state.

In this construction the "non-equilibrium state" is viewed as a partitioning into parts that are in internal equilibrium. We then compare the partitioned state to the equilibrium state of the whole. Entropy could be minimized in equilibrium. Or it could be 70% of the min. It's not. Instead, it's maximized.