Lotka   Volterra   Model

A Model to simulate Predator - Prey Interactions

Page Designed by : AMIT  KUMAR ( Date : Oct 04 , 2006)

Prey = Rabbits                                                                          Predator = Wolves

Many of the most interesting dynamics in nature have to do with interactions between organisms. These interactions are often subtle , indirect and difficult to detect. Predator - prey interactions are the exceptions ; predation is often direct, conspicuous and easy to study. For this reason our knowledge of predator - prey relationships is extensive and a large number of models exist to  study such interactions . One of such models that simulates predator - prey interactions is the Lotka Volterra Model.

The model is based on  simple assumptions for predator - prey interactions. The first assumption of this model is that the prey population x , without predation, exhibits simple exponential growth .

where a is the average  birth rate minus the average death rate of the prey population, and dx / dt  is the rate of change of the prey population.

Since predation reduces the prey population, this model accounts for predation by subtracting some term from equation 1. This term must account for how often the prey and predator encounter each other. Also, how often the predator is successful should be accounted for by the model . This idea is implemented by introducing the simple term bxy where b is te parameter that indicates the efficiency of predation and  x and y are the prey and predator population respectively.  The product xy is equivalent to the encounter rate. The idea here is that  each individual predator has the possibility of finding and consuming every individual in the prey population Subtracting bxy from equation (1) gives

In order to define a a related equation for the predator population, it is assumed that the loss bxy from the prey population results in an increase in the predator population .This term when multiplied by a conversion efficiency ( from prey to predator ) shall account for the growth of the predator population .Thus, the growth rate for the predator population is

where p is the equal to the product of  conversion efficiency and b .

Since the predators do not live forever, their death is accounted for by the assumption that the greater is the number of predators, the greater is the predator death rate ( increased competition between predators ). Incorporating this idea to equation (3) gives,

Thus, Equations (2) and (4) form a model for the predator - prey interactions consisting of two coupled equations. The dynamics of the two populations depends on the parameters a , b , p and c and the starting populations of the predators and the preys.

a =  Intrinsic rate of Prey Population increase
b = Predation rate Coefficient
p = Reproduction rate of Predators ( after eating preys )
c = Death rate of Predators

Numerical Implementation of the model using Euler's Simplest Differential Equation Procedure

To Start with , the above discussed model gives two coupled differential equations which can easily be solved using the Euler's technique of solving differential equations . The formula used for this technique was

which gives the solution for the equations numerically. The Parameters chosen for this simulation was a = 1 , b = 0.2 , p = 0.04 and c = 0.5. The initial prey population was chosen to be 5 and the Predator population was chosen to be 2 . The time step was chosen as 0.01. Clearly, the solution derived from this model shows error as the phase space seems to spread with time . This error arises due to the cumulative errors generated in each step of the Euler's technique.

Java Code :     LotkaEulers.java                     StdDraw.java
Please Download Both these files to a folder and run the LotkaEulers.java file . It won't run till StdDraw.java is in the same folder as StdDraw.java is a dependancy for LotkaEulers.java .The StdDraw.java file helps in auto-genearting plots on the Screen

Numerical Implementation of the model using Runge Kutta  Differential Equation Solver Procedure

The coupled differential equations in the Lotka Volterra Model were implemented using the Fourth order Runge-Kutta numerical technique for solving differential equations.

The fourth order Runge-Kutta requires four gradient or ''k'' terms to calculate   .

The Parameters chosen for this simulation were a = 1 , b = 0.2 , p = 0.04 and c = 0.5. The initial prey population was chosen to be 5 and the Predator population was chosen to be 2 . The time step was chosen as 0.01. As can be seen , the phase space obtained  from the output of the Runge-Kutta program does not seem to spread with time, which is an indication that this technique is better suited for the implementation of the model than Euler's technique.The predator and the prey Population cycle with time. Also, the predator population follows the prey population. Though this cycling behavior predicted by this model occurs in nature , it is not very common. Thus, other variants of this model have been used to simulate predator -Prey interactions.

Java Code :     LotkaKutta.java                     StdDraw.java
Please Download Both these files to a folder and run the LotkaKutta.java file . It won't run till StdDraw.java is in the same folder as StdDraw.java is a dependancy for LotkaKutta.java .The StdDraw.java file helps in auto-genearting plots on the Screen

Numerical Implementation of Competitive Lotka Volterra  model

As both the predator and the prey compete for food and shelter in  the forest, competition sets in and the population of each species tends to control itself  via a negative quadratic effect , that is  the population decreases with a rate directly proportional to the present population of that species. Hence , higher the population , higher is the quadratic decrease. This effect can be introduced in the model by incorporating a quadraic term in each of equations (2) and (4) as follows :

This effect was introduced in the model and the coupled differential equations were again solved using Fourth Order Runge- Kutta Differential equation Solver Procedure.The Parameters chosen for this simulation were a = 1 , b = 0.2 , p = 0.04 and c = 0.5. The initial prey population was chosen to be 5 and the Predator population was chosen to be 2 . The time step was chosen as 0.01 .The value of a was chosen as 0.01 and that of  b was chosen to be 0.005. As can be seen , the phase space obtained  from the output of the Runge-Kutta program converges with time towards a solution where the prey and the predator Population becomes constant with time. This is the predicted behaviour to be expected when competition sets in Predator-Prey interactions.

Java Code :     LotkaVar.java                     StdDraw.java
Please Download Both these files to a folder and run the LotkaVar.java file . It won't run till StdDraw.java is in the same folder as StdDraw.java is a dependancy for LotkaVar.java .The StdDraw.java file helps in auto-genearting plots on the Screen

Numerical Implementation of Competitive Lotka Volterra  model with Recurring Hunters

Let us assume that the forest in which the Rabbits and Wolves live is pretty close to a village . The villagers are wary of the wolves attacking their cattle in the night and also do not want to kill them completely ( they want to avoid huge rise in rabbit population which can affect their crops ) . Thus, they decide to send hunters who kill the Wolves if their number exceeds a certain critical value (y0). This idea can be incorporated in the model by applying  the following condition .

This effect was introduced in the model and the coupled differential equations were again solved using Fourth Order Runge- Kutta Differential equation Solver Procedure. The Parameters chosen for this simulation were a = 1 , b = 0.2 , p = 0.04 and c = 0.5. The initial prey population was chosen to be 5 and the Predator population was chosen to be 2 . The time step was chosen as 0.01 .The value of  b was chosen to be 0.1 and the critical number of the wolves ( Predators ) was set at y0 = 3. As can be seen , the phase space obtained  from the output of the Runge-Kutta program converges very quickly with time in comparison to the previously defined cases . Both the prey and the predator Population seem to become constant with time. This is the predicted behaviour to be expected  in Predator-Prey interactions when external conditions are applied on the population of a certain species.

Java Code :     LotkaHunters.java                     StdDraw.java
Please Download Both these files to a folder and run the LotkaHunters.java file . It won't run till StdDraw.java is in the same folder as StdDraw.java is a dependancy for LotkaVar.java .The StdDraw.java file helps in auto-genearting plots on the Screen

Thus, this assignment helps us in understanding the practical application of numerical solution to differential solutions . Even very complex situations can be simulated by applying the correct conditions and using the appropriate numerical technique for that problem.

References :