Examples
DDESolve comes with 3 examples model files:
- ode_eg.c is an ordinary differential equation model;
- dde_eg.c is a delay differential equation model;
- sdde_eg.c is a delay differential equation model with switches.
The purpose of this section is simply to specify these
3 models mathematically so that, in conjunction with the 3 files, the reader can see how the
different types of model are coded up in practice.
The solv95.h header file is included by these files.
An ODE model
Consider the classic Lokta- Volterra predator- prey model:
P' = aNP - dP
N' = bN - gNP
where lower case letters are used for model parameters, N is prey population and P is predator
population (and typically g>a). The file ode_eg.c codes up this model
defining: s[0] as N, s[1] as P, c[0] as a,
c[1] as d, c[2] as b, c[3] as g, c[4] as
N(0) and c[5] as P(0).
A DDE model
Consider Gurney and Nisbet's (1981) model of Nicholson's (1954) famous1 blowflies:
A' = { |
- dA(t) |
t<T |
PA(t-T)e-A(t-T)/A0 - dA(t) |
t &ge T |
Where A is the population of adult flies in a laboratory population, T is the
development time from egg to adulthood, P is maximum adult fecundity rate multiplied by the
survival rate from egg to adult, and A0 is a parameter determining how quickly fecundity
declines with adult population.
This model is coded in the file dde_eg.c.
A switched DDE model
This model (again vaguely ecological, but very simplistic for clarity) describes a resource
replenished at regular intervals, grazed down by a population of consumers. It is assumed that
consumers produce offspring in proportion to how much they eat, but that there is a lag between
offspring production and those offspring starting to feed.
The resources $ R$ are governed by:
R'= -aRC
except every T time units, when a quantity RA is added to R. The consumer equation is:
C' = { |
- dC(t) |
t<T |
gC(t-T)R(t-T) - dC(t) |
t &ge T |
where g is the consumer fecundity per unit of resource (over a, strictly),
T is the development time and d the per capita death rate.
The file sdde_eg.c codes up this model, with the assumption C(0)=1 and R(0)=0.
Back to index
- If you're an ecologist!