Code Monkey home page Code Monkey logo

sa4dus / infection_models Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5 KB

This repository hosts a Python-based Infection Model Simulator capable of simulating and visualizing the dynamics of various infection models: SIR, SIRD, and SIER. The models allow tracking the spread and impact of infections considering different parameters.

Python 100.00%
computational-modeling data-visualization disease-spread epidemic-simulations epidemiology infection-simulation python python3 simulation

infection_models's Introduction

Infection Model Simulator

This Python project simulates and plots various infection models: SIR, SIRD, and SIER.

Introduction

This simulation utilizes three distinct infection models:

  • SIR Model: Tracks the number of individuals susceptible (S), infected (I), and recovered (R).
  • SIRD Model: Extends the SIR model by incorporating a category for deaths (D).
  • SIER Model: Enhances the SIRD model by introducing an exposed category (E) before individuals become infectious.

Usage

Requirements

  • Python 3.x
  • Required Python packages (install via pip install -r requirements.txt)

Running the Simulation

  1. Clone this repository (git clone https://github.com/sa4dus/infection_models).
  2. Navigate to the project directory (cd infection_models).

To run the simulation, execute the main script using the command line:

python main.py <model> [--parameter_name parameter_value]

Replace <model> with the desired infection model: SIR, SIRD, or SIER.

You can specify model parameters (optional). If not specified, default values will be used.

Available Parameters

The following parameters can be adjusted for each model:

  • BETA: Transmission rate
  • GAMMA: Recovery rate
  • DELTA: Death rate (for SIRD and SIER models)
  • ALPHA: Exposed to infectious rate (for SIER model)
  • S0: Initial proportion of susceptible individuals
  • I0: Initial proportion of infected individuals
  • R0: Initial proportion of recovered individuals
  • D0: Initial proportion of deceased individuals (for SIRD and SIER models)
  • T_MAX: Maximum time for simulation (in days)

Examples

Example 1: Run the SIR model with default parameters:

python main.py SIR

Example 2: Run the SIRD model with custom parameters:

python main.py SIRD --BETA 0.3 --GAMMA 0.04 --DELTA 0.02

Outputs

The simulation generates a plot visualizing the progression of the chosen infection model based on the provided or default parameters.

Notes

  • If additional parameters are provided but not used for the selected model, a warning will be displayed.
  • To interrupt the script, use Ctrl+C.

infection_models's People

Contributors

sa4dus 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.