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 1.00
β: predation rate 0.100
γ: predator death rate 1.500
δ: predator growth factor 0.075
Initial Conditions
x₀: initial prey 10
y₀: initial predators 5
Simulation time 200
Key Metrics
Prey equilibrium xₑ
Predator equil. yₑ
Prey peak
Predator peak

Lotka-Volterra Equations

$$\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$

CAE connection: Runge-Kutta ODE integration here is identical to structural dynamics and CFD time-stepping. Phase portrait analysis is used in nonlinear control design.
Time Series & Phase Portrait
Time series: prey (blue) and predator (red) populations
Phase portrait: closed orbits confirm conservative oscillations

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$.

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.

Related Engineering Fields

The Lotka-Volterra equations aren't just for ecology. They are deeply connected to control engineering. For example, consider a factory inventory management system. The relationship between inventory level (prey) and production line operation rate/order volume (predator) can be precisely described by this model. When inventory gets too high, production is reduced; when it gets too low, production is increased... This "delayed feedback" creates oscillations (the bullwhip effect). The "phase plane" concept you explored with the simulator becomes foundational knowledge for designing controllers to stabilize such oscillations.

Another field is electrical circuits and vibration engineering. Predator-prey oscillations are mathematically equivalent to the oscillations of charge and current in an LC resonant circuit or the motion of a mechanical pendulum with damping. While there's a difference in whether the differential equation form is "linear" or "nonlinear", the fundamental dynamics—where energy (population) shifts between two forms—are the same. As an introduction to nonlinear oscillations, this model is exceptionally good.

Applications are also advancing in network security. For instance, there is research modeling the spread of malware (predator) and vulnerable hosts (prey) to simulate optimal patching strategies. If you reinterpret the parameter δ (predation efficiency) as "infectiousness" and γ (mortality rate) as "host recovery/isolation rate", the core concepts are directly applicable.

For Further Learning

Once you're comfortable with this simulator, try thinking about a "three-species system". For example, a food chain like "plants → rabbits → foxes". What complex effects occur on the upper and lower species when the intermediate prey (rabbits) fluctuate? The simulation becomes less straightforward, but richer phenomena like chaotic behavior emerge. A good first step is to take pen and paper and write down the equations, adding terms to represent the three-species interactions.

To dig a bit deeper mathematically, challenge yourself with "stability analysis of equilibrium points". The motions you observed in the simulator—"spiraling in", "circling"—can actually be predicted in advance by calculating the eigenvalues of the Jacobian matrix at the equilibrium point (where the time derivative is zero). In mathematical terms, you find the equilibrium point $(x^*, y^*)$ and examine the signs of the real parts of the eigenvalues of the linearized matrix there: $$ J = \begin{bmatrix} \alpha - \beta y^* & -\beta x^* \\ \delta y^* & \delta x^* - \gamma \end{bmatrix} $$ If all real parts are negative, it's stable; if they are purely imaginary, it's a center (periodic solution); if any are positive, it's unstable. This "linearization" technique is a powerful tool that forms the foundation for analyzing all kinds of nonlinear systems.

Ultimately, you should also develop an interest in the numerical solvers (Euler method, Runge-Kutta methods) that power the simulation engine itself. Why use "NovaSolver"? It's because solving differential equations on a computer requires iterative calculations over small time steps. If the step size is too coarse (dt is too large), the calculation can diverge. Understanding the principles of numerical computation working behind the scenes in this tool will deepen your overall comprehension of CAE software.