HomeAlgorithms & AICar-Following Model: Traffic Shockwaves (Time-Space Diagram)

Car-Following Model: Traffic Shockwaves (Time-Space Diagram)

Interactive Intelligent Driver Model (IDM) car-following simulation: individual vehicles negotiate a bottleneck one by one, and the emergent stop-and-go shockwave is read straight off a live scrolling time-space (trajectory) diagram — the classic traffic-engineering plot, with measured Rankine-Hugoniot shock speed, throughput and queue length.

Algorithms & AI2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-traffic-flow-shockwave-formation ↗ Open standalone

Rather than solving one macroscopic density equation, this simulation gives every vehicle its own equation of motion: the Intelligent Driver Model, a car-following ODE that reacts only to the gap and closing speed to the car directly ahead. A lane-closure bottleneck lowers each driver's own desired speed inside its zone, and pushing upstream demand past what that zone can sustain makes cars queue up behind it — a shockwave that emerges purely from local, per-vehicle rules, with no notion of "density" built in anywhere. Watch it appear live on a scrolling time-space (trajectory) diagram, the same x-position-vs-time plot traffic engineers use to read shockwaves off real detector data, with measured throughput, queue length and Rankine-Hugoniot shock speed updating in real time.

⚙ Under the hood

Interactive Intelligent Driver Model (IDM) car-following simulation: every vehicle is its own equation of motion reacting only to the gap and closing speed ahead, and the emergent stop-and-go shockwave from a lane-closure bottleneck is read straight off a live scrolling time-space (trajectory) diagram, with measured Rankine-Hugoniot shock speed, throughput and queue length updating live.

intelligent driver modelcar-following modeltraffic flowshockwavealgorithmstime-space diagrammicroscopic traffic simulationfundamental diagram

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)