Study materials · photonresources.comClasses with our teachers · Photon AcademyFor IB Diploma students worldwide

Maths IA · Modelling · topic 93 of 97

Epidemics: does a top-down model match a real outbreak? · IB Maths IA idea: guide, sample graph and step-by-step plan

fit it, solve it, then try to break it

One model tracks the whole population with three equations. The other follows every person by the rules of chance. Which one better matches a real outbreak, and where do they disagree?

Difficulty●●● Stretch
KitA spreadsheet or Python, one real outbreak data set, your GDC
TimeAbout 15 to 18 hours
FitsAA SL1 of 3AA HL2 of 3AI SL1 of 3AI HL3 of 3
  • ✓ you want to fit a model to real data and then ask whether it deserves trust
  • ✓ you like comparing two very different ways of modelling the same thing
  • ✓ you enjoy an equation that has no neat solution and needs a numerical method

The big idea

In the SIR model every person is susceptible, infectious or recovered, and two rates move people along. The ratio of those rates, R₀, decides whether an outbreak grows, and the equations give the peak and how many people are ever infected. That last number comes from an equation with no neat solution, so you solve it numerically. Then you build the bottom-up version: agents who meet others at random and pass the infection on with some chance. Average many runs of the agents and they should match the equations; single runs will not. The routine part is fitting two rates to the data. The marks come from asking when the two models disagree and why: small populations, early luck, uneven mixing, and an outbreak that was never as simple as three boxes. This is not the rumour model: here the point is fitting, solving and comparing.

Make it yours: pick one twist

Copying a classic won't show your choices. Pick one of these (or invent your own) and your IA becomes yours.

Swipe for more twists →

Fit the rates to a real outbreak

Choose daily counts from one published outbreak and find the two rates that make the model's curve match them best.

→ A fit with two parameters and a stated measure of fit. Say which data the model counts, and which it does not.
Solve the final-size equation

Find the share of people ever infected by solving an equation with an exponential in it, using Newton-Raphson or your GDC.

→ A numerical method of your own. Show how many steps it needs and compare it with your solver.
Test the threshold

Vary R₀ across 1 in both models and record how many people are infected in each.

→ A sharp change in behaviour. Explain why the agent runs sometimes die out below, and even above, the threshold.
Euler's method for the totals

Solve the three equations step by step with several step sizes and compare the peak you get with the exact peak formula.

→ A numerical error you can measure, because the peak has a formula to check it against.
Change who meets whom

Let agents meet only a fixed set of neighbours, or two groups who mix unevenly, and compare with the equations.

→ The point where 'well mixed' breaks. Measure how far the equations are off, not only that they are.
Add a control

Vaccinate a fraction in advance, or cut contacts partway through, and predict the effect with both models.

→ A new parameter and a decision to compare. Check that the herd-immunity threshold 1 − 1/R₀ appears in your results.

Your Maths IA research question: run the check

which outbreak? which gap?

Write your own question first. Then make sure it ticks every box:

  • Names the outbreak or the made-up population, the data used, and what the counts measure.
  • Names the quantity you will find: the fitted rates, the final size, or the gap between the two models.
  • Says how the fit is judged and how the agent runs are averaged.
  • Goes beyond fitting: there is an equation solved numerically and a bottom-up model compared with it.
  • States what you leave out: age groups, reporting delays, changes in behaviour, and deaths.
Stuck on your question?Get an RQ Check: each question is scored on 5 points, with what to fix. Your first one is free.
Get an RQ Check

The model

The same outbreak seen two ways: totals moving between three boxes, and individual agents passing it on. Label the rates and rules for your own outbreak.

Top-down: three equations for the totalsSsusceptibleIinfectiousRrecoveredβSI/NγIR₀ = β/γ: above 1, it takes offBottom-up: a chance rule for every persondo the two agree? where not?

How your Maths IA could be laid out

The usual order for a topic like this, what each part needs to show, and roughly how much of your 12 to 20 pages it takes. The words are all yours.

Aim and context~1 page
Which outbreak, where the data comes from, and what you expect before calculating: how big, how fast?
The equations~2 pages
The three equations, every symbol defined, R₀ derived and what it predicts about growth.
Fitting to data~2 pages
How the two rates are chosen, the fitted curve against the counts, and a number for how well it fits.
The final size~2 pages
The final-size equation derived, solved numerically with your method, and checked against the data and a solver.
The agent model~2 pages
The rules written out, how R₀ links to them, and the averaged runs beside the equations.
Where they disagree~1.5 pages
A measured gap between the models and a reason for it, with one test of the reason.
Conclusion~1 page
Back to your aim: the fitted rates, the final size, and which model you would trust for what.
Evaluation~2 pages, the biggest part!
Mixing, small numbers, data quality and what the data really counted. Say which assumption matters most.
Bibliographynot counted
Where every data set, rate and method came from.

What your Maths IA graph could look like

model and data, same axes!

Made-up readings to show the form of a strong graph, not the answer: the fraction infectious each day for an outbreak with R₀ = 2.5 and a 3-day infectious period. Yours will look different. example only

