Live ecosystem lab

Predator–Prey Simulator

A living meadow: grass regrows, rabbits graze and multiply, foxes hunt rabbits. Watch the populations rise and crash in cycles, compare them with the Lotka–Volterra equations, and change the rules to see what keeps an ecosystem stable.

TIME0
RABBITS0
FOXES0
GRASS0%

Populations

rabbits foxes ×1

Click an animal to inspect it. Space play/pause · F full screen

How the simulation works
  1. Grass covers the meadow in small patches. A patch that is eaten turns to soil and grows back after the regrow time.
  2. Rabbits wander and eat grass under them. Each step costs energy; grass gives energy. With some chance per step a rabbit has a baby and shares its energy with it. If it sees a fox, it runs.
  3. Foxes wander until a rabbit is in range, then chase it. Catching a rabbit gives energy. Foxes breed only when well fed and die when their energy runs out.
  4. Cycles appear on their own: more rabbits feed more foxes, more foxes eat too many rabbits, then foxes starve and rabbits recover.

This is a simplified teaching model, not a model of any real ecosystem. Everything runs in your browser.

Using Predator–Prey Simulator

A living meadow where grass regrows, rabbits graze and foxes hunt. Watch population cycles appear on their own, compare them with the Lotka–Volterra equations and change the rules to see what keeps an ecosystem stable.

  1. Press Play or pick an example such as Boom and bust, No predators or Drought.
  2. Watch the meadow: green grass turns to soil when eaten and grows back; rabbits flee from foxes and foxes chase rabbits. Click an animal to see its energy and what it is doing.
  3. Open Charts to follow rabbits, foxes and grass over time, and the phase plot where each loop is one cycle.
  4. Open Equations to solve the Lotka–Volterra model with your own α, β, γ and δ, or match its equilibrium to the simulation.
  5. Change speeds, energy, birth chances, grass regrowth and more in Settings, then Apply & restart. Download the data as CSV.

Example

Boom and bust: rabbits rise to a few hundred, foxes follow a little later, rabbits crash, then foxes starve — the same pattern repeats with some randomness.
Drought: with slow grass the rabbits stay few, the foxes cannot find enough food and die out, and the rabbits survive alone.

Questions & answers

Why do the populations go up and down in cycles?

More rabbits mean more food for foxes, so foxes multiply. Then foxes eat rabbits faster than they are born, rabbits fall, and foxes starve. With fewer foxes the rabbits recover and the cycle starts again.

What are the Lotka–Volterra equations?

dx/dt = αx − βxy for prey and dy/dt = δxy − γy for predators. α is prey growth, β the hunting rate, γ the predator death rate and δ how much predators grow per prey eaten. The Equations tab solves them and shows the equilibrium γ/δ prey and α/β predators.

Why is the simulation different from the equations?

The equations describe huge, perfectly mixed populations, so their cycles repeat forever. The meadow has individual animals in space with random encounters and limited grass, so cycles are noisy, can dampen and can end in extinction.

Why did everything die?

If foxes catch rabbits too easily they wipe them out and then starve. Try fewer foxes, rabbits that run away, faster grass or a bigger meadow.

Can I repeat a run?

Yes. The same seed and settings always give the same result, so you can change one thing at a time.

Can I export the data?

Download Data CSV for rabbits, foxes, grass cover, births, rabbits eaten and starvations over time, with the settings in the first line.

Is it a model of a real ecosystem?

No. It is a simplified teaching model of population dynamics. Everything runs in your browser.

Help improve this tool

Report a problem or suggest an improvement

Describe the issue without pasting private tool input. Feedback goes to our admin inbox.

Find another tool · Read practical guides