36B (source code)

= 36B
{scope}
{title2=Waves}

Linearizing the <shallow water equations> about depth $h$ at rest gives wave speed $c=\sqrt{gh}$. Replacing $h$ by $c$ in the nonlinear equations yields $c_t+u c_x+(c/2)u_x=0$ and $u_t+u u_x+2c c_x=0$. Direct addition and subtraction give
$$
[\partial_t+(u\pm c)\partial_x]\,[u\pm2(c-c_0)]=0.
$$
Thus the <Riemann invariants> $J_\pm=u\pm2(c-c_0)$ are constant on the <characteristics> $C_\pm$ with speeds $u\pm c$. In this problem $c_0=\sqrt{gh_0}$.