{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## A SIR epidemic model\n", "\n", "### Question: \n", "\n", "Simulate the step response of the SIR epidemic model using an ODE solver in Python.\n", "\n", "### Mathematical model:\n", "\n", "A simple mathematical description of the spread of a disease in a population is the so-called SIR model, which divides the (fixed) population of N individuals into three \"compartments\" which may vary as a function of time, t:\n", "\n", " - S(t) are those susceptible but not yet infected with the disease;\n", " - I(t) is the number of infectious individuals;\n", " - R(t) are those individuals who have recovered from the disease and now have immunity to it.\n", "\n", "The SIR model describes the change in the population of each of these compartments in terms of two parameters, $\\beta$ and $\\gamma$. $\\beta$ describes the effective contact rate of the disease: an infected individual comes into contact with $\\beta N$ other individuals per unit time (of which the fraction that are susceptible to contracting the disease is S/N). $\\gamma$ is the mean recovery rate: that is, $1/\\gamma$ is the mean period of time during which an infected individual can pass it on.\n", "The differential equations describing this model were first derived by Kermack and McKendrick [Proc. R. Soc. A, 115, 772 (1927)]:\n", "\n", "\\begin{align}\n", "\\frac{dS}{dt} &= -\\frac{\\beta S I }{N}\\\\\n", "\\frac{dI}{dt} &= \\frac{\\beta S I }{N}- \\gamma I\\\\\n", "\\frac{dR}{dt} &=\\gamma I\n", "\\end{align}\n", "\n", "The model becomes more generic by working with population fractions rather than raw population counts. To this end, define\n", "\n", "\\begin{equation}\n", "s =S/N \\ \\ \\ \\ i = I/N \\ \\ \\ \\ r =R/N \n", "\\end{equation} \n", "\n", "After substitution, this results in a system of four equations.\n", "\n", "\\begin{align}\n", "\\frac{ds}{dt} &= -\\beta s i \\\\\n", "\\frac{di}{dt} &= \\beta s i- \\gamma i \\\\\n", "\\frac{dr}{dt} &=\\gamma i\n", "\\end{align}\n", "\n", "### Key Properties of the SIR Model\n", "\n", "The SIR model describes key epidemiological phenemena. Here is a brief synposis of the relevant results.\n", "\n", " - The parameters $\\beta$ and $\\gamma$ have units of inverse time.\n", " - $\\beta$ is rate constant associated with transmission of the infection. The corresponding time constant $\\tau_{infect}=\\frac{1}{\\beta}$ corresponds to exponential growth of new infections in an initially susceptible population where $s=1$\n", " - $\\gamma$ is the rate of recovery from infections. The associated time constant $\\tau_{recovery}=\\frac{1}{\\gamma}$ is average time to recover from an infection.\n", " - The infectious population can grown only if $\\beta s>\\gamma$ , that is the rate of infection is greater than the rate of recovery.\n", " - The ratio $R_0=\\frac{\\beta}{\\gamma}$ is the \"Basic Reproduction Number\" that describes the transmissability or contagiousness of an infectious disease.\n", " - $R_0$ is the average number of people infected by an index 0 case in an otherwise completely susceptible population.\n", " - The infectious population can grow only if $R_0 s>1$. If s=1, then $R_0>1$ is sufficient for growth of the infectious population. The infectious population decreases if $sR_0<1$ or, equivalently, $s<1R_0$.\n", " \n", " - The population has 'herd immunity' when the fraction of susceptibles is less than $\\frac{1}{R_0}$.\n", "\n", "\n", "[More information above the SIR and more advanced model can be found here](https://jckantor.github.io/CBE30338/03.09-COVID-19.html)\n", "\n", "**Python based simulation methods**:\n", "\n", "- [ODE simulation of SIR model ](SIR_ODE.ipynb)\n", "\n", "- [Transfer function model of SIR ](SIR_TF.ipynb)\n", "\n", "- [State Space model of SIR ](SIR_SS.ipynb)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }