Two reversible ideal-gas paths between the same states (source code)

= Two reversible ideal-gas paths between the same states

Take a <closed system> consisting of one <mole> of a classical <monatomic gas>, idealized as an <ideal gas> with constant <heat capacity at constant volume> $C_V=3nR/2$. Stipulate <amount of substance> $n=1\,\mathrm{mol}$ and <molar gas constant> $R=8.314\,\mathrm{J\,mol^{-1}\,K^{-1}}$ for this calculation. Set initial <temperature> $T_0=300\,\mathrm K$ and <volume (thermodynamics)> $V_0=0.010\,\mathrm{m^3}$, and define $E_0=nRT_0=2.4942\,\mathrm{kJ}$ and $p_0=E_0/V_0=249.42\,\mathrm{kPa}$. The specified equilibrium endpoints are
$$
A:(V,T,p)=(V_0,T_0,p_0),\qquad
B:(V,T,p)=(3V_0,2T_0,2p_0/3).
$$
Thus $B$ has <volume (thermodynamics)> $0.030\,\mathrm{m^3}$, <temperature> $600\,\mathrm K$ and <pressure> $166.28\,\mathrm{kPa}$. The fixed material inventory and <ideal gas law> make these complete endpoint specifications for this model. All numbers below are calculated values, rather than measurements of a particular <gas>.

Use a frictionless piston, ignore bulk mechanical <energy> changes, and allow only <pressure>-<volume (thermodynamics)> <work>. Each step is the limit of a <reversible thermodynamic process>: adjust loads by infinitesimal <pressure> differences, and supply <heat> through infinitesimal <temperature> differences. Heating with changing <temperature> requires a succession of matching <thermal reservoirs>; contact with a single hotter <heat bath> would give an irreversible finite difference. On a fixed-<volume (thermodynamics)> leg the piston is locked. These assumptions justify using the actual equilibrium path's <pressure> in
$$
W_{\rm by,rev}=\int_{\rm path}p\,dV.
$$
An endpoint chord is not the path; substituting a guessed straight line would compute a different <thermodynamic process>.<Thermodynamics and Propulsion>[Thermodynamics and Propulsion, §1.3.3, Figures 1.10–1.11: external pressure versus equilibrium gas pressure in boundary work]{ref}

The upper route heats at fixed <volume (thermodynamics)> from $A$ to $C=(V_0,2T_0,2p_0)$, then undergoes <isothermal expansion> at $2T_0$ to $B$. The lower route undergoes <isothermal expansion> at $T_0$ from $A$ to $D=(3V_0,T_0,p_0/3)$, then heats at fixed <volume (thermodynamics)> to $B$. The tuples use the same $(V,T,p)$ ordering as the endpoints. Vertical legs do zero expansion <work>, and the two curved legs have different <pressures> at every shared intermediate <volume (thermodynamics)>.

\Image[/state-function-two-paths-pv.png]
{title=Two reversible <ideal gas> paths connect the same equilibrium endpoints}
{description=Original idealized <pressure>-<volume (thermodynamics)> diagram. The upper route is $A\to C\to B$ and the lower route is $A\to D\to B$; the shaded gap is the difference in <work>, not an experimental uncertainty. Both are <reversible thermodynamic processes> under the stated piston and <thermal reservoir> assumptions.}

The <internal energy of an ideal gas> gives the same endpoint difference for both routes:
$$
\Delta U=\frac32nR(2T_0-T_0)=\frac32E_0=3.7413\,\mathrm{kJ}.
$$
On either fixed-<volume (thermodynamics)> heating leg, $W_{\rm by}=0$ and $Q=3E_0/2$. On each <isothermal expansion>, $\Delta U=0$, so the <first law of thermodynamics> gives $Q=W_{\rm by}$. The <ideal gas law> and the <integral> of $1/V$ then give
$$
\begin{aligned}
W_{\rm by,upper}&=\int_{V_0}^{3V_0}\frac{2E_0}{V}\,dV=2E_0\ln3, & Q_{\rm upper}&=\frac32E_0+2E_0\ln3,\\
W_{\rm by,lower}&=\int_{V_0}^{3V_0}\frac{E_0}{V}\,dV=E_0\ln3, & Q_{\rm lower}&=\frac32E_0+E_0\ln3.
\end{aligned}
$$
Here $\ln$ is the <natural logarithm>. Rounded to $0.001\,\mathrm{kJ}$, the upper route has $(Q,W_{\rm by},\Delta U)=(9.222,5.480,3.741)\,\mathrm{kJ}$ and the lower route has $(6.481,2.740,3.741)\,\mathrm{kJ}$. Subtracting separately rounded entries can differ by $0.001\,\mathrm{kJ}$; the unrounded balances are exact in the stipulated model.

\Image[/state-function-two-paths-energy-ledger.png]
{title=Different <heat> and <work> transfers leave the same <internal energy> increment}
{description=Original calculated <energy> ledger for the two reversible paths. Each incoming <heat> bar is divided into outgoing <work> and the common stored increment $\Delta U$. Labels are rounded; bar lengths use unrounded values. These are process totals, not inventories of stored <heat> or stored <work>.}

The shaded <area> between the curves explains the entire difference:
$$
W_{\rm by,upper}-W_{\rm by,lower}
=Q_{\rm upper}-Q_{\rm lower}
=E_0\ln3\approx2.740159\,\mathrm{kJ}.
$$
Following the upper route forward and the lower route backward makes a <thermodynamic cycle> with this positive net <work> and matching net <heat>. Its <internal energy> change is zero. The two open routes themselves are reversible, so their different <work> outputs should not be mistaken for a loss caused by <entropy production>: they receive different <heat> transfers at different <temperatures>.

Two other <state functions> provide independent endpoint checks. With <enthalpy> $H=5nRT/2$ in this model,
$$
\Delta H=\frac52E_0=6.2355\,\mathrm{kJ},\qquad
\Delta S=\frac32nR\ln2+nR\ln3\approx17.7781\,\mathrm{J\,K^{-1}}.
$$
To obtain the <entropy> change along either route, integrate $C_V\,dT/T$ on its heating leg, giving $C_V\ln2$, and $nR\,dV/V$ on its <isothermal expansion>, giving $nR\ln3$. Reordering the legs changes their <heat> totals but leaves the sum of their <entropy> changes unchanged. In particular, neither route's total $Q$ divided by its final <temperature> equals $\Delta S$, and neither total $Q$ equals $\Delta H$: both routes include an <isothermal expansion>, rather than a single fixed-<pressure> heating step.