SIR Epidemic Model

Consider the SIR system \[ \begin{aligned} \dot S(t) &= -\alpha\,S(t)\,I(t),\\ \dot I(t) &= \alpha\,S(t)\,I(t)-\beta\,I(t),\\ \dot R(t) &= \beta\,I(t), \end{aligned} \] where \(S(t)\) denotes the number of susceptible individuals, \(I(t)\) the number of infectious individuals, and \(R(t)\) the number of recovered (or removed) individuals at time \(t\). A conserved quantity of this ODE system is \(N(t):=S(t)+I(t)+R(t)\), which remains constant in the exact model and should be approximately constant in the numerical simulation.

Parameters: \(\alpha\ge 0\) is the infection rate (mass action), and \(\beta\ge 0\) is the recovery rate. Initial values: \(S_0=S(0)\), \(I_0=I(0)\), \(R_0=R(0)\) (absolute counts). Simulation settings: final time \(T\), number of time steps \(N_{\mathrm{st}}\), and step size \(h=T/N_{\mathrm{st}}\). The widget recomputes \(h\) automatically from \(T\) and \(N_{\mathrm{st}}\).

Parameters

Initial values

Simulation

Time series: \(S(t), I(t), R(t), N(t)\)
\(S(t)\) \(I(t)\) \(R(t)\) \(N(t)\)
Phase space: \((S(t), I(t))\)
\((S(t), I(t))\)