Epidemic Simulator
Watch an infection spread through a town of moving people: susceptible, exposed, infectious, recovered and vaccinated. Test social distancing, masks, vaccination, quarantine and a busy market, see R₀ and herd immunity, and compare with the SEIR equations.
Town health
S E I R V DClick a person to see their status. Space play/pause · F full screen
Everyone, per day
S E I R V DInfectious now
infectious exposedEffective R
above 1 = growing, below 1 = shrinkingdE/dt = βSI/N − σE
dI/dt = σE − γI
dR/dt = γI (R₀ = β/γ)
Equations vs. town
equations I town IThe equations assume everyone meets everyone equally. In the town, people only infect neighbours, so the real wave is usually slower and smaller.
Pick an experiment. The town restarts with its settings and starts playing.
Change anything, then press Apply & restart. Same seed + same settings = same result.
Export
How the simulation works
- People walk around town (or stay home with social distancing). Each day is 24 small steps.
- Infection: an infectious person can infect anyone within the contact distance. Masks lower the chance for both sides; vaccines protect the vaccinated person.
- Illness: an infected person is first exposed (not contagious), then infectious, then recovers — or dies with the fatality chance. Immunity can fade after a number of days.
- Measures: quarantine moves contagious people into an isolation area; the market draws people to one crowded spot.
- R₀ is measured from the first infected people: how many others each of them infected.
This is a simplified teaching model with made-up numbers. It is not a forecast for any real disease and must not be used for medical or public health decisions. Everything runs in your browser.
Using Epidemic Simulator
Watch an infection spread through a town of moving people and test what slows it down: social distancing, masks, vaccination, quarantine and fewer trips to a central market. Live SEIR charts, R₀ and herd immunity, plus the classic equations for comparison.
- Press Play or pick an example such as Uncontrolled outbreak, Social distancing or Vaccination.
- Watch the town: blue people are susceptible, yellow exposed, red infectious, green recovered and purple vaccinated. Click a person to see their status.
- Read the live chart of each group, the peak of infections and the effective reproduction number.
- Change transmission, how long people are contagious, masks, distancing, vaccination, quarantine and market visits in Settings, then Apply & restart.
- Compare with the SEIR equations in the Equations tab and download the daily data as CSV.
Example
Uncontrolled outbreak: one infected person starts a fast wave that reaches most of the town. Vaccination 70%: the same disease barely spreads because most contacts are protected — herd immunity.
Questions & answers
What is the SIR / SEIR model?
People are Susceptible, Exposed (infected but not yet contagious), Infectious or Recovered. The simulator moves each person individually; the Equations tab solves the classic SEIR equations with the same rates for comparison.
What is R₀?
The basic reproduction number: how many people one infectious person infects in a fully susceptible population. The simulator estimates it from the first infections and also shows the effective number R as immunity grows.
What is herd immunity?
When enough people are immune, each infection causes less than one new infection and the outbreak shrinks. The threshold is about 1 − 1/R₀.
Why does social distancing flatten the curve?
Fewer contacts per day means slower spread, so fewer people are sick at the same time, even if the outbreak lasts longer.
Is this a forecast for a real disease?
No. It is a simplified teaching model with made-up rates. Do not use it for medical or public health decisions.
Can I repeat an experiment?
Yes. The same seed and settings always give the same run.
Does it upload anything?
No. Everything runs in your browser.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
