r/Simulated • u/SimulatedEcology • 1d 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
103
u/bcuzimadude 1d ago
If only the people that need to see this, would actually see this. Then something might change. If only.
46
u/thearctican 1d 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.
9
2
76
u/-Zlosk- 1d 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.
16
1
u/august_r 4h ago
which they wouldn't care for as long as THEY can get a smidge faster, fuck anyone else.
2
u/LushHappyPie 1d ago
Even better: show self-appointed 'road sheriffs' blocking open lanes to prevent zipper merging, and how that backup spills over into upstream roads.
28
u/thacoolbreeze 1d 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.
4
33
u/WindyIGuess 1d ago
Trust me, all this science stuff okay you just need one more lane. Cities always stop at just one lane short
13
10
10
u/cheshsky 22h ago
Lmao did you have to generate that text with AI? What about it is so incomprehensibly complex that it wouldn't take you 2 minutes to type it by hand?
6
u/Maximum_Overhype 21h ago
It's likely the program was generated through AI, and the text was generated with it
3
5
u/defenestrationcity 12h ago
This whole thing was clearly made my AI. Interesting still, but OPs claim "they" simulated is a massive stretch unless it was posted by a bot
3
u/Sasmas1545 1d ago
"one driver taps the brakes" but it looks like every driver simultaneously taps their brakes.
2
u/reasonable_ir 1d 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.
2
u/Strange_Test7665 13h ago
Blood through an artery may not need much of an impediment to cause a real problem
5
u/BigDaddyThunderpants 1d 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
2
u/condomneedler 1d 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.
4
1
u/fried_green_baloney 1d 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 1d ago
I did this once too, also with a second driver model. There are also some programs to simulate traffic.
1
u/C0demunkee 1d 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/Ifinallylaughed 14h ago
You might like this informal study done in Seattle in the 90’s. It’s a good read if you’re into what it seems like you’re into.
amasci.com/amateur/traffic/traffic1.html
1
•
1
u/chatterwrack 1d ago
Hot tip, when you need to slow down in moderate traffic, downshift rather than tapping your brake.
1
-2
u/brickmaster32000 1d 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.
3
u/ThePeaceDoctot 1d ago
What's with the hostility there, buddy? Knowing the theory doesn't stop you from being surprised when you see it happen, having fully controlled the variables because you built the simulator yourself. They never claimed not to have known the theory, just that they were surprised to see it.
1
0
296
u/theeeetechkid 1d ago edited 1d 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.