Controls
Presets
Parameters
Quality
Camera
Model checks
The science
What is modelled. A population of 400 people is shown; before the outbreak a fraction v is vaccinated with a vaccine of efficacy e (all-or-nothing: a share e of the vaccinated is fully protected, the rest are as susceptible as everybody else), so the immune fraction is u = v e. One infected person arrives, and the SIR equations ds/dt = −βsi, di/dt = βsi − γi, dr/dt = γi with β = R0γ and an infectious period 1/γ of 7 days describe the epidemic of a well-mixed population (Kermack & McKendrick 1927).
Herd immunity. The outbreak can grow only if the effective reproduction number Reff = R0(1 − v e) exceeds one. The critical coverage is therefore vc = (1 − 1/R0)/e: 74 % for R0 = 3 and e = 90 %. If the vaccine is too weak (e ≤ 1 − 1/R0) no coverage is enough. Above vc an introduced case does not start an epidemic; this protects people who are not vaccinated (indirect protection).
Final size and peak. The total infected fraction r solves 1 − u − r = (1 − u − i0) e−R0 r; the peak prevalence is i0 + s0 − (1 + ln(R0s0))/R0. The second graph shows the final size against coverage; it falls to zero at vc.
Numerical checks. (1) RK4 final size against the root of the final-size equation (bisection and Newton); (2) the numerical peak against its closed form; (3) bisection over simulated epidemics for the smallest coverage without growth against vc; (4) 60 exact Gillespie stochastic runs of 2000 people against the equation; (5) conservation of s + i + r + u and monotone s; (6) the early growth rate against γ(R0s0 − 1).
Simplifications. Homogeneous mixing, a constant infectious period, no latent period, births, deaths, waning immunity, age structure or leaky vaccines. The 400-person square shows one stochastic run, so small outbreaks can die out by chance, unlike the smooth curves. Real thresholds also depend on how vaccination is spread over the population. R0 values in the presets are only typical orders of magnitude (flu about 1.3 to 1.8, measles about 12 to 18). This is an educational model and not public-health advice.