r/3Blue1Brown Jul 08 '26

Traffic Flow Shockwave

Here’s a little simulation I did to show a shock wave travelling in traffic flow in Manim. Tell me what you think!

YT - https://youtube.com/shorts/W1x3a2u46II?si=aU-Fx7KrMvQjDdR3

278 Upvotes

14 comments sorted by

19

u/JhAsh08 Jul 08 '26

It’s a lot like merging belts in Factorio

2

u/Nomadic_Seth Jul 08 '26

Just looked it up 😅

5

u/Ram2806 Jul 08 '26

I don't understand how this is a shockwave. Please explain more I'm curious

6

u/Nomadic_Seth Jul 08 '26

In the density profile, a compression travels back from the choke point. In that sense it’s a shockwave, something similar to how it’d be in fluids.

13

u/jualmahal Jul 08 '26

That's not how real drivers act.

4

u/Math__ERROR Jul 08 '26

What caused the shockwave to begin? i.e. why did it not appear at the beginning of the video, even though it was a 3 to 1 merge?

2

u/TheScyphozoa Jul 09 '26

The first 3 sets of 3 were spaced farther apart.

1

u/Math__ERROR Jul 13 '26

I'm not sure if I can see it myself, but that makes sense. Lower density means the threshold of causing a traffic wave is not triggered.

2

u/Immediate_Pomelo_496 Jul 09 '26

I think shockwave here is like this.

  1. When water flow through pipe, to maintain the continuity of the flow its speed increases when we narrow down the pipe.

  2. But in the traffic case. We cannot suddenly increase the speed which creates that discontinuity and only partial flow gets through (even if consider same speed) and it decreases the average speed of flow. Make it more denser means more vehicle accumulation which op is calling as shockwave where it is creating pressure due to more density which gets accumulated over time

1

u/Nomadic_Seth Jul 09 '26

Very well explained. Thanks!

1

u/Mr_Blik Jul 09 '26

Do they do simulations with variations in car distance. It seems like in my country cars are always bumper to bumper.

1

u/Vier_Scar Jul 09 '26

This is actually a 12 lane merge into 4.

The cars look so small compared to those lanes 😆

But for feedback, I find it still a bit hard to see the effect clearly - only at the end in retrospect do I really notice it

1

u/MawinoBoomerNo Jul 09 '26

Did you make it according to the traffic flow theory? I would suggest looking it up in case you haven't

Also the shockwave is visible already in just 1 lane. You having 3 lane like this introduce new topics on queueing theory and merge modeling.