Git Product home page Git Product logo

pandemic_simulator's Introduction

Pandemic Simulator

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.

Differential Equations

The SIR model is described by the following set of differential equations:

  1. Susceptible Population (S): $\frac{dS}{dt} = -\beta \frac{SI}{N}$

  2. Infected Population (I): $\frac{dI}{dt} = \beta \frac{SI}{N} - \gamma I$

  3. 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:

  1. Susceptible Population (S): ${S_{n+1}} = {S_n}-\beta {S_nI_n \Delta t}$

  2. Infected Population (I): ${I_{n+1}} = {I_n}+ (\beta {S_nI_n - \gamma I_n \Delta t})$

  3. Recovered Population (R): ${R_{n+1}} = {R_n} + {\gamma I_n \Delta t}$

Functionality

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.

pandemic_simulator's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.