TNK LAB

Legendre Transform in Thermodynamics

Same tangent-line trick as the pure-math version, now applied to a real ideal monatomic gas: the exact (inverted) Sackur-Tetrode internal energy $U(S,V)$. Sweep the entropy S at fixed volume V and watch the tangent's slope become temperature T, and its y-intercept become the Helmholtz free energy F = U − TS.

System Parameters

At S₀ = -, V = -

U(S₀,V): -
T = (∂U/∂S)V [slope]: -
b = U − TS₀ [y-intercept]: -

F(T,V) = b: -
Exact F(T,V), closed form: -

Maxwell Relation Check

(∂S/∂V)T, from U(S,V): -
(∂P/∂T)V, from U(S,V): -
-

The Model

$$U(S,V,N) = \Theta\,N^{5/3}V^{-2/3}\,e^{2S/3N}$$
This is the exact Sackur-Tetrode entropy of a monatomic ideal gas, algebraically inverted to give U(S,V,N) directly (reduced units, kB=1; Θ bundles particle mass and ħ into one dial). It reproduces real ideal-gas thermodynamics exactly: $T=\tfrac{2U}{3N}$, $P=\tfrac{2U}{3V}$, and $PV=NT$.
$$F(T,V) = U - TS = b \quad\text{(the tangent's y-intercept, directly)}$$
Note the sign: in the pure-math sim, $f^*(p)=-b$. Here $F=+b$ — thermodynamics defines $F=U-TS$ (minimized over S at fixed T), not $\sup_S[TS-U]$, so the extra minus sign disappears. Same geometric construction, opposite convention.
Where does the Maxwell relation come from?
$dF = -S\,dT - P\,dV$ is an exact differential (F is a genuine function of state), so its mixed second partial derivatives must agree regardless of order: $$\frac{\partial}{\partial V}\!\left(\frac{\partial F}{\partial T}\right) = \frac{\partial}{\partial T}\!\left(\frac{\partial F}{\partial V}\right) \;\Longrightarrow\; \left(\frac{\partial S}{\partial V}\right)_T = \left(\frac{\partial P}{\partial T}\right)_V$$
The panel above computes both sides independently, straight from U(S,V) — not from a shared shortcut formula — and they match. That's not a coincidence needing proof each time: it's a direct consequence of F being a well-defined Legendre transform of U in the first place.
This only works because U(S,V) is convex in S at fixed V (equivalently, CV > 0): thermodynamic stability is convexity, exactly the requirement sim17's double-well violated.

U(S) at Fixed V, with Tangent Line

U(S,V)
tangent at S₀
(S₀, U(S₀))
y-intercept (0, b) = F

Transformed Variable: F(T,V) vs. T

F(T,V) = b(S), traced in S₀ order
current S₀
Always monotonic here — U is convex in S, so it never folds.