An epidemic in three boxes. Everyone is susceptible, then infected, then recovered — and three coupled rates decide the whole curve. Kermack & McKendrick wrote it in 1927, and it is runnable: feed a transmission rate and a recovery rate, integrate the equations, and the epidemic peak, the herd-immunity line, and the fraction never touched all fall out. Down the center the compartments go in, the solver runs, the curve comes out. The blue team builds and defends it; the red team tries to break it. A model with named assumptions — not medical advice.
source Kermack, W. O. & McKendrick, A. G., A Contribution to the Mathematical Theory of Epidemics, Proc. Roy. Soc. A 115 (1927) 700–721 — doi:10.1098/rspa.1927.0118. Rendered, not quoted.
A fixed population N is split three ways and never leaves — no births, no deaths. The flow is one-directional:
S → I → R. Contact turns S into I at rate βSI/N; the infected recover at rate γI:
dS/dt = −β·S·I/N
dI/dt = β·S·I/N − γ·I
dR/dt = γ·I
The one number that governs everything is the basic reproduction number R₀ = β/γ — secondary cases per case in a fully-susceptible crowd. Live values for the current run:
The epidemic in three boxes: susceptible to infected to recovered — Kermack and McKendrick, 1927. This is the curve behind every outbreak report you have ever seen.
Add a fourth box for the waiting and it becomes the SEIR model; let recovery expire and R flows back to S, and it becomes SIS. One deletion, one addition — each sphere is the next one's premise. The threshold R₀ = 1 is the hinge they all share.
The blue team's live check: re-integrate the fixed test epidemic and confirm conservation, the R₀ threshold, the peak position, the final-size overshoot, and the disease-free eigenvalues against the closed-form truth. If red tampers, this badge is where it shows.
Four inputs fully determine the epidemic: the transmission rate β (contacts × infection probability per unit time), the recovery rate γ (1/γ is the mean infectious period), the population N, and the initial spark I₀.
Assumptions, stated plainly: the population is well-mixed (everyone equally likely to meet everyone), β and γ are constant, and the population is closed (S+I+R = N forever). Real epidemics violate all three — this is a model, a lens, not medical advice.
Set the rates below and feed them to the solver.
Move any slider — the whole trajectory is re-integrated (RK4, fixed step h=0.05) on the spot, never looked up.
What the machine produces, proven from the equations: the peak arrives exactly when S/N = 1/R₀; the herd-immunity threshold is 1 − 1/R₀; the epidemic overshoots it, and a positive fraction S∞ is never infected. Current run's numbers are above; below is the load-time proof.
The blue team's witness (left) confirms these live; the red team (right) tries to make them wrong.
R₀ from this model is a property of a fitted model, not a measured constant of a pathogen — it shifts with the contact structure you assumed. The SIR curve is the first honest skeleton of an outbreak, not a forecast, and never a substitute for a clinician or a public-health authority.
"R₀ is a fixed biological constant of the virus." Cut. R₀ = β/γ depends on contact rate and social structure — the same pathogen has different R₀ in different populations.
"Herd immunity at 1−1/R₀ ends the epidemic instantly." Cut. That threshold only stops growth; the momentum of existing infections overshoots it — the model proves R∞/N > 1−1/R₀.
"Everyone eventually gets infected." Kept, corrected. No — the final-size relation leaves S∞ > 0; the outbreak dies from lack of infectives, not lack of susceptibles.
The red team's move: drop the −βSI/N term from dS/dt so susceptibles get infected but are never removed from the S pool. The population then inflates and S+I+R ≠ N. The blue team's witness (window 7) is watching conservation.
Delete the outflow from S and the closed-population law breaks: S+I+R climbs past N. The witness re-integrates, sees conservation fail, and turns red. Nothing is faked; the attack is real and it is caught.