Author: Constanze Ciavarella @ConniCia
Date: 2018-10-02
This code combines two deterministic metapopulation SEIR models as described in Lloyd & Jansen (2004).
Cross-coupling is controlled through matrix $\beta$, describing the effective contact rates acting within and between patches.
Setting the off-diagonal elements of $\beta$ to zero, we switch off cross-coupling across patches.
Matrix $C$ must be such that the elements on the diagonal, denoting outflow of each patch, are negative. Element $c_{ij}$ describes the flow from patch $i$ to patch $j$. For each row, the sum all elements on the row is 0.
Setting all elements of $C$ to zero, we switch off migration between patches.
This model consists of many SEIR models connected through between-patch contact and/or migration of individuals between patches. The model has a constant total population size, which means that births and deaths correspond at each time step.
The model will be written as $$ \begin{aligned} &S_i' = \mu - \mu S_i - S_i \, \sum_{j=1}^n \, \beta_{ij} \, I_j + \, m_S * (S_1 * c_{1i} \, + ... + \, S_n * c_{ni})\\ &E_i' = S_i \sum_{j=1}^n \beta_{ij} \, I_j - (\mu + \sigma) \, E_i + \, m_E * (E_1 * c_{1i} \, + ... + \, E_n * c_{ni})\\ &I_i' = \sigma \, E_i - (\mu + \gamma) \, I_i + \, m_I * (I_1 * c_{1i} \, + ... + \, I_n * c_{ni})\\ &R_i' = \gamma \, I_i - \mu \, R_i + \, m_R * (R_1 * c_{1i} \, + ... + \, R_n * c_{ni}) \end{aligned} $$