Populations, chemistry & chaos

Compartmental Epidemic Model Lab

An outbreak in a closed town played day by day with the classic SIR and SEIR compartment models: R0, the infectious and latent periods, vaccination before day 0, one transmission-reduction window and a care-capacity line. The model integrates the outbreak with and without the window, measures the peak, the share ever and eventually infected, the days above capacity, the effective reproduction number and the early doubling time, puts the herd immunity threshold, the final-size relation and the SIR peak formula beside them, and scores five challenges. An educational model, not a forecast.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

Transmission reduction strength (required)
About this input

How much the reduction window cuts transmission while it is on, from 0% to 90%. At 0% the window changes nothing.

Default 0 Range 0 to 0.9
Reduction window start (days) (required)
About this input

The first day of the reduction window, a whole number from 0 to 240. The reduction switches on at the first step that starts on or after this day.

Default 30 Range 0 to 240
Reduction window length (days) (required)
About this input

The length of the reduction window, a whole number of days from 0 to 240.

Default 60 Range 0 to 240
Latent period (days) (required)
About this input

The mean time from infection to infectiousness, from 2 to 14 days. Used only by SEIR; it is still checked with SIR.

Default 5 Range 2 to 14
Vaccinated share before day 0 (required)
About this input

The share immune before day 0, from 0% to 95%. They start in Removed. Together with the initially infected share it must leave at least 1% of people susceptible.

Default 0 Range 0 to 0.95
Population (people) (required)
About this input

The number of people in the town, a whole number from 1,000 to 100,000,000. It scales the people counts only; every share is the same for any population.

Default 100000 Range 1000 to 100000000
Model template (required)
About this input

The model template: SIR (susceptible, infectious, removed) or SEIR (with an exposed stage between infection and infectiousness). Set by the chip on the canvas; it adds or removes the exposed box.

Default SIR Allowed SIR, SEIR
Challenge (required)
About this input

Selects a challenge: 0 for none, 1 to 5 for a predefined challenge, which sets its own inputs and leaves one or more to you.

Default 0 Range 0 to 5
Care capacity (share of people) (required)
About this input

The care-capacity line on the infectious curve: the share of people that can be cared for at once, from 0.5% to 30%.

Default 0.1 Range 0.005 to 0.3
Basic reproduction number R0 (required)
About this input

R0, the basic reproduction number: the new infections one case causes in a fully susceptible population, from 0.5 to 6.

Default 2.5 Range 0.5 to 6
Duration (days) (required)
About this input

How many days are played, from 60 to 240 in steps of 10. The run always has 300 steps, so a longer duration means longer steps.

Default 180 Range 60 to 240
Initially infected share (required)
About this input

The share of people infectious at day 0, from 0.01% to 10%.

Default 0.001 Range 0.0001 to 0.1
Infectious period (days) (required)
About this input

The mean time a case stays infectious, from 3 to 14 days. With R0 it sets the transmission rate R0/period and the recovery rate 1/period.

Default 7 Range 3 to 14
Your prediction of the share ever infected
When omitted Blank
About this input

Challenge 1: your prediction of the share of people ever infected, from 0% to 100%. Blank until you predict; the curves and results stay hidden until then. Not used outside challenge 1.

Default Not set Range 0 to 1

Outputs

Latent rate (per day)
About this output

The rate sigma = 1 divided by the latent period at which exposed people become infectious, per day (SEIR only). Blank with SIR and when the inputs are not valid.

No unit declared
Latent period used (days)
About this output

The latent period used, days (SEIR only). Blank with SIR and when the inputs are not valid.

No unit declared
Reduction strength used
About this output

The reduction strength used. Blank when the inputs are not valid.

No unit declared
Model Status
About this output

NOT VALID with the reason when an input cannot be used; CHECK when the step is coarse for this fast an outbreak (with the longest clean duration), or a guard fails; otherwise OK. An outbreak still running at the end is a result, not a warning.

No unit declared
Formula module versions
About this output

The formula modules the model is built from, with their versions.

No unit declared
Model version
About this output

The model version.

No unit declared
Model template used
About this output

The model template used (the challenge's when a challenge is selected). Blank when the inputs are not valid.

No unit declared
Infections averted
About this output

People ever infected without the window minus with it (whole people; 0 when the window changes nothing). Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Herd immunity threshold
About this output

The herd immunity threshold 1 - 1/R0 (0 when R0 is at most 1). Blank when the inputs are not valid, while challenge 1 awaits a prediction and while challenge 2 is unsolved.

No unit declared
Halving time (days)
About this output

The early halving time ln 2 / |growth rate|, in days, when the outbreak shrinks from the start. Blank otherwise, when the inputs are not valid and while challenge 5 is unsolved.

No unit declared
Infectious period used (days)
About this output

The infectious period used, days. Blank when the inputs are not valid.

No unit declared
Window start used (day)
About this output

The window start used, the entered whole day (the effective start is reductionStartDay). Blank when the inputs are not valid.

No unit declared
Window length used (days)
About this output

The window length used, days. Blank when the inputs are not valid.

No unit declared
Initially infected share used
About this output

The initially infected share used. Blank when the inputs are not valid.

No unit declared
Outbreak at the end
About this output

Over, or Still running when more than 0.1% of people would still be infected after the run. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Smallest compartment share
About this output

The smallest compartment share in any step of the three runs (never below 0 within the input ranges). Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Peak share from the SIR formula
About this output

The classic SIR peak formula I0 + S0 - (1 + ln(R0 S0))/R0 (SIR with growth only). Blank with SEIR, without growth, when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Estimated step error
About this output

An estimate of the step error from a run with steps twice as long (the largest difference divided by 15). Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Step ratio
About this output

The step ratio: the time step times the fastest rate of the model. Above 1 the status reads CHECK (the curves lose accuracy). Blank when the inputs are not valid.

No unit declared
Vaccinated share used
About this output

The vaccinated share used. Blank when the inputs are not valid.

No unit declared
Transmission rate (per day)
About this output

The transmission rate beta = R0 divided by the infectious period, per day. Blank when the inputs are not valid.

No unit declared
Time step (days)
About this output

The time step h = duration / 300, in days. Blank when the inputs are not valid.

No unit declared
Peak infectious share
About this output

The largest infectious share, interpolated through the largest row and its neighbours. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Peak infectious people
About this output

The peak infectious share times the population, rounded to whole people. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Peak day
About this output

The day of the infectious peak (0 when the outbreak shrinks from the start; the last day when it is still rising). Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Population used (people)
About this output

The population used. Blank when the inputs are not valid.

No unit declared
Reduction starts (day)
About this output

The day the reduction actually starts (the first step on or after the entered start, at most one step later). Blank when no step of the run lies in the window and when the inputs are not valid.

No unit declared
Reduction ends (day)
About this output

The day the reduction actually ends (at most the last day). Blank when no step of the run lies in the window and when the inputs are not valid.

No unit declared
Recovery rate (per day)
About this output

The recovery rate gamma = 1 divided by the infectious period, per day. Blank when the inputs are not valid.

No unit declared
Challenge: the value scored
About this output

The value the selected challenge scores: the share ever infected (1), the effective R at the start (2), the peak infectious share (3), the share eventually infected (4) or the doubling time (5). Blank with none, when not valid, while challenge 1 awaits a prediction and while challenge 5 is unsolved.

No unit declared
Challenge goal
About this output

The goal of the selected challenge (blank with none).

No unit declared
Challenge feedback
About this output

Feedback on the selected challenge: the prediction prompt, the met text or the not-met hint (blank with none).

No unit declared
Challenge score
About this output

The challenge score: 100 when met, else 0.

No unit declared
Conservation residual
About this output

The largest departure of S + E + I + R from 1 over every step (rounding only). Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Longest clean duration (days)
About this output

The longest duration on the 10-day grid whose step ratio is at most 1 (at least 120 days within the input ranges). Blank when the inputs are not valid.

No unit declared
Challenge result
About this output

No challenge selected, MET or NOT MET.

No unit declared
Share ever infected without the window
About this output

The share ever infected by the end of the run without the reduction window. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
People ever infected without the window
About this output

The people ever infected without the reduction window, rounded to whole people. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Active share at the end
About this output

The exposed plus infectious share on the last day. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Peak day without the window
About this output

The peak day without the reduction window. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Care capacity used
About this output

The care capacity used. Blank when the inputs are not valid.

No unit declared
R0 used
About this output

R0 used (the challenge's when a challenge fixes it). Blank when the inputs are not valid.

No unit declared
Peak share without the window
About this output

The infectious peak of the same outbreak without the reduction window (the faint curve). Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Day effective R falls below 1
About this output

The day the effective reproduction number first falls below 1 (linear between steps; 0 when it starts below). Blank when it never does, when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Share ever infected
About this output

The share of people infected at some point by the end of the run, the initially infected included. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
People ever infected
About this output

The share ever infected times the population, rounded to whole people. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Share eventually infected
About this output

The share eventually infected if transmission returned to normal after the run, from the run's end state and the final-size relation: it counts any wave still to come. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Final size from the formula
About this output

The share ever infected in an unchecked outbreak from this start, from the final-size relation (the same for SIR and SEIR). Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
First day above the care capacity
About this output

The day the infectious share first passes the care capacity (linear between steps; 0 when it starts above). Blank when it never does, when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Run minus formula, final size
About this output

The share ever infected without the window minus the final-size formula: small when the outbreak has finished within the run, large when the run stopped early. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
The final size across R0: the share ever infected in an unchecked outbreak from this start, and the herd immunity threshold
About this output

The final size across R0 = 0.5, 0.6, .., 6.0 from this start: the share ever infected in an unchecked outbreak and the herd immunity threshold. Blank while challenge 1 awaits a prediction and while challenge 2 is unsolved.

No unit declared
Duration used (days)
About this output

The duration used, days. Blank when the inputs are not valid.

No unit declared
Doubling time (days)
About this output

The early doubling time ln 2 / growth rate, in days, when the outbreak grows from the start. Blank otherwise, when the inputs are not valid and while challenge 5 is unsolved.

No unit declared
Days above the care capacity
About this output

The days the infectious share spends above the care capacity (whole steps). Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
Early growth rate (per day)
About this output

The early growth rate per day from the model linearised at day 0 (negative when the outbreak shrinks). Blank when the inputs are not valid and while challenge 5 is unsolved.

No unit declared
The outbreak frame by frame: the day, the four compartment shares, new infections per day, the effective reproduction number, the infectious share without the window and the icon counts of a town of 1,000 (every third step)
About this output

The outbreak frame by frame, every third step (101 frames): the day, the susceptible, exposed (blank with SIR), infectious and removed shares, the new infections per day, the effective reproduction number, the infectious share without the window, and the icon counts of a town of 1,000 (whole people adding up to 1,000; the vaccinated are in Removed). Rows after the first are blank while challenge 1 awaits a prediction.

No unit declared
Effective R at the start
About this output

The effective reproduction number at day 0: R0 times the reduction factor times the susceptible share. Blank when the inputs are not valid.

No unit declared
Effective R at the end
About this output

The effective reproduction number on the last day. Blank when the inputs are not valid and while challenge 1 awaits a prediction.

No unit declared
This page is provided by LogicCommons for informational purposes only. Results are analysis outputs computed from the inputs you supply and are not professional advice. Verify all inputs and results independently.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This lab plays an outbreak in a closed town day by day with the classic compartment models. People are split into shares: susceptible (S), exposed, that is infected but not yet infectious (E), infectious (I), and removed (R: recovered, or vaccinated before day 0). Two templates share one set of equations: SIR, where S -> I -> R, and SEIR, where S -> E -> I -> R with a latent stage. The learner sets the basic reproduction number R0, the infectious and latent periods, the share infected at day 0, the share vaccinated before day 0, one window in which transmission is reduced, and a care-capacity line.

The model integrates the outbreak with and without the reduction window, and measures the peak, the share ever infected, the share eventually infected, the days above the care capacity, the effective reproduction number over time and the early doubling time. Beside the run it places the closed forms of the theory: the herd immunity threshold, the Kermack-McKendrick final-size relation and the SIR peak formula. Five challenges are scored by the model.

It is a lab for learning how compartment models behave: why an outbreak overshoots the herd immunity threshold, how vaccination before the start can stop growth, how the timing of a reduction matters more than its length, and how early growth is tied to R0 and the infectious period. It is an educational model, not a forecast. It names no disease and has no age groups, no behaviour change, no births, deaths or waning immunity, and no chance.

The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the compartment chain, the curves with and without the window, the window strip, the care-capacity line, the town of 1,000 icons and the final-size curve across R0. The page computes no share, peak, reproduction number or doubling time itself.

Inputs and units

Input Meaning and unit
Model template SIR (default) or SEIR.
Basic reproduction number R0 0.5 to 6 (default 2.5): the new infections one case causes in a fully susceptible population.
Infectious period (days) 3 to 14 days (default 7): the mean time a case stays infectious.
Latent period (days) 2 to 14 days (default 5): the mean time from infection to infectiousness. Used only by SEIR, but checked with SIR too.
Initially infected share 0.01% to 10% (default 0.1%): the share infectious at day 0.
Population (people) A whole number from 1,000 to 100,000,000 (default 100,000). It scales the people counts only; every share is the same for any population.
Duration (days) 60 to 240 days in steps of 10 (default 180). The run always has 300 steps, so a longer duration means longer steps.
Vaccinated share before day 0 0% to 95% (default 0%): the share immune at day 0. They start in Removed. Together with the initially infected share it must leave at least 1% of people susceptible.
Transmission reduction strength 0% to 90% (default 0%): how much the window cuts transmission while it is on. At 0% the window changes nothing.
Reduction window start (days) A whole number from 0 to 240 (default 30).
Reduction window length (days) A whole number from 0 to 240 (default 60).
Care capacity (share of people) 0.5% to 30% (default 10%): the share of people that can be cared for at once, drawn as a line on the infectious curve.
Challenge 0 for none, or 1 to 5.
Your prediction of the share ever infected Blank, or 0% to 100%: your answer for challenge 1. Blank means not yet predicted; 0% is a real prediction.

Every input except the prediction is required, and each is checked on the value entered, even when the template or a challenge does not use it.

Where each input is set:

  • On the canvas only: the model template, with the chip on the compartment chain (it adds or removes the exposed box); the reduction window's start and length, as a strip on the time axis (drag the window or its ends, or type the days in its popover); and the care capacity, as a draggable line on the infectious chart. None of these is in the input panel.
  • In the input panel: R0, the infectious period, the latent period (hidden with SIR), the initially infected share, the population (a number box), the duration, the vaccinated share, the reduction strength and the challenge picker. The prediction box appears only while challenge 1 is selected.

Governing relationships

Rates. From R0 and the infectious period D_I the model takes the transmission rate β = R0/D_I and the recovery rate γ = 1/D_I, both per day. With SEIR the latent rate is σ = 1/D_E, with D_E the latent period; with SIR there is no latent stage.

The compartment equations. With S, E, I and R as shares of the population and b the transmission rate in force (β, or β·(1 - c) while the window is on, with c the reduction strength), the infection flow is f = b·S·I and:

  • dS/dt = -f;
  • SEIR: dE/dt = f - σ·E and dI/dt = σ·E - γ·I; SIR: E stays 0 and dI/dt = f - γ·I;
  • dR/dt = γ·I.

At day 0, S = 1 - v - I0, E = 0, I = I0 and R = v, where v is the vaccinated share and I0 the initially infected share. The four shares always add up to 1; the model integrates all four and reports the largest departure from 1 as a check of rounding.

The integration. The classic fourth-order Runge-Kutta method takes 300 equal steps of h = duration/300 days (0.2 to 0.8 days). Three runs are made: the scenario with your window, the same outbreak without the window, and the outbreak without the window in 150 steps twice as long. The difference between the last two, divided by 15, estimates the step error of a fourth-order method.

The reduction window. The reduction is applied to a whole step: step n uses β·(1 - c) when the step starts on or after the entered start day and before the start plus the length. So the reduction switches on at the first step boundary on or after the entered day, at most one step later, and the model reports the days on which it actually starts and ends.

Step ratio. The step ratio is h × the largest of β + σ, σ + γ and β + γ, a bound on the fastest rate of the model. Within the input ranges it is at most 2.0, inside the stability limit of the method (about 2.785). Above 1 the curves lose accuracy, and the model names the longest duration on the 10-day grid whose step ratio is at most 1.

Effective reproduction number. R_eff = R0 × (1 - c while the window is on) × S: the new infections one case causes now. The outbreak grows while R_eff is above 1 and shrinks once it falls below 1.

Herd immunity threshold. 1 - 1/R0 (0 when R0 is at most 1): the immune share above which R_eff is below 1 without any reduction.

Early growth. Linearising the model at day 0, with R_e the effective R at the start: for SIR the growth rate is r = γ·(R_e - 1); for SEIR it is the positive root of x² + (σ + γ)·x + σ·γ·(1 - R_e) = 0, computed as r = 2·σ·γ·(R_e - 1)/((σ + γ) + √((σ - γ)² + 4·σ·γ·R_e)). The doubling time is ln 2/r when R_e is above 1, and the halving time ln 2/|r| when it is below 1.

The final-size relation. For this model without a window, the susceptible share at the end of an outbreak that starts with susceptible share s₀ and infected share a₀ (exposed plus infectious) solves the Kermack-McKendrick relation s = s₀·exp(-R0·((s₀ - s) + a₀)). The model solves it with 40 Newton steps from s = 0, which rise steadily to the root. It is the same for SIR and SEIR, because the latent period changes when people are infected, not how many. The model uses it three ways:

  • the final size from the formula: from the day-0 state, the share ever infected in an unchecked outbreak, 1 - v - s;
  • the share eventually infected: from the scenario's state on the last day, as if transmission returned to normal then, so any wave still to come is counted;
  • the final-size curve: the formula for R0 = 0.5, 0.6, ... 6.0 from your start, beside the herd immunity threshold.

SIR peak formula. For an unchecked SIR outbreak that grows (R0·S0 above 1), the infectious share peaks when S = 1/R0, at I0 + S0 - (1 + ln(R0·S0))/R0.

Calculation sequence

  1. Check the inputs in the order of the list under Errors and warnings.
  2. In a challenge, replace the inputs the challenge fixes with its own values.
  3. Derive β, γ, σ, the time step, the start shares, the window's steps and the step ratio.
  4. Integrate the scenario and the outbreak without the window (300 steps each) and the double-step run (150 steps).
  5. From every step, measure the peaks, the shares ever infected, the care-capacity crossing and days above it, the effective R and the day it falls below 1, and the step-error and conservation checks.
  6. Compute the early growth rate and doubling or halving time, the herd immunity threshold, the final-size relations, the SIR peak formula and the people counts.
  7. Set the status and, in a challenge, score it.

Outputs and interpretation

  • Peak infectious share, its people count and peak day: the largest infectious share, refined by a parabola through the largest step and its neighbours. The peak day is 0 when the outbreak shrinks from the start and the last day when it is still rising.
  • Share ever infected and its people count: everyone who left Susceptible by the last day, the initially infected included.
  • Share eventually infected: the share ever infected if transmission returned to normal after the run. Outbreak at the end reads Still running when more than 0.1% of people would still be infected after the run, else Over.
  • Without the window: the peak share, peak day, share ever infected and people ever infected of the same outbreak with no reduction, drawn as a faint curve; infections averted is the difference in people.
  • First day above the care capacity and days above the care capacity.
  • Effective R at the start and at the end, and the day effective R falls below 1.
  • Early growth rate, doubling time or halving time.
  • Herd immunity threshold, final size from the formula, run minus formula (small when the outbreak ended within the run, large when the run stopped early) and peak share from the SIR formula.
  • Transmission, recovery and latent rates, time step, step ratio, longest clean duration, estimated step error, conservation residual, smallest compartment share and the active share at the end.
  • Settings used (a challenge may fix them), the actual reduction start and end days, and the model version.
  • Frames: every third step (101 frames), with the day, the four shares, new infections per day, effective R, the infectious share without the window, and the icon counts of a town of 1,000 (whole people adding up to 1,000; the vaccinated are in Removed).
  • Final-size curve across R0, with the herd immunity threshold.

Reading the canvas: the chain shows the compartments, the chart shows the shares over time with the no-window curve faint behind, the strip shows the reduction window and the line the care capacity. The town of 1,000 icons shows each frame's counts. The infectious curve can be read on a log scale, where early growth is a straight line.

What to take from the lab: an outbreak does not stop at the herd immunity threshold but overshoots it, because many people are still infectious when it is crossed; vaccination before the start stops growth once R0 times the susceptible share is at most 1; a reduction that ends too early mostly moves the outbreak in time, while one timed over the steep part of the wave lowers the peak; and the early doubling time depends on R0 and the infectious period together.

Challenges

Each challenge fixes its own settings and leaves one or more inputs to you. The model scores each one MET (100) or NOT MET (0) and gives a hint while it is not met.

  1. How many catch it? Predict the share of people who catch the disease at some point in this outbreak (R0 2, no vaccination, no measures), then compare. Met when your prediction is within 3 percentage points of the share ever infected.
  2. Vaccinate just enough. With R0 3, find the smallest vaccinated share, in steps of 1%, at which the outbreak does not grow at all from the start. Met when the effective R at the start is at most 1 and 1% less vaccination would leave it above 1.
  3. Stay under the line. Time a 60-day, 40% transmission reduction so that the infectious share never goes above the 10% care capacity. Met when the peak infectious share is at or below the care capacity.
  4. Shrink the epidemic. Using one transmission reduction of at most 60 days, keep the share eventually infected at or below 75%, counting any wave still to come after the run. Met when the share eventually infected is at most 75% and the window is at most 60 days long.
  5. Read the growth. An outbreak was seen to double every 4 days. With an infectious period of 7 days, set R0 so the model's early doubling time is within 0.2 days of 4. Met when the doubling time is from 3.8 to 4.2 days.

Held-back results:

  • Challenge 1, until you predict: the results that reveal how many are infected (the peaks, shares ever and eventually infected, the capacity and effective-R crossings, the end values and the checks) are blank, only the first frame is shown, and the final-size curve is blank. The rates, the step ratio, the effective R at the start and the early growth stay visible. Once you enter a number, 0 included, everything appears and the challenge is scored.
  • Challenge 2, while not met: the herd immunity threshold and the final-size curve are blank.
  • Challenge 5, while not met: the early growth rate, doubling time and halving time are blank; the rates and the effective R at the start stay, and the slope can be read from the log-scale curve.
  • Challenges 3 and 4 hold nothing back: the curves and results are feedback on your own window.

Validation and status logic

The status reads the first match in the list under Errors and warnings. The NOT VALID checks use the values you entered, inside a challenge too; the CHECK messages use the values in effect after a challenge has fixed its own, and apply inside challenges as well. A challenge number that is not a whole number from 0 to 5 counts as no challenge. An outbreak still running at the end of the run is a result, not a warning: the outbreak-at-end result and the share eventually infected say so.

Assumptions and limitations

  • A closed, well-mixed population in shares; constant rates apart from one reduction window; latent and infectious periods with exponential distributions; vaccination only before day 0.
  • No births, deaths, waning immunity, age groups, behaviour change, seasonality or chance. It is not a forecast.
  • 300 fixed Runge-Kutta steps; the step ratio is at most 2.0 within the input ranges, and steps above 1 are flagged with the shortest fix. The step-error estimate assumes fourth-order behaviour and can under-read the true error at step ratios above 1.
  • The window switches at step boundaries, up to one step (at most 0.8 day) after the entered day; the actual days are reported.
  • Peaks are interpolated by a parabola through three steps; the capacity and effective-R crossings are linear between steps.
  • The share eventually infected assumes transmission returns to normal after the last day.
  • A value within about 1×10⁻⁹ (relative) of a threshold, such as the coarse-step bound, the 1% susceptible bound, a crossing, the still-running threshold, a people count at an exact half, or a challenge band, may fall either side of it.

Restrictions and non-computing states

Under NOT VALID every result, frame and curve entry is blank, except the model version, the challenge result (No challenge selected, or NOT MET with a challenge selected), a score of 0, and the goal and hint of a selected challenge.

The doubling time is blank unless the outbreak grows from the start, the halving time unless it shrinks, and both when the effective R at the start is within 1×10⁻⁹ of 1. The SIR peak formula is blank with SEIR or without growth. In challenges 1, 2 and 5 the results listed under Challenges are held back.

Errors and warnings

The status messages, first match wins:

  • NOT VALID: choose SIR or SEIR from the list
  • NOT VALID: the basic reproduction number R0 must be from 0.5 to 6
  • NOT VALID: the infectious period must be from 3 to 14 days
  • NOT VALID: the latent period must be from 2 to 14 days: checked with SIR too.
  • NOT VALID: the initially infected share must be from 0.01% to 10%
  • NOT VALID: the vaccinated share must be from 0% to 95%
  • NOT VALID: the vaccinated and initially infected shares together must leave at least 1% of people susceptible
  • NOT VALID: the duration must be from 60 to 240 days, in steps of 10
  • NOT VALID: the intervention strength must be from 0% to 90%
  • NOT VALID: the intervention start and length must be whole days from 0 to 240
  • NOT VALID: the care capacity must be from 0.5% to 30% of people
  • NOT VALID: the population must be a whole number from 1,000 to 100,000,000
  • NOT VALID: the challenge number must be a whole number from 0 to 5, and the final-size prediction blank or from 0% to 100%
  • CHECK: the time step is coarse for this fast an outbreak (step ratio above 1), so the curves lose accuracy; shorten the duration to N days or less: N is the longest clean duration.
  • CHECK: a compartment went below zero, so the run is not reliable; shorten the duration: a guard; no state within the input ranges is known to reach it.
  • CHECK: the final-size relation did not converge, so the closed-form results are not reliable: a guard, when a final-size residual is above 1×10⁻¹³; no state within the input ranges is known to reach it.
  • OK

References

This laboratory is an educational model of an outbreak in a closed, well-mixed population, using the SIR and SEIR compartment models. People move from susceptible to infectious (through an exposed stage in SEIR) to removed, at rates set by the basic reproduction number and the infectious and latent periods. The run is integrated with the classic fourth-order Runge-Kutta method. Beside it stand the closed forms of the theory: the threshold R0 times the susceptible share above 1 for growth, the herd immunity threshold 1 - 1/R0, and the Kermack-McKendrick final-size relation, solved by Newton's method.

Sources and further reading

  • The final-size relation and the threshold behaviour of an epidemic: W. O. Kermack and A. G. McKendrick, "A contribution to the mathematical theory of epidemics", Proceedings of the Royal Society of London, Series A 115(772), 1927, pages 700-721. doi:10.1098/rspa.1927.0118
  • The SIR equations, the basic reproductive ratio, the condition for an epidemic and the fraction ever infected: J. R. Chasnov, Mathematical Biology, section 4.3, The SIR Epidemic Disease Model, LibreTexts Mathematics. LibreTexts
  • The vaccinated share needed to prevent an epidemic, 1 - 1/R0: J. R. Chasnov, Mathematical Biology, section 4.4, Vaccination, LibreTexts Mathematics. LibreTexts
  • The classic fourth-order Runge-Kutta method and its four slopes: W. F. Trench, Elementary Differential Equations with Boundary Value Problems, section 3.3, The Runge-Kutta Method, LibreTexts Mathematics. LibreTexts
  • The SEIR model, the latent period and early growth rates: M. J. Keeling and P. Rohani, Modeling Infectious Diseases in Humans and Animals, Princeton University Press, 2008, chapter 2, Introduction to Simple Epidemic Models.

No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.

This laboratory is for learning. Its results hold only within its stated ranges; it is not a forecast of any real outbreak and must not be used for public health decisions.

Links were current at build time. If one moves, search the document's title rather than reporting a broken link as a defect.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms