SIR Epidemic Simulator illustration

SIR Epidemic Simulator

The SIR model splits a population into three compartments — Susceptible, Infected and Recovered — and moves people between them with two rates: an infection rate β (how many contacts spread the disease) and a recovery rate γ (how fast the infected recover). Set the population, the initial number infected, β, γ and an optional vaccinated fraction, and the simulator integrates the equations with fourth-order Runge–Kutta and animates the S/I/R curves live on a stacked chart, plus a dot-grid "population view" that recolours as the outbreak moves through it. The basic reproduction number R₀ = β/γ updates as you drag, and the peak number infected and the final epidemic size are reported when the run settles.

Runs 100% in your browser — simulations are computed locally on your device.

Notes

  • Assumes a closed, well-mixed population of constant size: no births, deaths or migration, and every person is equally likely to meet every other.
  • The outbreak only grows when R₀ = β/γ exceeds 1; below that threshold the infection dies out. Vaccinating a fraction 1 − 1/R₀ of the population reaches herd immunity.
  • Even without vaccination the epidemic ends with susceptibles left over — the disease runs out of people to infect before everyone is hit.
  • Runs 100% in your browser — simulations are computed locally on your device.