Turbine mode P_el = eta_t(P) rho g Q (H_g - h_f(Q))
Pump mode P_el = rho g Q (H_g + h_f(Q)) / eta_p(P)
Head loss h_f = (f L/D + K) Q^2 / (2 g A^2) A = pi D^2/4
Friction Swamee-Jain: f = 0.25 / [log10( eps/(3.7 D) + 5.74/Re^0.9 )]^2, Re = v D / nu
Best flow max over Q of Q (H - k Q^2) at Q* = sqrt(H / 3k) (constant eta, constant f)
Round trip eta_rt = eta_t eta_p (H - h_f)/(H + h_f) for the same Q and head
Energy bookkeeping dE_pot = rho g Q (z_up - z_low) dt (levels move: head falls while generating)
This is a real hydraulic model: the water levels of both reservoirs follow the water volumes through their basin shapes, so the head shrinks as the upper reservoir drains, the penstock loss grows with the square of the flow, and the machine efficiency is lower away from its best load. The price is a synthetic 24-hour "duck curve" (cheap solar noon, evening peak), not a market feed.
Honest simplifications: one reversible unit with parabolic efficiency curves (assumed round numbers, 92 % turbine and 91 % pump at best), no transients (water hammer), no evaporation, inflow or ramp limits, reservoirs are prismatic-like basins, the picture is a schematic side view and the scale is set by the head slider. Real plants reach 70-80 % round trip; the model's value comes from the loss mechanisms, not from a fitted number.
Not run yet.