Solution (source code)

= Solution

Before shock formation, the piston launches a right-moving <pressure in a perfect-gas simple wave>[simple wave] into the undisturbed gas. The opposite invariant is fixed at its ambient value:
$$
R_-=u-\frac{2c}{\gamma-1}
=-\frac{2c_0}{\gamma-1}.
$$
Therefore the <pressure in a perfect-gas simple wave>[simple-wave relation] is
$$
\boxed{c=c_0+\frac{\gamma-1}{2}u}.
$$