Three coupled state variables — coral cover C, macroalgae cover M and herbivorous-fish biomass P (all fractions of the reef's carrying capacity) — evolve under a Mumby-style coral–algal–grazer model, integrated here with 4th-order Runge–Kutta at a fixed sub-step:
T = 1 − C − M (open/turf substrate)
bleach(temp) = Bmax / (1 + e^(−k(temp − temp_th)))
dC/dt = r·C·T − d·C − a·M·C − bleach(temp)·C
dM/dt = a·M·C + γ·M·T − g·P·M/(M+T+0.05)
dP/dt = rP·P·(1 − P / Kfish(C)), Kfish(C) = 0.15 + 0.85·C
Coral recruits into open space (r·C·T) but loses ground to algal overgrowth (a·M·C) and, above a thermal-stress threshold, to a sharply-rising bleaching-mortality term — the real mechanism behind mass coral bleaching. Algae spreads over both coral and open substrate but is cropped back by grazing fish, whose own population is capped by a carrying capacity that itself depends on coral cover (reef structural complexity = fish habitat). That last link closes the feedback loop: bleaching kills coral → fish habitat shrinks → grazing weakens → algae wins the space race — a phase shift from a coral-dominated to an algae-dominated reef, a documented alternative-stable-states result for real reefs.
- Reef cross-section — live substrate bar: green = coral, brown-red = algae, grey = open/turf; fish icon count tracks herbivore biomass.
- Cover chart — coral vs. algae cover over simulated years; the crossover is the regime shift.
- Fish chart — herbivore population trajectory and its shrinking/growing carrying capacity.