# A Mathematical Model of Epidemics—A Tutorial for Students

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Exponential Growth

## 3. Mathematical Model of Epidemics

## 4. Numerical Solution of SIR Model

## 5. Analytical Solution of SIR Model

**Problem**

**1.**

## 6. Analytical Approach of SIR Model with Vital Dynamics

## 7. Discussion and Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## Appendix A. Python Code of the Numerical Solution of the SIR Model Using the Runge–Kutta Method

`# coding: utf-8`

`import math`

`import matplotlib.pyplot as plt`

`N = 10000`

`x = N-10`

`y = 10`

`z = 0`

`taxis=[ ]`

`xaxis=[ ]`

`yaxis=[ ]`

`zaxis=[ ]`

`beta=0.5/N`

`gamma=0.2`

`dt=0.001`

`t = 0`

`cnt=0`

`while t<60:`

`if cnt%100==0:`

`taxis.append(t)`

`xaxis.append(x)`

`yaxis.append(y)`

`zaxis.append(z)`

`# step 1`

`kx1 = - beta*x*y`

`ky1 = beta*x*y - gamma*y`

`# step 2`

`t2 = t+dt`

`x2 = x + kx1*dt`

`y2 = y + ky1*dt`

`kx2 = - beta*x2*y2`

`ky2 = beta*x2*y2 - gamma*y2`

`# update`

`x = x + (kx1+kx2)*dt/2`

`y = y + (ky1+ky2)*dt/2`

`z = N - x - y`

`t = t + dt`

`cnt = cnt + 1`

`plt.title("SIR MODEL")`

`plt.plot(taxis,xaxis, color=(0,1,0), linewidth=1.0, label=’S’)`

`plt.plot(taxis,yaxis, color=(1,0,0), linewidth=1.0, label=’I’)`

`plt.plot(taxis,zaxis, color=(0,0,1), linewidth=1.0, label=’R’)`

`plt.xlim(0,60)`

`plt.legend()`

`plt.xlabel(’DAY’)`

`plt.grid(True)`

`plt.show()`

## Appendix B. Solutions of Problems

**Solution**

**A1**

**Solution**

**A2**

## References

