To run the Simulator:
g++ main.cpp
The SIR mathematical model is used for describing the spread of infectious diseases within a population. It divides the population into three groups:
- Susceptible (S): Individuals who are not infected but can get infected.
- Infectious (I): Individuals who are currently infected and can transmit the disease.
- Removed (R): Individuals who have either recovered or died from the disease.
The SIR model is described by the following set of differential equations:
-
Susceptible Population (S):
$\frac{dS}{dt} = -\beta \frac{SI}{N}$ -
Infected Population (I):
$\frac{dI}{dt} = \beta \frac{SI}{N} - \gamma I$ -
Recovered Population (R):
$\frac{dR}{dt} = \gamma I$
Where
$\beta$ is the transmission rate and$\gamma$ is the recovery rate.
In order to solve the differential equations, thus allowing us to know the number of susceptibles, infected, and removed individuals at a particular momment in time, I used Euler's numeric method:
-
Susceptible Population (S):
${S_{n+1}} = {S_n}-\beta {S_nI_n \Delta t}$ -
Infected Population (I):
${I_{n+1}} = {I_n}+ (\beta {S_nI_n - \gamma I_n \Delta t})$ -
Recovered Population (R):
${R_{n+1}} = {R_n} + {\gamma I_n \Delta t}$
The user can set:
- Average age of the population (affects transmission rate)
- Variant of the virus (affects transmission rate)
- Percentage of the population that is vaccinated (affects transmission rate)
- Initial number of infected individuals
- Number of days to run the simulation
For further customization, you can change the base tranmission rates for each variant in the constructor of the Population.h file.