Simulate Susceptible-Infected-Recovered compartment dynamics. Compute R₀, herd immunity threshold, and peak infected. Model vaccination campaigns across 6 disease presets.
The SIR model, developed by Kermack and McKendrick (1927), divides a closed population N into three compartments: S (Susceptible), I (Infectious), and R (Recovered/Removed). The dynamics are governed by three coupled ordinary differential equations:
$$\frac{dS}{dt} = -\frac{\beta S I}{N} \qquad \frac{dI}{dt} = \frac{\beta S I}{N} - \gamma I \qquad \frac{dR}{dt} = \gamma I$$
where β is the transmission rate (contacts per day × probability of transmission) and γ is the recovery rate (1/γ = mean infectious period). The basic reproduction number is simply R₀ = β/γ — the average number of secondaries produced by one infective in a fully susceptible population.
R₀ = β/γ. If R₀ > 1, epidemic grows; if R₀ < 1, it dies out. The effective Rₑ = R₀ · S/N decreases as susceptibles are depleted. The epidemic peaks when Rₑ = 1, i.e., when S = N/R₀.
HIT = 1 − 1/R₀. For measles (R₀≈15), HIT≈93%. For flu (R₀≈1.3), HIT≈23%. Once the fraction immune exceeds HIT, each infective generates <1 secondary on average and the outbreak collapses.
The final fraction of population infected satisfies the implicit equation: R∞ = 1 − e^(−R₀R∞). This has no closed form but can be solved numerically. For R₀=2.5, ~89% of a fully susceptible population is eventually infected.
SEIR adds an Exposed (E) compartment with transition rate σ (inverse of incubation period). This delays the epidemic curve and produces more realistic peak timing for diseases with long incubation (COVID: ~5 days, measles: ~14 days).
| Disease | R₀ | Infectious Period | β (est.) | HIT | Vaccine Efficacy |
|---|---|---|---|---|---|
| Measles | 12–18 | 8 days | 1.5–2.25/day | 92–94% | 97% (MMR×2) |
| Smallpox | 5–7 | 17–19 days | 0.26–0.37/day | 80–86% | 95% (vaccinia) |
| COVID-19 (original) | 2.5–3 | 10 days | 0.25–0.30/day | 60–67% | 72–95% (mRNA) |
| Influenza (seasonal) | 1.2–1.4 | 4 days | 0.30–0.35/day | 17–29% | 40–60% (varies) |
| Ebola (2014 W. Africa) | 1.5–2.5 | 9 days | 0.17–0.28/day | 33–60% | 97.5% (Ervebo) |
| SARS-CoV-1 | 2–4 | 10 days | 0.20–0.40/day | 50–75% | No approved vaccine |
| Polio | 5–7 | Variable | — | 80–86% | 99% (OPV series) |
| Mumps | 4–7 | 10–14 days | 0.29–0.70/day | 75–86% | 88% (MMR×2) |
The SIR model divides a population into three compartments: Susceptible (can catch the disease), Infected (currently infectious), and Recovered (immune). It is governed by dS/dt = −βSI/N, dI/dt = βSI/N − γI, dR/dt = γI. Despite its simplicity, SIR captures the key epidemic features: initial exponential growth, peak, and decline as susceptibles are depleted. Extensions (SEIR, SIRS, age-structured) add biological realism.
R₀ is the average number of secondary cases one infectious individual would cause in a completely susceptible population. R₀ = β/γ in SIR. If R₀ > 1 the epidemic grows; if R₀ ≤ 1 it fades out. The effective reproduction number Rₑ = R₀ · S/N decreases as the epidemic progresses and susceptibles are depleted or vaccinated. Real-world R₀ estimates combine contact surveys, generation-time distributions, and epidemic growth data.
Herd immunity is reached when enough individuals are immune (by infection or vaccination) that each infective produces on average less than one secondary case, causing outbreaks to self-extinguish. The herd immunity threshold is HIT = 1 − 1/R₀. Measles with R₀≈15 requires HIT≈93% — forcing near-universal vaccination. Flu with R₀≈1.3 requires only HIT≈23%, which is why seasonal flu epidemics can partially self-limit but still recur annually.
SIR assumes instant transition from infected to recovered (no incubation, permanent immunity). SEIR adds an Exposed compartment (incubation period between infection and becoming infectious) — critical for diseases like COVID-19 (≈5 days) and measles (≈14 days). SIRS allows recovered individuals to lose immunity and return to susceptible — relevant for flu-like diseases where immunity wanes over months to years. SIS models diseases like common cold with no lasting immunity at all.
Read the companion article covering SIR derivation, SEIR extensions, contact tracing mathematics, and pandemic preparedness models.
Read: Mathematical Epidemiology Models →