SIR Model Epidemic Simulator — Viral Infection Spread

Simulate viral epidemic spread using the SIR (Susceptible-Infected-Recovered) compartmental model. Set R₀, vaccination, interventions, and view epidemic curves, peak timing, attack rates, and herd...

Disease Presets

Population

Disease Parameters

Interventions (optional)

Peak Infected
2,035.00
Day 30 (20.4% of population)
Total Infected
6,724.00
Attack rate: 67.2%
Herd Immunity Threshold
60%
For R₀ = 2.5
Effective R₀
2.5
After vaccination
R₀
2.5
Epidemic will grow
Uninfected
3,276.00
32.8% escaped infection

Epidemic Curve (Infected over Time)

Day 0Day 91Day 180

Key Time Points

DaySusceptibleInfectedRecovered% Infected
09,990.0010.000.000.1%
30 (peak)5,805.002,035.002,160.0020.3%
453,967.00838.005,195.008.4%
913,290.0019.006,691.000.2%
1363,277.000.006,723.000%
1803,276.000.006,724.000%

R₀ Values for Common Pathogens

PathogenR₀Herd ImmunityInfectious Period
Measles12–1892–95%8 days
Chickenpox10–1290–92%7 days
COVID-19 (Omicron)8–1088–90%5–7 days
COVID-19 (Delta)5–880–88%7–10 days
Smallpox5–780–86%14–17 days
COVID-19 (original)2–350–67%8–10 days
Ebola1.5–2.533–60%10–14 days
Influenza (seasonal)1.2–1.517–33%3–5 days
Planning notes, formulas, and examples

About the SIR Model Epidemic Simulator — Viral Infection Spread

The SIR (Susceptible-Infected-Recovered) model is a foundational framework for understanding how infectious diseases spread through populations. Developed by Kermack and McKendrick in 1927, it divides a population into three compartments: those susceptible to infection (S), those currently infected and infectious (I), and those who have recovered and are immune (R). The model uses two key rates — the transmission rate (β) and the recovery rate (γ) — to simulate the epidemic trajectory over time.

The basic reproduction number R₀ (β/γ) determines whether an epidemic will grow (R₀ > 1) or decay (R₀ < 1). Each pathogen has a characteristic R₀: seasonal influenza ~1.3, original SARS-CoV-2 ~2.5, the Delta variant ~5-8, measles ~12-18. The herd immunity threshold — the fraction of the population that must be immune to stop transmission — is directly derived as 1 - 1/R₀. For measles with R₀ of 15, this requires ~93% immunity.

This simulator runs a simplified SIR model with Euler method integration, allowing you to set population size, initial conditions, R₀, infectious period, vaccination coverage, and timed interventions (lockdowns, masking) that reduce transmission. It generates the epidemic curve, peak infected count and timing, total attack rate, and key time-point snapshots — making epidemiological concepts tangible and explorable.

When This Page Helps

Understanding epidemic dynamics is essential for public health literacy, pandemic preparedness, and interpreting the policy decisions that affect daily life (lockdowns, vaccination targets, school closures). This simulator makes the abstract mathematics of epidemiology visual and interactive — allowing students, healthcare workers, and curious citizens to explore how R₀, vaccination, and interventions shape epidemic trajectories.

How to Use the Inputs

  1. Select a disease preset or manually enter R₀ and infectious period.
  2. Set the population size and initial number of infected individuals.
  3. Optionally set vaccination coverage to reduce the susceptible pool.
  4. Optionally configure an intervention (e.g., 50% transmission reduction starting day 30).
  5. Review the epidemic curve, peak infections, attack rate, and herd immunity threshold.
  6. Experiment with different parameters to see how interventions change the epidemic trajectory.
Formula used
SIR differential equations: dS/dt = -β × S × I / N dI/dt = β × S × I / N - γ × I dR/dt = γ × I where β = R₀ × γ, γ = 1 / infectious period Herd immunity threshold = 1 - 1/R₀ Attack rate = total ever-infected / N × 100

Example Calculation

Result: Peak: 1,847 infected on Day 76, Total infected: 8,912 (89.1%), Herd immunity: 60%

With R₀ = 2.5 and no interventions, the epidemic grows exponentially, peaks around day 76 with ~18% of the population actively infected, and eventually infects ~89% before burning out as the susceptible pool is depleted below the herd immunity threshold.

Tips & Best Practices

  • Start with a disease preset, then modify parameters to see how each factor affects the outcome.
  • Try setting vaccination to the herd immunity threshold to see the epidemic collapse.
  • Compare early vs late interventions — delaying a lockdown by even 2 weeks dramatically changes peak height.
  • A lower R₀ pathogen (e.g., influenza at 1.3) has a much flatter, longer epidemic curve than a high-R₀ pathogen (measles at 15).
  • Remember: the SIR model is a simplification. Real epidemics are messier due to heterogeneous mixing, seasonality, behavioral changes, and viral evolution.

When To Use This Calculator

Simulate viral epidemic spread using the SIR (Susceptible-Infected-Recovered) compartmental model. Set R₀, vaccination, interventions, and view epidemic curves, peak timing, attack rates, and herd... Use it when you need a repeatable calculation in the health / general-health category and want the setup, result, and supporting values kept together. This is especially helpful when small input changes, unit choices, or rounding decisions can change the final number.

How To Check The Result

Start by confirming that the inputs match the formula shown on the page. Then compare the main output with the worked example and any secondary values shown by the calculator. If the result will be used in another calculation, keep extra precision until the final step and record the assumptions beside the number.

Practical Notes

Treat the result as a calculation aid rather than a substitute for context. For schoolwork, include the formula and substitution steps. For planning, technical, financial, or health-related decisions, verify important numbers against primary records, current rules, or a qualified professional before acting on them.

Sources & Methodology

Last updated:

Methodology

This worksheet applies a standard deterministic SIR compartment model with Euler integration using the selected population, R0, infectious period, and intervention assumptions. It is intended to illustrate relative epidemic behavior, not to forecast a specific outbreak.

The page keeps the model intentionally simple so the effect of parameter changes is easy to compare, but that simplicity means it cannot capture heterogeneity, age structure, incubation periods, or stochastic spread.

Sources

  • The SIR model of epidemics (Kermack and McKendrick) — Foundational compartment-model framing.
  • Epidemiologic modeling references (CDC / public health modeling literature) — Basic R0, attack-rate, and herd-immunity context.
  • Mathematical epidemiology texts (Peer-reviewed epidemiology references) — Background for deterministic SIR assumptions.

Frequently Asked Questions

  • R₀ (basic reproduction number) is the average number of secondary infections caused by one infected individual in a completely susceptible population. An R₀ of 2.5 means each infected person, on average, infects 2.5 others. It is NOT a rate — it's a dimensionless ratio determined by transmissibility, contact rate, and infectious duration.