Pages

Sunday, July 17, 2022

Self-Jamming Cars

This week I wanted to try another Complex Systems-style simulation, this time based on something I had originally seen on Mythbusters, but others have tried with similar results: Traffic jams that appear out of nowhere simply due to drivers varying their speed. The system is fairly simple: Some number of cars drive on a circular track, trying to go as fast as possible while maintaining a safe stopping distance and obeying the speed limit. However, they may not all accelerate at the same speed, and can brake unexpectedly. These error factors result in some interesting effects, including waves of slow speed that travel backwards around the track.

To simplify things, I assumed the cars were either accelerating at maximum, or braking at maximum. They would decide based on the stopping distance from the car ahead of them:

where v is the car's velocity, and a_b is the braking acceleration. If the distance to the next car is less than this, we brake, otherwise we continue accelerating.

The controls you'll find below are the number of cars on the track, the maximum speed they'll go, the rate of acceleration, the rate of braking, the size of the variation in acceleration rate, and the rate at which that variation changes. This last factor is needed because if we change the acceleration error at every step, it tends to average out and have little effect. There's also a brake button that makes the red car slow while holding it down. As with many of these Complex Systems topics, I'm always surprised by the dynamics that emerge with just a few simple rules. Be sure to post a comment if you find something particularly weird!

Canvas not supported; please update your browser.

N Cars

Max Speed

Max Accel

Max Brake

Error Size

Error Rate

No comments:

Post a Comment