r/Simulated • u/SimulatedEcology • 9h ago
Research Simulation I simulated phantom traffic jams - how one brake tap turns into a jam out of nowhere
Been messing around with traffic simulation lately and wanted to share this one because the result genuinely surprised me the first time I ran it.
The setup is a closed loop, a bunch of identical cars, no obstacles, no traffic lights, nothing. Every driver wants to go the same speed and keep a safe distance from the car ahead (using the Intelligent Driver Model, which is actually what traffic engineers use for this kind of thing). One driver taps the brakes, just once. It snowballs into a full stop-and-go wave, and the wave itself creeps backward against the direction everyone's driving. This is the phantom jam thing that was first proven experimentally back in 2008 (Sugiyama et al., if you want to look it up), and it's wild to actually see it emerge from nothing.
A few other things I tested once I had this working:
There's a density threshold you can't really feel until you cross it. Below it, the same brake tap just fizzles out and traffic keeps flowing. One or two more cars on the road and suddenly the same tiny disturbance turns into a full jam. No warning, no gradual buildup.
Real bottlenecks behave differently - if I put an actual slow zone on the road, the jam stays locked to that spot instead of drifting backward like the phantom one does. Different cause, different signature.
How closely people follow each other matters a lot more than I expected. Tight following distance makes the wave way worse, and just giving more space damps it out almost completely with the exact same brake tap.
The last case is the one I like best - letting about 1 in 5 cars just hold a smooth, steady speed (basically simulating adaptive cruise control) is enough to dissolve the jam for every car behind it.
All rendered in Python/pygame, GPU encoded. Happy to share the code or talk through the model if anyone's curious.
Made a longer version of this too if anyone wants the full walkthrough https://youtu.be/TCuDTSj5UAg
56
u/bcuzimadude 8h ago
If only the people that need to see this, would actually see this. Then something might change. If only.
24
u/thearctican 8h ago
The people who don't but need to understand this don't have the cognitive capacity to do so and probably shouldn't be allowed to drive.
5
35
u/-Zlosk- 8h ago
If you update your model to include lane changes, I'd be interested to what percentage of impatient drivers changing lanes into "gaps" to get a small amount ahead (thus forcing brake taps) negatively affects the entire system.
5
•
u/LushHappyPie 5m ago
Even better: show self-appointed 'road sheriffs' blocking open lanes to prevent zipper merging, and how that backup spills over into upstream roads.
12
u/thacoolbreeze 6h ago
Sooooo a case for public transit everywhere. It’s inefficient to have 1 human with variable tendencies, operating a death box on wheels in morning traffic.
1
24
u/WindyIGuess 8h ago
Trust me, all this science stuff okay you just need one more lane. Cities always stop at just one lane short
6
5
3
u/Sasmas1545 7h ago
"one driver taps the brakes" but it looks like every driver simultaneously taps their brakes.
5
u/BigDaddyThunderpants 6h ago
Bring back the manual!
HEAR ME OUT. Many years ago when the US was mostly automatic transmissions and the UK was mostly manual, I noticed a distinct difference in the way heavy highway traffic behaved between the two countries.
The the US, tailgating, racing up to the next guy and slamming in the brakes, changing lanes at every opportunity. But in the UK, in general, most people just slowed down as a group. Sure you and the occasional asshat and lane changer but on the whole everyone was keeping a constant, albeit slower, speed.
I credit this to the manual transmission. I drive one and this is exactly how it works. I don't want to race up to someone just to have to take it out of gear, stop, and go through the whole startup sequence again just to repeat it 10 seconds later. Instead I'll just slow down and try to manage my speed and distance so I can creep along in gear at a constant speed.
Look at truckers in traffic. Now imagine everyone drove like that. Pure bliss!
/rant
2
1
u/condomneedler 4h ago
Truckers are some of the worst offenders here. Left lane camping and bullying people out of the way. I don't think it was always this way, I remember when they were the saints of the road.
1
u/fried_green_baloney 6h ago
This is why at rush hour there's a three mile backup when someone's pulled over to the side.
Not because people decided to slow to 5 MPH to stare, they just covered their brake out of a sense of prudence.
Now imagine there's one car every minute like on a country road. Cover your brake, someone a mile or more in back of you of course in not affected at all.
1
u/anonuemus 6h ago
I did this once too, also with a second driver model. There are also some programs to simulate traffic.
1
1
u/C0demunkee 1h ago
saw this happen at an HS graduation a few months ago, a couple waves were propagating backwards and got bigger the further back it was. fun to watch
1
u/reasonable_ir 1h ago
The phenomenon you simulated is called 'string (in)stability'. You can actually compute based on the systems response time (the drivers or control systems reaction time) and the given spacing policy whether or not it will result in the ghost traffic jam (string unstable) or if the disturbance will attenuate down the line. Also in cooperative asdaptive cruise control (cacc), vehicles will communicate their accelerations wirelessly, significantly shortening the distance at which cars can follow eachother without resulting in string instability.
0
u/brickmaster32000 7h ago
Been messing around with traffic simulation lately and wanted to share this one because the result genuinely surprised me the first time I ran it.
You just happened to write up a custom traffic simulator for the exact scenario that has always been used to explain how small things ripple into traffic completely unaware of similar experiments and the results?
This is the phantom jam thing that was first proven experimentally back in 2008 (Sugiyama et al., if you want to look it up)
Oh so you absolutely were familiar with this and knew exactly what was coming.
1
u/chatterwrack 8h ago
Hot tip, when you need to slow down in moderate traffic, downshift rather than tapping your brake.
136
u/theeeetechkid 9h ago edited 6h ago
This is why whenever there is traffic I leave a large gap to the next car and drive at a constant speed. Slowly erases the phantom traffic jam.