Differential Equations (18.03SC)
A complete free course with lecture videos, notes and problem sets with solutions: first-order equations, linear systems, phase portraits.
System
State variables
Parameters
Defined quantities
Rt: people one case infects now; above 1 it grows. Switch “Show” to see new infections.
The event log has one row per transition: time, individual, from, to and infector. Together with the scenario and seed it is the full ground truth of the run.
Degree distribution
Contacts of the selected individual
Centre: the selected individual; inner ring: its contacts; outer ring: their contacts. Red lines are transmissions; a dark ring marks isolation. Click a node to move to it.
The contact network (nodes and edges of who can meet whom) is drawn only for a contact structure other than homogeneous mixing: with homogeneous mixing everyone can meet everyone, so the graph shows who infected whom.
Click any node to show that individual and all its descendants, in the phylogeny and in the infection tree alike; then limit the generations shown. “Back to the full chain” returns to everything.
This phylogeny is built from who infected whom in the simulation, not from sequence data: it is the tree a genomics study would try to reconstruct.
Lineages through time
With every host sampled at removal, the number of lineages at time t is the number infected at t; its slope early on is the growth rate, as in birth-death phylodynamics.
Tree statistics
The agents are individuals: their epidemic is random, finite and follows the contact structure you chose. The ODE is its mean-field limit (everyone mixes with everyone, infinitely many people). Run many epidemics and see where the agents agree with the ODE, where they do not, and why.
A run is a major outbreak when it infects more than 2% of the population (and more than ten times the initial cases). Medians and 5–95% ranges are over major outbreaks; the shaded band is the 5–95% range of all runs at each time. Seeds 1 to n, so results can be reproduced.
Compare two scenarios of the agent simulation: contact structure, interventions, population and initial conditions, or a changed model. To compare model variants (equations and parameter values) side by side, with sliders and R₀ analysis, use the model lab.
A run counts as a major outbreak when cumulative infections exceed 2% of the initial population. Seeds are 1 to n for both models, so each pair of runs starts from the same random stream.
Elasticity = % change in the outcome per 1% change in the parameter (central difference, ±5%, on the ODE). +1 means proportional. This is a local measure around the current values; switch to Global for LHS-PRCC over parameter ranges.
Detected from the structure of the flows, not from names. Hover a feature for what was found.
Searches 250 million scholarly works with the model's fingerprint as the query. Edit the query to narrow it.
A curated starting list chosen by the model's features, with each title linked to a Scholar search. It is not an exhaustive search of the literature.
Turn the current simulation into realistic surveillance data with a known ground truth: only a fraction of events is reported, each after a random delay, aggregated by day or week, and cases not yet reported by the last simulated day are missing (right truncation).
Run the simulation first (or part of it), then generate.
Columns are matched to the model automatically: new cases are fitted through the observation model, compartment counts (S, E, I, R, deaths, ...) directly. Incidence and the infectious compartments are used by default.
Each simulation runs the full agent model; time grows with the population. Reduce the population for quick exploratory runs.
Counts of the same people on consecutive days are not independent observations; treating them as such (as the Poisson and negative binomial likelihoods do) makes the intervals too narrow. Prefer incidence, or thin the rows.
Equations are exported as written, with the derived individual-level flows listed as comments.
Platform for epidemic modelling
Kermack is a tool for epidemic modellers, researchers, teachers, students and enthusiasts: write or find an epidemic model, simulate it, fit it to data, compare interventions and generate synthetic data, all in your browser.
Works best on a desktop or laptop, where controls and plots sit side by side.
Named after William Ogilvy Kermack, who with Anderson McKendrick wrote the 1927 paper that founded compartmental epidemic modelling.
Agent Lab engine
Describe a situation in words and Kermack builds a town: people with ages, households, schools, workplaces, markets and a hospital, on the real map of the place, living hour by hour. Each person carries the infection with the disease's own waiting times, and some pass it on far more than others.
Write equations, start from the library, or let AI read a document and write its core model, with every parameter marked as stated in the document or illustrative.
Duplicate the model in the lab, change an equation or add a parameter, and see every variant on the same axes as you move the sliders.
Run any variant as individuals, with interventions and contact networks, and turn it into surveillance data with under-reporting and delays.
Estimate growth and reproduction numbers, fit the model by likelihood or ABC, including the data you simulated in Agent Lab.
Enjoyed using Kermack? Tell us in a sentence or two what it helped you do. With your permission, your words appear here and help other modellers, teachers and students find the tool.
Developed by
PhD in Applied Mathematics and Mathematical Biology, Technical University of Munich (TUM)
Research interests: mathematical epidemiology, stochastic and agent-based models of infectious diseases, phylodynamics (birth-death models on phylogenetic trees), statistical inference for epidemic data, data science, machine learning, generative AI.
To know more about him and his research, visit his Google Scholar and LinkedIn profiles.
Kermack is designed and built by a researcher in mathematical epidemiology, so that every model, simulation and analysis rests on the mathematics behind it.
Kermack is built for the epidemic modelling community, and it grows with its users. Collaboration with modellers, epidemiologists, public health teams and students is welcome.
Add a model to start comparing: choose one from the list above and press Add model, bring in the model open in the simulator, extract one from a document, or write your own.
An example is loaded: SEIR with and without waning immunity. Both models use exactly the same values; the only difference is the new parameter ω (omega) (waning immunity, marked “new”), so every difference in the plots comes from it. Parameters and state variables that are not in the first (reference) model are always marked “new”. Move a slider to see how each model responds. Keep it to explore, or and start your own: add a model or template from the list above (Add model), copy a model with Duplicate to change it, , or .
Reproduction number R(t), all models
Next-generation matrix at the current state (≈ R₀·S(t)/N for simple models). The epidemic grows while R(t) > 1 and declines once it falls below 1.
R₀ as a function of a parameter
Computing…
Equilibria are followed as the parameter changes: filled dots are stable, open circles unstable; dashed lines mark where stability changes.
Did the lab help your teaching, study or research? ; with your permission it appears on the home page.
Learn
Free courses, textbooks and key papers on differential, delay and integral equations, epidemic modelling, mathematical biology and phylodynamics, chosen to go with what you can try here. They are external: Kermack is not affiliated with them. Suggest one with .
What an ODE is, how to solve it and how to read its behaviour: the language every model in Kermack is written in.
A complete free course with lecture videos, notes and problem sets with solutions: first-order equations, linear systems, phase portraits.
Clear worked examples, from separable equations to systems; good for revising one technique at a time.
The classic introduction to equilibria, stability, phase planes, bifurcations and limit cycles, with biological examples.
Models with memory: incubation delays, infectivity that depends on the time since infection, and the general Kermack-McKendrick model.
Delay equations for biologists and mathematicians: stability, Hopf bifurcation, distributed delays and the linear chain trick.
The original age-of-infection model: threshold theorem and final-size relation for any infectivity profile.
How a large class of epidemic models becomes one renewal equation for the force of infection.
The general model in discrete time, and why compartmental models under-predict peaks when periods are fixed in length.
Textbooks and courses behind the models in the library.
Step by step, for readers without advanced mathematics; with model files and exercises online.
From simple ODEs to seasonality, stochasticity, spatial structure and control.
Deterministic and stochastic models together: R₀, structured populations and inference, with worked exercises.
Compartmental models, heterogeneous mixing, vectors and disease-specific models (TB, HIV, influenza, Ebola, malaria, dengue).
The next-generation matrix method that Kermack uses for R₀.
Building, calibrating and using models in R, from the SIR model to interventions.
The same tools for ecology, physiology, biochemistry and within-host dynamics: every model of this kind runs in the model lab.
Population dynamics, predator and prey, competition, enzyme kinetics and oscillators.
A gentle, thorough introduction to discrete and continuous models in biology.
Why runs differ from the ODE, and how the who-infected-whom tree becomes a phylogeny.
The algorithm behind exact event-by-event simulation of models written as flows.
How epidemic dynamics shape pathogen phylogenies, and how to read them back.
Estimating changing reproduction numbers from a time-scaled tree.
Open the Newick files that Kermack exports from the infection tree.
When you leave Kermack: the solvers behind its Python and R exports.
Initial value problems with adaptive Runge-Kutta and stiff solvers; used by Kermack's notebooks.
ODE, DAE and delay differential equations in R; used by Kermack's R export.
ODEs, delay, stochastic and jump processes in one library.
Write any ODE, delay, integral or discrete-time model, move the sliders, and read its equilibria, stability, phase plane and R₀.
Run an epidemic model as individuals, with a contact network, and compare the runs with the ODE. The infection tree exports as a phylogeny.
Published models with their sources, from Kermack and McKendrick to predator and prey, neurons and genetic switches.
Terms and intellectual property
How Kermack treats the papers you read with it, the models it extracts, and the material you export. Short version: Kermack keeps the science (equations, parameter values) with full credit to its authors, never the publication itself, and removes anything an author or rights holder objects to.
To show that Kermack is used, the server counts visits and uses (simulations run, Model lab and Agent Lab sessions, exports, data sets analysed, models opened, synthetic data generated). It stores no network address and no cookie: a visitor is a salted one-way hash of the network address and the browser, which can be counted but not traced back. Each kind of use counts once a day per visitor (exports up to 20). Only the totals are shown, on the home page.
Every model says where it comes from: published model (equations from a cited publication), teaching template (written for teaching, not from a paper), lab variant and changed here (modified, so results are not those of the original), and, for extracted models, how many values are stated in the paper and how many were chosen, and whether a person has checked the extraction.
Every model read from a document has a “Report a problem or request removal” button. Authors and rights holders can ask for a model to be corrected or removed; it is hidden while we check, and a removed paper cannot be added again by a new upload.
This page explains how Kermack works; it is not legal advice.
Approve feedback for the home page, approve models suggested for the library and community models, review topic pages and credit contributors, and check models extracted from papers. Needs the admin token (the Worker secret ADMIN_TOKEN); it is kept only in this browser tab.
Models suggested for a library topic, and community models (Publish, SBML import, papers). Nothing is listed on the site before you approve it here.
Approving publishes the version and credits its writer: the first approved writer of a topic as author, later writers as co-authors.
For reviewers, curators, model contributors and people who suggested a topic. One person is matched across topics by ORCID iD, otherwise by name.
Dynamical systems in mathematical biology, organised by field and topic for teaching and research: epidemics, populations and ecology, within-host dynamics, physiology, cell biology and more. Every model states its source and whether its values come from a paper or are illustrative; open it in the Model lab or the simulator, or export a whole topic as teaching material.
Score-based diffusion models learn what real surveillance curves look like (levels, growth and decline, turning points, short-term variability) from several public data sources. They then generate new curves that follow the same patterns without copying any real place. Compare synthetic and real curves below, and check that the same analysis gives the same answer on both.
You define the dynamics: a compartmental model and its parameters. Kermack simulates every individual with the Gillespie algorithm, so the generating mechanism and the true parameters are known.
A neural network trained on real-world surveillance data generates curves that resemble the data. No mechanism or epidemiological parameters are defined: the curves only reflect patterns in the training data, including its reporting artefacts.
Loading…
Press Generate above to create synthetic epidemic curves. The comparison with held-out real places, the download of a synthetic dataset, the spread over the window, the statistics and the memorisation check appear here once the curves are generated.
Each panel shows a real 64-day curve from a place the model never saw (black) and, in blue, the most similar of the curves just generated. The model does not imitate a particular place: it generates new curves, and this pairing shows that realistic counterparts to real outbreaks appear among them. The memorisation check below confirms they are not copies of training data.
Press Generate.
sample, group, day_1 … day_64 (or week_…). One line per
curve; easy to read in a spreadsheet or as a matrix in R or Python.
sample, group, day, value. One line per curve and time point;
the format most plotting and modelling tools expect (ggplot2, pandas, tidyverse).
Synthetic data are not real data. They imitate statistical patterns of the training data, including its biases and reporting artefacts, and describe no real place, period or person. Use them for testing methods, teaching and software development; do not use them as evidence about a real epidemic or as a substitute for surveillance data, and review them carefully before any use. State in any output that the data are synthetic, and cite the model and its training data source.
Median and 10 to 90% range of log(1 + daily cases) at each point of the window.
Distance from each curve to its closest training curve.
Write a model as ordinary differential equations or as flows, and Kermack derives the individual-level stochastic process whose mean-field limit is exactly that ODE. Everything else, from interventions to inference, works on any model you write, paste or import.
Epidemiological insights workspace
Upload, paste or type a case series. Kermack checks the data, then estimates growth and decline, doubling or halving times, reproduction numbers, the peak, epidemic phases, changes in transmission and a short-term projection, each with its uncertainty. No model is needed; when you want one, fit any compartmental model, from a template, the library or your own equations, to see which mechanisms could have produced the curve.
Bars: data. Line: centred moving average. Background: epidemic phase from the growth-rate interval (growth, decline, stable or uncertain, low level). Dashed lines: change points. Right: projection with 50% and 95% intervals.
A compartmental model turns the curve into transmission, recovery and reporting parameters. Several models can fit the same curve equally well, so compare them (AIC) and treat parameters as conditional on the model's assumptions.
Write any system of ODEs (dX/dt = ...) or flows (X -> Y : rate), and describe
every state variable and parameter with a comment. Three further kinds run in the
model lab: delay models with delay(x, tau) (x at time t − tau), integral
(renewal, age-of-infection) models with conv(x, k(s), L) (the integral over s from 0 to L of
k(s)·x(t − s)), and discrete-time models written X[t+1] = .... The individual-based simulator
runs ODEs and flows; for a kernel there, use a chain of k stages (I1 -> I2 -> ... -> Ik, each at rate k·γ: Erlang-distributed durations).
Data checks, smoothing, peak timing and size. No assumptions about how cases arise.
Local log-linear regressions (quasi-Poisson) for growth rates and doubling times; segmented regression for change points; log-linear projection with Student-t intervals.
Renewal equation: reproduction number by the method of Cori et al. (2013) and its projection; R from the growth rate (Wallinga and Lipsitch 2007). Needs the serial interval.
Any compartmental model (templates, published models or your own equations) fitted by maximum likelihood (negative binomial) with reporting fraction, R0 and intervals; compare models by AIC and open any fit in the simulator.
SBML is the exchange format of the BioModels repository and of COPASI, Tellurium and PySB. Reactions, kinetic laws, local parameters, assignment and rate rules, initial assignments, function definitions and piecewise expressions are converted to equations; the simulator then derives the individual-level flows.
Upload a document that contains a model: a paper or preprint you may share, a chapter, a thesis, lecture notes or a report (PDF, LaTeX source or text). Kermack AI, with its strongest models, reads it and writes the core ODE system in Kermack's model language. Every parameter is marked paper when its value is stated in the document (with where), or illustrative when it is not and a plausible value was chosen.
Sources are always cited. Kermack AI checks whether the document is a published work and whether its model comes from one, and finds the DOIs; every citation is confirmed with the DOI registry before it is used. A model is listed in the shared library only after the Kermack team has checked it. Kermack keeps the model, its parameter values with short notes on where they are stated, and the citations: never the file, its text or its figures. Terms and intellectual property
Paywalled papers are not read. When a document is a published paper, Kermack checks with Unpaywall whether it is openly available. A paper behind a paywall or a subscription (for example through a university account) is not sent to the AI and its content is not used. A paper that is free to read but has no open licence is read for you only: its model stays in your browser. Only open-access papers under an open licence (e.g. Creative Commons) can have their model shared, with the citation and the licence.
Up to 8 MB and 40 pages (a paper, a chapter or lecture notes, not a whole book), or up to 200,000 characters of text.
Please check what is extracted. The extractor takes the document's core (baseline) model. When it has several models or variants, it lists the others and you can extract any of them next. AI extraction can misread equations, values or units: compare the result with the document before you use, teach or publish it. You are responsible for checking it, and if something is wrong, report it: every report helps us improve the extractor.
Kermack AI reads the document and extracts its core model equations and parameter values. If you think the extracted model is wrong (a term, a value or a missing compartment), please so it can be corrected.
The document could not be read right now. Please try again in a few minutes. Meanwhile you can write the model yourself or start from a model in the library.
Didn't find your topic? Tell us what it is and where to read about it. Suggestions are reviewed by the Kermack team (they are not published); accepted topics are added to the library with their models, sources and teaching material. Experts who help are credited.
Propose a model for this topic. The Kermack team checks every suggestion before it is listed in the library, with your name as the person who suggested it. A published model needs the DOI of its original publication; an illustrative model (written for teaching) needs none.
A topic page introduces the topic for teaching and research, next to its models. The Kermack team reviews every version before it is published; you are credited by name (and ORCID iD, if you give it) on the page, in the contributors list and in every teaching pack of the topic.
What did Kermack help you do? A sentence or two is perfect. With your permission, it is shown on the home page after a quick check, with your name and role as you give them.
A request from an author or a rights holder hides the model at once while the moderators check it.
Everything about this run in one document: the model with its source, the scenario, the agents and charts, R₀ and long-term behaviour, and the analyses you have done here (agents against the ODE, comparison of scenarios, parameter sensitivity, surveillance data, fit to data), the infection tree or contact network with related literature. Charts are taken as they are now.
Analyses you have not run yet are left out. The literature search runs automatically if you have not searched.
A handout of this lab for a class, a tutorial or self-study: each model with its source, equations and parameters, the plots as they are now, a summary, questions for discussion and an answer key. Every file carries the Kermack signature, a link that reopens this lab, and the citations.