Understanding the SIR Compartmental Model
The SIR framework represents a population as three distinct compartments that change over time. Susceptible individuals have no immunity and can contract the disease. InfectedRecovered
This mathematical approach simplifies real epidemiology by assuming:
- Immunity is lifelong once acquired
- The population size remains constant (no births or deaths during the simulation)
- Mixing between groups is random and homogeneous
- Parameters like transmission rate do not change over time
Despite these simplifications, SIR models accurately capture core epidemic dynamics and remain invaluable for understanding disease trajectories, planning healthcare capacity, and evaluating intervention effectiveness.
Core SIR Mathematical Relationships
Three fundamental equations govern population flow through the SIR model:
Susceptible + Infected + Recovered = Total Population
R₀ = Recovery Time ÷ Infection Interval
Time Step = Total Simulation Period ÷ Number of Points
R₀ (Basic Reproduction Number)— Average number of new infections caused by one infected person in a fully susceptible population. R₀ > 1 means the disease spreads; R₀ < 1 means it dies out.Recovery Time— Mean duration (in days or weeks) from infection until the person becomes immune and non-infectious.Infection Interval— Average time elapsed between when an infected person contacts and successfully transmits the virus to a susceptible individual.Time Step— Duration between consecutive data points in the simulation output. Smaller steps increase resolution but require more computational points.
Disease Parameters and R₀ Interpretation
The basic reproduction number R₀ is the cornerstone of epidemic forecasting. It reflects both the pathogen's biological transmissibility and the contact patterns in the population studied.
- Measles: R₀ ≈ 12–18 (extremely contagious; herd immunity threshold ~95%)
- Seasonal influenza: R₀ ≈ 1–2 (moderately transmissible; vaccination can shift R₀ downward)
- COVID-19 (original strain): R₀ ≈ 2–3 (depends on variant, behavior, and immunity)
- Common cold: R₀ ≈ 2–4 (reinfection possible despite prior exposure)
Recovery time varies widely: influenza typically resolves in 7–10 days; COVID-19 in 10–14 days; measles in 2–3 weeks. Shorter recovery times combined with high R₀ create explosive outbreaks unless vaccination or isolation intervenes.
Vaccination and Herd Immunity Thresholds
Vaccination shifts the population balance by converting susceptible individuals into the recovered (immune) group without requiring active infection. This breaks transmission chains and protects the entire community.
The herd immunity threshold—the percentage of the population that must be immune to halt disease spread—equals (R₀ − 1) ÷ R₀ × 100%. For measles (R₀ ≈ 15), this threshold reaches ~93%, explaining why measles vaccination coverage must exceed 90% to interrupt transmission. For a disease with R₀ = 3, the threshold is 67%.
In the calculator, increase the "Recovered" parameter to simulate vaccination campaigns. Setting recovered to 95% then observing the infected curve dramatically illustrates how immunity levels suppress outbreaks and protect those medically unable to receive vaccines.
Common Pitfalls in Epidemic Modeling
SIR simulations are powerful teaching tools, but several assumptions limit their real-world precision.
- Ignoring Reinfection and Waning Immunity — The standard SIR model assumes lifelong immunity after recovery. Many real viruses—including seasonal influenza and some coronaviruses—allow reinfection or immune waning. When modeling influenza year-to-year, recovered individuals may shift back to susceptible, fundamentally changing long-term patterns.
- Fixed R₀ Misses Behavioral Feedback — R₀ is treated as constant, but public behavior, policy interventions, and seasonal effects alter transmission rates mid-outbreak. Lockdowns, mask adoption, and vaccination campaigns lower effective R₀ over time. Simulations using a static R₀ may overestimate peak cases if real-world interventions are deployed.
- Population Homogeneity Assumption Oversimplifies Reality — SIR assumes random mixing, but real transmission clusters around households, workplaces, and schools. Age-structured models (SEIR variants) account for age-dependent vulnerability and contact patterns, producing more accurate predictions for diseases like influenza or COVID-19.
- Short Simulation Windows Ignore Seasonality and Mutation — Respiratory viruses exhibit seasonal forcing—winter peaks due to crowding and indoor air quality. Longer simulations also encounter pathogen mutation, changing transmissibility. For multi-year forecasts, R₀ must be updated or allowed to vary.