How to convert delay differential equations to a discrete-time agent-based model?

355 Views Asked by At

I am building an agent-based model in discrete time. To do this, I need to convert a continuous time delay and ordinary differential equations to discrete-time equations. Here is the equation system:

$$ \frac{\mathrm{d} S_\text{L}^\text{Q}}{\mathrm{d}t} = \underbrace{B_\text{L}(t)}_\text{birth} - \underbrace{d_\text{L} S_\text{L}^\text{Q}}_\text{mortality} - \underbrace{a_\text{L} N_\text{H} S_\text{L}^\text{Q}}_\text{encounter success} ,\\ \frac{\mathrm{d} S_\text{L}^\text{A}}{\mathrm{d}t} = \underbrace{a_\text{L} N_\text{H} S_\text{L}^\text{Q}}_\text{encounter success} - \underbrace{d_\text{L} S_\text{L}^\text{A}}_\text{mortality} - \underbrace{a_\text{L} N_\text{H} e^{-d_\text{L} τ} S_\text{L}^\text{Q} (t-τ)}_\text{feeding success} , \\ \frac{\mathrm{d} S_\text{L}^\text{F}}{\mathrm{d}t} = \underbrace{a_\text{L} N_\text{H} e^{-d_\text{L} τ} S_\text{L}^\text{Q}(t-τ)}_\text{feeding success} - \underbrace{d_\text{N} S_\text{L}^\text{F}}_\text{mortality} $$

How can I rewrite these continuous-time equations to discrete-time equations? What discretization method should be used? In the agent-based model, each time step represents one day.

I am beginner in ODEs and DDEs.

1

There are 1 best solutions below

0
On BEST ANSWER

You can easily discretise any differential equation, e.g., every numerical solver does this. However, the result will not be agent-based and not help you much as such. At best, you can use a simple Euler discretisation as inspiration or sanity check (see below).

Instead, first realise that every term in your differential equations represents accumulations of events happening to individuals (agents) on the population level. Stochastic effects are assumed to have averaged out due to large population sizes. Try to understand these terms and then replace population sizes with individuals (appropriately modified) and make other adaptions necessary to translate them.

For example, consider the mortality term $-d_\text{L}S_\text{L}^\text{Q}$, and let’s first try to reconstruct it from events happening to individuals. The assumption underlying that term is that the (not feeding-related) death of individuals in the population $Q$ is a Poisson process with rate $d_\text{L}$ that affects all individuals equally (regardless of age, etc.). Thus the chance $p$ that a give individual dies in an in an infinitesimal time span $Δt$ is $d_\text{L} Δt$. For $S_\text{L}^\text{Q}$ individuals, the average number of individuals dying within that time span is consequentially $p S_\text{L}^\text{Q} = d_\text{L} S_\text{L}^\text{Q} Δt$. As a consequence, the reduction rate of a the population $Q$ due to such effects is $d_\text{L} S_\text{L}^\text{Q}$ (this is what you get in the differential equation).

Now, the interesting thing for you is the boldfaced sentence. This is something you can directly implement in an agent-based model – if your discretisation step $Δt=1\,\text{d}$ is small compared to the average life time of your individuals, i.e., you are not modelling mayflies. In every step, you let each individual drop dead with a probability of $d_\text{L} Δt$.

A backwards way to arrive at this would be to apply an Euler discretisation to your mortality term, which yields a negative population change of $d_\text{L} S_\text{L}^\text{Q} Δt$ during each discretisation step $Δt$. You can then divide this by $S_\text{L}^\text{Q}$ to obtain the effect on each individual, obtaining $d_\text{L} Δt ≪ 1$. (If the letter inequality does not hold, your discretisation step is far too coarse.) Now you are facing the problem that individuals do not die in fractions, and one way to address this is to make death stochastic, arriving at the same result as above. Alternatively, you can let each individual accumulate “deadness” and have it drop dead once that reaches $1$ – which is equivalent to giving each individual a fixed life span.

An appropriate translation of the delay term is probably to equip one affected individual have an internal timer causing event. For example, a simple implementation of mammalian reproduction would be that a male and female mating triggers a timer in the female that creates a new individual after the gestation time. Finally note that the term $e^{-d_\text{L} τ}$ very likely serves to account for the probability that an individual dies during whatever happens during the delay (and thus the delayed event cannot happen). If you discretise your delay properly, you should get this automatically.