Traffic flow. How vehicles respond to varying speed, traffic density and conditions. The phantom traffic jam.




Road Speed
Road Surface
Vehicles Per Minute
Comformt Factor

Danger level

Be alert to traffic at the right hand side of the screen getting closer or dropping away as conditions change.

How phantom traffic jams occur

This illustration cannot accurately represent all the factors that affect a stream of traffic - use it only as an aid to understanding your own experiences.

How the illustration has been programmed

70 vehicles are randomly created between between 4.0m and 7.0m long with most being 4.5m long. This is to represent traffic in a lane that does not expect lorries or very long vehicles, normally the outer lanes.

Drivers are given random reaction times of between 0.7 seconds and 2.5 seconds with most being around 1.25 seconds. This is the thinking time plus the time to move between accelerator and brake.

Because the vehicles and drivers are created randomly, every time you refresh the page you get a different set of vehicles and drivers. The overall behaviour of the traffic will be different each time.

The lead car can accelerate at 1.0g and decelerate at 1.0g
All other vehicles can accelerate at 0.2g and decelerate at 0.7g in dry conditions. The deceleration figure compares with 0.65 m/s/s used in the Highway Code for stopping distances when dry. In wet conditions stopping distances are doubled and when it's icy stopping distances are 10 times longer.

Drivers do not start braking behind the vehicle in front until they've come within range. That is, they do not even contempate slowing down if they are more than 5 times their intended gap.

The maximum speed of the road is 80mph - no vehicles can travel faster than 80mph. In reality many do, but here we'll presume most people are sensible.

I have not adopted the notion of Passenger Car Units (PCU and PCU/hr) because most motorway journeys involve a mix of cars, trucks, vans, small lorries and large lorries, and hours are too coarse a time scale when flows vary from minute to minute. Vehicles per minute seems more pragmatic.

All the math is done in javascript using normal laws of motion, each vehicle looking at the rear of the vehicle ahead.

This is not an attempt at great science but simply a tool to illustrate what can happen. Feel free to copy the source and alter it to make a better example (as long as this for education and not for profit).


The document referenced at suggests a thinking time of 1.25 seconds for unexpected events such as a vehicle ahead braking.

0.2g is approximately 0-60mph in 13 seconds.

Deceleration / braking rate
The rate of deceleration used is 8.5ms-2 [0.85g]. This would represent a very high rate of deceleration such as may be achieved by a car fitted with ABS when braking on a dry road. A rate of deceleration of 4ms-2 [0.4g] would represent the sort of deceleration that might be achieved on a wet road surface.


Education, carrot and stick. There are plenty of ways of educating drivers using articles in newspapers, on television and other media. The carrot would be that the inside lane will always be best maintained and give a more comfortble ride. (Obviously some costs here but considering the alternatives of building more lanes or converting the hard shoulder, the cost of keeping inside lane well maintained AND making sure that people know, must surely be cheaper.) The stick is for people who go too slow or too fast or simply don't move over to let others overtake. This also applies in average speed check zones where speed differences are usually small but frustrating.

In the early days of motorways they prohibited slow traffic with explicit signs on the slip roads.
road sign

Today it could be appropriate to have a sign saying

  • please do at least 60 mph where possible
  • let people overtake easily
  • do not rush past when overtaking

And maybe (tongue in cheek)

  • The middle lane is not yours to keep
  • If you normally drive slower than 60 mph please travel between 20:00 and 06:00

Tracking speed

To keep the action on screen the camera moves to keep pace with the lead car; effectively this is the road speed – slower cars dropping behind and faster cars catching up.

Remember, the lead car may accelerate and brake for all sorts of reasons: the road ahead might suddenly seem clear or the road head is suddenly blocked by another vehicle moving into that lane. Test it!

Traffic Flow

Traffic flow is measured here in vehicles per minute. You can adjust the circumstantial traffic flow using the buttons. This way you can simulate the effect sudden changes caused by vehicles joining or leaving the flow from junctions or extra cars in your lane as they need to move over.

The safe gap

If all vehicles could maintain a 2 second gap the flow would be just under 30 vehicles per minute, depending on the general speed. The vehicles you find in your stream will have a random mix of desired gaps, ranging from 0.2 (crazy) to 4 (very safe) seconds. By adjusting the flow, say from 30 VPM to 40 VPM, you would force all drivers to compromise their desired gap to accommodate the new circumstance. This would cause the "comfort factor" to be changed.. The "comfort factor" is a notional measure intended to indicate the variation from the driver's preferred gap. Your desired safe gap may be compromised by events beyond your control.

Some opinions assert that a gap of 2 car lengths should be maintained. A few moments thinking about this will easily show that this advice is flawed. The safe distance to be maintained will depend on speed. The faster you travel the more distance you will need to be able to react and slow down.


The ability of cars to brake in response to an emergency is determined by the grip available. In dry conditions we'll assume this is 100%. Grip reduces through damp and wet conditions to about 10% in icy conditions.


The illustration shows a single lane of traffic. If the conditions remained steady this lane could be be quite safe. HOWEVER, the reality is that the conditions are not steady. Even in a 50 mph average speed check zone you'll occasionally find some fool doing 40. This has the effect of forcing others into outer lanes and thereby severely affecting the density in those lanes and necessitating emergency slowing to accommodate the traffic sqeezing in. Count that as 2 effects: denser traffic and car in front slowing to recover a desired gap. You can play with the buttons to see what happens. And, of course, it's the same when a lorry occupies the middle lane on a busy motorway - sometimes for 10 minutes - in a selfish attempt to overtake another lorry going slightly slower, or even sadder, overtaking a car! People just don't realise that driving slowly is not safer: it is more likely to cause an accident than if they just drove at the speed of the majority.

The thing is, if we didn't have slow drivers forcing others to overtake and if we didn't have fast drivers bearing down in the next lane out, thus preventing comfortable overtaking, fluctuations in speed and traffic density (per lane) would be much less and the road would be safer and deliver more vehicles per minute.


In the end it's not about affording a few people a fast journey but more about affording a lot of people a safe journey. When motorways are nearly empty it's quite possible for a speedy driver to thread through the gaps and achieve a quick journey time (often at the expense of others), but once those gaps are gone it's a question of getting vehicles per minute along the road - and that can only be achieved with a smooth traffic flow and no one needing other people to slow down to make room for them. Of course, this is easier said than achieved, given the variable densities that occur at rush hours and at junctions.

Please visit contact me to leave your comments.

A version of this was also created with drivers able to communicate with adjacent drivers using a WhatsApp style dialogue.