Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Spread simulator

Model how things spread: SIR and SEIR outbreak curves with herd immunity, germs and habits on a small-world network, and opinions that agree or split.

How to use

  1. Outbreak curves: set how infectious something is (R0), how long people stay infectious, and how many are immune at the start. The chart shows who is susceptible, infectious and recovered day by day; the table gives the peak and how many are infected in the end.
  2. Spread on a network: people sit in a ring, each linked to nearby people, with a few random shortcuts. Choose whether the thing spreads from a single contact or only once enough contacts have it, then press Run and watch it move.
  3. Opinions and camps: people with views from 0 to 1 meet in pairs and move closer only if their views are already close enough. See whether everyone ends up agreeing or splits into camps.
  4. The same seed always gives the same network and the same run.

Keyboard and touch

TabMove between tabs, boxes and buttons
Enter in a boxRun the current model
Arrow keys in a number boxChange the value by one step
Changing a box on Outbreak curvesRedraws the curves straight away

Tips

  • Set the share immune at the start to the herd-immunity threshold shown (60 % for R0 = 2.5) and the outbreak never takes off.
  • The final-size formula shows that an outbreak stops before everyone is infected: with R0 = 2.5 about 89 % catch it, because the last cases run out of people to infect.
  • A delay before people become infectious slows the curve and pushes the peak later, but in this simple model it does not change how many are infected in the end.
  • On the network, a few random shortcuts make a germ jump across the ring and spread much faster. For habits that need several friends, shortcuts can do the opposite: a lone link to the far side is rarely enough to convince anyone.
  • In the opinions model, a group that is open to views 0.3 away tends to agree; at 0.1 it usually splits into several camps that no longer talk to each other.

About these models

Outbreak curves use the SEIR model (SIR when the delay is 0) for a well-mixed population: susceptible people become exposed at rate β S I with β = R0 ÷ days infectious, exposed people become infectious at rate 1 ÷ days before infectious, and infectious people recover at rate 1 ÷ days infectious. It is solved with fourth-order Runge-Kutta in 0.05-day steps. The final share never infected solves Send = S0 e−R0 (1 − immune − Send) (Kermack and McKendrick, 1927); the herd-immunity threshold is 1 − 1/R0.

The network is a Watts-Strogatz small world (1998): a ring where each person is linked to the nearest contacts on each side, with each link moved to a random person by the shortcut chance. Single-contact spread passes from each sick person to each healthy contact with the chance per step, and people recover after the set number of steps. Adoption follows Granovetter's threshold model (1978). Opinions follow the bounded-confidence model of Deffuant and others (2000): two random people meet; if their views differ by less than the open-mindedness, each moves halfway towards the other. Camps are groups of views within 0.01 of each other that hold at least 2 % of the people.

These are teaching models with made-up, adjustable numbers. They leave out real-world detail such as age, travel, seasons, behaviour changes and treatments, so they are not forecasts and not health advice.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product