Lotka-Volterra Calculator
- What are the Lotka-Volterra equations? Population dynamics
- How do I calculate the Lotka-Volterra model for a predator-prey population?
- Fixed points in the Lotka-Volterra equations
- The atto-fox problem
- How to represent the Lotka-Volterra equations?
- How to use our calculator for the Lotka-Volterra equations
- FAQ
The Lotka-Volterra calculator enables you to understand and simulate the dynamics of populations in a generic biologic system. But there's much more to it! Keep reading to learn:
- What the Lotka-Volterra equations are and the predator-prey model;
- The differential equations defining the dynamics of a predator and prey population;
- Real-life examples of the Lotka-Volterra predator-prey model;
- How to use our Lotka-Volterra model calculator;
- And much more!
What are the Lotka-Volterra equations? Population dynamics
The Lotka-Volterra equations in the competitive case are a system of two differential equations that describe the dynamics of a biological system where a predator species coexist with a prey population. The system models the oscillation of the populations in time.
🙋 The Lotka-Volterra equations take the name of the two scientists, Alfred Lotka and Vito Volterra, who independently developed the equations to describe phenomena of their interest between 1925 and 1926.
Observations of real-life systems confirmed the existence of a correlation between the sizes of populations of predators and prey. They are highly dependent on each other, making this model one of the first development of mathematical biology. We find evidence of the correctness of the Lotka-Volterra model everywhere: from rabbit populations to the constant fight of bacteria and the viruses bacteriophages (you can discover how quickly bacteria multiply by visiting the generation time calculator), but also in economy, and other sciences.
To introduce the model, we need to explain the assumptions used in its definition:
- The prey population has access to unlimited food supplies;
- The food supply of the predator population consists only of the prey population;
- Bigger populations grow faster than small populations (the rate of change of a population depends on its size);
- Environmental and genetic effects are excluded or assumed to be negligible; and
- Predators won't stop feeding on the prey population.
Once the assumptions are clear, we can introduce the elements of the model:
- The prey population, with a number of individuals ; and
- The predator population, with a number of individuals .
Here are the equations of the Lotka-Volterra model for a predator-prey competition:
Let's take a deeper look at these equations. The first thing we notice is that on the left-hand side, the populations appear differentiated in time. As these equations are differential equations, we are studying the evolution of the population in time. While technically, we can find the instantaneous value of these quantities (it would correspond to the variation of a given population for a set of parameters), we are more interested in calculating the Lotka-Volterra model as it evolves with time.
On the right-hand side, we see the populations in their familiar form: instantaneous number of individuals; here we can also identify four characteristic quantities of the Lotka-Volterra model) and their interactions with the populations:
-
— This term represents the exponential growth of a population under an unlimited supply of resources. We discussed a similar quantity in our exponential growth calculator.
-
— This factor models the rate of predation. Its magnitude depends on the size of both the prey and the predator population. Notice how we add a negative sign.
-
— In the case of the variation of the predator population, we model a growth that depends on the size of both the prey and the predator population. As the food supply is limited, we must consider this (when the prey population dwindles, the predator one also follows suit).
-
— The reduction of the size of the predator population depends on this term. Here we assume that the predator population is subject to a decrease due to natural death or other causes. Notice how this factor properly models the natural behavior of predators' populations, and it doesn't apply to the prey one.
We can assign names to the parameters of the equations:
-
— The natural reproduction rate of the prey in absence of predation. If you want to know something about a realistic model for this parameter, visit our carrying capacity calculator.
-
— The death rate per encounter between predator and prey (how many hunts are successful).
-
— The natural death rate of the predator population in absence of resources.
-
— The resource conversion rate in new individuals (how many new predators can find sustainment at each encounter).
🙋 Do you know you can simulate more than predators and prey with the Lotka-Volterra model? We did it with our humans vs. vampires calculator.
How do I calculate the Lotka-Volterra model for a predator-prey population?
When we "calculate the Lotka-Volterra model," we are computing its behavior over time. To do so, we need to solve simultaneously the two equations (as they interact with each other). There are techniques that allow you to do so precisely, but they are limited to specific points of the dynamics: the Lotka-Volterra model is usually solved by numerical means. In this case, we need to follow some simple steps:
-
Define the initial conditions of the problem. In our case, defining the initial populations of prey and predator will suffice.
-
Apply any implicit or explicit iterator that takes the values of the population at each moment in time and calculates the next step. Commonly used iterative methods are the Runge-Kutta methods.
-
Proceed until you reach the desired number of iterations or until the populations collapse to a stable state (e.g., both species go extinct).
What is an iterative method?
An iterative method is a numerical technique used to solve differential equations or systems of differential equations. Iterative methods, both explicitly and implicitly, approximate the solution to the desired equation(s) starting from its value at a given initial point (the initial conditions). Though they differ in execution, the purpose is to find the value of , being the function of interest, starting from . The value of is the step size and corresponds to the "resolution" of the final result.
Iterative methods vary in complexity, from simple ones such as the Euler method to the powerful yet computationally expensive 6th Runge-Kutta method implemented with an adaptive step size. The choice of which one to use is up to you!
Our calculator does exactly this, iterating the equations with the conditions and parameters you passed to the tool. Is there something you can calculate by hand in the Lotka-Volterra model?
Fixed points in the Lotka-Volterra equations
There are two possible fixed points in any system described by Lotka-Volterra's equations. A fixed point is a state where the system's dynamics stop, and, in the case of populations, the number of individuals doesn't change. You can find two types of fixed points:
-
Stable fixed points where the stability resists small perturbations (think of a static pendulum).
-
Unstable fixed points where the system is not resistant against perturbation: a small change and the system moves, usually toward a stable point (think of a broom balanced vertically).
In the case of the Lotka-Volterra predator-prey model, we can find a trivial stable fixed point corresponding to the state:
Once both populations reach that point, the dynamics stop. The other point is more intriguing, as it represents a situation where the populations can reach stable numbers, from where, neglecting oscillations, the dynamics would stop.
To reach a stable point from an oscillatory model like the one we implemented in our tool, you would need to introduce a generic dissipation-like term in the equations that would contribute to the damping of the dynamics in the direction of stability.
The atto-fox problem
The description of populations using the Lotka-Volterra equations suffers from an annoying problem that was rather funnily named the atto-fox problem. Atto is the metric prefix for .
The populations described by the Lotka-Volterra predator-prey model tend to recover even when their numbers dwindle to extreme lows (for example, the unrealistic fraction of a fox). In real-life, small populations with very few individuals (in particular prey ones) can quickly become extinct due to environmental factors, diseases, or even sheer bad luck. How do we deal with this problem? We consider a population with a single individual to be doomed: if the preys drop below , the species go extinct. Notice how this would happen necessarily after reaching the first peak if the conditions are adequate.
How to represent the Lotka-Volterra equations?
The Lotka-Volterra equations depend on time: this makes their representation straightforward: place the time (or the number of iterations) on the horizontal axis, and plot the population drawing a dot for each data point. In this way, you can easily see the periodic behavior of the predator-prey model. If you choose the correct parameters, you may find situations where the model behaves astonishingly like a simple harmonic motion calculator. In fact, in these cases, the predator population is nothing but a rescaled copy of the prey population shifted by 90°.
However, we can find another representation of the evolution of the populations: the representation in the phase space. In the phase space, both the horizontal and vertical axis are associated with populations, and the relationship between the predator and the prey becomes easy to visualize.
In a phase diagram representation, we must assign a direction for the evolution of the dynamics, using arrows, for example. Otherwise, by following the curves in this wrong direction, we may get the impression that an increase in the number of predators may happen without justification, followed by a decline of the prey in the absence of predators.
How to use our calculator for the Lotka-Volterra equations
Our Lotka-Volterra calculator for the model of predator-prey populations is a simple tool. Input six fundamental values:
-
, , , and — The four parameters of the simulation; and
-
The initial conditions, that is, the initial number of predators and prey.
At the bottom of the calculator, you can find additional parameters that can help you tune your simulation: the duration of the simulation, if you want to include extinction or not, and the time scale of your graph.
Play with our tool, and see what the results are! But be careful: you can easily stumble upon unsatisfactory conditions: as for many biological systems, the predator-prey dynamics is exceptionally sensitive to the set-up of the problem!
🙋 We set up our calculator with initial conditions that produce a dynamics with a period of almost half a year and tuned the graph to frame its feature in the best possible way. Changing the initial conditions may cause the dynamics to change by a lot: tune the graphic visualization with the variable end of the simulation
. Changing the time scale will also return more manageable labels on the horizontal axis for a better understanding.
If you click on advanced mode
, you can also find the variable timestep. Choosing a value will force the simulation to run with the "resolution" you want. Don't increase it too much, or the details of the dynamics will go missing.
🙋 Under the plot of the dynamics, we added an additional representation of the Lotka-Volterra predator-prey model: the phase space representation of the dynamics! Change the parameters, and observe the trajectories (or orbits) change. Do you see the orbits shrinking? Where are they going to shrink? You are correct if you are thinking "in the stable point"!
At the bottom of our tool, you can find a link to download a file containing the points of your simulation. Download it, and use it in your projects!
FAQ
What are the Lotka-Volterra equations?
The Lotka-Volterra equations are a couple of nonlinear differential equations that describe the dynamics of a population of prey hunted by a population of predators. The Lotka-Volterra equations are:
dx/dt = αx - ßxy
dy/dt = δxy - γy
where:
α
,ß
,δ
, andγ
— Parameters related to growth and predation;x
andy
— The size of the pupulations; anddx/dt
anddy/dt
— The time derivatives of the populations' sizes.
How does a population of prey interact with a predator population?
A population of prey interacts with a population of predators in multiple ways.
- The population of prey tends to grow in an uncontrollable fashion (exponential growth).
- The predators keep the prey in check by hunting it. A given fraction of each encounter between the two species results in successful predation.
- Predators convert prey into new predators.
- Predators naturally die out in the absence of prey.
Putting together all these "rules", we can see how the populations peak and decrease in an almost alternating fashion.
How do I calculate the stable points of the Lotka-Volterra model?
To calculate the stable points of the Lotka-Volterra model, follow these easy steps:
-
Be sure to know the parameters of the Lotka-Volterra equations. These are four numbers that multiply combinations of the populations' sizes:
α
,ß
,δ
, andγ
. -
To find the stable prey population, divide the coefficients of the predator dynamics:
stable prey population = α/ß
-
To find the predator population that doesn't oscillate with time, consider the coefficients of the prey's dynamics:
stable predator population = γ/δ
What are the assumptions of the Lotka-Volterra model?
The Lotka-Volterra model uses multiple assumptions to allow a satisfying simulation of predator-prey dynamics:
- Natural resources for the prey are unlimited.
- The predator population gets its only sustainment from the prey population.
- The rate of change of the populations' sizes depends on the size of the initial populations.
- External factors don't affect the dynamics.
- The predators keep predating the population at a constant rate.