# Generalized work to increase both entropy and energy of a system

Suppose we have an adiabatic container with $N$ ideal gas particles, and each particle consists of two identical atoms so that each possesses a vibrational mode. For simplicity, let us assume that the vibrational modes are approximated by harmonic oscillators. In other words, we have $N$ ideal gases and, simultaneously, $N$ harmonic oscillators in the container.

If we exert an external force to compress the container, some amount of work will be transferred into the container, increasing total kinetic energy of ideal gases. In other words, the number of allowable microstates in a momentum phase space of the gases increases. On the other hand, the shirinkage of a coordinate phase space (= reduced volume) cancels out the expansion of the momentum phase space. Thus, the total number of microstates of the container does not change, resulting in no change in entropy of the container, i.e. $$dS =k_B(dln\Omega)= \frac{1}{T}(dE + PdV - \mu dN - fdX) = 0$$ since $dE = -PdV$ and $\mu dN = fdX = 0$ ($f$ and $X$ stand for generalized forces and generalized coordinates respectively). This result agrees with what we already know: $dS=0$ since $dQ_{rev}/T=0$ in an adiabatic compression of an ideal container.

However, suppose that we radiate an electric field to the container. The field will transfer some work to the container, assuming that the field interacts with electron density polarizations of the gases, which results in excitation of the vibrational modes. As a result, the number of allowed modes inside the container will increase and subsequently, the entropy of the container will also increase (the number of microstates rise), i.e. $$dS=k_B(dln\Omega) >0 \tag{1} \label{1}$$. However, since all work done by the electric field is equivalent to the change of the energy of the container, $$dE=fdX$$ and thus, $$dS=\frac{1}{T}(dE + PdV - \mu dN - fdX) =0 .\tag{2} \label{2}$$ Obviously, equations $\eqref{1}$ and $\eqref{2}$ are contradictory. If the generalized work has a form of $-PdV$, I do not have any problem (as illustrated above). The origin of such contradiction may result from the fact that the generalized work done by the electric field increase both the energy and the total number of allowed microstates inside the container.

How can I solve this contradiction? Shouldn't I interpret the energy transferred by the field as a work? If this is true, why? I mean, how can I judge whether an energy transferred to a system is $TdS$ (~ heat) or $fdX$ (~ work)?

• Since reversible work carries no entropy and doesn't increase entropy, the problem must lie with the statement "As a result, the number of allowed modes inside the container will increase". Note that whereas heating increases the width of energy distributions, doing reversible work elevates energies but doesn't change their distribution. (Consider heating a gas vs. imparting a high speed to its enclosure.) If the gases in the electric field example are all vibrating uniformly, are there really more microstates relative to the zero-electric-field case? Commented Apr 18, 2018 at 17:56

After a work is done on a thermally isolated system, its entropy may have stayed the same or it may have increased.

It seems you consider adiabatic process where the entropy has increased. This is fine, such processes are common.

In such a process, the usual relations between changes of state variables (displacements, forces) and work may not apply; total work may not be expressible as sum of (force)x(generalized displacement).

This happens, for example, when friction has to be considered. Consider gas in a cylinder with a piston. If there is friction between the piston and the walls, the work done on the system will be greater than work accepted by the gas, since part of the work goes to heating the walls and part of that part heats the gas. Then, the work done is not expressible as $-pdV$ where $p$ is pressure inside the cylinder. However, if the process is quasistatic, then some relations are still applicable, such as the fundamental relation connecting changes of state variables $T,S,p,V$ to changes of internal energy:

$$dU = TdS - pdV.$$

In such a situation, $-pdV$ is not equal to work done on the system (the work done is greater than $-pdV$) and $TdS$ is not equal to heat supplied to the system. But their sum still equals increase in internal energy.

Similar thing will happen in your process; during the change of polarization part of the work done will not manifest as increased polarization, but as increased entropy. Of course, increase in internal energy will be equal to the work done. But at the same time, the fundamental relation

$$dU= TdS + f_1dX_1 + f_2dX_2 + ...$$

will be applicable, where $TdS$ is positive. In other words, the work done won't be expressible as

$$f_1dX_1 + f_2dX_2 + ...$$ but will include the term $TdS$.