Swimming against a current costs power with the cube of speed. Which speed gets a fish upstream cheapest, and can it clear a weir by leaping or by a ladder?
Runs the whole school for 2 to 24 steps over the same weir height (fast-forward) and plots the share that reaches the gravel.
The science
Swimming power. Drag power P = ½ ρ CD S u³ with wetted area S = 0.42 L² and an effective CD = 0.015 (an active-swimming allowance over a rigid body, illustrative), divided by an overall efficiency of 0.2, plus standard metabolism 0.4 W/kg with a Q10 of 2.1 for temperature. In a current U the ground speed is u − U, so the cost per metre is P(u)/(u − U); with pure cubic drag its minimum is exactly u = 1.5 U, and standing metabolism pushes the optimum a little higher. The page checks the numeric minimum against 1.5 U.
Fatigue. Endurance follows a Brett-type curve log10 t = A − B·u (u in body lengths per second), calibrated to 1 hour at 2.5 BL/s and 15 s at 6 BL/s (illustrative round numbers for adult sockeye, not a measurement). Fatigue accumulates by Miner's rule, dD = dt / t(u); at D = 1 the fish is exhausted and is swept downstream until it can rest and recover.
Leaping. A fish leaving the water at burst speed v and angle θ rises h = (v sin θ)² / 2g. A plunge pool must be deep enough: the usable height is scaled by min(1, depth / (1.25 h)). Burst capacity is about 10 body lengths per second, reduced for fish with a low energy reserve; each attempt costs a short burst of power and fatigue.
Fish ladder. A pool-and-weir ladder splits the weir height H into n equal drops Δh = H/n. Each drop drives a jet of about 0.85 √(2 g Δh) (Torricelli with a discharge loss); a fish must swim at that speed plus a margin for about 1.2 m, then rests in the next pool. Steps that are too tall give a jet faster than the fish can sustain for long enough: it fatigues and falls back. Entrance finding is a random process with a mean time you can set.
Limits. The river is a one-dimensional reach with a made-up current profile (riffles, a slower plunge pool, an impounded reach); no turbulence, temperature profile, predators, nets or migration-timing effects. All constants are illustrative; check species data before quoting numbers.
Models built with Blender (salmon, river bed, boulders, trees) and rendered with Three.js; weir and ladder are simple concrete blocks. Not an engineering design tool.