Predator-Prey (Lotka-Volterra) Simulator Back
Mathematical Ecology · Population Dynamics

Predator-Prey (Lotka-Volterra) Simulator

Tune α, β, γ, δ and watch how oscillation period changes. The closed orbits in the phase portrait reveal the conservative nature of classic Lotka-Volterra dynamics. Switch to logistic or Holling Type II to see how ecological realism changes the picture.

Presets
Model Type
Equation Parameters
α: prey growth rate
β: predation rate
γ: predator death rate
δ: predator growth factor
Initial Conditions
x₀: initial prey
y₀: initial predators 5
Simulation time 200
Key Metrics
Results
Prey equilibrium xₑ
Predator equil. yₑ
Prey peak
Predator peak
Time Series & Phase Portrait
Population vs Time
Time series: prey (blue) and predator (red) populations
Phase
Phase portrait: closed orbits confirm conservative oscillations
Theory & Key Formulas
$$\frac{dx}{dt}= \alpha x - \beta xy$$ $$\frac{dy}{dt} = \delta xy - \gamma y$$

Equilibrium: $x_e = \gamma/\delta$, $y_e = \alpha/\beta$

Conservation: $V = \delta x - \gamma\ln x + \beta y - \alpha\ln y$

What is the Lotka-Volterra Model?

🙋
What exactly is the "delayed feedback" that causes the populations to oscillate in this model? It seems like they should just find a balance.
🎓
Basically, the timing is off. When there are lots of prey (rabbits), predators (foxes) have a feast and their numbers grow. But that growth takes time. By the time the predator population peaks, they've already eaten so many prey that the prey population starts to crash. Then, with little food, predators starve and decline, which takes more time, allowing the prey to recover. It's a perpetual chase. Try moving the "Prey Growth Rate (α)" slider up in the simulator—you'll see the peaks get higher and the cycles become more dramatic.
🙋
Wait, really? So the populations never settle down? That seems unrealistic. What's the "equilibrium" point shown in the phase portrait?
🎓
Good observation! In the classic model, the equilibrium is a center, not a stable attractor. It's like a frictionless pendulum—if you start exactly at that point ($x_e = \gamma/\delta$, $y_e = \alpha/\beta$), populations stay constant. But any tiny deviation, like changing the initial populations with the x₀ and y₀ sliders, puts the system into a permanent, closed orbit around that point. In practice, real ecosystems have stabilizing factors, which is why we added parameters like Carrying Capacity (K). Set K to a low value and watch the oscillations dampen.
🙋
So the "handling time" parameter is one of those real-world tweaks? What does it represent physically?
🎓
Exactly. In the basic model, the predation term $\beta x y$ assumes predators instantly consume prey and are ready for more. But in reality, catching, eating, and digesting takes time—that's handling time (h). A high h means each meal occupies a predator longer, reducing its total consumption rate. This limits predator growth and can stabilize the system. For instance, a lion after a big kill rests for hours. Slide the handling time up and see how it smooths out the violent predator peaks.

Physical Model & Key Equations

The core engine of the simulation is a pair of coupled, nonlinear ordinary differential equations (ODEs). The first describes the rate of change of the prey population (x), which grows on its own but is reduced by encounters with predators (y).

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

$\alpha$ : Prey intrinsic growth rate (1/time). $\beta$ : Predation rate coefficient, representing the efficiency of capture. The term $\beta x y$ assumes encounters are proportional to the product of both populations (the "mass action" law).

The second equation governs the predator population, which dies off naturally but grows by converting consumed prey into new predators.

$$\frac{dy}{dt} = \delta \beta x y - \gamma y$$

$\gamma$ : Predator mortality rate (1/time). $\delta$ : Conversion efficiency (how many new predators result from one consumed prey). Note that $\delta \beta$ is often grouped as a single parameter in the classic form. The equilibrium populations, where both rates are zero, are $x_e = \gamma / \delta \beta$ and $y_e = \alpha / \beta$.

Frequently Asked Questions

Yes, it is working correctly. The Lotka-Volterra system is a conservative system, and although the period of closed orbits is not theoretically constant when parameters are changed, the amplitude and the shape of the orbit in the phase plane do change. In particular, changing α and γ shifts the center of the orbit, which can make the apparent change in period seem small. Please check the time step of the numerical integration or try changing the initial values.
This is due to numerical errors. The Lotka-Volterra equations analytically have a conserved quantity (Lyapunov function), but methods like Euler's method or the Runge-Kutta method do not conserve it exactly, causing the orbit to gradually drift. This can be improved by adopting a more accurate integration method (such as the symplectic method) or by reducing the time step.
This is due to numerical overflow or unrealistic growth. When the population becomes extremely large in the Lotka-Volterra equations, the exponential growth of prey and the rapid increase of predators compromise the stability of the numerical calculation. Additionally, real ecosystems have carrying capacity limits, but this model does not include them. It is recommended to set initial values in the range of about 1 to 100.
No, it cannot. This model is for educational purposes in nonlinear dynamics, and real ecosystems are influenced by many factors such as carrying capacity, seasonal variations, spatial structure, and interactions among multiple species. The Lotka-Volterra equations are a simplified theoretical model useful for understanding qualitative oscillations, but they should not be used for quantitative predictions.

