Euler Integration & the Lotka-Volterra Equations

Introduction

This notebook first develops Euler integration as a technique for approximating differential equations using a computer. After that it uses this technique to graph the Lotka-Volterra equations a set of differential equations used to model the behaviour of a population of prey and predator species coupled in a basic ecological system. After the simple model of a population that the logistic map generates these represent the next natural layer of complexity.

Euler Integration

Euler integration is a way of approximating continuous functions ('differential equations') using discrete steps ('difference equations'). To do this we take a differential equation like $$dx/dt = -x$$ and convert it to a difference equation like $$ x_{t+1} = x_t + (1/tau)(-x_t) $$ where the values correspond to:

As you might imagine the generalised form of this equation is relatively straightforward. For any differential equation you have a difference equation such that:

$$ dx/dt = f(x) $$$$ x_{t+1} = x_t + \frac{1}{tau}f(x_t) $$

Two examples of euler integration are given below.

Lotka-Volterra Equations

The Lotka-Volterra Equations describe the interactions of a predator and prey population through a pair of interacting differential equations. Specifically:

$$ dx/dt = \alpha x - \beta xy $$$$ dy/dt = \delta xy - \gamma y $$

The values here correspond to

You can get the intuition for how this works by thinking about a prey population like moose and a predator population like wolves. As the prey population grows it is negatively impacted by the prey population that is around. The predator population is supported by the prey population but if it gets too large then it will naturally reduce the prey population leading to it's own demise.

To model these as difference equations we can use the general formula described above, which gives us:

$$ x_{t+1} = x_t + \frac{1}{tau}(\alpha x_t - \beta x_t y_t) $$$$ y_{t+1} = y_t + \frac{1}{tau}(\delta x_t y_t - \gamma y_t) $$

Note: As a point of interest the canonical example of a system which the Lotka-Volterra models model unreasonably well is the populations of hare and lynx as prey and predator

Another way to visualise this is using an oscillation graph that shows how the two act in unison with prey on the x axis and predators on the y axis.

Resources Used