Toolyard

Predator and Prey Population Simulator

Equations in this simulation

dR/dt = a R (1 − R ÷ K) − b R F, dF/dt = c b R F − d F
R, Fnumbers of rabbits and foxes
aRabbit birth rate a (births per rabbit per day)without foxes the rabbits would grow exponentially, or level off at K
bhunting rate: rabbits caught per fox per rabbit per dayHunting success ÷ the 2,601 patches of the field, the chance a fox and a given rabbit share a patch on a given day
cFox births per rabbit eaten c (equations)
dFox death rate d (per fox per day, equations)

With the current values:

R* = d ÷ (c b), F* = a ÷ b
R*, F*equilibrium numberswhere both populations stop changing; the cycles circle around this point

With the current values:

T ≈ 2π ÷ √(a d)
Tperiod of small cycleslarger cycles take longer; the measured period is from the peaks of the rabbit numbers

With the current values:

V = c b R − d ln R + b F − a ln F
Vconserved quantity of the Lotka–Volterra equationsconstant along each cycle when K = 0, so the orbits are closed loops; a carrying capacity makes it fall and the cycles die away

With the current values:

How to use the predator and prey simulator

  1. With Animals on a field, each one simulated, every rabbit and fox moves on its own. Rabbits eat the grass on their patch, which then takes time to regrow, and breed; foxes catch the rabbits they meet, and starve when they go too long without one. Watch the numbers rise and fall in turn: more rabbits feed more foxes, the foxes eat the rabbits down, then starve.
  2. The chart is a phase plot of foxes against rabbits: the run traces loops around the equilibrium, where the blue and orange lines cross. Change the rabbit birth rate, the hunting success or the food a fox gets from a rabbit, and see whether both species survive, or the foxes die out and leave the rabbits to the grass.
  3. Switch to The Lotka–Volterra equations to run the classic model instead. Without a carrying capacity its cycles repeat for ever; set one and they die away to a steady state. The results give the equilibrium numbers and the period, and the Bacterial Growth Simulator shows a single population growing on its own.

Frequently asked questions

What are the Lotka–Volterra equations?

Two equations for a predator and its prey, written by Alfred Lotka and Vito Volterra in the 1920s: dR/dt = aR − bRF for the prey and dF/dt = cbRF − dF for the predators. Prey grow exponentially and are eaten in proportion to how often the two meet; predators are born in proportion to what they eat and die at a steady rate. Their solutions are endless cycles.

Why do predator numbers peak after prey numbers?

Foxes need rabbits to breed, so their numbers climb only after the rabbits have become plentiful, and keep climbing while rabbits are still common. By then they eat more rabbits than are born, the rabbits crash, and the foxes starve a little later. The predator peak lags the prey peak by about a quarter of a cycle.

Is the lynx and snowshoe hare cycle an example?

It is the famous one: the Hudson’s Bay Company’s fur records show Canadian lynx and snowshoe hare rising and falling about every ten years. Later studies found the hares cycle partly because of their food and stress as well, so the real story is more than predator and prey alone.

Why do the populations sometimes die out?

In the equations a population can shrink to a tiny fraction and recover, but real animals come in whole numbers. When the foxes fall to a handful they can all die by chance, and when the rabbits crash to nothing the foxes must starve. Small, isolated populations are the most at risk.

It says WebGL is turned off.

The 3D view needs WebGL, which every current browser has. It can be switched off by hardware acceleration being disabled in the browser settings, or by a very old graphics driver. Turn hardware acceleration on, or try another browser.

Is anything uploaded?

No. The simulation is drawn by your own browser with WebGL; nothing is sent anywhere, and it keeps working offline once the page has loaded.

More science simulations

Projectile Motion SimulatorPendulum SimulatorDouble-Slit Experiment SimulatorElectric Field SimulatorOrbit SimulatorMass-Spring Oscillator SimulatorRutherford Scattering SimulatorParticle Collider Event DisplayRadioactive Decay SimulatorBohr Atom Simulator3D Molecule ViewerIdeal Gas SimulatorDiffusion and Osmosis SimulatorDNA and RNA Folding ViewerBacterial Growth SimulatorCentrifuge SimulatorLens and Mirror Ray Diagram SimulatorStanding Wave SimulatorDoppler Effect SimulatorCollision and Momentum SimulatorRC and RL Circuit SimulatorCharged Particle in a Magnetic Field SimulatorBlackbody Radiation SimulatorSpecial Relativity SimulatorRefraction and Total Internal Reflection SimulatorSeries and Parallel Circuit SimulatorFluid Flow and Bernoulli's Principle SimulatorElectromagnetic Induction SimulatorTitration Curve SimulatorReaction Rate and Collision Theory SimulatorChemical Equilibrium Simulator (Le Chatelier)Galvanic Cell and Electrolysis SimulatorHeating Curve and Phase Change SimulatorAtomic Orbitals 3D ViewerBuffer SimulatorChromatography SimulatorSpectrophotometer and Beer-Lambert Law SimulatorCrystal Lattice 3D ViewerEnzyme Kinetics SimulatorAction Potential SimulatorPCR SimulatorNatural Selection and Population Genetics SimulatorHeart and Cardiac Cycle SimulatorGel Electrophoresis SimulatorMitosis and Meiosis SimulatorProtein Synthesis Simulator: Transcription and TranslationPhotosynthesis and Limiting Factors SimulatorEpidemic Spread Simulator: SIR and SEIRSeasons and Day Length SimulatorPlate Tectonics and Earthquake SimulatorMoon Phases, Tides and Eclipses SimulatorGreenhouse Effect SimulatorStellar Evolution and Hertzsprung–Russell Diagram SimulatorGalton Board SimulatorFourier Series Simulator

Related calculators and tools

Guides