Skip to content

nonlinear-vibes/SIRD-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SIRD-model

Throwback to 2020: Epidemic Model with Vaccination, Mitigation, and Seasonal Effects

This repository implements an extended SIRD epidemic model with:

  • Two infectious groups (unvaccinated and vaccinated infectives)

  • Waning immunity from both vaccinated and recovered compartments

  • Piecewise-constant mitigation measures

  • Piecewise-constant vaccination capacity

  • Seasonal transmissibility (sinusoidal modulation)

  • Scenario comparison plots (mitigation + vaccination vs. none)

It is intended as a lightweight, yet sufficiently complex model to produce qualitatively realistic long-term epidemic dynamics.

Model Overview

The population is divided into the following compartments:

  • S – Susceptible

  • V – Vaccinated (reduced infection probability)

  • I₁ – Infectious (unvaccinated)

  • I₂ – Infectious (vaccinated — reduced infectiousness)

  • R – Recovered (temporary immunity)

  • D – Cumulative deaths

All compartments sum to 1.0 (normalized population).

Dynamics

The model is given by the equations:

$$\begin{aligned} \dot{S} &= -\lambda_{eff}(t) S - \min(v(t), v S) + (1 - \rho) w_r R + w_v V \\\ \dot{V} &= \min(v(t), v S) - \kappa \lambda_{eff}(t) V + \rho w_r R - w_v V \\\ \dot{I_1} &= \lambda_{eff}(t) S - (\gamma_1 + \delta_1) I_1 \\\ \dot{I_2} &= \kappa \lambda_{eff}(t) V - (\gamma_2 + \delta_2) I_2 \\\ \dot{R} &= \gamma_1 I_1 + \gamma_2 I_2 - w_r R \\\ \dot{D} &= \delta_1 I_1 + \delta_2 I_2 \end{aligned}$$

where $\lambda_{eff}(t)$ is the effective force of infection:

$$\lambda_{eff}(t) = (\beta_1 I_1 + \beta_2 I_2) m(t) s(t) \,$$

i.e. the base transmission rate multiplied by the mitigation factor (lockdowns, masks, distancing…) and the seasonal factor (higher/lower transmissibility depending on the time of year). This makes the system non-autonomous (explicitly time-dependent).

The vaccination rate, described by $\min(v(t), v S)$, is determined by two limits: $v(t)$ is the daily maximal capacity, and $vS$ denotes the fraction of susceptibles who are willing to get vaccinated.

The model also takes waning immunity into account, both for natural immunity (the recovered group R) and for the vaccinated (V). Although $\rho$ fraction of the recovered keep the same immunity level as the vaccinated (until that wanes as well).

The other parameters are:

  • $\beta_1$: infection probability of the unvaccinated (1/day)
  • $\beta_2$: infection probability of the vaccinated (1/day)
  • $\kappa$: reduction factor of the vaccinated getting infected (-)
  • $\gamma_1$: recovery rate of the unvaccinated (1/day)
  • $\gamma_2$: recovery rate of the vaccinated (1/day)
  • $\delta_1$: death rate of the unvaccinated (1/day)
  • $\delta_2$: death rate of the vaccinated (1/day)
  • $w_r$: waning rate of the recovered (1/day)
  • $w_v$: waning rate of the vaccinated (1/day)
  • $\rho$: fraction of R $\rightarrow$ V when immunity wanes (-)
  • $v$: vaccination willingness (-)

Some simulation results:

image

The figure shows four different scenarios with both vaccination and mitigation (33% reduction for two years), mitigation only (33% reduction for the whole 4-year period), vaccination only and no measures. Vaccination was assumed to be only 50% effective: the probability of both infecting and getting infected was halved.

As can be seen, combining mitigation and vaccination is far more effective: using only one of the two results in the disease becoming endemic for several years.

Quick start

  • Install dependencies: pip install numpy scipy matplotlib typing
  • Run the main SIRD.py script.

About

Throwback to 2020: Epidemic model with vaccination, mitigation, and seasonal effects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages