Traffic Wave Simulator - 3D Ring Road

Follow-the-leader traffic on a ring road: stop-and-go waves appear with no accident. Blender-built vehicles and road kit, Three.js r160.

Presets

Playback

Tip: click any car in the 3D view to make it brake.

Opening conditions

Traffic

Simulation

Camera

Layers

Quality

Model check

The science

The model: Intelligent Driver Model (IDM)

Each driver accelerates freely towards a desired speed v0 and brakes when the gap s to the car ahead gets smaller than the gap they want to keep:

dv/dt = A [ 1 - (v/v0)^4 - (s*/s)^2 ], with s* = s0 + v T + v Δv / (2 sqrt(A B))

Here A is the maximum acceleration, B the comfortable braking, T the desired time headway, s0 the minimum bumper gap and Δv the closing speed. The integration uses a 0.05 s time step (trapezoidal position update). Driver noise adds a small random acceleration, as in the Sugiyama et al. ring-road experiment.

Steady state and the fundamental diagram

Equal gaps and equal speeds are a solution when acceleration is zero: s_e(v) = (s0 + v T) / sqrt(1 - (v/v0)^4). Inverting it gives the equilibrium speed for a given density and the flow q_e = rho v_e(1/rho - l) (car length l = 4.5 m), the green curve in the last graph.

Why a jam appears out of nothing

Perturb car n by a small amount and linearise: y_n'' = f_s (y_(n-1) - y_n) + f_v y_n' + f_Δv (y_n' - y_(n-1)'). For the ring, perturbations are Fourier modes exp(i k θ n + λ t), θ = 2π/N, giving λ² - [f_v + f_Δv (1 - e^(-iθ))] λ - f_s (e^(-iθ) - 1) = 0. If the largest Re λ over all modes is positive, the uniform flow is unstable: a tiny disturbance grows exponentially (red band in the flow graph) until it saturates as a stop-and-go wave. Below that density the same disturbance fades away.

Reading the plots

  • Space-time diagram: time runs right, position along the ring up, colour is speed. A jam is a red band slanting downwards: it travels backwards against the traffic at roughly 10-20 km/h. The dashed white line is the measured wave speed.
  • Speed vs gap: free cars sit on the green steady-state curve; jam cars crowd at tiny gaps and low speed.
  • Flow vs density: the white or red dot is the actual flow; a jam drives it well below the green capacity curve (capacity drop).

Honest simplifications

One lane, identical cars and drivers, no overtaking, no reaction delay, no lane changes. The ring is drawn at its real size (circumference L) so it is small compared to a motorway; the wave speed (about -12 km/h here) is typical of IDM, real motorway jams move at about -15 to -20 km/h. Vehicle meshes are a scaled generic kit, not any manufacturer's design.

What to try

  • Press Phantom jam (default) and watch: no accident, no bottleneck, yet a jam forms within about 5 simulated minutes.
  • Choose Stable: a brake tap fades away, then click a car (or press Tap the brakes): the wave appears and dies out.
  • Slide Time headway T up to 2 s: the unstable band shrinks and eventually disappears. Longer headways make traffic smoother.
  • Set driver noise to 0 in the default preset: the jam still forms, just later, because the instability is a property of the dynamics, not of the noise.
Loading model...
Loading Blender model...
Space-time diagram (colour = speed)
Speed vs gap, every car
Speed history
Flow vs density (unstable band)
Made with 🟠 Blender · Three.js