PatchSim documentation#

PatchSim#

PatchSim is a modular metapopulation simulation framework for compartmental epidemiology. It supports single-patch and multi-patch models, YAML-based configuration, and ODE-based simulation with network-coupled transmission.

What PatchSim provides#

  • Compartment models: SIR, SEIR, SIRS, SIS, and custom variants

  • Multi-patch networks: Weighted directed patch-to-patch transmission

  • YAML configuration: Model structure, parameters, seed data, and network inputs

  • CLI workflows: Scaffold, validate, run, inspect models, and export summaries

  • Results outputs: CSV time series, plots, and logs

Start here#

If you are new to the project, follow the docs in this order:

  1. Getting Started — install, initialize, validate, and run

  2. Configuration — every YAML field and a worked SEIR example

  3. CLI Reference — command and flag reference

  4. Mathematical Model — equations and the rate rule

  5. Network Design — how multi-patch mixing works

  6. Results — how to interpret CSVs, plots, and logs

Core concepts#

Compartments#

Compartments represent model states such as S, E, I, and R.

Parameters#

Parameters are per-capita rates like beta, sigma, gamma, and rho.

Transitions#

Transitions define movement between compartments using YAML expressions. See Mathematical Model for the rate multiplication rule.

Network structure#

Patch-to-patch transmission is represented by a weighted directed network. See Network Design for the expected CSV format.

Common workflows#

Output overview#

PatchSim writes results to the configured OutputDir:

  • runs/ — time series CSV output

  • plots/ — visualization images

  • logs/ — run logs with configuration and solver details

Documentation map#