Epidemic Spread Simulator: SIR and SEIR
Equations in this simulation
| S, E, I, R | susceptible, exposed (infected but not yet infectious), infectious, recovered | vaccinated people start outside S and never catch it | |
|---|---|---|---|
| β | infectious contacts per infectious person per day | R₀ × γ × (1 − distancing) | |
| I′ | infectious people who are not in quarantine | I × (1 − quarantine share) | |
| σ | rate of becoming infectious | 1 ÷ the incubation period; with 0 days E is skipped and this is the SIR model | |
| γ | recovery rate | 1 ÷ the infectious period |
With the current values:
| R_t | effective reproduction number now | the outbreak grows while it is above 1 and shrinks once it falls below 1 |
|---|
With the current values:
| 1 − 1/R₀ | share that must be immune to stop an outbreak growing | with distancing and quarantine R₀ is replaced by the reduced value |
|---|
With the current values:
| S∞ | people never infected, by the final size equation | R_e = R₀ × (1 − distancing) × (1 − quarantine), v the vaccinated share; the same for SIR and SEIR |
|---|
With the current values:
How to use the epidemic simulator
- Set R₀, the incubation and infectious periods and the size of the town. Everyone starts susceptible except a few infectious people. Infectious people pass the infection on through random contacts across the town; the newly infected become exposed, then infectious, then recovered and immune. Short red lines show each new infection.
- The chart compares the town, in solid lines, with the SIR or SEIR equations for the same numbers, dashed. Read the peak and when it comes, how many catch it so far and in the end, and the effective R, which falls as people become immune. Once it drops below 1 the outbreak shrinks.
- Try the measures: vaccinate a share of the town before the outbreak, cut contacts by distancing, or send a share of cases to quarantine. Push vaccination past the herd immunity threshold, 1 − 1/R₀, and the outbreak cannot take off. The Cell Doubling Time Calculator finds the doubling time of the early, exponential rise.
Frequently asked questions
What is R₀?
The basic reproduction number: how many people one infectious person infects, on average, in a population where everyone is susceptible. Above 1 an outbreak can grow; below 1 it fades. Measles has an R₀ of about 12 to 18, seasonal flu about 1.3, and the first strains of COVID-19 about 2.5 to 3.
What is the difference between the SIR and SEIR models?
SIR puts everyone in three groups: susceptible, infectious and recovered. SEIR adds an exposed group for people who have caught the infection but cannot pass it on yet. The final number infected is the same, but the incubation period makes the outbreak rise more slowly and peak later.
What is herd immunity?
Once enough of a population is immune, each case infects fewer than one other on average and outbreaks die out, which protects people who are not immune. The threshold is 1 − 1/R₀: two thirds for R₀ = 3, about 95% for measles. Without vaccination an outbreak overshoots it, infecting far more people than the threshold.
Why does flattening the curve matter?
Cutting contacts lowers the peak and spreads the cases over a longer time, so fewer people are ill at once and hospitals can cope. It also lowers the total number infected, because the outbreak overshoots the herd immunity threshold by less.
It says WebGL is turned off.
The 3D view needs WebGL, which every current browser has. It can be switched off by hardware acceleration being disabled in the browser settings, or by a very old graphics driver. Turn hardware acceleration on, or try another browser.
Is anything uploaded?
No. The simulation is drawn by your own browser with WebGL; nothing is sent anywhere, and it keeps working offline once the page has loaded.