About this simulation

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 5 July 2026

This simulation combines Lotka-Volterra population dynamics with an evolving predator trait: the attack rate v changes over time under selection, so prey and predator populations don't just oscillate — they coevolve. This is the Red Queen hypothesis in action: both species must keep evolving just to maintain their fitness against the other.

🔬 What it shows

Prey H grow logistically toward a carrying capacity K=200 and are consumed at rate a(v)·H·P, while predators P convert consumed prey into growth at efficiency e=0.1 and die at rate d=0.2. The attack rate v itself evolves via a fitness gradient (driven by how much prey is currently available relative to the cost of a higher attack rate) plus small random mutation, scaled by the Evolutionary rate and Selection pressure sliders. The time-series chart plots Prey (green), Predator (red) and Attack rate (dashed orange); the phase-plane chart plots Prey against Predator directly.

🎮 How to use

Press Run to start the simulation and watch the populations and the evolving attack rate update live in Time, Prey H, Predator P, Attack rate v and Status. Raise Selection pressure or Evolutionary rate to make the attack rate adapt faster, or raise Mutation variance σ to inject more random drift into its evolution. Switch Evolution speed between Slow and Fast to compare gradual versus rapid coevolution, and use Stop/Reset to pause or restart from the initial populations H=100, P=20.

💡 Did you know?

The Red Queen hypothesis takes its name from the Red Queen's line in Lewis Carroll's Through the Looking-Glass — "it takes all the running you can do, to keep in the same place." Biologists use it to describe exactly this kind of coevolutionary arms race: cheetahs evolving faster sprints in response to gazelles evolving faster escapes, or bacteria and the phages that infect them locking into cycles of resistance and counter-resistance that never settle into a permanent advantage for either side.

Frequently asked questions

What do the Lotka-Volterra equations in this simulation mean?

dH/dt = rH(1−H/K) − a(v)HP says prey grow logistically (limited by carrying capacity K) but are removed by predation at a rate proportional to the attack rate a(v), prey density H, and predator density P. dP/dt = e·a(v)HP − dP says predators grow from converting consumed prey into offspring at efficiency e, but die off at a constant per-capita rate d. Unlike the classic Lotka-Volterra model, the attack rate a(v) here is not a fixed constant — it is itself an evolving trait, which is what makes this a coevolutionary rather than purely ecological model.

How does the attack rate v actually evolve over time?

Each step computes a fitness gradient proportional to Selection pressure times a term that weighs the benefit of a higher attack rate (more available prey, H·P) against its cost (a penalty proportional to v itself). This gradient, scaled by the Evolutionary rate and the square of the Mutation variance σ, nudges v up or down, and a small random term scaled by σ adds drift so evolution isn't perfectly deterministic. The Evolution speed radio button multiplies the effective evolutionary rate by 5× in Fast mode compared to Slow mode.

What is the Red Queen hypothesis and how does this simulation demonstrate it?

The Red Queen hypothesis proposes that species in an antagonistic relationship — like predator and prey, or host and parasite — must constantly evolve not to gain an absolute advantage but simply to maintain their relative fitness, because the other species is evolving too. In this simulation, as the predator's attack rate v increases, it depletes prey faster, which then reduces the very prey abundance that made a higher attack rate worthwhile, creating a moving target that keeps selection pressure active indefinitely rather than settling into a single optimal value.

What causes the different Status readings like "Stable cycle" or "Arms race!"?

The simulation reports "Prey extinct" when prey density H falls below 1, "Predator extinct" when predator density P falls below 1, "Arms race!" when the attack rate v climbs above 1.5, and "Stable cycle" otherwise — meaning both populations are oscillating in the classic Lotka-Volterra pattern without either collapsing or the attack rate escalating dramatically. High Selection pressure combined with a low initial attack rate v₀ tends to push the system into the arms-race regime fastest.

How does this model relate to real predator-prey coevolution?

Real ecological arms races follow the same broad logic modelled here: garter snakes and rough-skinned newts have coevolved toxin resistance and toxin potency in an escalating cycle across parts of western North America, and many bacteria-phage systems cycle through resistance mutations and counter-adaptations on timescales of days to weeks in laboratory experiments. Evolutionary rescue — a population evolving fast enough to avoid extinction from a new threat — is the same dynamic visible here when a slow-evolving prey population manages to survive a rapidly escalating predator attack rate instead of going extinct.