Lotka-Volterra Calculator
Why do lynx and snowshoe hare populations rise and crash together, a few years apart, like clockwork across a century of fur-trade records? In the 1920s Alfred Lotka and Vito Volterra independently wrote down the two differential equations that answer the question, and ecology has argued with them productively ever since. This calculator simulates those equations exactly — a numerical RK4 integration, not a sketch — from your starting populations and interaction rates, and reports the cycle the mathematics insists on: the equilibrium both species orbit, and the peak and trough each population actually reaches.
The Two Equations
Call the prey population x and the predators y. Prey, alone, would grow exponentially at rate α; encounters with predators remove them in proportion to both populations (βxy — twice the prey or twice the predators, twice the meetings). Predators convert eaten prey into new predators at efficiency δ and starve at rate γ without food. The system:
dx/dt = αx − βxy · dy/dt = δxy − γy
Four parameters, no other machinery — and out falls oscillation, unforced. The logic is a delayed feedback loop: abundant prey feed a predator boom; the boom overeats the prey; scarcity starves the predators; released from predation, the prey recover; and the wheel turns. The populations chase each other around a fixed point — the equilibrium where both derivatives vanish: prey x* = γ/δ (enough prey that predator births balance deaths) and predators y* = α/β (few enough that predation exactly cancels prey growth). Note what the equilibrium says: make prey grow faster (α up) and you get more predators, not more prey — the surplus is harvested. Enrichment paradoxes and fisheries puzzles have been unpacked from that one counterintuitive line for a century.
Worked Example: A Balanced Little World
The defaults — α = 0.8, β = 0.04, γ = 0.6, δ = 0.03 — set the equilibrium at prey 0.6/0.03 = 20 and predators 0.8/0.04 = 20. Starting off balance (25 prey, only 8 predators) the simulation runs the story: prey, under-hunted, surge to about 45; predators, feasting, multiply after them to about 41; the prey crash under the pressure to near 6.5; the predators follow them down to about 7.7; and the cycle repeats with a period of roughly 9 time units (the linearised estimate 2π/√(αγ) = 2π/√0.48 ≈ 9.1) — forever, in this frictionless model. Compare the famous data: Hudson’s Bay Company pelt records show lynx trailing hare with exactly this phase lag across ninety years of ten-year cycles. The model is not the ecosystem — no seasons, no alternative prey, no territory — but it captures the skeleton every richer model must still explain.
Reading a Phase Portrait, and the Model’s Honest Limits
Ecologists plot these runs with prey on one axis and predators on the other: the trajectory is a closed loop around the equilibrium, its size fixed entirely by the starting point — start at (25, 8) and you ride one loop; start nearer the centre and you ride a smaller one. This neutral stability is the model’s famous fragility: real cycles are buffeted by weather, disease and migration, and a mathematically neutral loop struck by noise wanders — sometimes into the axes, which in plain language is extinction. Later models repair pieces: give prey their own carrying capacity (our Carrying Capacity Calculator supplies that term) and the loops become stable spirals; add a prey refuge or a saturating predator appetite (Holling’s functional responses) and stranger dynamics, including chaos in three-species systems, become possible. Use this calculator as its authors intended: the cleanest possible demonstration that cycles need no external clock — then distrust any real-world forecast that stops here.
How the Equations Were Born: Fish, War and Fur
The model’s origin story is a war and a fish market. Umberto D’Ancona, an Italian biologist, noticed in Adriatic catch statistics that during the First World War — when fishing fleets were idled — the proportion of predators (sharks, rays and other selachians) in the catch rose markedly, while prey fish made up less of the total. Less fishing should have helped all fish; why did it help the hunters most? He put the puzzle to his future father-in-law, the mathematician Vito Volterra, whose analysis became the 1926 paper founding mathematical ecology — the same equations Lotka had reached from chemical kinetics in America. The answer lives in this calculator’s equilibrium: fishing pressure had been holding both populations below their natural cycle, cropping prey in a way that suppressed predators disproportionately; release the pressure and the system swings back toward the predator-rich balance the equations describe. The lynx-hare pelt ledgers of the Hudson’s Bay Company later gave the model its iconic dataset — ninety years of ten-year cycles, predator trailing prey, recorded by trappers who had never heard of differential equations and priced in beaver pelts.
Where the Skeleton Shows Up Next
Once seen, the two-equation skeleton is recognisable across the sciences, which is why this calculator’s mechanics repay learning beyond ecology. Epidemiology’s SIR model is a close cousin — susceptibles and infectives playing prey and predator, with an epidemic curve as one rising limb of the cycle. Chemical kinetics supplied Lotka’s original framing: autocatalytic reactions oscillate by the same bookkeeping. Economists have fitted predator-prey forms to employment and wage share (the Goodwin model), and fisheries science runs the equations in reverse, treating fishing fleets as the predator whose effort must be capped before the prey stock’s cycle is driven into the axis. In each field the transfer of intuition is the prize: delays create overshoot, overshoot creates cycles, and any manager — of fish, forests, or epidemics — who steers by today’s numbers alone will chase the cycle a quarter-period behind, forever. Simulate first; the wheel you can see coming is the wheel you can avoid steering into.
Three Experiments Worth Running
The simulator teaches fastest by hand, and three runs repay the clicks. Start at equilibrium — prey 20, predators 20, the defaults — and nothing happens at all: both populations hold dead level for the whole run, the eye of the cycle confirmed as a place, not a pause. Double the prey growth rate (α to 1.6) and read the equilibrium line before the ranges: predator equilibrium doubles to 40 while prey equilibrium stays at 20 — enrichment feeding the hunters, the paradox from the equations section made visible — while the cycle itself grows wilder, because a richer system swings harder around its centre. Start with very few predators (y = 2) and watch the first act: prey irrupt almost unchecked toward numbers a real range could never feed — the calculator’s way of showing why prey carrying capacity had to be added to the model by later hands, and why islands that lose their predators (or never had them) get their vegetation eaten by the second act of the same play.
Smooth Curves, Lumpy Animals
A last caveat from the field: the equations treat populations as continuous fluids, but real hares arrive in litters and real lynx in ones and twos, in generations that overlap unevenly with the seasons. Discrete, seasonal breeding can sharpen the smooth cycles into spikes, and a trough the model draws as a graceful 6.5 may in nature be seven specific, unlucky animals. This is why the simulator’s deepest dips should always be read with the FAQ’s extinction warning attached — the mathematics of the average is serene precisely where biology is most precarious.
Related Tools
More from the Ecology Calculators hub: the Carrying Capacity Calculator for single-species logistic growth, the Shannon Diversity Index Calculator for measuring community diversity, and the Carbon Footprint Calculator for the human footprint side of the hub.
Frequently Asked Questions
Do the cycles ever settle down in this model?
No — the classic Lotka-Volterra system is neutrally stable: each starting point defines a permanent closed orbit, neither spiralling in nor out. Settling (or extinction) arrives only when later models add realism such as prey carrying capacity, refuges or predator saturation.
Why do predators peak after prey?
Predator numbers respond to food with a generational delay: prey abundance must first become predator offspring. In the simulation the predator peak follows the prey peak by roughly a quarter period — the same lag visible in the lynx-hare pelt records.
What does the equilibrium depend on?
Prey equilibrium = γ/δ (predator hunger versus conversion efficiency); predator equilibrium = α/β (prey productivity versus catchability). Enriching the prey (raising α) raises predator numbers, not prey — the surplus is eaten — a result with real fisheries and pest-control echoes.
Can the model predict extinction?
Not by itself: populations in the equations are continuous and can dip to fractions of an individual and recover, which real animals cannot. When a simulated trough falls below a handful of individuals, read it as “extinction risk in reality” — small populations die of bad luck the equations cannot see.
How accurate is the RK4 simulation?
With a 0.005 time step, RK4 tracks the true solution closely over these horizons; the conserved quantity of the system (a combination of the two populations that the true equations hold constant) drifts negligibly at this step size. Lengthen the run greatly and a slow drift can appear — numerical, not ecological.
Where is the model actually used today?
As the teaching core of population ecology, as the null model in predator-prey studies, and structurally far afield: epidemiology’s SIR models, chemical kinetics and even some economic cycle models are Lotka-Volterra in different clothes — two quantities, each feeding on the other’s growth.