# Unable to validate the Roe matrix for the Shallow Water Equations

In LeVeque's Finite Volume Methods for Hyperbolic Problems, p. 320-321, one may find the derivation of the Roe matrix to the 1D Shallow Water Equations (SWEs). It is $$\hat{A}_{i-1/2}=\begin{pmatrix}0&1\\-\hat{u}^2+g\bar{h}&2\hat{u}\end{pmatrix}$$ where $\bar{h}=(h_i+h_{i-1})/2$ and $$\hat{u}=\frac{\sqrt{h_{i-1}}u_{i-1}+\sqrt{h_i}u_i}{\sqrt{h_{i-1}}+\sqrt{h_i}}$$ is the Roe average. I just want to validate that this in fact is a Roe matrix to the SWEs by checking the three conditions. I can without problem check the first two, i.e. that the matrix is diagonalizable with real eigenvalues and that the consistency with the exact Jacobian; however, I am struggling with the third condition. In LeVeque, p. 318, it says

If $Q_{i-1}$ and $Q_i$ are connected by a single wave $\mathcal{W}_p=Q_i-Q_{i-1}$ in the true Riemann solution, then $\mathcal{W}_p$ should also be an eigenvector of $\hat{A}_{i-1/2}$.

(This statement is equivalent with the one on Wikipedia).

My attempt: Assume that $Q_{i-1}$ and $Q_i$ are connected by a single wave $\mathcal{W}_p=Q_i-Q_{i-1}$ in the true Riemann solution. Using the Rankine-Hugoniot condition this means $$f(Q_i)-f(Q_{i-1})=s(Q_i-Q_{i-1})$$ where $s$ is the shock speed. So if $Q_i=(q^1_i,q^2_i)$ and $Q_{i-1}=(q^1_{i-1},q^2_{i-1})$ then $$f(Q_i)-f(Q_{i-1})=\begin{pmatrix}q^2_i\\(q^2_i)^2/q^1_i+\frac{1}{2}g(q^1_i)^2\end{pmatrix}-\begin{pmatrix}q^2_{i-1}\\(q^2_{i-1})^2/q^1_{i-1}+\frac{1}{2}g(q^1_{i-1})^2\end{pmatrix}\\ =\begin{pmatrix}q^2_i-q^2_{i-1}\\(q^2_i)^2/q^1_i-(q^2_{i-1})^2/q^1_{i-1}+\frac{1}{2}g((q^1_i)^2-(q^1_{i-1})^2)\end{pmatrix}\\ =s\begin{pmatrix}q_i^1-q_{i-1}^1\\q_i^2-q_{i-1}^2\end{pmatrix}$$ From this we get a condition, namely $$\frac{q^2_i-q^2_{i-1}}{q^1_i-q^1_{i-1}}=\frac{(q^2_i)^2/q^1_i-(q^2_{i-1})^2/q^1_{i-1}+\frac{1}{2}g((q^1_i)^2-(q^1_{i-1})^2)}{q^2_i-q^2_{i-1}}$$ By letting $\overline{q^1}=q^1_i-q^1_{i-1}$ and $\overline{q^2}=q^2_i-q^2_{i-1}$, this can be written $$\alpha=\frac{\overline{q^2}}{\overline{q^1}}=\frac{(q^2_i)^2/q^1_i-(q^2_{i-1})^2/q^1_{i-1}+\frac{1}{2}g((q^1_i)^2-(q^1_{i-1})^2)}{\overline{q^2}}$$ and we get a relation between the components of the eigenvector $\mathcal{W}_p$. Note that $$\mathcal{W}_p=Q_{i}-Q_{i-1}=\begin{pmatrix}\overline{q^1}\\\overline{q^2}\end{pmatrix}=\begin{pmatrix}\overline{q^1}\\\alpha\overline{q^1}\end{pmatrix}=\overline{q^1}\begin{pmatrix}1\\\alpha\end{pmatrix}$$ Now, the eigenvalues to the Roe matrix is given by $\hat{u}\pm\sqrt{g\bar{h}}$ with corresponding eigenvectors $(1,\hat{u}\pm\sqrt{g\bar{h}})$, so I really just have to show that $\alpha=\hat{u}\pm\sqrt{g\bar{h}}$; however, plugging the expressions in to Maple gives me that they are not. I have also tried in the other direction, namely to take the eigenvectors and plug it into $f(Q_i)-f(Q)$ but yet again it does not yield the desired result. Is there something else I have to assume – some relation that I am missing? It is funny, the derivation of the matrix is quite simple.

You do not need to fiddle around with simple waves to show that the Roe-mean satisfies the third condition. Just plug \begin{align} \hat{u}&=\frac{\sqrt{h_{1}}u_{1}+\sqrt{h_2}u_2}{\sqrt{h_{1}}+\sqrt{h_2}}\\ \bar{h}&=(h_1+h_2)/2 \end{align} into $$\hat{A}_{i-1/2}=\begin{pmatrix}0&1\\-\hat{u}^2+g\bar{h}&2\hat{u}\end{pmatrix}$$ and verify $\hat A(q_2-q_1) = F(q_2) - F(q_1)$ being $$\begin{pmatrix}0&1\\-\hat{u}^2+g\bar{h}&2\hat{u}\end{pmatrix} \begin{pmatrix} h_2-h_1\\ (hu)_2-(hu)_1 \end{pmatrix} = \begin{pmatrix} (hu)_2 - (hu)_1\\ \frac g2\left(h_2^2 - h_1^2\right)+h_2 u_2^2- h_1 u_1^2 \end{pmatrix}.$$ (That turns out to be true.)
In the second equation component you get already the interesting component with $g=0$. The left-hand side is: \begin{align} &=-\frac{(\sqrt{h_1}u_1 + \sqrt{h_2}u_2}{(\sqrt{h_1}+\sqrt{h_2})^2}\cdot (\sqrt{h_1}+\sqrt{h_2})(\sqrt{h_2}-\sqrt{h_1}) +\frac{\sqrt{h_1}u_1+\sqrt{h_2}u_2}{\sqrt{h_1}+\sqrt{h_2}}((hu)_2-(hu)_1) \end{align} In the first term $\sqrt{h_1}+\sqrt{h_2}$ cancels out and you get a common denominator $\sqrt{h_1}+\sqrt{h_2}$. \begin{align} &=\frac{-(\sqrt{h_1}u_1+\sqrt{h_2}u_2)((hu)_2-(hu)_1+\sqrt{h_1h_2}(u_1-u_2)) +2(\sqrt{h_1}u_1+\sqrt{h_2}u_2)((hu)_2-(hu)_1) }{\sqrt{h_1}+\sqrt{h_2}}\\ &=\frac{(\sqrt{h_1}u_1+\sqrt{h_2}u_2)((hu)_2-(hu)_1-\sqrt{h_1h_2}(u_1-u_2))}{\sqrt{h_1}+\sqrt{h_2}}\\ &=\frac{(\sqrt{h_1}u_1+\sqrt{h_2}u_2)(\sqrt{h_2}u_2-\sqrt{h_1}u_1)(\sqrt{h_1}+\sqrt{h_2})}{\sqrt{h_1}+\sqrt{h_2}}\\ &=h_2 u_2^2 - h_1 u_1^2 \end{align} Avoid formula manipulation software for such things -- use your own brain (as far as possible).