Live status · Read the latest
monad-knowledge Wi-Fi sensing lab · FIIT STU
CRD503 active 2 / 12 weeks

Crowd Dynamics & Pedestrian Simulation

A twelve-week track on how crowds move, how to model that movement at three scales, and how to measure it. Every model in the course is written by the students in a few dozen lines of numpy, shown live on the projector as a widget they can push until it fails, and then tested against published measurements. The throughline: a crowd model is a hypothesis about people, and a hypothesis is only as good as the measurement that could refute it.

The course is self-contained. Each lecture introduces its scenario on its own terms (a corridor, a doorway, a library reading room, one transmitter and one receiver) and needs no knowledge of any particular laboratory, dataset or software installation. Production simulators such as JuPedSim and Vadere appear as optional tools for the capstone, never as a prerequisite.

The 12-week arc

2 of 12 lectures published — each a self-contained read with a slide deck and runnable workbook. Start at the first published week and work forward.

Wk Theme & focus Read
01 Why model crowds start here Safety, facility design and ground truth for sensing: what a crowd model is for, and the vocabulary of density, speed and flow. Widgets (rebuilt 2026-09-29): `SwissCheese`, `DensityBox` (people N 1–60, floor area A 4–40 m²; discs in a box; ρ = N/A and mean spacing 1/√ρ; break it: push ρ past the packing bound and the discs no longer fit), `LocalDensityProbe`, `DensitySpeedFlow`, `CrowdPressure`, `ExitSizer`, `LabelsFromSimulation`. read → slides · workbook
02 The fundamental diagram One walking rule, V(s) = min(v0, (s − ℓ)/T), gives the speed–density law, the flow curve and a capacity peak. Widgets (rebuilt 2026-09-29): `HeadwayClock`, `OvRule`, `OptimalVelocityFD` (body length ℓ 0.30–0.50 m, time gap T 0.3–1.5 s, desired speed v0 0.8–1.8 m/s; OV function, speed–density and flow–density panels with the Weidmann curve overlaid; readout J* = v0/(ℓ + v0·T); break it: T → 0 and the predicted flow exceeds any measured door), `SingleFileRing`, `SpacingSpeedFit`, `TimeGapFan`, `WeidmannArea`. read → slides · workbook
03 Microscopic models I: social force Walkers as particles: a driving term that relaxes velocity to the desired one over τ, exponential repulsion from neighbours and walls, and the self-organised patterns it buys. Widgets: `SocialForceCorridor` (periodic 10 × 3 m corridor, walkers per direction 5–40, strength A 0.5–5 m/s², range B 0.1–0.6 m, relaxation τ 0.2–1.0 s, noise 0–1 m/s², time step dt 0.01–0.2 s; live counterflow with a lane-order parameter φ readout; break it: large dt with short B lets bodies tunnel and overlap, strong noise dissolves the lanes); `ForceProbe` (drag one walker, see each force arrow and the summed acceleration in KaTeX). planned
04 Microscopic models II: velocity-based and cellular The collision-free speed model sets speed from the headway and direction from repulsion, so bodies never overlap; the floor-field cellular automaton moves walkers between 0.4 m cells by a static and a dynamic field. Widgets: `CfsmVsForce` (the Week 3 corridor, same seed, both models side by side; overlap count and mean speed readouts; toggle per-walker v0 draws; break it: one v0 for everyone in a symmetric doorway and the crowd locks); `FloorFieldCA` (25 × 25 grid, static sensitivity kS 0–10, dynamic kD 0–5, exit width 1–4 cells; transition probability formula; egress-time readout; break it: kS = 0 is a random walk, very large kS jams the corners). planned
05 Macroscopic models: crowds as a fluid Conservation of pedestrians, ∂ρ/∂t + ∂(ρ·u(ρ))/∂x = 0, with the Week 2 flux: characteristics, a shock at a sudden stop, a rarefaction at a release; Hughes' potential as the travel time to an exit from an eikonal equation. Widgets: `LwrCorridor` (50 m corridor, upstream and downstream density 0–5 ped/m², flux Greenshields or Weidmann, Godunov scheme; shock speed from the jump condition as readout; break it: violate the CFL condition and the solution oscillates and blows up); `EikonalExit` (room with two exits and a pillar, speed field from density, fast-marching travel-time map with route arrows). planned
06 Measuring a crowd: the method trap Density as N in an area versus Voronoi cells assigned to each walker; flow through a line; speed; why area size and method change the reported diagram. Widgets: `MeasurementArea` (one seeded snapshot of 40 walkers, square area side 0.5–5 m, method classic or Voronoi with a 0.5 m cell cut-off; density time series; break it: an area smaller than one body makes classic density jump between 0 and 1/A); `FlowLine` (line position, window Δt 1–30 s; J = N/(Δt·b) against ρ·v·b). planned
07 Geometry is half the model: building a scenario Walkable area, doors, waypoints and journeys, agent radius and clearance; a floor plan is not yet a scenario. Widgets: `DoorwayGauge` (door width 0.30–1.50 m, agent radius 0.10–0.25 m, clearance 0–0.10 m; two discs in the gap; passable iff w > 2(r + c); break it: shrink the radius to make a jam vanish, the geometry cheat); `WalkableShrink` (a room outline with furniture, walkable polygon eroded by r, slits narrower than a body highlighted, reachability of each seat). planned
08 Bottlenecks, clogging and faster-is-slower Door capacity and specific flow, the capacity drop, arching at an exit, and why pushing harder can empty a room more slowly. Widgets: `BottleneckRoom` (social-force room of 60 walkers, exit width 0.6–2.4 m, desired speed 0.8–5 m/s, body friction off or on; outflow staircase N(t) and the survival curve of time gaps between exits; break it: narrow door, friction on, raise v0 and the egress time grows); `CapacityChart` (width against flow with the published 2–3.5 persons/(s·m) band). planned
09 Evacuation and exit choice Egress time as a curve with a linear part set by capacity and a tail set by slow walkers; exit choice by distance, by queue, by following others. Widgets: `ExitChoice` (two exits with widths and distances, logit weights on distance and queue length, herding fraction 0–1; exit-use imbalance and total egress time readouts; break it: everyone takes the nearest exit); `EgressCurve` (N(t) with the capacity slope and tail annotated, pre-movement time distribution). planned
10 A day, not a minute: agendas and occupancy Walkers with purposes: activity legs, dwell times, seat claims, state machines with guards (room full, time after, visited), arrival windows; the occupancy time series a building produces. Widget: `AgendaDay` (one to four personas with arrival window, dwell and exit rule; room-capacity guard on or off; occupancy trace per room and the variance of the count; break it: fill the room at t = 0 and hold it, the count never varies and so carries nothing a sensor could learn). planned
11 Crowds meet sensors: simulation as labelled ground truth Simulated trajectories label a radio signal. One transmitter, one receiver, four walls in a 4 × 3 m room: direct path, one image per wall, one scatter path per body, shading when a path passes a body. The spread of the received level grows with walkers, but more slowly than their number, and still people are invisible to a spread feature. Data assimilation feeds a noisy count sensor back into an agent model. Widgets: `PeopleOnTheLink` (walkers 0–8, walking speed 0.2–1.6 m/s, window 1–60 s, body pass factor 0.1–0.7, SNR 10–40 dB, carrier 2.4 or 5 GHz; room with paths, level trace, spread-against-N plot with a power-law fit; break it: freeze the walkers and the spread falls to zero at any count); `CountFilter` (particle filter over the room count from a noisy detector, particles 50–2000; break it: too few particles and the estimate collapses). planned
12 Validation, calibration and capstone Calibration as optimisation against reference data; why one metric is not validation; parameters that trade off (ℓ and T on the congested branch); reporting divergence with intervals over seeds. Widget: `CalibrationLandscape` (reference speed–density points from the literature, loss heat map over two chosen parameters, metric speed, flow or both; best-fit readout; break it: fit speed only and watch flow miss). Capstone review. planned

Capstone

Week 12: pick one space (a corridor, a room with two exits, or a reading room with an agenda of arrivals and departures). Build the walkable scenario, simulate it with one model from Weeks 3–5 written in numpy (JuPedSim or Vadere may be used alongside), measure it with both density methods, calibrate at least two parameters against a published reference with two metrics, and attach the Week 11 sensor model to the trajectories. Report, with intervals over at least ten seeds, where the simulation and the reference agree, where they diverge, and what a sensor on that space could and could not recover. Deliverables: an executed workbook, one widget of your own that follows the materials contract, and a two-page report.