SimulationLab ladder

SimulationLab: ten rungs from a grid to a digital twin

Ten modelling & simulation projects built as a ladder: - Each level jumps to a new field and keeps every tool from the level below, then adds more. - The first is a forest fire on a NumPy grid. The last is a 3D twin of Georgia Tech driven by real bus GPS, real buildings, a real solar year and 17,579 real crystal structures. - Every level verifies itself against theory or published data, and every README ends with the industry tools that do the same job at scale.

Browse it: double-click index.html. Every rung opens its level's README.html, which contains: - the full write-up, with rendered math - every figure, plus playable videos and GIFs - the complete source code, syntax-highlighted

Levels 9 and 10 also launch their interactive 3D apps. After editing a README or re-running a level, rebuild the pages with uv run python build_site.py.

ladder

The ladder

# Level Field M&S paradigm New tools (stack is cumulative) Headline result (verified)
1 Wildfire Percolation Statistical physics · ecology Cellular automata, Monte Carlo, phase transitions NumPy, Matplotlib p_c = 0.5936 ± 0.0007 vs 0.5927; ν = 1.34 vs 4/3; Drossel–Schwabl density 0.3978 vs 0.3976
2 Noise in Gene Circuits Systems biology ODE vs exact stochastic simulation SciPy (solve_ivp, FFT), Gillespie SSA SSA matches the exact master equation (TV distance 0.007); switch time grows as e^{0.53 Ω}
3 ATL Checkpoint Operations research Discrete-event simulation, output analysis, sim-optimisation SimPy, scipy.stats Erlang-C Wq 0.4789 vs sim 0.4793 ± 0.033 min; 141 lane-hours vs 148 for SIPP staffing
4 Echo Chambers Computational social science Agent-based modelling on adaptive networks Mesa 3, NetworkX, parallel batch_run Deffuant clusters ≈ ⌊1/2ε⌋; with a recommender (r ≥ 0.2), camps become sealed network components 100% of the time
5 Galactic Collision Astrophysics N-body, symplectic integration, HPC Numba JIT/prange, ffmpeg MP4 Kepler period error 0.025%; 1,558× over pure Python (7.6e9 interactions/s)
6 Virtual Wind Tunnel Fluid dynamics Lattice Boltzmann CFD, verification & validation Numba stencils, scipy.fft, V&V Observed order 2.000 (Poiseuille); Schäfer–Turek St 0.3014 in [0.295, 0.305]; cylinder St 0.1651 vs Williamson 0.164
7 Earth's Thermostat Climate science Bayesian calibration, UQ, global sensitivity pandas, live APIs, emcee, SALib TCR 1.60 [1.42, 1.80] K, inside AR6; ECS 2.17 K, low for a known reason (pattern effect); 93% of observations inside the 90% band
8 Generative Bracket Structural engineering FEM + 3D topology optimisation scikit-fem, pyamg, PyVista/VTK, STL GE-challenge bracket, 4 load cases incl. torsion, hits 8.00% volume; FEM within 1% of Euler–Bernoulli; watertight 351 g Ti STL
9 Orbital Traffic Control Astrodynamics Real-catalogue propagation, conjunction screening, debris Monte Carlo sgp4, KD-trees, Three.js, satellite.js 18,677 objects screened over 24 h; python-sgp4 and satellite.js agree to 0.25 m
10 Solar Stinger twin Energy × mobility × materials Real-data multi-physics digital twin pvlib, OSM/Overpass, Materials Project, NREL HTEM One roof (CRC) covers the 841 MWh/yr electric fleet, but overnight charging gets 0% solar without storage

How the stack grows

L01  NumPy · Matplotlib
L02  + SciPy (ODE solvers, root finding, FFT)                     stochastic vs deterministic
L03  + SimPy · scipy.stats                                        events, queues, confidence intervals
L04  + Mesa · NetworkX · multiprocessing sweeps                   agents, networks, emergence
L05  + Numba (JIT, parallel) · ffmpeg                             performance engineering
L06  + stencil kernels · spectral analysis · V&V discipline       PDEs / CFD
L07  + pandas · live APIs · emcee · SALib                         real data, Bayesian UQ
L08  + scikit-fem · sparse solvers + AMG · PyVista/VTK · STL      FEM, optimisation, 3D sci-vis
L09  + sgp4 · spatial indexing · Three.js/WebGL · satellite.js    real-time interactive 3D
L10  + pvlib · GIS (OSM) · pymatgen/Materials Project · HTEM      everything, coupled: a digital twin

Run anything

# once, from this folder (Python 3.12 via uv; everything is in pyproject.toml)
uv sync
# any level
uv run python L01_wildfire_percolation/sim.py
# L10 needs its data first (see its README): fetch.py, extract_materials.py, then twin.py

Each full run takes roughly 3–6 min on this laptop (Ryzen 7840U, no CUDA) when the CPU is idle. Outputs land in each level's output/.

How to use this as a learning resource

  1. Read L01–L04 in order. They are the four classic M&S worldviews: cellular automata, differential equations, discrete events and agents. Most GT M&S coursework lives here.
  2. L05–L08 are "make it real and fast": compiled numerics, PDEs, real data with uncertainty, and FEM. Each README has a Go further section that says how to rebuild the level in the industry tool (NetLogo, Arena/AnyLogic, OpenFOAM, Ansys, FaIR…).
  3. L09–L10 are systems. Real data pipelines, several models coupled, and a UI people can use. L10 reuses code patterns from L03 (SimPy), L05 (Numba) and L09 (Three.js) on purpose.
  4. Every level's verification section is the part worth copying. A simulation you haven't checked against something known is a screensaver.

Files