Lotka-Volterra Equations

A predator-prey model calculator that solves the Lotka-Volterra equations numerically with 4th-order Runge-Kutta.

Nature Predator-prey RK4 solver Phase plot
Rate this calculator

Lotka-Volterra Predator-Prey Solver

RK4 numerical solution · equilibrium · oscillation period · time-series plot

Instructions — Lotka-Volterra Equations

1

Set the populations

Enter the starting prey count x₀ and predator count y₀. These are the initial conditions the solver integrates forward from.

2

Enter the four rates

Fill in α (prey growth), β (predation), γ (predator death), and δ (conversion efficiency). Use a preset like Hare & lynx if you want realistic numbers.

3

Read the output

Set the simulation time, then read the coexistence equilibrium x* = γ/δ, y* = α/β, the oscillation period, peak populations, and the population-vs-time plot.

Formulas

Prey equation
$$\frac{dx}{dt} = \alpha x - \beta x y$$

Prey x grow exponentially at rate α and are removed by encounters with predators at rate β.

Predator equation
$$\frac{dy}{dt} = -\gamma y + \delta x y$$

Predators y die off at rate γ and gain numbers from consumed prey scaled by conversion efficiency δ.

Coexistence equilibrium
$$x^* = \frac{\gamma}{\delta}, \qquad y^* = \frac{\alpha}{\beta}$$

The non-trivial fixed point where both populations stay constant. The system orbits around it.

Oscillation period
$$T \approx \frac{2\pi}{\sqrt{\alpha \gamma}}$$

For small cycles near equilibrium the period depends only on prey growth α and predator death γ.

Conserved quantity
$$H(x,y) = \delta x - \gamma \ln x + \beta y - \alpha \ln y = C$$

This first integral is constant along every trajectory, which is why orbits are closed loops.

Reference

The Lotka-Volterra equations are a pair of first-order nonlinear differential equations describing the dynamics of two interacting species, one a predator and one its prey. The model produces sustained, neutrally stable oscillations rather than settling to a steady state.

Article — Lotka-Volterra Equations

Lotka-Volterra Equations: the Predator-Prey Model

The Lotka-Volterra equations are a pair of nonlinear differential equations that model how a predator population and its prey rise and fall together over time. The prey grows at rate α and is eaten at rate β; the predator dies at rate γ and reproduces from food at rate δ. The result is a steady cycle with a coexistence equilibrium at x* = γ/δ and y* = α/β.

This calculator integrates the system with the fourth-order Runge-Kutta method, then reports the equilibrium point, the oscillation period, peak populations, and a population-vs-time plot. Set your starting counts and the four rates, or load a preset, and watch the cycle emerge.

What are the Lotka-Volterra equations?

The Lotka-Volterra equations describe two species locked in a feeding relationship. One species, the prey, would multiply without limit if left alone. The other, the predator, depends entirely on eating the prey to survive. The model is written as two coupled equations: dx/dt = αx − βxy for the prey, and dy/dt = −γy + δxy for the predator. The xy term, the product of the two population sizes, is the contact rate, and it appears with opposite signs in the two equations.

Alfred Lotka, a chemist and biophysicist, derived the system around 1920 while studying autocatalytic chemical reactions and plant-herbivore systems. Vito Volterra, an Italian mathematician, reached the same equations independently in 1926 after his son-in-law, a marine biologist, asked him to explain odd fluctuations in Adriatic fish catches. The two names have been linked to the model ever since.

Did you know

Volterra noticed that during World War I, when Adriatic fishing nearly stopped, the share of predatory fish like sharks rose sharply while small prey fish fell. When fishing resumed, the ratio swung back. The Lotka-Volterra model predicted exactly that pattern, an early empirical win for the equations.

The four Lotka-Volterra parameters

Every Lotka-Volterra simulation is controlled by four positive rate constants. Each one has a direct biological meaning, and changing any of them reshapes the cycle.

  • α = prey growth rate (how fast prey breed with no predators around)
  • β = predation rate (how effectively predators remove prey on contact)
  • γ = predator death rate (how fast predators starve with no prey)
  • δ = conversion efficiency (how much eaten prey turns into new predators)
  • x₀, y₀ = starting prey and predator counts
  • t = how long the simulation runs

Raising α makes prey rebound faster and widens the cycle. Raising β intensifies hunting, which knocks prey down but feeds the predator. A larger γ starves predators sooner and stretches the cycle out. A larger δ lets predators breed more from each meal, tightening the loop. The interplay of all four sets both the shape and the timing of the oscillation.

Lotka-Volterra equilibrium points

The Lotka-Volterra system has two equilibrium points, places where neither population changes. The first is the origin (0, 0), where both species are extinct. The second, the one that matters for living ecosystems, is the coexistence point x* = γ/δ and y* = α/β.

At the coexistence point both populations would hold perfectly steady forever. But the point is neutrally stable, not attracting. A small nudge does not decay back to equilibrium and does not blow up either. Instead the system settles onto a new closed orbit of a different amplitude. This neutral stability is what makes Lotka-Volterra behave like a frictionless pendulum rather than a system that damps toward rest.

Tip

