SIR spatial simulation
This program simulates epidemiology of the COVID-19 virus using SIR Models. For given regional segmentation and commuter data it simulates how infections spread over time. It plots the SIR data over time and generates an animated map to visualize the infection and recovery ratio.
Each regional area, which can be a city, district or any other type of division, has its own SIR model instance. We model social exchange between those area using commuter data. For simplification, we assume that during daytime, commuters are at there working place, interacting with everyone in the same area. At night, everyone is at home, possibly infecting everyone else with the same home area.
We use these SIR differential equantions:
dS/dt = -beta * I/N * S dI/dt = beta * I/N * S - I * gamma dR/dt = I * gamma
git clone https://github.com/fl4p/sirmodel cd sirmodel/simulator pip install -r requirements.txt python3 Simulation.py
After the simulation has finished, open
web/animation.html with your browser to view the animated map.
You can edit the
gamma for the SIR differential equations in
beta = 1.1 gamma = 1 / 14
Edit the file
simulator/pendlerData/start.csv, defaults are:
id,inf,rec 09188,1000,0 05370,1000,0 08117,1000,0
id is the area ID (for Germany you can find the real values inside
inf is the inital count of infected individuals
rec is the inital cound of recovered individuals
- Use Monte Carlo simulation for infection distribution between commuting groups
- Add random commuting "noise"
Try It out
html, pandas, python