Phantom Traffic JamBeta
See how one car's brake tap turns into a backward-moving phantom jam
This tool is a beta version still being stabilized. Please let us know if a result looks off.
45 cars in smooth flow. Tap a car to make it brake hard and watch the jam wave spread backward.
- Car
- Truck
- Bus
- Self-driving
Every car follows the Intelligent Driver Model (IDM), reacting only to the gap and speed difference to the vehicle ahead. Trucks and buses are long and accelerate slowly, and every driver wants a slightly different speed and gap. Tap the road and the nearest car brakes hard for a few seconds; brake lights ripple back as each follower brakes a little harder and a jam forms. That jam drifts backward while the cars move forward (the red bands in the space-time diagram).
Working…
0.0
It hasn't frozen — the result will appear when the calculation finishes.
About Phantom Traffic Jam
This tool solves the Intelligent Driver Model (IDM; Treiber, Hennecke and Helbing, 2000) for every vehicle on a single-lane ring road. Each driver looks only at the gap s to the car ahead, their own speed v and the speed difference Δv, and picks an acceleration. There is no overtaking, and because the road loops back on itself the number of cars never changes. The point is to watch a jam appear although nobody intends one, and to see it travel in the opposite direction to the cars.
The space-time diagram underneath puts position along the road across and the past downwards. Red bands mark slow cars, and the direction a band leans tells you which way the jam is moving.
The IDM formula and the numbers on screen
Acceleration is a·[1 − (v/v0)⁴ − (s*/s)²]. The first term is the urge to reach the desired speed v0 on an empty road; the second brakes when the gap is smaller than the desired gap s*. That desired gap is s* = s0 + v·T + v·Δv/(2√(ab)), with minimum standstill gap s0 (2 m by default, 1 m in the Sugiyama scenario), time headway T and comfortable deceleration b (1.5 m/s² by default); s0 and b have their own sliders. Closing in fast on the car ahead (Δv > 0) enlarges s*, so the driver slows early.
The default scenario has 45 cars, each 4.5 m long, on a 1,000 m ring. The free space between cars is (1,000 − 45 × 4.5) ÷ 45 ≈ 17.7 m. Even with a desired speed of 110 km/h, solving for the speed at which acceleration is zero at a 17.7 m gap gives only about 40 km/h. Every car starts exactly at that speed, which is why nothing happens until you intervene.
Experiment 1: a single hard brake that never goes away
Tap a car in the default scenario. It brakes at 7 m/s² for 2.5 seconds. Each follower brakes slightly harder than the car in front, the brake lights ripple backwards, and a knot of nearly stationary cars forms. The knot survives long after the braking car is back to cruising, and keeps circulating. Running the same setup offline, after several hundred seconds the slowest car is still below 10 km/h while the fastest swings up to around 65 km/h: steady 40 km/h traffic has turned into stop-and-go.
Now cut the count to 30 cars and brake again. The gap widens to 28.8 m, the equilibrium speed rises to about 64 km/h, and the ripple dies out within a few minutes. Push it to 80 cars instead and the 15 km/h equilibrium breaks into traffic that alternates between standstill and 30 km/h. Same drivers, same rules; density decides whether a disturbance grows or fades.
Experiment 2: how acceleration and headway absorb waves
Back at 45 cars, raise acceleration from 1 to 2 m/s² and brake a car again. A jam forms briefly, then dissolves. When the car ahead pulls away, the follower catches up quickly, so each car passes a little less deceleration back than it received. A longer headway T has a similar calming effect, but on the same road with the same number of cars it also lowers the equilibrium speed.
In the space-time diagram, if a red band leans against the direction the cars travel, the jam is moving backwards. Stop-and-go waves measured on real motorways do the same.
Experiment 3: the Sugiyama experiment
In 2008 Sugiyama and colleagues spaced 22 cars evenly around a 230 m circular track and asked the drivers to cruise at 30 km/h while keeping a safe distance. There was no bottleneck and no incident, yet small speed fluctuations grew into a jam cluster, and the cluster moved backwards at about 20 km/h.
The “Sugiyama” scenario uses 230 m, 22 cars and some driving noise (random acceleration jitter). Without touching anything, cars bunch up within two to three minutes. The free gap is only 5.95 m, so with the default 2 m standstill gap the equilibrium speed would be barely 13 km/h. This scenario therefore uses a 1 m standstill gap, 0.6 s of headway and 0.4 m/s² acceleration, so traffic starts evenly at about 30 km/h as in the experiment. The cruising speed matches; how long the jam takes to form and how fast it travels are not calibrated.
What to look for in the other scenarios
- Roadworks bottleneck: a 200 m stretch limited to 50 km/h. Drivers start slowing 60 m before it, so the jam's tail grows back from the entrance.
- Hill (sag): top speed is unchanged but acceleration drops to 35%. With trucks in the mix, the jam starts at the foot of the climb.
- Traffic light: on red, the stop line acts as a stationary obstacle; a car too close to stop safely drives through.
- 25% autonomous: these cars have no noise and 1.6× acceleration. They are not a model of any real automated controller. In the field experiment by Stern et al. (2018), a single controlled vehicle among more than 20 on a ring track was enough to dampen stop-and-go waves.
What this model simplifies
There is one lane, no overtaking and no lane changes. Drivers have no reaction delay, which makes the IDM somewhat more stable than real traffic; noise stands in for human imprecision. The textbook Nagel–Schreckenberg model (1992) splits the road into cells and slows cars at random; this tool instead uses continuous positions and speeds.
Worked examples
Equilibrium speed of the default scenario
- Input
1,000 m, 45 cars, v0 110 km/h, T 1.4 s- Output
Gap 17.7 m, about 40 km/h, flow about 1,800 vehicles/hour
Solve 1 − (v/v0)⁴ − ((2 + 1.4v)/17.7)² = 0 for v ≈ 11.1 m/s. Flow = 40 km/h × 45 vehicles/km.
Flow versus density
- Input
Same settings, 30, 45 and 80 cars- Output
About 1,935, 1,800 and 1,235 vehicles/hour
Equilibrium speeds 64.5, 40.0 and 15.4 km/h. Flow peaks near 31 cars per km.
Gap in the Sugiyama scenario
- Input
230 m, 22 cars- Output
5.95 m, equilibrium about 30 km/h
(230 − 22 × 4.5) ÷ 22 = 5.95 m. With the scenario settings (s0 1 m, T 0.6 s, v0 80 km/h), solving 1 − (v/v0)⁴ − ((1 + 0.6v)/5.95)² = 0 gives v ≈ 8.2 m/s ≈ 29.4 km/h. With s0 2 m and T 1.1 s it would be about 13 km/h.
How to use it
- Choose a scenario: road shape, length, number of cars and driver mix change together.
- Tap the road to make the nearest car brake hard for 2.5 seconds.
- Adjust cars, desired speed, headway, acceleration, comfortable braking b, minimum gap s0 and noise, and watch the space-time diagram.
Frequently asked questions
Why does traffic stop when there is no accident ahead?
In a certain density range, a small slowdown by one car grows as it passes back through the followers. Eventually someone stops, and cars arrive at the back of the queue faster than they leave the front, so the jam persists even after its cause has gone.
Why does the jam move backwards?
Cars leave the front of the jam and new ones join at the back. The jam is a place where cars are stopped, not a group of particular cars, so it shifts against the flow. In the Sugiyama experiment it moved back at about 20 km/h.
Does leaving a bigger gap help?
In this model, smoother acceleration and braking and more relaxed reactions to the car ahead reduce waves. On a fixed road with a fixed number of cars, however, a longer headway also lowers the equilibrium speed.
How is this different from the Nagel–Schreckenberg model?
Nagel–Schreckenberg divides the road into cells and applies four rules each step: accelerate, slow to avoid the car ahead, randomly slow down, move. The random slowdown produces spontaneous jams. This tool gets a similar effect from the continuous IDM plus noise.
Related guides
Sources
- M. Treiber, A. Hennecke, D. Helbing, Congested traffic states in empirical observations and microscopic simulations, Phys. Rev. E 62, 1805 (2000)
- Y. Sugiyama et al., Traffic jams without bottlenecks — experimental evidence for the physical mechanism of the formation of a jam, New J. Phys. 10, 033001 (2008)
- R. E. Stern et al., Dissipation of stop-and-go waves via control of autonomous vehicles: Field experiments, Transportation Research Part C 89, 205–221 (2018)
- K. Nagel, M. Schreckenberg, A cellular automaton model for freeway traffic, J. Phys. I France 2, 2221 (1992)
Last reviewed: