Solution (source code)

= Solution

This is the ideal <Diesel cycle>. In the $(p,V)$ plane, $A\to B$ is an adiabatic curve running up and left, $B\to C$ is a horizontal constant-pressure segment running right, $C\to D$ is an adiabatic curve running down and right, and $D\to A$ is a vertical constant-volume segment running down. The traversal is clockwise, so the enclosed area is positive work output.

In the $(T,S)$ plane, the two reversible adiabats are vertical because <entropy> is constant: $A\to B$ rises at $S_A=S_B$, and $C\to D$ falls at $S_C=S_D$. Along $B\to C$, the heat increment at constant pressure is
$$
\delta Q=C_p\,dT=T\,dS,
$$
so
$$
\boxed{S-S_B=C_p\log\frac{T}{T_B}},
\qquad
\boxed{T=T_Be^{(S-S_B)/C_p}}.
$$
Along the constant-volume curve $D\to A$,
$$
\delta Q=C_V\,dT=T\,dS,
$$
which gives
$$
\boxed{S-S_A=C_V\log\frac{T}{T_A}},
\qquad
\boxed{T=T_Ae^{(S-S_A)/C_V}}.
$$
\b[Thus $B\to C$ runs up and right and $D\to A$ runs down and left between the two vertical adiabats.]