Solution (source code)

= Solution

Work in the <shock frame>. The undisturbed upstream gas enters the stationary discontinuity at speed
$$
w_1=U,
$$
while the downstream gas, which moves with the piston in the laboratory frame, leaves at
$$
w_2=U-V.
$$
The <Rankine-Hugoniot conditions for a perfect gas> are
$$
\rho_1U=\rho_2(U-V),
$$
$$
p_1+\rho_1U^2
=p_2+\rho_2(U-V)^2,
$$
and
$$
\frac{\gamma p_1}{(\gamma-1)\rho_1}+\frac{U^2}{2}
=\frac{\gamma p_2}{(\gamma-1)\rho_2}
+\frac{(U-V)^2}{2}.
$$
Eliminating the velocities between these equations gives the perfect-gas density jump
$$
\frac{\rho_2}{\rho_1}
=\frac{2\gamma+(\gamma+1)\beta}
{2\gamma+(\gamma-1)\beta},
\qquad
p_2=(1+\beta)p_1.
$$

The mass and momentum equations also imply
$$
p_2-p_1
=\rho_1U^2-\rho_2(U-V)^2
=\rho_1UV,
$$
so
$$
V=\frac{\beta p_1}{\rho_1U}.
$$
Substitution of the density ratio into mass conservation, followed by this momentum relation, gives
$$
U^2=\frac{p_1}{\rho_1}
\left[\gamma+\frac{\gamma+1}{2}\beta\right].
$$
Using the <adiabatic sound speed> $c_1^2=\gamma p_1/\rho_1$ therefore yields
$$
\boxed{\frac{U^2}{c_1^2}
=1+\frac{\gamma+1}{2\gamma}\beta.}
$$
Finally, eliminating $U$ from $V=\beta p_1/(\rho_1U)$ gives the <piston-driven normal shock> relation
$$
\boxed{
V^2=
\frac{2\beta^2}{2\gamma+(\gamma+1)\beta}
\frac{p_1}{\rho_1}.}
$$
For a compressive shock $\beta>0$, the first boxed equation has $U>c_1$: \b[the shock propagates supersonically into the undisturbed gas], approaching the sound speed in the <weak shock> limit $\beta\to0$.