Biology · Simulator 034
Follow an infection through a population using the SIR model: susceptible, infected, recovered. Change how easily it spreads, how long people stay infectious, and how many are vaccinated. Compare the peak, its timing and how many are infected in total.
The population is split into three compartments that change over time:
dS/dt = −β S I / N
dI/dt = β S I / N − γ I
dR/dt = γ I
β is the transmission rate and 1/γ the average infectious period. The basic reproduction number R₀ = β/γ is the number of people one case infects in a fully susceptible population. The epidemic grows while the effective number R_eff = R₀ · S/N is above 1. It peaks exactly when R_eff falls to 1.
Vaccinating a fraction v before the outbreak moves people straight to R. If v > 1 − 1/R₀, the herd-immunity threshold, the outbreak cannot grow at all. The final size z (fraction ever infected, without vaccination) solves z = 1 − e^(−R₀ z).
Educational compartment model: homogeneous mixing, lifelong immunity, no births, deaths or behaviour change. It is not a forecast for any real disease.
Measles has R₀ around 15. What vaccination coverage is needed for herd immunity? Why is that much harder than for a disease with R₀ = 2?
1 − 1/15 ≈ 93%, against 50% for R₀ = 2. Because the threshold approaches 100% as R₀ grows, small drops in measles coverage quickly allow outbreaks. Set β/γ = 15 and try 90% and 95%.