Interactive SIR compartmental model — ODE solver with R₀, phase portrait, and real-time S/I/R curves
The Kermack-McKendrick (1927) SIR model divides a population of N into Susceptible S, Infected I, and Recovered R. The governing ODEs: dS/dt = −βSI/N, dI/dt = βSI/N − γI, dR/dt = γI. The basic reproduction number R₀ = β/γ determines whether an epidemic occurs.
R₀ = β/γ is the expected number of secondary infections from one case in a fully susceptible population. R₀ > 1 → exponential growth (epidemic); R₀ < 1 → disease dies out. Herd immunity is achieved when the immune fraction exceeds 1 − 1/R₀.
When the recovered fraction R/N exceeds 1 − 1/R₀, each infected person causes fewer than one new infection on average, and the epidemic declines. For R₀ = 2.5, herd immunity requires at least 60% immune. Vaccination aims to reach this threshold safely.
β = R₀ × γ. It encodes contact frequency and transmission probability. Physical distancing, masks, and ventilation reduce β, lowering R₀ below the epidemic threshold.
γ = 1/D where D is the mean infectious period. For COVID-19 D ≈ 10 days → γ ≈ 0.1/day. For seasonal flu D ≈ 5 days → γ ≈ 0.2/day. Medical treatment increases γ.
Measles: 12-18. Smallpox: 3.5-6. COVID-19 (original): 2.5-3.5. 1918 Flu: 2-3. Seasonal flu: 1.3-1.8. Ebola: 1.5-2.5.
Kermack and McKendrick formulated the SIR model in 1927 to study plague in Bombay. Their threshold theorem showed that an epidemic need not infect everyone — it ends when susceptibles fall below a critical level.
1918 Spanish Flu (H1N1): ~50M deaths, R₀≈2-3. 1957 Asian Flu: ~2M deaths. 1968 Hong Kong Flu: ~1M deaths. 2009 H1N1 Swine Flu: ~284K deaths. 2020 COVID-19: 7M+ confirmed deaths.
SIR and its extensions (SEIR, SIRD, SEIRS, age-structured) form the backbone of epidemic forecasting at agencies like the CDC, WHO, and Imperial College. They guide vaccination strategy, social-distancing policy, and hospital capacity planning.
Adds an Exposed (E) compartment for the latent/incubation period: S → E → I → R. The rate σ = 1/(incubation days) governs the E→I transition. For COVID-19, σ ≈ 1/5.2 ≈ 0.19/day.
Adds a Deaths compartment: infected individuals recover at rate γ or die at rate μ. The case fatality rate (CFR) = μ/(γ+μ). IFR accounts for asymptomatic cases.
Vaccinating a fraction p of the population effectively reduces the susceptible pool. If p > 1 − 1/R₀, herd immunity prevents epidemic spread. The SIR model shows why rapid, widespread vaccination is critical.