Equilibrium tide from the Moon and Sun, and what a tidal turbine and a tidal barrage could take from it.
The science
A body of mass M at distance d raises a tide-generating potential. For the equilibrium tide the sea surface rises by
ζ = (M/E)(R/d)3 R · (3cos2θ − 1)/2, where E and R are the Earth's mass and radius and θ is the angle from the body to the zenith of the place.
The Moon gives 0.357 m at θ=0 and the Sun 0.164 m (Sun/Moon = 0.46), so the two peaks add at spring tide and subtract at neap tide:
range ratio (M+S)/(M−S) ≈ 2.7.
The cos² term has period 12 h 25 min (half a lunar day) because there are two bulges. Declination of the Moon adds a daily inequality.
Moon distance enters as 1/d³, so perigee tides are about 20 % larger than apogee tides in this model.
Stream turbine: P = ½ ρ A Cp v³, with seawater ρ = 1025 kg/m³, rotor area A = πD²/4, Cp below the Betz limit 16/27 = 0.593, cut-in 0.7 m/s.
Barrage: filling a basin of area A through a head R stores at most E = ½ ρ g A R² per tide (real plants get roughly a third of this).
Honest simplifications. Equilibrium theory ignores continents and ocean dynamics, so real tides differ by large factors: resonant basins amplify (the slider mimics this) and the open ocean can show almost nothing.
The stream speed is simply scaled in proportion to the rate of change of the sea level, as in a simple basin; real flows depend on channel geometry. The Sun's declination is tied to the Moon's. The orbit is circular, so the Moon distance is fixed by the slider.
Self-check running...
Educational model, not a navigation or engineering tool.