Understanding the traffic density calculator — concept and principle
Traffic density is the number of vehicles on a stretch of road at one moment. Combined with the average speed, it gives the traffic flow, the spacing between vehicles and the time headway. This calculator is used in traffic engineering courses, road planning and for understanding why congestion forms.
How it is calculated
Density k = N ÷ L (vehicles per km)
Density per lane = k ÷ lanes
Flow q = k × v (vehicles per hour)
Average spacing = 1000 ÷ (density per lane) in metres
Average headway = 3600 ÷ (flow per lane) in seconds
- N is the number of vehicles on the section, L its length in km, v the space-mean speed in km/h.
- Density per lane is also shown per mile (× 1.609344).
The principle
The relation q = k × v is called the fundamental relation of traffic flow. Picture the vehicles as a moving column: if there are k vehicles in every kilometre and the column moves at v km/h, then k × v vehicles pass a fixed point each hour. Spacing is the inverse of density, and headway is the inverse of flow. Speed and density are linked as well: as density rises, drivers slow down. Flow therefore increases with density only up to a critical point (capacity); beyond it, speed falls faster than density rises, flow drops and congestion sets in.
Worked example
Default inputs: 45 vehicles on 1.5 km, 3 lanes, average speed 80 km/h.
- Density = 45 ÷ 1.5 = 30 vehicles/km.
- Per lane = 30 ÷ 3 = 10 veh/km/lane = 10 × 1.609 = 16.1 veh/mile/lane.
- Flow = 30 × 80 = 2,400 vehicles/h; per lane = 10 × 80 = 800 veh/h/lane.
- Spacing = 1000 ÷ 10 = 100 m.
- Headway = 3600 ÷ 800 = 4.5 s.
| Length of the section (km) | Density (vehicles/km) |
|---|---|
| 0.375 | 120 |
| 0.75 | 60 |
| 1.12 | 40 |
| 1.5 | 30 |
| 1.88 | 24 |
| 2.25 | 20 |
| 3 | 15 |
How to read the result
Low density with high speed means free-flowing traffic; drivers have room to change lanes. As density rises toward capacity, small disturbances like a sudden brake can grow into stop-and-go waves. Capacity guidelines put a freeway lane at roughly 2,000–2,400 passenger cars per hour under ideal conditions. A headway of 4.5 s is comfortable; headways under about 2 s mean vehicles are following closely.
Common mistakes
- Using a spot speed (one point) instead of the space-mean speed over the section.
- Counting vehicles in both directions but entering lanes for one direction.
- Applying q = k × v to signalised streets with stops, where flow is interrupted.
- Confusing spacing (distance) with headway (time).
Frequently asked questions
What is the difference between density and flow?
Density counts vehicles on a length of road at one instant; flow counts vehicles passing a point over time.
Why does traffic jam even without an accident?
Near capacity, small speed changes spread backward as waves that slow or stop following vehicles.
What is the two-second rule?
A safe-driving guideline to keep at least about two seconds of headway behind the vehicle ahead.
How do I measure density in practice?
Count vehicles on a known length from an aerial photo or camera, or estimate it from flow and speed.
Sources: MIT course 1.041/1.200 "Transportation: Foundations and Methods", lecture "Macroscopic traffic models"