HomeSimulations › SIR Epidemic Model

SIR Epidemic Model — Infectious Disease Dynamics

Simulate Susceptible-Infected-Recovered compartment dynamics. Compute R₀, herd immunity threshold, and peak infected. Model vaccination campaigns across 6 disease presets.

Day: 0
R₀: 2.50
Infected: 1.00%
HIT: 60.0%
Susceptible
Infected
Recovered
Vaccinated

Disease Presets

Parameters

Epidemic Metrics

R₀
2.50
Peak Infected
Total Attack
Peak Day

Controls

The SIR Model: Mathematical Foundations

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.

Basic Reproduction Number R₀

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

Herd Immunity Threshold

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.

Attack Rate (Final Size)

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 Extension

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 Parameters Reference

DiseaseR₀Infectious Periodβ (est.)HITVaccine Efficacy
Measles12–188 days1.5–2.25/day92–94%97% (MMR×2)
Smallpox5–717–19 days0.26–0.37/day80–86%95% (vaccinia)
COVID-19 (original)2.5–310 days0.25–0.30/day60–67%72–95% (mRNA)
Influenza (seasonal)1.2–1.44 days0.30–0.35/day17–29%40–60% (varies)
Ebola (2014 W. Africa)1.5–2.59 days0.17–0.28/day33–60%97.5% (Ervebo)
SARS-CoV-12–410 days0.20–0.40/day50–75%No approved vaccine
Polio5–7Variable80–86%99% (OPV series)
Mumps4–710–14 days0.29–0.70/day75–86%88% (MMR×2)

Frequently Asked Questions

What is the SIR model?

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.

What is R₀ (basic reproduction number)?

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.

What is herd immunity and how is it calculated?

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.

What is the difference between SIR, SEIR, and SIRS?

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.

Learn the Mathematics of Epidemiology

Read the companion article covering SIR derivation, SEIR extensions, contact tracing mathematics, and pandemic preparedness models.

Read: Mathematical Epidemiology Models →