14 Discrete Dynamic System (foxrabbit)

Run LPL Code  ,  PDF Document

The class of discrete and continuous model system is huge. In LPL it is not possible right now to model differential systems, however an example of a discrete dynamic system is given here. It is the famous predator-prey model.


“Consider a forest containing foxes and rabbits where the foxes eat the rabbits for food. We want to examine whether the two species can survive in the long-term. A forest is a very complex ecosystem. So to simplify the model, we will use the following assumptions:

  1. The only source of food for the foxes is rabbits and the only predator of the rabbits is foxes.

  2. Without rabbits present, foxes would die out.

  3. Without foxes present, the population of rabbits would grow.

  4. The presence of rabbits increases the rate at which the population of foxes grows.

  5. The presence of foxes decreases the rate at which the population of rabbits grows.”

(This problem is from [1] p. 132ff).

Modeling Steps

The populations are modeled using a discrete dynamical system, that is, at each point in time – let’s say each month – the size of the two populations is calculated and then mapped on a graph (for more information see [1]). We calculate the populations over a period of 500 months. Hence, let i I = {0,, 500} a set of time points (first of month). Furthermore, let Ri and Fi be the population at time i. In the absense of the other specie, the populations would grow/shrink proportionally to the actual size, so (with 0 α,δ 1) (The foxes would die out, while the population of rabbits grows infinitely.):

ΔF    =   F    - F   =   - αF
   i       i+1    i           i
ΔRi   =   Ri+1 - Ri  =   δFi

Now, The presence of the other specie either increases (the foxes) its population by a rate of β, or decreases (the rabbits) its population by a rate of γ. Therefore we have:

ΔF    =   F   -  F   =   - αF  + βR
   i       i+1    i          i      i
ΔRi   =   Ri+1 - Ri  =   - γFi + δRi

Reassigning the terms gives:

Fi+1  =   (1 - α)Fi + βRi
Ri+1  =   - γFi + (1 + δ)Ri

Given an initial population of F0 = 110 and R0 = 900, and the rates α = 0.12, β = 0.0001, γ = -0.0003, and δ = 0.039, it is easy to calculate the population at each time point using the simple LPL model :

Listing 12: The Complete Model implemented in LPL [10]
model foxrabbit "Discrete Dynamic System"; 
  parameter n:=500; 
  set i:= 0..n; 
  parameter x{i}:=i; F{i}; R{i};; 
  F[0]:= 110, R[0]:=900, 
    {i|i<#i-1} (F[i+1]:=0.88*F[i] + 0.0001*F[i]*R[i], 
                R[i+1]:=-0.0003*F[i]*R[i] + 1.039*R[i]); 


With the rates given, the populations ocillate as can be seen in Figure 4 (Black the population of foxes, red the population of rabbits.)


Figure 4: Fox-Rabbit Population over time