# Simple epidemiological model of Covid-19¶

As we have seen during the Covid-19 crisis, model predictions of the case numbers are notoriously difficult to make. This is not because the mathematics of infectuous diseases is difficult. The reason why these predictions are so hard is that the models are entirely dependent on the model parameters such as how many contacts people have, where they have them, if they wear masks, and what effect these have on the infection rate. All these unknowns eventually boil down to one single parameter: the infamous basic reproduction number $R_0$ parameter. Of course, it is a bit more complex than that, as one should distinguish between different kinds of groups with different $R_0$. But in its simplest form, an epidemic is driven by the $R_0$ parameter.

## The SIR model¶

The simplest epidemic model was formulated more than 90 years ago by Kermack and McKendrick (1927). The idea is to divide the population up into three compartiments (groups): The "S" compartiment for the "susceptibles" (those people who are not yet infected), the "I" compartiment for the "infectuous" (those people who are ill and can transmit the disease) and the "R" compartiment for the "removed" (those people who are cured or died, but in either case no longer participate in the infectuous dynamics, hence "removed"). This is called the SIR model. If we normalize the full population to 1, then

$$S+I+R=1$$

We usually start with a small fraction of the population infected (for instance $I\simeq 10^{-3}$) and nobody removed yet ($R=0$). The rest is susceptible ($S=1-I-R=0.999$). The time-evolution of the SIR model is as follows:

$$\begin{split} \frac{dS}{dt} &= -\beta\,S\,I\\ \frac{dI}{dt} &= \beta\,S\,I-\gamma I\\ \frac{dR}{dt} &= \gamma I \end{split}$$

The parameters $\beta$ and $\gamma$ can be computed from the more familiar parameters $R_0$ (the basic reproduction number) and $t_g$ (the so-called generation time). The generation time is the mean time between successive infections. From these two parameters one can compute the exponential growth time scale $t_e$:

$$t_e = \frac{t_g}{\ln(R_0)}$$

The parameters $\beta$ and $\gamma$ then follow from:

$$\begin{split} \gamma &= \frac{1}{(R_0-1)t_e}\\ \beta &= \gamma R_0 \end{split}$$

## Applying the SIR model to Covid-19 in Germany¶

According to the Robert Koch Institute, for Covid-19 the generation time is $t_g=4$ days. During the October/November 2020 surge the value of $R_0=1.3$. Let us assume that we start with $I=10^{-3}$ and $R=0$ and $S=1-I-R$.

Write a Python program that computes the epidemic dynamics of Covid-19 if no counter-measures were taken, i.e.\ keeping $R_0$ the same over time. Plot the result for a period of 6 months, where you plot in a single figure all three quantities. Label them with "S", "I" and "R" and provide a legend for easy identification of the three curves. To be able to see the solution better, make the y-axis logarithmic, but set the minimum scale to $10^{-3}$ (what would happen if you don't set this minimum value?).

In [ ]:
# Your solution here


With this model, answer the following questions:

• Germany has 80 Million people. At the peak of the epidemic, how many people would be ill?

• After everything is over, how many people would have contracted the disease?

• How many people have to be vaccinated to avoid the run-away?

• If nobody is vaccinated, but somehow the disease gets 50% less contageous (e.g. due to behavioral changes in the population), what happens?

In [1]:
# Your answers here