- Harapan, H.; Itoh, N.; Yufika, A.; Winardi, W.; Keam, S.; Te, H.; Megawati, D.; Hayati, Z.; Wagner, A.L.; Mudatsir, M. Coronavirus disease 2019 (COVID-19): A literature review. J. Infect. Public Health
**2020**, 13, 667–673. [Google Scholar] [CrossRef] - Burki, T.K. Coronavirus in China. Lancet Respir. Med.
**2020**, 8, 223. [Google Scholar] [CrossRef] - Tang, B.; Bragazzi, N.L.; Li, Q.; Tang, S.; Xiao, Y.; Wu, J. An updated estimation of the risk of transmission of the novel coronavirus (2019-nCov). Infect. Dis. Model.
**2020**, 5, 248–255. [Google Scholar] [CrossRef] [PubMed] - Atkeson, A. What Will Be the Economic Impact of COVID-19 in the US? Rough Estimates of Disease Scenarios; NBER Working Paper No. 26867; The National Bureau of Econmic Research: Cambridge, MA, USA, 2020. [Google Scholar]
- Stock, J.H. Data Gaps and the Policy Response to the Novel Coronavirus; NBER Working Paper No. 26902; The National Bureau of Econmic Research: Cambridge, MA, USA, 2020. [Google Scholar]
- Ivorra, B.; Ferrandez, M.R.; Vela-Perez, M.; Ramos, A.M. Mathematical modeling of the spread of the coronavirus disease 2019 (COVID-19) taking into account the undetected infections. The case of China. Commun. Nonlinear Sci. Numer. Simul.
**2020**, 88, 105303. [Google Scholar] [CrossRef] [PubMed] - Prem, K.; Liu, Y.; Russell, T.W.; Kucharski, A.J.; Eggo, R.M.; Davies, N.; Jit, M.; Klepac, P. The effect of control strategies to reduce social mixing on outcomes of the COVID-19 epidemic in Wuhan, China: A modelling study. Lancet Public Health
**2020**, 5, e261–e270. [Google Scholar] [CrossRef] [Green Version] - Kermack, W.O.; McKendrick, A.G. A Contribution to the Mathematical Theory of Epidemics, I. Proc. Roy. Soc. Lond. A
**1927**, 115, 700–721. [Google Scholar] - Kermack, W.O.; McKendrick, A.G. A Contribution to the Mathematical Theory of Epidemics, II. Proc. Roy. Soc. Lond. A
**1932**, 138, 55–83. [Google Scholar] - Diekmann, O. Thresholds and travelling waves for the geographical spread of infection. J. Math. Biol.
**1978**, 6, 109–130. [Google Scholar] [CrossRef] - Metz, J.A.J. The epidemic in a closed population with all susceptibles equally vulnerable; some results for large susceptible populations and small initial infections. Acta Biotheor.
**1978**, 27, 75–123. [Google Scholar] [CrossRef] - Thieme, H.R. A model for the spread of an epidemic. J. Math. Biol.
**1977**, 4, 337–351. [Google Scholar] [CrossRef] - Inaba, H. Kermack and McKendrick revisited: The variable susceptibility model for infectious diseases. Jpn. J. Indust. Appl. Math.
**2001**, 18, 273–292. [Google Scholar] [CrossRef] - Diekmann, O.; Heesterbeek, J.A.P.; Metz, J.A.J. The Legacy of Kermack and McKendrick. In Epidemic Models, their Structure and Relation to Data; Mollision, D., Ed.; Cambridge University: Cambridge, UK, 1994. [Google Scholar]
- Harko, T.; Lobo, F.S.N.; Mak, M.K. Exact analytical solutions of the Susceptible-Infected-Recovered (SIR) epidemic model and of the SIR model with equal death and birth rates. Appl. Math. Comput.
**2014**, 236, 184–194. [Google Scholar] [CrossRef] [Green Version] - Diekmann, O.; Heesterbeak, J.A.P.; Metz, J.A.J. On the definition and the computation of the basic reproduction ratio R0 in models for infectious diseases in heterogeneous populations. J. Math. Biol.
**1990**, 28, 365–382. [Google Scholar] [CrossRef] [Green Version] - Diekmann, O.; Heesterbeek, J.A.P. Mathematical Epidemiology of Infectious Diseases: Model Building, Analysis and Interpretation; John Wiley and Sons: Chichester, UK, 2000. [Google Scholar]
- Dietz, K. The estimation of the basic reproduction number for infectious diseases. Stat. Methods Med. Res.
**1993**, 2, 23–41. [Google Scholar] [CrossRef] - Metz, J.A.J.; Diekmann, O. (Eds.) The Dynamics of Physiologically Structured Populations. In Lecture Notes in Biomathematics 68; Springer: Heiderberg, Germany, 1986. [Google Scholar]
- Brauer, F.; Castillo-Chávez, C. Mathematical Models in Population Biology and Epidemiology; Springer: New York, NY, USA, 2001. [Google Scholar]
- Murray, J.D. Mathematical Biology: I. An Introduction; Springer: New York, NY, USA, 2002. [Google Scholar]
- Panayotounakos, D.E.; Zarmpoutis, T.I. Construction of exact parametric or closed form solutions of some unsolvable classes of nonlinear ODEs (Abel’s nonlinear ODEs of the first kind and relative degenerate equations). Int. J. Math. Math. Sci.
**2011**, 2011, 387429. [Google Scholar] [CrossRef] [Green Version] - Salinas-Hernández, E.; Mu noz-Vega, R.; Sosa, J.C.; López-Carrera, B. Analysis to the Solutions of Abel’s Differential Equation of the First Kind under the Transformation y = u(x)z(x) + v(x). Appl. Math. Sci.
**2013**, 7, 2075–2092. [Google Scholar] [CrossRef] [Green Version] - Hethcote, H.W. The Mathematics of Infectious Diseases. SIAM Rev.
**2000**, 42, 599–653. [Google Scholar] [CrossRef] [Green Version] - Fernández-Villaverde, J.; Jones, C.I. Estimating and Simulating a SIRD Model of COVID-19 for Many Countries, States, and Cities; NBER Working Paper No. 27128; The National Bureau of Econmic Research: Cambridge, MA, USA, 2020. [Google Scholar]
- Batista, M. Estimation of the final size of the COVID-19 epidemic. medRxiv
**2020**. [Google Scholar] [CrossRef] [Green Version] - Liu, W.-M.; Hethcote, H.W.; Levin, S.A. Dynamical behavior of epidemiological models with non-linear incidence rate. J. Math. Biol.
**1987**, 25, 359–380. [Google Scholar] [CrossRef] - Hethcote, H.W.; van den Driessche, P. Some epidemiological models with nonlinear incidence. J. Math. Biol.
**1991**, 29, 271–287. [Google Scholar] [CrossRef] [Green Version] - Li, M.Y.; Graef, J.R.; Wang, L.; Karsai, J. Global dynamics of a SEIR model with varying total population size. Math. Biosci.
**1999**, 160, 191–213. [Google Scholar] [CrossRef] [Green Version] - Peng, L.; Yang, W.; Zhang, D.; Zhuge, C.; Hong, L. Epidemic analysis of COVID-19 in China by dynamical modeling. arXiv
**2020**, arXiv:2002.06563. [Google Scholar]

