The SIR model without vital dynamics: The dynamics of an epidemic, for example the flu, are often much faster than the dynamics of birth and death, therefore, birth and death are often omitted in simple compartmental models. The SIR system without so-called vital dynamics (birth and death, sometimes called demography) described above can be expressed by the following set of ordinary differential equations:
Code
usingModelingToolkit, DifferentialEquations, Plots, ForwardDiff, ModelingToolkitStandardLibrary, LatexifyusingModelingToolkit: D_nounits as D, t_nounits as t@mtkmodel SIR begin@parametersbegin β γend@variablesbeginS(t)I(t)R(t)end@equationsbeginD(S) ~-β*S*ID(I) ~ β*S*I - γ*ID(R) ~ γ*Iendend@mtkbuild sir =SIR()latexify(sir)
\[\begin{align}
\frac{\mathrm{d} S\left( t \right)}{\mathrm{d}t} &= - S\left( t \right) I\left( t \right) \beta \\
\frac{\mathrm{d} I\left( t \right)}{\mathrm{d}t} &= - I\left( t \right) \gamma + S\left( t \right) I\left( t \right) \beta \\
\frac{\mathrm{d} R\left( t \right)}{\mathrm{d}t} &= I\left( t \right) \gamma
\end{align}\]
At time \(t\) the SIR model is characterised by \(S(t)\) for the number of susceptible in the population, \(I(t)\) for the number of infected, and \(R(t)\) for the number of recovered or deceased (or immune) individuals out of the population \(N = S(t)+I(t)+R(t)\).