What is Miasma?
Miasma is an interactive spatial epidemic simulator. Instead of integrating ordinary differential equations on a well-mixed population, it runs a stochastic cellular automaton on a hex-tiled two-dimensional manifold whose topology you choose. Each cell holds an individual whose state evolves through an extended compartmental model — Susceptible, Exposed, Infectious, Recovered, Deceased, Vaccinated, with Maternal-immunity, Latent-carrier, Chronic-carrier, and Fatality flags, and Hospitalized/Quarantined status overlays. The result is a system where you can see how the same disease parameters produce dramatically different outbreaks depending on the geometry of the contact network.
Compartmental Models
The compartmental tradition begins with Kermack and McKendrick's 1927 paper, which partitioned a population into Susceptible, Infectious, and Removed and derived the threshold condition that the modern basic reproduction number R0 formalizes. The SIR core has since been extended in many directions — adding latency (E), demography (births, deaths), vaccination (V), maternal immunity (M), and waning. Miasma's SEIRDV core with M/L/C/F flags and H/Q status overlays is a synthesis of these extensions, made tractable by running each compartment as a discrete state on a finite lattice. Beyond canonical SEIR, recovered cells can be reinfected at a per-cell susceptibility multiplier and vaccinated cells admit breakthrough infections at a configurable efficacy. Both compose with the per-strain bloom-filter cross-immunity record so that reinfection and breakthrough favor novel antigens — the right shape for waning population-level immunity to a previously circulating strain.
Latent and Chronic Carriers
Two of the flag overlays correspond to disease classes the canonical SEIR model handles awkwardly. The latent flag (L) marks an exposed cell whose progression to infectious goes through a slow reactivation rate rather than the normal incubation period — a fraction of fresh exposures latch latent on contact, configurable per preset. Tuberculosis is the canonical case: the World Health Organization estimates roughly a quarter of the global population carries latent TB, with only a small per-capita per-year reactivation rate, producing a long-tailed epidemic that the standard E compartment cannot capture. The chronic-carrier flag (C) marks a recovered cell that still transmits at a reduced multiplier of the baseline transmission rate — the right shape for hantavirus-like reservoir dynamics where some recoveries do not clear the infection. Both flags are gated on per-preset seeding probabilities (l_seed and c_seed) so the underlying SEIR model is recoverable by setting them to zero.
Why Spatial Structure Matters
Well-mixed (mass-action) models assume every individual can contact every other with equal probability. Real contact networks have geometry. In Miasma, infection only crosses between cells that are neighbors on the lattice, so outbreaks propagate as traveling waves rather than synchronous global infections. Wave fronts have a characteristic speed; the effective reproduction number behind a front is lower than R0 because part of the neighborhood is already immune; final size is generally smaller than the mass-action prediction; and stochastic extinction at low densities becomes possible even when R0 exceeds 1.
Topology
The simulator lets you set the underlying surface. The plane has boundary — outbreaks die at edges. The cylinder wraps one axis; the torus wraps both and is boundary-free and orientable, giving the cleanest long-time dynamics. The Möbius strip and Klein bottle are non-orientable: a wave returning to its origin can arrive mirror-reflected, producing interference patterns and altered final sizes that no orientable surface can reproduce. The real projective plane (RP²) identifies antipodal points and is the most non-trivial of the six. Comparing the same disease across topologies isolates the contribution of geometry alone, with all other parameters held fixed.
Multi-Strain Dynamics
Beyond a single pathogen, Miasma supports multi-strain populations with antigenic mutation, partial cross-immunity, and competition for susceptibles. Strains can emerge spontaneously through per-transmission mutation, and the strain-view mode colors each cell by which lineage currently or most recently infected it, producing a phylogeographic readout of the outbreak.
The Z Compartment: Two Readings
The Z compartment is interpretation-agnostic. The same state machine reads as two different stories depending on which spawn pathway is active and where the encounter-outcome dials sit. Macroscopic: a zombie pandemic. Cells are people. Infectious corpses reanimate (the F flag is the bridge — only F-flagged deaths can convert to Z, at rate dz_dead per tick). When a zombie meets a human, a single bucketed roll resolves the outcome — clean kill (target → D), kill-with-infection (target → D + F-corpse), expose alive (target → E), or unopposed conversion (target → Z). A separate per-encounter roll handles whether the zombie itself dies in the fight (z_die_fighting), so mutual destruction is on the table. Zombies have a finite lifespan via z_die_natural — decomposition catches up. Microscopic: oncoviral cellular transformation. Cells are cells. The L flag carries the oncovirus latently in the host genome after S→E exposure, and at a small per-tick rate (l_transform) a latently-infected cell transforms into a malignant clone (→ Z). Transformed cells expand by contact-driven conversion (z_convert_unopposed dominates because cells don't fight back). Immune surveillance is represented by a small nonzero z_die_fighting — NK cells and cytotoxic T cells clearing transformed cells. Transformed cells are immortal (telomerase reactivation), so z_die_natural is zero; crowding-driven exhaustion stays on to capture necrotic-core formation in tumor masses where the interior loses access to oxygen. The two readings emerge from the same code with no toggles renamed and no special-case branches — the parameters are the whole story. Intermediate configurations produce intermediate readings, which is often the most pedagogically interesting region.
Calibrated Presets
Ten named configurations cover the textbook curriculum and a few exotic cases: SEIR-vanilla (pure Kermack–McKendrick on a torus), COVID-like (moderate β, longer infectious period, hospital pressure), Ebola (lower β, high mortality, infectious corpses), Tuberculosis (long latency with reactivation), Andes hantavirus (rodent-reservoir-primary with rare human-to-human spread), Smallpox (high β with severe mortality), Plague with rats (bidirectional spillover and infectious corpses), Zombie apocalypse (F-corpse reanimation, humans fighting back with finite-lifespan zombies — the macroscopic Z reading), Oncoviral transformation (latent integration → malignant clones with immune surveillance and tumor-core necrosis — the microscopic Z reading), and Absurd mode (every toggle on, including zombies, on a Klein bottle). Each preset sets the transmission parameters, compartment toggles, and topology; from there you can paint interventions or tweak any slider live.
View Modes
Six heatmap projections of the same underlying state: compartment (canonical SEIRDV coloring), strain (cell colored by dominant active lineage), age (green when young, near-black when saturated), health (per-cell health ramp from red to green), status (faded background highlighting hospitalized and quarantined cells), and susceptibility (red where a cell has no prior exposure, green where the bloom-filter immunity record is saturated). Switching modes mid-run is non-destructive — the dynamics keep running on the same state.
Interventions
The intervention brushes let you paint five modes onto the manifold: seed (place strain α infections), vaccinate (S/E/R/M → V), quarantine (status overlay reducing transmission both ways), sanitize (clear infections and corpses), and cull (force-kill cells, including the zombie compartment). Brush radius scales 1/7/19 hexes, and every stroke goes onto an undo stack until the simulation advances; once time moves, undo is cleared so paint history never rewinds evolved disease state. The geometry of intervention matters: contiguous immune blocks at the herd-immunity threshold suppress outbreaks more reliably than the same fraction scattered randomly, because contiguous immunity blocks percolation paths. The simulator exposes this geometric dependence directly.
Learning Outcomes
After using Miasma, students should be able to: define compartments and transitions in an SEIRDV-class model and connect them to per-tick transition probabilities; derive the basic reproduction number R0 and the herd-immunity threshold 1 − 1/R0; distinguish deterministic mass-action dynamics from stochastic spatial dynamics and predict where the two diverge; explain how lattice topology — boundary, orientability, antipodal identification — alters wave propagation and final size; describe multi-strain competition under partial cross-immunity; and evaluate the geometric efficacy of different vaccination patterns at the same coverage.
Prerequisites
Basic probability (rates, expected values, Poisson processes) and elementary linear algebra. Familiarity with differential equations is helpful for connecting the discrete-time spatial model to the continuous SIR ODEs but is not required — the simulator introduces both views.
References
W. O. Kermack and A. G. McKendrick, "A contribution to the mathematical theory of epidemics", Proc. R. Soc. A (1927). H. W. Hethcote, "The Mathematics of Infectious Diseases", SIAM Review 42(4):599–653 (2000). M. J. Keeling and K. T. D. Eames, "Networks and epidemic models", J. R. Soc. Interface 2(4):295–307 (2005). R. M. Anderson and R. M. May, Infectious Diseases of Humans: Dynamics and Control (Oxford University Press, 1991).
Accessibility
Miasma supports full keyboard navigation across the toolbar, sidebar tabs, topology and view-mode selectors. The theme toggle provides a high-contrast variant. All toolbar buttons carry ARIA labels and the canvas exposes its purpose via aria-label. Compartment counts, status counts, animal census, and observed Re are also reported as text in the sidebar dashboard for screen readers. Known hazards: continuous color changes on the lattice during outbreaks; rapid color shifts when running at high speed. Users sensitive to motion or flashing can lower the speed, step the simulation tick by tick, or switch to the compartment view mode which uses more muted colors than the strain view.
See also: Geon for particle physics, Cyano for cellular biochemistry, Gerry for electoral fairness, Shoals for options trading, Scripture for the comparative-religion corpus.