If one good thing has come out of the COVID-19 pandemic, it’s the vast amount of data we have acquired. In light of technological advancements, we have access to more information and computing power, which we can use to predict and curb the spread of the virus. One of the simplest ways to do this is through the SIR model.

The SIR is a compartmental model that categorizes a _constant _population into three groups, namely the susceptible, infected, and recovered. These can all be expressed as functions that take time as an argument.

S(t) — The number of people who are susceptible to the disease

I(t) — The number of people infected with the disease

R(t) — Those incapable of infecting others; either recovered or diseased (hence a better name for this group may be “removed”)

Of note, S(t) + I(t) + R(t) = N at any time t, where N is the total population.

Importing the needed Python libraries

from scipy.integrate import odeint

import numpy as np
import matplotlib.pyplot as plt

There are several libraries that we can use to smoothen out the calculations and graphing process. The SciPy library contains calculation methods that are “user-friendly and efficient.” We will be using their numerical integration function for this program. We will also be using Numpy for float step values and Matplotlib for graphing.

#python #pandemic #data-visualization #mathematics #education

Graphing The SIR Model With Python
7.60 GEEK