Predator-Prey Simulator
Solve the Lotka-Volterra equations in real time — watch prey and predator populations oscillate in perpetual out-of-phase cycles, and trace closed orbits in the phase portrait.
The Mathematics of Predator-Prey Dynamics
🌿 The Lotka-Volterra Model
Independently proposed by Alfred Lotka (1920) and Vito Volterra (1926), the Lotka-Volterra equations model the interaction between a prey species (N) and a predator species (P). Prey reproduce at rate α but are removed by predator encounters at rate βNP. Predators grow by consuming prey at efficiency δ but die naturally at rate γP. Together these give a system of two coupled nonlinear ODEs whose solutions are periodic orbits in phase space.
📈 Coexistence Equilibrium
Setting both derivatives to zero reveals the coexistence equilibrium: N* = γ/δ and P* = α/β. Strikingly, N* depends only on predator parameters (γ, δ) and P* only on prey parameters (α, β). This means increasing the prey birth rate α does not increase the equilibrium prey level — it only increases the equilibrium predator level. This counter-intuitive result, known as the Volterra effect, has real consequences for pest control.
🔄 Neutral Stability
The coexistence equilibrium is neutrally stable — a centre, not an attractor. Any initial condition (N₀, P₀) near but not at the equilibrium produces a closed orbit that repeats indefinitely: the populations oscillate forever at constant amplitude. This distinguishes Lotka-Volterra from models with carrying capacity (Rosenzweig-MacArthur), where the equilibrium is a spiral attractor and perturbations decay. The phase portrait shows a family of concentric closed loops around the equilibrium point.
🔡 Phase Lag
In the time-series plot, predator peaks follow prey peaks by approximately one-quarter cycle. This phase lag is a direct consequence of the dynamics: prey must first become abundant before predators have enough food to reproduce. Biologists use this lag as a qualitative signature of predator-prey coupling in field data — it was observed in the famous Hudson's Bay Company lynx–hare time series (1845–1935), which prompted Volterra to refine his model.
Key Equations
| Equation / Symbol | Meaning |
|---|---|
| dN/dt = αN − βNP | Rate of change of prey: birth − predation losses |
| dP/dt = δNP − γP | Rate of change of predators: prey-fuelled growth − natural death |
| N* = γ/δ | Coexistence equilibrium prey level (depends only on predator parameters) |
| P* = α/β | Coexistence equilibrium predator level (depends only on prey parameters) |
| α | Prey intrinsic growth rate (yr⁻¹) |
| β | Predation rate coefficient (per predator per prey) |
| δ | Predator reproduction efficiency per prey consumed |
| γ | Predator natural death rate (yr⁻¹) |
| V = δN − γln(N) + βP − αln(P) | Lyapunov / conserved quantity — constant on each orbit |
Ecological Scenarios
🐇 Snowshoe Hare & Lynx
The most-studied real predator-prey system. Hudson’s Bay Company pelt records show ~10-year cycles with hare numbers ranging 1,000-fold and lynx following with a lag of 1–2 years. The Lotka-Volterra model explains the basic oscillation but not the precise period or amplitude. Additional mechanisms include hare-vegetation dynamics and delayed density dependence.
🦊 Wolves & Elk (Yellowstone)
After wolves were reintroduced to Yellowstone in 1995 (removed in 1926), elk populations stabilised and riparian vegetation recovered — a trophic cascade. This shows how predators regulate prey beyond simple numbers: the fear of predation changes prey behaviour (foraging patterns, habitat use) in ways the basic Lotka-Volterra model cannot capture. Top-down trophic effects are a major area of modern ecology.
🐟 Plankton Dynamics
Marine phytoplankton (prey) and zooplankton (predators) exhibit rapid oscillations on timescales of days to weeks. Their dynamics are crucial for ocean carbon cycling — phytoplankton fix CO₂ via photosynthesis. Lotka-Volterra-type models adapted for nutrient limitation and light availability form the basis of ocean biogeochemical models used in climate science.
🍋 Pest Control
The Volterra effect predicts that indiscriminate pesticide use, which kills both pest (prey) and natural predator, results in higher pest equilibrium levels after treatment than before. This phenomenon was originally observed by Volterra analysing fishing data from the Adriatic Sea during WWI. It remains a key argument for biologically integrated pest management over broad-spectrum pesticide application.
Model Extensions
🔄 Logistic Prey Growth
Adding a carrying capacity K to the prey: dN/dt = αN(1 − N/K) − βNP. This is the Rosenzweig-MacArthur model. The equilibrium becomes a stable spiral attractor — perturbations now dampen rather than orbit indefinitely. For sufficiently large K, a Hopf bifurcation occurs: the stable spiral loses stability and a limit cycle appears (“paradox of enrichment”).
📈 Holling Functional Response
Real predators do not consume prey at a constant rate βN — at high prey density they become satiated. Type II Holling response: f(N) = βN/(1 + hβN), where h is handling time. Type III: sigmoid response, common in generalist predators. These functional responses replace the linear predation term and produce richer dynamics including stable limit cycles and bistability.
🗻 Spatial Models
When prey and predators are distributed in space with diffusion (or dispersal), the Lotka-Volterra PDEs can produce travelling waves — invasions of prey followed by predator pursuit fronts, spiral waves, and spatiotemporal chaos. These patterns are analogous to Turing patterns in the reaction-diffusion model and are observed in real ecosystems (vole–weasel cycles in Scandinavia).
👥 Multi-Species Food Webs
Generalised Lotka-Volterra (GLV) models extend to N species: dxᵢ/dt = xᵢ(rᵢ + Σⱼ aᵢⱼxⱼ), where the interaction matrix aᵢⱼ encodes all pairwise interactions (predation, competition, mutualism). GLV models are the foundation of theoretical community ecology and are used to study the relationship between food-web complexity, stability, and biodiversity.
Curriculum Alignment
| Level | Topic | Concepts |
|---|---|---|
| GCSE Biology | Ecology; Interdependence | Food chains, predator-prey relationships, population size |
| A-Level Biology | Ecology; Population Dynamics | Interspecific competition, predation graphs, carrying capacity |
| A-Level Mathematics | Differential Equations | Coupled ODEs, phase plane analysis, equilibrium stability |
| IB Biology SL/HL | Ecology; Topic 4 / Option C | Population models, trophic levels, ecological efficiency |
| IB Maths AA HL | Differential Equations | Systems of ODEs, phase portraits, Euler/RK methods |
| AP Biology | Free Energy & Ecosystems | Population dynamics, species interactions, food web |
| University Year 1–3 | Mathematical Biology; Ecology | Lotka-Volterra, Rosenzweig-MacArthur, Holling responses, GLV, stability analysis |
Worked Example
Finding the equilibrium and conserved quantity
Parameters: α = 0.4, β = 0.01, δ = 0.005, γ = 0.2, starting at N₀ = 40, P₀ = 9.
Equilibrium: N* = γ/δ = 0.2/0.005 = 40. P* = α/β = 0.4/0.01 = 40.
Conserved quantity V = δN − γln(N) + βP − αln(P)
At N=40, P=9: V = 0.005(40) − 0.2 ln(40) + 0.01(9) − 0.4 ln(9) ≈ 0.2 − 0.738 + 0.09 − 0.878 = −1.326
Since N₀ = N* = 40 but P₀ = 9 ≠ P* = 40, the system starts off-equilibrium and will oscillate. Had we started exactly at (40, 40) it would remain there forever.
Prediction: Prey will peak before predators. Since α = γ = 0.2 × 2, the cycle period is roughly T ≈ 2π/√(αγ) ≈ 2π/√(0.08) ≈ 22 years. Verify this in the simulator using the Long Cycles preset (similar parameters).
Frequently Asked Questions
Can both populations go extinct?
In the pure Lotka-Volterra model (no carrying capacity), if either population reaches exactly zero the dynamics halt. In practice, the RK4 integrator clamps populations at zero to prevent negative values. In real ecosystems, stochastic effects can drive populations to extinction even when the deterministic Lotka-Volterra model predicts oscillation — this is why conservation biologists worry about small population bottlenecks during cycle troughs.
Why is the equilibrium neutrally stable rather than attracting?
The standard Lotka-Volterra system conserves a Lyapunov function V = δN − γln(N) + βP − αln(P), which is constant on every orbit. Because V is conserved, no energy is dissipated and trajectories cannot spiral inward. Mathematically, the eigenvalues of the Jacobian at the equilibrium are purely imaginary (±i√(αγ)), giving a centre rather than a spiral. Adding any form of density dependence or realistic functional response breaks this conservation and produces a true attractor.
How does this relate to the SIR epidemic model?
Both the Lotka-Volterra and SIR models are systems of coupled nonlinear ODEs describing population flows between compartments. They share a mathematical structure — nonlinear interaction terms (βNP and βSI respectively) — and both exhibit threshold behaviour. The SIR model has a single epidemic and then reaches a disease-free equilibrium; Lotka-Volterra oscillates indefinitely (neutrally stable) rather than settling. Both can be explored on MySimulator.uk.
What is the Volterra effect and why does it matter for farming?
The Volterra effect states that proportional harvesting of both predator and prey (as with a non-selective pesticide) raises the average prey population and lowers the average predator population. Mathematically the equilibrium shifts: increasing the “death term” for both species changes N* = γ/δ upward and P* = α/β downward. In agriculture this means that broad-spectrum insecticides killing both pest insects (prey) and their natural predator parasites can lead to a pesticide rebound — a worse pest problem after spraying than before.
Can I use this simulator for my IB extended essay?
Yes. Good IB EE research questions include: "How does changing the predation efficiency δ affect the period and amplitude of population oscillations?"; "Compare population dynamics under Lotka-Volterra vs a logistic prey model (Rosenzweig-MacArthur)"; or "How does the initial N/P ratio affect oscillation amplitude?" All three can be investigated systematically in this simulator by varying one parameter at a time and recording the phase portrait and period.
Further Reading
🆕 Unlock All 33 Simulations
The Predator-Prey simulator is free to use. Premium unlocks: stochastic noise overlay (demographic stochasticity), side-by-side model comparison (Lotka-Volterra vs Rosenzweig-MacArthur vs logistic prey), Poincaré section analysis, parameter sweep heatmaps, high-res time-series export as CSV, and access to all 33 simulations.
View Premium Plans🌿 Population Ecology
The Lotka-Volterra equations are the foundational mathematical model of predator-prey ecology, published simultaneously by Lotka (1920) and Volterra (1926). Solutions exhibit perpetual population oscillations with characteristic phase lags: prey peaks precede predator peaks by approximately one-quarter of the cycle period. The coexistence equilibrium N*=γ/δ, P*=α/β is neutrally stable — a centre in phase space surrounded by a family of closed periodic orbits.
📈 Phase Portrait Analysis
The phase portrait (predator P vs prey N) reveals the geometric structure of the dynamics: closed orbits encircling the equilibrium point. The orbit’s shape and size are conserved by the Lyapunov function V = δN − γ ln(N) + βP − α ln(P), constant on every trajectory. Perturbations from any initial condition orbit at constant V indefinitely — unlike real ecosystems, where density dependence introduces damping and produces stable limit cycles.