A modular form is a stylized way of writing down a
dynamical systems that emphasizes the structure of the underlying
process. The modular structure of ramp.xds
can be understood through the use of these forms. The forms we describe
here rewrite models so that they closely resemble their implementation
in ramp.xds
, which makes it possible to relate written
equations and computed code.
A mathematical framework for building modular models of malaria
dynamics and control (and other mosquito-borne pathogens) was described
in Spatial Dynamics of Malaria Transmission, and that
framework has been implemented in ramp.xds.
There is no standard form for writing down systems of differential equations, but many forms are used, depending on context. For comparison, we writing down a system of equations that does not emphasize the modularity, or not a modular form.
To illustrate the modular form, we start with the Ross-Macdonald-style model in Box 1.
Box 1: A Ross-Macdonald Model
Let the dependent variable denote the density of infected humans, and the parameter the density of all humans
Let the dependent variable denote the density of infected mosquitoes, and the parameter the density of all mosquitoes
Let denote the fraction of bites by infective mosquitoes that infect a human, and let denote the rate that infections clear
Let denote the fraction of blood meals on infectious humans infect a mosquito, and let denote the mosquito death rate
Let denote the overall blood feeding rate, and the human fraction
Let denote the EIP.
In this set of equations, we ignore the delay for sporogony, but we count the mortality, so infections occur at the rate We assume that the daily FoI is linearly proportional to the daily EIR, consistent with a Poisson model for exposure, so
We illustrate by writing a Ross-Macdonald model in its modular form (Figure 1). In the modular form, we identify the terms in one equation that depend on the other variable. First, we focus on the equation describing human infection dynamics. We note that it depends on a term involving the variable The term is epidemiologically meaningful – it is called the force of infection (FoI). We let denote the FoI:
and now we can rewrite the equation
Next, we isolate the equation describing mosquito infection dynamics, we note that it depends on a term that we will call the net infectiousness (NI).
The term is the density of infected humans, weighted by their infectiousness.
We note that is the FoI for mosquito infections, and now we can rewrite the equation for mosquitoes:
Since we also want to make this model extensible, we want to draw attention to the term We note that the number of infective bites, per human, per day – called the daily entomological inoculation rate (EIR) – is
We assume that exposure is Poisson distributed:
We emphasize that this is the same set
To solve these equations, we need to write functions that compute the
derivatives. We are using the R package deSolve.
A properly
formed derivative function implementing the
For a longer discussion of modularity, see the vignette modularity