b2KIT

Predator-Prey Simulator

Simulate Lotka-Volterra predator-prey dynamics. Visualize population cycles, phase portraits, and equilibrium stability.

Tested tool guide Tested browser tools Checked August 16, 2026

What Predator-Prey Simulator does, with a checked example

This tool integrates the classic Lotka-Volterra pair of differential equations - prey grow at rate alpha, are removed at rate beta per predator, predators grow from eaten prey at rate delta and die at rate gamma - stepping both populations forward from the initial counts you set. It plots the two time series, the predator-versus-prey phase portrait, and the coexistence equilibrium. The surprise: the standard model is neutrally stable. Every starting point traces its own closed loop; nothing damps the swings, and any disturbance moves the system onto a different cycle.

Worked example

A concrete input and expected output from the current implementation.

Input

alpha = 1.5 (prey growth), beta = 0.5 (attack rate), delta = 0.5 (conversion), gamma = 0.75 (predator death); initial prey 2.0, initial predators 2.0; run 30 time units.

Expected output

Both populations rise at first - prey at 1.0 per time unit, predators at 0.5 - then cycle around the equilibrium at prey = gamma/delta = 1.5, predators = alpha/beta = 3.0. Prey crest first, as predators pass 3.0; predators crest about a quarter cycle later, as prey fall back through 1.5. Near equilibrium the period is about 2*pi/sqrt(alpha*gamma) = 5.9 time units and lengthens with amplitude, so the run shows several full loops in the phase portrait.

The coexistence point (gamma/delta, alpha/beta) is a neutrally stable center, so the orbit is closed and the small-amplitude period follows from the linearized frequency sqrt(alpha*gamma). The quarter-cycle lag between peaks comes from the sign structure of the rates: prey stop rising exactly when predators cross alpha/beta, and predators stop rising exactly when prey cross gamma/delta.

How the result is produced

1

Time-stepping the two species

From the starting prey and predator numbers, the tool advances both populations through time in small steps, recomputing each step from the current rates: prey change at N(alpha - beta*P) and predators at P(delta*N - gamma). Every step is recorded, so a run yields the two time-series curves plus the predator-versus-prey trace in the phase plane, and rerunning with changed parameters lets you compare runs side by side.

2

Equilibrium and cycle period

Setting both rates to zero gives two fixed points: the trivial one at (0, 0) and the coexistence point at prey = gamma/delta, predators = alpha/beta. Around that point the linearized motion is a rotation with frequency sqrt(alpha*gamma), so small cycles complete in about 2*pi/sqrt(alpha*gamma) time units, and larger loops take longer. Nothing damps the motion: the equilibrium is a neutrally stable center, not an attractor.

Good uses

  • Teaching the boom-bust lag: run a two-species cycle and watch the predator peak arrive roughly a quarter cycle after the prey peak - the out-of-phase pattern of the classic hare-and-lynx fur-trade records.
  • Parameter sensitivity: raise the predator death rate gamma or lower the attack rate beta and watch the coexistence point move (prey equilibrium is gamma/delta), then see how the cycle's size and timing change.
  • Qualitative data matching: given a real time series of two alternating waves, adjust the four rates until the simulated period and phase lag land in the right ballpark, then compare the shape of the loop with the data's scatter.

Limits and checks

  • No carrying capacity: the prey equation is pure exponential growth, so nothing limits prey while predators are scarce. The model is a qualitative sketch of two-species oscillation, not a forecast for real populations.
  • Populations are continuous numbers, not whole animals, and every rate carries the same arbitrary time unit. Halving all four rates leaves the phase-portrait loop identical but doubles the period, so the numbers on the axes and the clock depend on your units.
  • The peak order is easy to misread: predators crest about a quarter cycle after prey, while prey are already falling. And because the center is neutrally stable, a simulation that keeps cycling says nothing about real persistence - amplitude is set by the initial counts and never decays.

Common questions

Why do the cycles never die out?

Because the classic equations contain no damping. Every orbit is a closed loop around (gamma/delta, alpha/beta), and its size is fixed by the starting counts, not the parameters. Add prey self-limitation (a logistic term) or a saturating predator response and the center usually becomes a damped spiral or a true limit cycle - so no, eternal cycles are an idealization of the bare model.

Can this tool predict real predator and prey numbers?

Not reliably. The model ignores carrying capacity, seasonality, refuges, age structure, and every other species in the food web, and it treats populations as smooth continuous numbers. Its honest use is qualitative: showing why two-species systems oscillate out of phase and which parameters shift the equilibrium. Treat the plotted values as illustrations, not forecasts.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools