Skip to content

Epidemiology simulator

Outbreak Lab

The Kermack-McKendrick SIR model (1927) splits a population into Susceptible, Infected, and Recovered, then evolves it by a transmission rate beta and a recovery rate gamma. This run drives a fast disease: beta = 0.5, gamma = 0.1, so R0 = 5.

How to read it: the infected wave (red) rises as susceptibles (blue) are consumed, peaks near day 15 with ~48% of the population sick at once, then decays as the recovered pool (green) fills. Only 0.7% are ever spared.

5.00R0 (basic reproduction)
80.0%herd-immunity threshold
47.9%peak infected, day 15
99.3%ever infected by day 100

Infected wave - I(t), every 5 days

dayS%I%R%wave
099.01.00.0
591.76.81.5
1060.829.49.7
1521.747.930.4
207.040.053.0
253.027.369.7
301.717.580.8
351.211.087.8
401.06.992.1
450.94.394.9
500.82.696.6
600.71.098.3
800.70.199.2
1000.70.099.3

The peak height matches the SIR approximation 1 - (1 + ln R0)/R0 ~= 47.8% for R0 = 5.

Raw program output (100 days, dt = 1 day)

  OUTBREAK LAB - SIR epidemic curve simulator
  powered by OnlyCSharp 1.8 - Medicine.Epidemiology (SirModel + OutbreakMetrics)
==============================================================================
  Model parameters : beta = 0.50   gamma = 0.10   dt = 1.0 day
  Initial state    : S(0) = 99.0%   I(0) = 1.0%   R(0) = 0.0%

  Basic reproduction number   R0  = beta / gamma   = 5.00  (500.0%)
  Herd-immunity threshold      HIT = 1 - 1/R0      = 0.800  (80.0%)
==============================================================================

  Day    S%      I%      R%    Infected wave (I%) - one '#' per (int)(I*60)
  --------------------------------------------------------------------------
    0    99.0%    1.0%    0.0%
    5    91.7%    6.8%    1.5%  ####
   10    60.8%   29.4%    9.7%  #################
   15    21.7%   47.9%   30.4%  ############################   <- peak
   20     7.0%   40.0%   53.0%  ########################
   25     3.0%   27.3%   69.7%  ################
   30     1.7%   17.5%   80.8%  ##########
   35     1.2%   11.0%   87.8%  ######
   40     1.0%    6.9%   92.1%  ####
   45     0.9%    4.3%   94.9%  ##
   50     0.8%    2.6%   96.6%  #
   55     0.8%    1.6%   97.6%
   60     0.7%    1.0%   98.3%
   65     0.7%    0.6%   98.7%
   70     0.7%    0.4%   98.9%
   75     0.7%    0.2%   99.1%
   80     0.7%    0.1%   99.2%
   85     0.7%    0.1%   99.2%
   90     0.7%    0.1%   99.3%
   95     0.7%    0.0%   99.3%
  100     0.7%    0.0%   99.3%

  PEAK: day 15 - 47.9% of the population infected at once.

  FINAL STATE at day 100:
    Susceptible (never infected)   : 0.7%
    Infected (still active)        : 0.0%
    Recovered (infected & immune)  : 99.3%
    Check S + I + R                : 100.0% (should be ~100%)