Solution (source code)

= Solution

Bed and sidewall stress, turbulent mixing at the interface, wave radiation and <hydraulic jumps> convert or remove mechanical energy. In the specified local head-loss model, differentiate $B=u^2/2+g'h$ while keeping $Q=bhu$ constant:
$$
B'=g'(1-F^2)h'-u^2\frac{b'}b.
$$
At a regular <hydraulic control> the coefficient of $h'$ vanishes. Therefore $B'=-\alpha$ requires
$$
\boxed{\alpha=u_c^2\frac{b'(x_c)}{b(x_c)}
=g'h_c\frac{2x_c}{L^2+x_c^2},\qquad
h_c=\left[\frac{Q^2}{g'b(x_c)^2}\right]^{1/3}.}
$$
Thus the control moves to the widening downstream side, $x_c>0$. This is the exact local compatibility condition; it is the <head-loss correction to hydraulic control> with loss expressed as Bernoulli potential per unit length.

For a small loss and a control remaining near the throat, use the lossless depth $h_c=2H/3+O(\alpha)$ and $b'/b=2x_c/L^2+O(x_c^3/L^4)$. The leading displacement is
$$
\boxed{x_c\simeq\frac{\alpha L^2}{2g'h_c}\simeq\frac{3\alpha L^2}{4g'H}.}
$$
For a finite loss, the local derivative alone does not specify the accumulated loss from the far-upstream reservoir, so it does not fix a unique revised discharge or numerical control depth. Given $Q$, the exact condition can instead be solved implicitly for $x_c$; if the inviscid discharge is imposed, it becomes $\alpha=(4g'H/3L)(x_c/L)[1+(x_c/L)^2]^{-5/3}$. The small-displacement root is the one continuous from the throat. This distinction avoids treating the original upstream energy as unchanged after an unspecified finite upstream loss.