Constant-entropy magnetic cooling example (source code)

= Constant-entropy magnetic cooling example
{title2=$T_f=T_iB_f/B_i$}

Choose a fictional two-level refrigerant with $\mu/k_B=1\,\mathrm{K\,T^{-1}}$, where the upright $\mathrm T$ denotes <tesla (unit)>. This chosen moment is a convenient model parameter, not a fitted property of the historical salt. At bath <temperature> $T_b=1\,\mathrm K$, raise $B$ from $0.20\,\mathrm T$ to $1.00\,\mathrm T$. Then $x$ increases from $0.20$ to $1.00$, so
$$
s(0.20)=0.673540\ldots,\qquad s(1)=0.365334\ldots,
\qquad \frac{Q_{\rm in}}{Nk_BT_b}=s(1)-s(0.20)=-0.308206\ldots.
$$
The last equality assumes a reversible <isothermal process> of <magnetization>; negative $Q_{\rm in}$ means the refrigerant rejects <heat>. The bath gains $0.308206\ldots Nk_B$ of <entropy>, balancing the stage's loss in this reversible limit. An appreciable <temperature> difference during real <heat transfer> adds <entropy production>.

Now open the <heat switch> and reduce $B$ from $1.00\,\mathrm T$ to $0.10\,\mathrm T$. Constant $x=1$ gives $T_f=0.10\,\mathrm K$. Throughout this ideal cooling leg, $p_-=0.880797\ldots$, $p_+=0.119203\ldots$, and $S_{\rm mag}=0.365334\ldots Nk_B$. Neither state becomes more probable. Field reduction shrinks the <energy> gap by ten while preserving the <Boltzmann distribution>'s dimensionless ratio of gap to <temperature>.

\Image[/paramagnetic-entropy-cooling-curves.png]
{title=<Magnetic entropy> curves and an original <isothermal process> followed by cooling}
{id=paramagnetic-entropy-cooling-curves}
{description=Left: the calculated two-level <magnetic entropy> at three chosen <magnetic fields>. Right: constant-<entropy> curves in the positive field–<temperature> plane. A to B exports <entropy> to a bath at $1\,\mathrm K$; B to C keeps $x=1$. All curves are ideal-model calculations, with no experimental points.}
{source=paramagnetic-entropy-cooling-curves.py}

There is a subtle <energy> check. For the spin <Hamiltonian> convention used here, external-field interaction <energy> belongs to $U_{\rm mag}$, so reversible <work> done on the spin subsystem is $\delta W_{\rm on}=-m\,dB$ and
$$
dU_{\rm mag}=T\,dS_{\rm mag}-m\,dB.
$$
On the isolated leg, $Q=0$ but $U_{\rm mag}$ increases from $-0.761594\ldots Nk_B\,\mathrm K$ to $-0.0761594\ldots Nk_B\,\mathrm K$, becoming less negative as the gap shrinks. Integrating $-m\,dB$ at constant $x=1$ supplies exactly $+0.685435\ldots Nk_B\,\mathrm K$. Cooling therefore need not decrease this chosen spin <internal energy>. An account of <work> exchanged with a magnet circuit must specify where field interaction <energy> is assigned before comparing signs. The occupation ratio and <temperature> prediction do not depend on that bookkeeping choice.

For the isothermal preparation, direct integration gives $W_{\rm on}/(Nk_BT_b)=-\ln[\cosh(1)/\cosh(0.20)]=-0.413913\ldots$. The endpoint <internal energy> difference is $-0.722119\ldots Nk_BT_b$, equal to $Q_{\rm in}+W_{\rm on}$. This independently checks both the rejected <heat> and the magnetic-work sign in the chosen convention.