Predators and Prey
Watch the Lotka-Volterra predator-prey model run live: the direction field, the closed orbit and a state that moves around it. Edit the equations.
A population of prey x grows when it is left alone, and is eaten at a rate proportional to the number of meetings between prey and predators. A population of predators y dies out when it is left alone, and grows with the same meetings. Alfred Lotka (1925) and Vito Volterra (1926) wrote this as x' = ax - bxy and y' = dxy - cy .
The picture is the plane of the two populations, not a plot against time. At each point the arrow shows where the populations go next. Many prey feed more predators; many predators leave few prey; few prey starve the predators; few predators let the prey recover. So the state turns around the equilibrium \left(\frac{c}{d}, \frac{a}{b}\right) , the grey dot inside the orbit, where both populations stay constant.
In this model the state returns exactly to its start: the quantity V(x, y) = dx - c\ln x + by - a\ln y does not change along a solution, so each solution is a closed level curve of V . The blue curve is the level curve through the start (p, q) . An action moves the state along it with the fourth-order Runge–Kutta method, h = 0.03 time units every 30 milliseconds. Edit the rates a , b , c , d or the start p , q (all six must stay positive), then run the second action to put the state back at the start. Near the equilibrium one turn takes the time \frac{2\pi}{\sqrt{ac}} ; a larger orbit takes longer.
In the usual notation the Lotka–Volterra equations are \frac{dx}{dt} = \alpha x - \beta xy and \frac{dy}{dt} = \delta xy - \gamma y : here a , b , c , d are \alpha , \beta , \gamma , \delta . The term \alpha x is the growth of the prey, \beta xy the prey eaten, \delta xy the growth of the predators from that food, and \gamma y their death. The entry uses a = b = d = 1 , c = 1.5 and the start (0.7, 0.7) , so the equilibrium is (1.5, 1) . On the orbit through the start, the prey go from about 0.65 to 2.88 and the predators from 0.35 to 2.18.
A predator prey graph can mean two plots. One draws both populations against time: two waves with the same period, the predator peak coming after the prey peak, by a quarter of a cycle for small orbits. The other is the phase plane drawn here, prey on the horizontal axis and predators on the vertical axis, where time is the motion along the closed orbit, counterclockwise. The first action starts when the page opens; the red trail shows the last 40 positions of the state.
After a JSXGraph example by The Center of Mobile Learning with Digital Technology.
JavaScript is required to view the interactive plot.