Presets
Playback
Road and traffic
Demand above the bottleneck capacity makes a queue whose tail moves upstream.
Layers
Model checks
The science
Traffic as a compressible fluid
The Lighthill-Whitham-Richards model treats vehicles as a continuous density ρ(x,t) that is conserved: ∂ρ/∂t + ∂q/∂x = 0 with flow q = ρ v(ρ). The Greenshields relation v = vmax (1 − ρ/ρjam) gives a parabolic fundamental diagram with maximum flow qmax = vmax ρjam / 4 at half the jam density.
Shock waves in a queue
Where a bottleneck allows less flow than arrives, a queue forms. The boundary between free flow (ρ1, q1) and the jam (ρ2, q2) moves at the Rankine-Hugoniot speed w = (q2 − q1) / (ρ2 − ρ1). It is negative: the jam tail travels backwards against the traffic even though every car moves forwards. The blue line on the diagram is this shock and the fundamental-diagram graph shows the two states it separates.
The numerical method
The road is split into 128 cells and advanced by Godunov's finite-volume scheme, where the flux between two cells is the exact solution of the local Riemann problem: min(qL, qR) if ρL ≤ ρR, otherwise the maximum flow if the critical density lies between them. The bottleneck caps the flux across one cell boundary. Time steps obey the CFL condition and the scheme conserves vehicles exactly.
Honest simplifications: one lane group, identical drivers, an instant response to density (real traffic shows capacity drop, hysteresis and stop-and-go waves that first-order LWR cannot produce), and probe vehicles that simply follow the local speed.
What to try
- Choose Bottleneck jam: the blue line is the queue tail moving upstream at the predicted shock speed; compare the readout with the formula.
- Press Close the lane now and watch the jam grow while the lane is shut and dissolve afterwards from the front.
- Lower the demand until the bottleneck no longer causes a queue: the flow graph shows entering and leaving flow equal.
- Move the bottleneck with the position slider and see the jam start from there.