Feed carp or tilapia from the bank. Photosynthesis fills the pond with oxygen by day; fish, algae, mud and rotting feed drain it all night. Feed too much and the dawn oxygen minimum falls toward zero while ammonia climbs — find the ration the pond can carry.
Runs six simulated days at each feeding rate with the current weather, stock and aerator, and reads the lowest DO before sunrise.
Compares the code with literature values and closed-form solutions: saturation table, ammonia fraction, the 0.8 metabolic exponent, exponential re-aeration and a night-time DO decay.
The science
Oxygen budget. The pond is treated as one well-mixed box of volume V:
V·dC/dt = P − Ralgae − Rfish − SDA − SOD − Rwaste − 4.57·Nit + Ka·V·(Cs − C) + Aer
Saturation. Cs(T) is the Benson–Krause / Standard Methods fit (ln Cs = −139.344 + 1.5757×105/T − 6.6423×107/T2 + 1.2438×1010/T3 − 8.6219×1011/T4), 14.62 mg/L at 0 °C, 9.09 at 20 °C, 7.56 at 30 °C: warm water holds less oxygen and fish burn more, a double squeeze.
Photosynthesis follows a half-sine over 06:00–18:00, P = Pmax·A·sin(π(t−6)/12)·(1−0.75·cloud), with bloom index A that grows on ammonia (Monod) and is lost at 1.2 %/h. Algae also respire all night. Each gram of N taken up by algae releases about 19.7 g O2 (Redfield).
Fish respiration scales as an allometric power law: VO2 = a·W0.8·Q10(T−25)/10 (mg O2/h per fish, W in g, Q10 = 2), so mass-specific demand falls as W−0.2. Digesting feed adds specific dynamic action, 0.15 g O2 per g digested.
Feeding and FCR. Fish take feed at up to twice the gut-gap per hour, with gut capacity 1.25 % of body weight × a temperature factor (Gaussian around the species optimum) × an oxygen factor (appetite fades between 4 and 1.5 mg/L). Gastric evacuation is first-order with a time constant of 8 h / f(T). Digested feed becomes weight gain with efficiency 1/FCR (1.5 tilapia, 1.8 carp), reduced by low DO and ammonia. Rate is quoted in % body weight per day; the measured FCR = feed offered / weight gained, so wasted feed raises it.
Waste and ammonia. Uneaten feed (12 %/h from the surface) and faeces (20 % of digested) form an organic pool that decomposes at 3 %/h at 20 °C, using 0.9 g O2/g and releasing N. Total ammonia nitrogen (TAN) is produced at 0.0432 g per g feed (30 % protein × 0.144), removed by nitrification (4.57 g O2 per g N) and algae. The toxic un-ionised fraction is 1/(1+10pKa−pH), pKa = 0.09018 + 2729.92/T (Emerson 1975).
Aerator and surface. Paddlewheel transfer = SAE·kW·(Cs−C)/9.09 with SAE = 1.5 kg O2/kWh; surface exchange Ka = (0.01 + 0.015·wind)/depth per hour. Both can also remove oxygen when C > Cs (supersaturated afternoons).
Honest simplifications. One fully mixed layer (no stratification, which in real ponds causes some of the worst crashes); pH is a crude function of C/Cs; fixed pond area 1,935 m2; coefficients are typical literature magnitudes, not calibrated to a particular farm; fish deaths are an expected-value rate, not individual events. Fish are drawn about 4× life size so you can see them. Educational only, not farm-management advice.
Baked 3D scene. Fish, dock, farmer, aerator and landscape models and their baked albedo, normal and ambient-occlusion textures come from Blender 5.2 (Cycles); Three.js r160 animates schools, water and light.