**Figure 3.**The numerical solution of the SIR model using the Runge–Kutta method; $N=10,000,{N}_{1}=9900,{N}_{2}=10,{N}_{3}=0$. (

**a**) Plot of the temporal variation of the susceptible (S), the infected (I), and the recovered (R) for $\beta =0.5$ and $\gamma =0.2$. In addition, the number of the newly infected individuals is shown by the red dotted curve. The time-dependent ${R}_{0}\left(t\right)$ is also shown in the black dashed curve. (

**b**) The comparison of S, I, R for $\beta $=0.5, 0.45, 0.4, 0.35, and 0.3; $\gamma $ is fixed as 0.2.

**Figure 4.**The semi-log plot of the cumulative number of the infected, ($y\left(t\right)+z\left(t\right))$.

**Figure 5.**The analytical solution of the SIR model. The conditions are the same as in Figure 3a.

**Figure 6.**The solution of Equation (54).

**Figure 7.**The solution of the SIR model with vital dynamics. The parameter $\mu $ is varied as 0.0, 0.02, 0.04, 0.06, and 0.08, and the data of $\mu =0.0$ are shown by thick dashed curves.

**Table 1.**The final number of the infected individuals: N = 10,000, ${N}_{1}$ = 9900, ${N}_{2}$ = 10, ${N}_{3}$ = 0, $\gamma $ is fixed as 0.2. The peak values of the infected individuals are also shown.

The Final Number | The Infected ($\mathit{y}\left(\mathit{t}\right)$) | The Newly Infected (${\mathit{y}}_{\mathbf{new}}\left(\mathit{t}\right)$) | |||
---|---|---|---|---|---|

of the Infected | Peak Day | Peak Number | Peak Day | Peak Number | |

$\beta $ = 0.50 (${R}_{0}$ = 2.5) | 8916 | 24.4 | 2339 | 21.2 | 587 |

$\beta $ = 0.45 (${R}_{0}$ = 2.25) | 8524 | 28.3 | 1956 | 24.9 | 468 |

$\beta $ = 0.40 (${R}_{0}$ = 2.0) | 7958 | 33.8 | 1539 | 30.2 | 351 |

$\beta $ = 0.35 (${R}_{0}$ = 1.75) | 7117 | 42.2 | 1094 | 38.4 | 238 |

$\beta $ = 0.30 (${R}_{0}$ = 1.5) | 5818 | 57.0 | 637 | 52.8 | 133 |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Okabe, Y.; Shudo, A.
A Mathematical Model of Epidemics—A Tutorial for Students. *Mathematics* **2020**, *8*, 1174.
https://doi.org/10.3390/math8071174

**AMA Style**

Okabe Y, Shudo A.
A Mathematical Model of Epidemics—A Tutorial for Students. *Mathematics*. 2020; 8(7):1174.
https://doi.org/10.3390/math8071174

**Chicago/Turabian Style**

Okabe, Yutaka, and Akira Shudo.
2020. "A Mathematical Model of Epidemics—A Tutorial for Students" *Mathematics* 8, no. 7: 1174.
https://doi.org/10.3390/math8071174