What you just saw
A population moves around a shared space. Infected agents transmit to susceptible neighbors within a contact radius, and the familiar epidemic curve rises, peaks, and falls. The shape of the curve — when it peaks, how tall it gets, how much of the population ever gets exposed — is set almost entirely by three numbers: transmission rate, incubation period, and recovery period.
The science behind it
The SEIR model divides a population into four compartments — Susceptible, Exposed, Infected, Recovered — and tracks the flow between them. It is the workhorse of infectious disease modeling and was parameterized extensively with real COVID-19 data during 2020-2022. The agent-based implementation here gives you the same dynamics but with spatial structure: transmission depends on proximity, not just mixing, so you can see wavefronts of infection sweep the grid.
Try these experiments
1. Slow burn
Settings: transmission_rate = 0.1
What to look for: Long, shallow curve. Endemic equilibrium possible.
2. Classic wave
Settings: transmission_rate = 0.3
What to look for: Clean wave shape with a single peak around day 60-90.
3. Explosive
Settings: transmission_rate = 0.6
What to look for: The wave finishes almost immediately. Most of the population is infected in ~30 days.
Run this at 100x scale
SEIR epidemic runs in your browser up to 5,000 agents. With SimLab, the same model runs on GPU at 50M+, with ensemble parameter sweeps and publication-ready output.
from scirouter import SciRouter
client = SciRouter(api_key="sk-sci-...")
result = client.simulation.run(
model="seir",
params={"population": 5_000_000, "transmission_rate": 0.3,
"incubation_period": 5, "recovery_period": 14,
"mortality_rate": 0.015},
steps=365,
seed=42,
)
print(result.metrics["peak_infections"])Related simulations
Hospital Capacity Simulator
SIR with finite beds and ICU. See how capacity limits and an epidemic curve collide, and how mortality spikes when the system is over capacity.
Voter Model Simulator
Binary opinion dynamics on a network. See how zealots, media influence, and network structure drive consensus vs. polarization.
Wildfire Spread Simulator
Cellular-automaton wildfire with wind, humidity, and fuel. Paint firebreaks by dragging on the grid; watch the fire route around them.
Schelling Segregation Simulator
Watch neighborhoods self-segregate from mild individual preferences. Drag the tolerance slider and see the 1971 model come alive.
Frequently asked questions
What is R₀?›
R₀ (basic reproduction number) is the expected number of secondary infections caused by one infected individual in a fully susceptible population. In this simulator the transmission rate slider is a proxy — higher transmission rate, higher R₀.
Why is this a grid instead of a network?›
Spatial grids are the simplest way to introduce spatial structure without importing real network data. For policy work you need real mobility data; for intuition-building, the grid is enough.
How is this different from SIR?›
SIR has only three compartments (no exposed/incubation state). SEIR adds the exposed compartment so the lag between infection and infectiousness matters — which is critical for COVID-style diseases.