0102030400.000.050.100.150.200.250.30Time (days)Fraction infectiousSIR (early, exponential)SIR model (shape)your outbreak data (made-up)mark the peak: model anddata, same axesILLUSTRATIVE · MADE-UP DATA
  • The fraction infectious each day, with the model drawn through your data.
  • Axis labels give units: days on the time axis, a fraction (or a count with its population) on the other.
  • Say what the data counts: new cases, cases in bed or reported cases are different things.
  • Plot the data as points: agreement with the curve is your evidence, and the gaps are your evaluation.
  • Another graph to consider: ever-infected fraction against R₀, for the equation and for your agents.

The maths in action

worked through, not sketched!

The graph above was a sketch with made-up numbers. This figure works the idea through from the model itself, so you can see what a finished figure looks like. The source line under it says where every number comes from.

Two panels. Left: three bell-shaped curves of the fraction infectious against days for three R0 values, with grey agent-based runs lagging the middle curve. Right: a rising S-shaped curve of the fraction ever infected against R0, with red agent-based averages on it and error bars.
(a) Fraction infectious for R₀ = 1.5, 2.5 and 4 (γ = 1/3 per day), with 10 agent runs (N = 2000) at 2.5, which peak later than the equations (24% on day 11). (b) Fraction ever infected against R₀: equation and agent means; 89.3% at R₀ = 2.5.Source: Computed: SIR solved with RK4 (gamma = 1/3 per day); agent-based runs with 2000 agents. No real outbreak data.

Your game plan

Tick steps off as you go. We'll remember on this device.

0 of 10 done

  1. Read and predictFind out what R₀ means. Before any calculation, guess how many people a 3-day infection would reach if each person infects 2.5 others.
  2. Choose the outbreakPick one published outbreak with daily counts, and note the population size and exactly what the counts measure.
  3. Write the equationsWrite the three SIR equations, define every symbol and units, and derive R₀. Say what each assumption means.
  4. Trial run (1 lesson)Code Euler's method for ten days. Compare the totals with a hand calculation of the first two steps and fix any mismatch now.
  5. Fit the ratesChoose the two rates that best match the data, and say how you measure 'best'. Plot the fit against the counts.
  6. Solve the final sizeDerive the final-size equation and solve it numerically with a method you write out. Compare it with the data's total.
  7. Build the agentsWrite the rules, link the chance of passing it on to R₀, and average many runs. Plot the average beside the equations.
  8. Go further, with a reasonTest the threshold, or change who meets whom, and say what the comparison shows. HL: this is where the rigour for criterion E comes from.
  9. Reflect as you goAfter every result, write one line on what it says about the real outbreak and what it assumes. These lines become your evaluation.
  10. Cut, check, then sendCheck every graph has labelled axes with units, every symbol is defined once and the conclusion answers your aim. Then send your teacher one draft.

The maths you'll use

  • Coupled differential equations – Write , , and derive and the peak condition .
  • Separating variables – Divide and integrate to get , which gives the peak size and the final-size equation.
  • Solving an equation numerically – Solve by iteration or Newton-Raphson and show how fast the iterates converge.
  • Euler's method – Step the system forward in time, compare with the exact peak formula and with a smaller step.
  • Probability and averaging – Write each agent's chance of infection and recovery, average many runs and use a spread to say when two curves agree.

Key equations

Syllabus links

  • 2.9Exponential and logarithmic functions
  • 2.10Solving equations graphically and analytically
  • 5.6Standard derivatives; chain, product and quotient rules
  • 5.18First-order differential equations; Euler's methodHL

Read up first

Data and sources to start from

Daily counts from one published outbreak (a school influenza outbreak or a published epidemic curve), plus the student's own agent simulation.

References to cite

  1. Kermack, W. O., & McKendrick, A. G. (1927). A contribution to the mathematical theory of epidemics. Proceedings of the Royal Society of London. Series A, 115(772), 700-721.
  2. Keeling, M. J., & Rohani, P. (2008). Modeling infectious diseases in humans and animals. Princeton University Press.
  3. Brauer, F., Castillo-Chavez, C., & Feng, Z. (2019). Mathematical models in epidemiology. Springer.
  4. World Health Organization. (2026). FluNet. https://www.who.int/tools/flunet

Cite what you actually use, in your own format, and say where each number came from.

Traps to avoid in this Maths IA

one run proves nothing
  • Fitting the model to the number of cases reported each day without saying whether reporting changed during the outbreak.
  • Treating R₀ as a property of the disease alone. It depends on how people mix.
  • Averaging agent runs without checking how many died out early. Those runs belong in the average, and are part of the story.
  • Using a large Euler step and calling the early peak a feature of the model.
  • Comparing one agent run with the equations and calling the gap an error in the equations.
  • Reading the final-size equation as 'the rest are immune'. It gives who was infected, not who is protected afterwards.

More Maths IA ideas like this

Make sure it's yours

This guide shows how a topic like this is usually approached. It is not an IA. Your question, choices, data, analysis and words must be your own: change something, tell your teacher where the idea came from, and follow your school's rules on outside help.

Get your RQ checked · first one free