To start a simulation exactly at equilibrium, set x₀ = γ/δ and y₀ = α/β. The populations will stay flat. Then change x₀ by a few units and rerun to see how far the cycle bulges from a small perturbation.

How the predator-prey cycle works

The classic Lotka-Volterra cycle runs through a repeating sequence. When predators are scarce, prey multiply quickly. The growing prey supply then feeds the predators, whose numbers climb after a delay. Heavy predation drives the prey back down, and once prey become scarce the predators starve and decline too. With few predators left, prey recover and the loop begins again.

A defining feature is the phase lag. The predator peak trails the prey peak by roughly a quarter cycle, about 90 degrees. The lag is not arbitrary. Predators need time to convert a food surplus into offspring, so by the time their numbers crest the prey have already turned downward. In a phase-plane plot of predator against prey, every trajectory is a closed loop circling the coexistence point.

The period formula

Near the equilibrium the cycle length is T ≈ 2π / √(αγ). It depends only on the prey growth rate and the predator death rate. The predation rate β and conversion rate δ shift the equilibrium location but leave the small-amplitude period untouched.

Solving Lotka-Volterra with RK4

The Lotka-Volterra equations have no simple closed-form solution for x(t) and y(t), so the trajectory has to be computed numerically. This calculator uses the fourth-order Runge-Kutta method, RK4, the workhorse solver for ordinary differential equations.

RK4 advances the solution one small step dt at a time. At each step it samples the slope four times, once at the start, twice in the middle, and once at the end, then blends those samples into a weighted average. That averaging cancels lower-order error terms, giving a local error on the order of dt to the fifth power. The calculator runs 1200 steps across your simulation window, which keeps the closed orbits from drifting visibly.

Lotka-Volterra at a glance
dx/dt = αx − βxy dy/dt = −γy + δxy
x* = γ/δ y* = α/β
T ≈ 2π / √(αγ) H = δx − γ ln x + βy − α ln y
Watch your step size

With very large rate parameters or a long simulation window, a fixed-step solver can let the orbit spiral outward as numerical error builds. If the plot shows the cycle growing each loop, shorten the simulation time or reduce the rate values. A true Lotka-Volterra orbit should close on itself exactly.

Limits of the Lotka-Volterra model

The Lotka-Volterra model is a deliberate simplification, and its assumptions are where it parts ways with real ecosystems. It assumes prey have unlimited food, so prey grow exponentially with no predators present. It assumes predation rises linearly with prey density, with no saturation when a predator is already full. It assumes the four rates never change with season, age, or crowding, and that the system is closed to migration.

Ecologists have built extensions to patch each gap. Adding a carrying-capacity term gives the prey logistic growth instead of exponential. Holling functional responses replace linear predation with curves that level off. Time-delay versions account for gestation lags, and stochastic versions inject random variation. The classic model remains the starting point because it captures the oscillation and the phase lag with just four parameters.

Lotka-Volterra in the real world

Beyond textbook ecology, the Lotka-Volterra framework appears wherever two quantities feed back on each other with a delay. The Hudson Bay lynx-and-hare fur records, spanning nearly a century, show coupled oscillations that resemble the model output, though the real mechanism is more tangled than pure predation.

The same math has been adapted to epidemiology, where pathogen and host play the predator and prey roles, and to immunology for tumor versus immune cells. Economists have borrowed it for business cycles and competition between firms, and chemists see Lotka-Volterra-style oscillations in some autocatalytic reactions. The equations endure because the predator-prey feedback loop is a pattern that shows up far outside biology.

FAQ

They describe the population dynamics of two interacting species, a predator and its prey. The prey would grow exponentially if left alone, while the predator would die out without food. The coupling terms make both populations rise and fall in linked cycles.
α is the prey growth rate without predation, β is the predation rate that removes prey on contact, γ is the natural death rate of the predator, and δ is the conversion efficiency that turns consumed prey into new predators. Larger α speeds prey growth, larger β strengthens predation, larger γ kills predators faster, and larger δ makes predators reproduce more from each meal.
There are two. The point (0, 0) means both species are extinct. The coexistence point x* = γ/δ, y* = α/β is where both populations hold steady. This second point is neutrally stable, so the system orbits around it instead of converging to it.
When prey are abundant, predators have plenty of food and start to reproduce, but reproduction takes time. By the time predator numbers peak, heavy predation has already pushed prey into decline. This roughly 90-degree phase lag is a natural result of the model dynamics.
Near the coexistence equilibrium the period is approximately T = 2π / sqrt(α·γ). Notably it depends only on the prey growth rate and the predator death rate, not on the predation or conversion rates. The calculator reports this value and the number of cycles inside your chosen time window.
It uses the fourth-order Runge-Kutta method (RK4), the standard solver for systems of ordinary differential equations. RK4 has a local error of order h to the fifth power, giving a good balance of accuracy and speed for predator-prey simulations.
It captures the core behaviour of predator-prey cycles and the phase lag seen in nature, and Volterra confirmed it with Adriatic fishery data. But it assumes unlimited prey food, linear predation, and constant parameters. More realistic studies add a carrying capacity, Holling-type functional responses, or time delays.