Every car follows the Optimal Velocity Model (Bando et al., 1995) on a closed loop of length L = 320 m. Each driver targets a speed that depends only on the gap to the car ahead:
V(gap) = Vmax · [tanh(gap/b − 2) + tanh 2] / (1 + tanh 2), a smooth curve that saturates at Vmax for a large gap and drops to 0 as the gap closes (b = 12 m gap scale).
- Acceleration relaxes toward that target:
dv/dt = α · (V(gap) − v), where α is the driver-adaptivity slider (1/s) — a quick, attentive driver (high α) tracks the optimal speed almost instantly; a sluggish one overshoots and brakes late.
- At low adaptivity and high density, this feedback loop is unstable: a small slowdown forces the follower to brake harder, which forces the next follower to brake harder still — a self-amplifying stop-and-go wave that travels backward through the traffic even though every car is trying to speed back up. This is the same "phantom jam" mechanism documented in real ring-road experiments (Sugiyama et al., 2008).
- Brake test hits one random car's speed to zero — a single hard brake — so you can watch whether the resulting wave damps out (stable regime) or grows into a standing jam (unstable regime) under the current density/adaptivity combination.
The companion 3D traffic flow simulation renders cars gliding around a similar loop; this 2D top-down view exposes the actual car-following equations driving that motion and lets you push the system into instability on purpose.