Real-World Applications

Fisheries Management: The model is used to understand the dynamics of commercially fished species (prey) and their predators. For instance, overfishing cod can cause an explosion in their prey, like shrimp, destabilizing the entire North Atlantic ecosystem. Managers simulate different harvest rates to find sustainable yields.

Pest Control & Agriculture: Introducing a natural predator (like ladybugs for aphids) is a classic biocontrol strategy. The Lotka-Volterra model helps predict whether the introduced predator will establish a stable balance with the pest or cause harmful population crashes and resurgences.

Epidemiology: The same mathematical structure models the spread of diseases, where "prey" are susceptible individuals and "predators" are infected individuals. The contact rate ($\beta$) and recovery/death rate ($\gamma$) are key parameters in basic SIR models, crucial for predicting epidemic waves.

Chemical Kinetics & CAE: In chemical engineering, these equations describe autocatalytic reactions where one species promotes the production of another. The numerical methods (like Runge-Kutta) used to solve these ODEs in our simulator are identical to those in CAE software for simulating structural vibrations, heat transfer, or fluid flow over time.

Common Misconceptions and Points to Note

When you start using this simulator, there are a few points you should be aware of. First, keep in mind that "the parameters are not the actual real-world values themselves". For example, setting the growth rate α=0.1 does not necessarily mean "a 10% increase per day". Since the simulation implicitly decides the unit of time (day, month, year), the relative magnitude is what's important. When applying this in practice, you'll need a separate process of identifying parameters by back-calculating from field data.

Next, you should experience firsthand how the results change significantly based on the initial values. In the basic model, slightly shifting from the equilibrium point yields beautiful periodic solutions. However, if you set the rabbits to 0, for instance, the foxes go extinct and no oscillation occurs. This represents the obvious yet crucial principle that "predators cannot survive without prey". Conversely, in the model with the logistic term, setting the environmental carrying capacity K to an extremely small value (e.g., smaller than the initial population) causes the prey population itself to decline rapidly before any oscillation can occur. When adjusting parameters, get into the habit of changing them one at a time and observing the results while considering their physical meaning.

Finally, note that this model does not account for "stochastic events". In real ecosystems, chance events like disease, abnormal weather, and the randomness of individual encounters have a major impact. This simulator uses a deterministic model, so the same parameters and initial values will always reproduce the same results. This is excellent for learning the basics, but to handle real-world uncertainty, more advanced models like "stochastic differential equations" are required.

How to Use

  1. Set prey growth rate (alpha, typical range 0.5–2.0 per year) using vAlphaNum slider to define intrinsic reproduction without predation.
  2. Adjust predation efficiency (beta, 0.01–0.1) via vBetaNum to control how prey deaths increase with predator encounters.
  3. Configure predator efficiency (delta, 0.01–0.5) with vDeltaNum to set predator reproduction per prey consumed.
  4. Set predator mortality (gamma, 0.1–1.5 per year) using vGammaNum to establish natural death rate without food.
  5. Click Simulate to generate population trajectories and phase portrait; equilibrium points xₑ and yₑ display where dx/dt=0 and dy/dt=0.

Worked Example

Lynx-hare system with alpha=0.6/year (hare growth), beta=0.015 (lynx predation efficiency), gamma=0.8/year (lynx mortality), delta=0.08 (biomass conversion). Simulation shows hare equilibrium xₑ≈53 individuals and lynx yₑ≈8, with hare populations peaking at 180 before predator lag causes collapse to 15, while lynx peak follows 6–8 months later at 22 individuals. Phase portrait traces counterclockwise ellipse, confirming classic 2–3 year cycle observed in Hudson Bay fur trade records (1821–1940).

Practical Notes

  1. Prey peak always precedes predator peak by approximately one generation time; peaks do not coincide due to population lag inherent in Lotka-Volterra dynamics.
  2. Equilibrium stability depends on parameter geometry: if alpha and gamma dominate, oscillations dampen; if beta and delta are too large relative to intrinsic rates, populations collapse.
  3. Real ecosystems deviate from this model when carrying capacity limits prey (logistic term) or predators switch prey species; use this simulator to understand baseline dynamics before adding spatial or behavioral complexity.
  4. For fisheries applications (cod-capelin off Newfoundland), adjust gamma upward to simulate fishing mortality and observe how harvesting destabilizes cycles.