1 · Why Traffic Is Weird
A jam out of nothing · trajectories · flow, density and speed
Part 1 · A jam out of nothing
The puzzle
22 drivers on a 230 m circle, all at one steady speed. No bottleneck, no accident, no traffic light.
What happens next?
NoteBefore you watch: predict
Will a jam form? If one does, does it move with the traffic, or against it?
- This really happened. In 2008, researchers in Japan asked 22 drivers to drive around a 230 m circle, all at the same steady speed (Sugiyama et al., New Journal of Physics, 2008). Watch it happen, below, recreates it.
- Think: with nothing on the road to stop anyone, what could make a driver brake?
Watch it happen
Each box is a car, coloured by its speed. Yours has the thick outline. Wait and watch.
NoteHow to read it
- Left, the ring: a 230 m one-lane road seen from above. Each box is a car, coloured by speed: red is stopped, green is fast (8 m/s). Your car has the thick outline.
- Right, the time-space diagram, the picture this whole course reads traffic from (Part 2 builds it up step by step). Time runs to the right; position around the ring runs up.
- Every half second each car leaves a dot where it is, so each car draws a chain of dots: its path, or trajectory. Your car’s chain is the one without speed colours.
- Steep chain: a fast car, it climbs many metres each second. Flat chain: a stopped car, time passes but it stays put.
- Chains close together (one above the other): cars close together on the road.
- Two ways to slice it. A vertical line, say at 60 s, cuts every car’s chain once: where all 22 cars were at that moment, like a photo from above. A horizontal line, say at 100 m, marks the moments cars pass that point, what a roadside counter sees.
- When a car reaches the top (230 m), it has gone once round and reappears at the bottom.
- Red bands are jams: many slow cars close together. Notice which way they tilt.
- Sliders: the number of cars on the ring, the drivers’ maximum acceleration a, and how fast the movie plays. ⏸/▶ pauses the ring on every card of this Part.
- The driver model: every driver follows the Intelligent Driver Model (Lecture 8). Every 0.1 s, each driver picks an acceleration from their speed v, the speed v_j of the car ahead and the gap s to it: \begin{aligned} \dot v &= a\,(1 - F - G) + \text{wobble} \\ F &= (v/v_0)^4 \\ G &= (s^*/s)^2 \\ s^* &= s_0 + v\,T \\ &\qquad + \frac{v\,(v-v_j)}{2\sqrt{a\,b}} \end{aligned}
- F eases off as the speed nears v_0; G brakes when the gap s is shorter than s^*, the gap the driver wants. Fixed: desired speed v_0 = 12 m/s, time headway T = 1.2 s, minimum gap s_0 = 2 m, comfortable braking b = 1.5 m/s², cars 4 m long.
- What a does: it scales every reaction, speeding up towards v_0 and easing off when the gap is shorter than s^*. It also sits in \sqrt{a\,b}: a driver who can speed up again quickly brakes less hard when closing on a slower car. Small a: slow corrections. Large a: quick ones.
- The wobble: a random 0.3 m/s² (standard deviation) added to every driver’s acceleration, every step: human imperfection. It stays the same when you move a, so with a larger a it is also relatively smaller.
- Every simulated driver follows the Intelligent Driver Model (Lecture 8) and starts at the steady speed for its spacing, 3.7 m/s for 22 cars, so nobody starts the jam on purpose.
- A small random wobble, 0.3 m/s², is added to every driver’s acceleration: human imperfection.
- Think: the cars start perfectly evenly spaced. Where does the first jam come from?
Follow one driver
Now ride in the black car. Did anyone ahead of you have a reason to stop?
NoteHow to read it
- The line is the speed of the black car on the ring above, over the last 2½ minutes. It keeps updating while the ring runs.
- A stop is counted each time your speed falls below 1 m/s after having been above 2 m/s.
- Nothing on the ring forces anyone to stop: no signal, no crash, no lane drop. The stops come from the cars themselves.
- Stopping and starting again and again, with no bottleneck anywhere, is what a phantom jam feels like from the driver’s seat.
- Think: you brake because the car ahead braked. Why did it brake?
What just happened?
The red bands tilt.
Predict does the jam move with the cars, or against them? Then reveal.
- Nobody caused it. Tiny wobbles, over-corrected by each driver behind, grew into a jam.
- Try it above: raise the maximum acceleration a to 1.5 m/s². The jam dissolves.
NoteHow to read it
- The same time-space diagram as on the ring above, live: dots are cars every half second, coloured by speed; your car is the one without speed colours.
- Reveal fits a straight line (violet dashes) through the slowest car’s position over the last minute: that is the jam’s path. Its slope is the jam’s speed.
- The line slopes down: the jam moves backward around the ring while every car moves forward through it. Cars leave the jam at its front while new cars join it at its back.
- With a = 1.5 m/s² each wobble is corrected before the car behind over-reacts, and the jam fades within a few minutes.
- The slider is the Intelligent Driver Model’s maximum acceleration a (Lecture 8; the equation is in the ring card’s “How to read it” box).
- A larger a makes every response faster: to get up to cruising speed, a driver needs a time of the order of v_0/a, about 24 s at 0.5 m/s² and 8 s at 1.5 m/s².
- Sluggish drivers correct each wobble too late, the driver behind over-reacts, and the wobble grows as it travels back around the ring. Automated vehicles with well-designed cruise control could damp it (Lecture 9).
- By Lecture 5 you will compute a jam’s speed with pencil and paper.
- Think: the jam moves backward, yet no car ever drives backward. What exactly is moving?
It happens on real freeways, every morning
Only a computer game? Here is US-101, Los Angeles, 2005: every vehicle in one lane, ten times a second.
Find the jam. Which way does it move?
In Lab 2 you load these data and measure the wave’s speed yourself.
NoteHow to read it
- Each thin line is one vehicle’s trip along 650 m of US-101, coloured by its speed: red stopped, green 100 km/h.
- The red band is a stop-and-go wave, like the one on the ring. Every vehicle moves forward (up), yet the band moves down: backward, against the traffic.
- Reveal draws the wave’s path: a straight line through the times at which vehicles stand still (below 2 m/s), averaged in 50 m steps from 150 m to 650 m. Its slope is about 5.7 m/s, or 21 km/h.
- On most freeways, waves like this move backward at roughly 15–20 km/h; this one is a little faster.
- The data are from the Next Generation Simulation (NGSIM) program of the US Federal Highway Administration: on 15 June 2005, cameras on a 36-storey building recorded US-101 (the Hollywood Freeway), and software turned the video into the position of every vehicle, ten times a second.
- Shown: lane 2, four minutes from 8:00 a.m., one point per vehicle per second.
- Think: the ring’s jam moves backward at about 8 km/h, this one at about 21 km/h. Both are “backward”. What could make one faster?
The 1959 experiment: one number decides
Why does a tiny wobble grow into a jam? In 1959, General Motors researchers boiled it down to one line of cars.
Each driver reacts late. Does one brief brake fade down the line, or grow?
\begin{aligned} \ddot x_{n+1}(t) &= \lambda\,\Delta\dot x(t-T), \\ \Delta\dot x &= \dot x_n - \dot x_{n+1}. \end{aligned}
\lambda: how strongly
the driver responds to a speed difference (1/s)
T: how late
the reaction time (s)
C = \lambda T: decides
strongly × late: one number
NoteHow to read it
- In words: my acceleration now equals \lambda times the speed difference between the car ahead (n) and me (n+1), as it was T seconds ago.
- Car ahead faster: I speed up. Car ahead slower: I brake. The stronger \lambda, the harder I respond.
- Everything about stability depends only on the product C = \lambda T.
- In 1959, Robert Herman, Elliott Montroll, Renfrey Potts and Richard Rothery at General Motors Research wrote down this, the simplest possible driver.
- Think: a driver who reacts twice as late but half as strongly has the same C. Would you expect them to behave alike?
Try it: C decides
The leader (dashed) brakes for 2 s, then recovers.
Predict at C = 0.75, does car 8 change speed more or less than car 1?
NoteHow to read it
- What is simulated: each driver’s speed. Every driver speeds up or slows down in proportion to the speed difference with the car ahead, seen T = 1 s late. Adding up a car’s speed over time gives its position.
- Left plot, speed: each car’s change from its cruising 72 km/h. Below zero, the car is slower than the traffic.
- Right plot, trajectories: each car’s position in the moving traffic over time, as Herman and his colleagues drew it in 1959. The leader is the uncoloured line, at the top; each follower starts 30 m below the car ahead. Lines drifting closer are a gap closing; two lines touching is a crash, circled in red.
- The road strip shows position: the leader (L, uncoloured) and its 8 followers in one lane, 30 m apart front to front: a 1.25 s gap, normal on a busy freeway.
- The strip is filmed from a camera that drives along at 72 km/h, so the cars do not race off the strip; a car that is slower than 72 km/h drifts back, and only the gaps change.
- The two cars of a crash are outlined in red, and the run stops there.
- Replay runs it again; Pause holds it (then Run carries on). Moving C starts a new run.
- Each coloured line is one follower’s speed change over time, car 1 right behind the leader, car 8 last. Tick or untick a car to show or hide its line; the colour under each name is its line’s colour.
- The dashed line is the leader: 2 s of braking (down 2 m/s), then 2 s of speeding up again.
- Regime names what C does, by the 1959 thresholds: 1/e \approx 0.37, 1/2 and \pi/2 \approx 1.57.
- A stable driver: one follower, watched alone behind a leader that brakes once. Its speed swings die away and it settles back to cruising speed. True for C < \pi/2; for C \le 1/e it settles without overshooting.
- A stable line passes the brake on smaller, car after car. That needs more: C < 1/2. Between 1/2 and \pi/2 each driver settles, yet hands the next a slightly bigger swing: stable drivers, unstable line.
- Car 8 ÷ car 1 compares the largest speed change of the last car with the first follower’s. Above 1, the brake grew on its way down the line. It appears when the run ends.
- On the road: the closest any two cars came, bumper to bumper. Up to C = 0.85 nobody collides; from about 0.9 on, the growing wave ends in a crash.
- Think: untick cars 2 to 7 so only car 1 and car 8 remain, then slide C slowly from 0.4 to 0.6. Where does the ratio cross 1?
- Theory says the line turns unstable at C = 1/2; with only 8 cars, the crossing is a little higher. You will find out why in Lab 1.
Stable driver, unstable line
At C = 0.75 every driver, alone, settles down. Does the line?
In Lab 1 you rebuild this experiment, find the thresholds, and find when a line crashes.
NoteHow to read it
- Each dot is one car’s largest speed change after the leader’s brief brake (2 m/s, the grey dashes), for cars 1 to 10 down the line.
- Teal, C = 0.4: the swing shrinks car by car. The line is stable.
- Red, C = 0.75: the swing grows car by car. The linear model has no floor, so car 10’s 10 m/s swing means: in reality, it stops, or it crashes.
- The key idea: stability of one car is not stability of the line. Between C = 1/2 and C = \pi/2, every driver settles on their own, yet the line amplifies.
- The ring above runs a different model, the Intelligent Driver Model, with no reaction delay; there, drivers with a larger maximum acceleration a damp each wobble before it grows.
- Same lesson in both: whether a disturbance dies out or grows depends on how the whole line responds. You derive the 1959 thresholds, and meet the ring’s again, in Lecture 9.
- Think: a convoy of trucks with cruise controls that each look stable on a test track. What would you test before letting ten of them drive in a line?
Your turn: be the smart car
Can one driver change the line? You drive the black car: dissolve the jam, and beat its average speed.
NoteHow to read it
- Ring: 22 cars on a 230 m ring, jammed after 5 minutes on their own. Your car (thick outline) becomes a smart cruise control: it holds your speed smoothly, with no wobble, and never gets closer to the car ahead than is safe.
- Jam meter: the spread (standard deviation) of all 22 speeds. The green dashes mark the goal, 0.8 m/s: above it the ring is jammed, below it the ring flows. The trace is red while nobody drives, violet while you do.
- You win when the meter stays under 0.8 for 30 simulated seconds. Your score is everyone’s average speed over those 30 s; beat the jam’s own average to earn the trophy.
- The movie runs at 12 times real time.
- Think: to make everyone faster, should you drive faster or slower than feels natural?
- Try it before you read on.
- The idea behind it was tested in the field: in 2017 in Tucson, a single automated vehicle damped stop-and-go waves on a ring of about 20 cars (Stern et al., Transportation Research Part C, 2018).
- Lecture 12 asks whether a reinforcement-learning car finds such a strategy on its own.
Part 2 · Reading traffic: trajectories
A trajectory is a story
Every plot so far had time across and position up. Read one car’s line first.
Think at which number is it stopped? Where is it braking?
© 2026 Wuping Xin · CC BY-NC-SA 4.0
1 · steep, straight
cruising
2 · bending flatter
braking
3 · flat
stopped
4 · bending steeper
speeding up
NoteHow to read it
- A vehicle’s trajectory is its position over time, x(t). Time runs across, position runs up.
- The slope of the line is the speed, v = dx/dt: the steeper the line, the faster the car.
- 1: a straight, steep stretch. The car cruises at a steady 15 m/s.
- 2: the line bends flatter. The slope shrinks: the car brakes for a red light at 200 m.
- 3: the line is flat. The position does not change: the car is stopped, for 10 s.
- 4: the line bends steeper. The slope grows: the car speeds up after the green.
- You may want position on the horizontal axis, because that is how a map looks. Keep the convention: time runs across, position runs up.
- Every result in the macroscopic part of the course (waves, shocks, queues) is read off this picture.
- Think: can a trajectory on a one-way road ever bend back down? What would that mean?
Try it: drive one car
Predict wait 20 s at the light instead of 10. Which part of the line moves, and how much time does the car lose?
NoteHow to read it
- The violet line is one car’s trajectory; the numbers 1–4 mark its four shapes, as on the card above.
- The red dashed line is the traffic light at 200 m. The car brakes at 3 m/s² and speeds up at 2 m/s².
- A longer wait stretches only the flat part 3; everything after it slides to the right.
- A faster car brakes earlier and for longer: parts 2 and 4 grow.
- Time lost to the light: the wait, plus v/(2b) for braking and v/(2a) for speeding up. At 15 m/s: 2.5 + 10 + 3.75 = 16.25 s.
- Why v/(2b)? Braking from v to 0 at b takes v/b seconds and covers v^2/(2b) metres. At full speed the car would have covered those metres in v/(2b) seconds.
- The difference, v/b - v/(2b) = v/(2b), is the time lost. Speeding up is the same with a.
- Think: the car loses 16 s, yet waits only 10. Where is the light’s “delay” on the diagram?
- The delay is the horizontal gap between the real line and a straight line at 15 m/s, after the light.
Many trajectories: the time-space diagram
One line tells one trip. Put several cars on one diagram: the gaps between lines tell how they share the road.
Two gaps: how far apart, and how long apart? Double the speed: which gap changes?
NoteHow to read it
- Draw every vehicle on one picture and you get a time-space diagram. Each coloured line is one car.
- Spacing (m) is the vertical gap between two trajectories: how far apart two cars are at one instant.
- Headway (s) is the horizontal gap: how much time passes between two cars at one point.
- When the cars share one speed, spacing = speed × headway: double the speed at the same headway and the spacing doubles.
- In a single lane, trajectories never cross. A crossing means someone changed lanes, or crashed.
- Spacing (m) and headway (s) are the microscopic versions of density and flow. Average spacing is 1/k, and average headway is 1/q. Divide one by the other and you meet q = kv again, in Part 3.
- Think: at 30 m/s with a 1 s headway, cars are 30 m apart. Is that safe? How long would a driver need to react?
Live: a red light and eight cars
Now make the gaps change: eight cars meet a red light.
Predict red at 16 s, green at 46 s. Do all eight cars start moving at 46 s?
NoteHow to read it
- Left: the road from above, the stop line at 300 m (red or green). Each box is a car, coloured by speed: red is slow, green is fast.
- Right: the time-space diagram of the same eight cars, coloured the same way. The red bar at 300 m is the red light, 16 s to 46 s.
- The orange dashed line is a loop detector at 150 m: one position, all times. It counts each car once.
- The violet line is a drone snapshot: one instant, every position. The dots on it are the cars it sees now.
- Headway and spacing, as on the card above, between cars 1 and 2.
- The pause button stops the clock; drag the slider to step through time.
- A GPS probe would be a single trajectory. Every sensor sees the diagram through its own slice: the loop through a horizontal line, the drone through a vertical one. Lecture 2 builds on exactly this.
- Think: at 30 s, the loop has counted some cars and the drone sees others. Which of the two could tell you that a queue is growing?
Can you read it?
Three questions about the red-light diagram. Answer each, then reveal.
NoteHow to read it
- The same diagram as on the card above, zoomed on the queue (150–420 m), without the time cursor.
- Red dots: where each car comes to a stop. They line up: the back of the queue moves upstream, against the traffic, as each arriving car stops a little further back. Its speed is the slope of the red dashed line. This is a shock wave, the subject of Lecture 5.
- Green dots: where each car starts again. Each car can start only after the car ahead has moved, so the start-up wave also travels upstream, faster than the queue grew. Real start-up and stop-and-go waves travel at roughly 15–20 km/h, as on the ring road and on US-101.
- Question 3: stopped cars are 7 m apart (5 m car, 2 m gap): the highest density on the road, with zero flow. After the green, cars cross the stop line every 2.2 to 3.2 s, about 1,430 veh/h for these eight. At the stop line a traffic engineer measures this saturation flow.
- The two waves are fitted lines through the dots: least squares on the eight stop points and the eight start points.
- The first car waits about 0.4 s after the green before its speed passes 0.5 m/s; the eighth starts 8.6 s after the green.
- Think: if the red lasted longer, which wave would be longer on the diagram, and would its speed change?
Try it: a few cars, many days
That light showed every car’s trajectory. A real signal sees only the connected cars, day after day.
Predict if 7 % of cars report, how many days of data until you see the queue at this light?
NoteHow to read it
- The picture: every trajectory from a connected car, from all the days, drawn on one signal cycle. Time 0 is the start of the red; the red bar is the red light at 300 m, the first 30 s of each 90 s cycle.
- Colour is speed: red is slow, green is fast. A flat red stretch is a car waiting in the queue.
- One day gives only a handful of lines. Overlaid, the days fill in the picture: the triangle of stopped cars behind the light, and the cars that sail through on green.
- The tiles: how many connected trips you have; the share of them that had to stop, next to the share of all cars; and the longest queue they reveal, next to the real longest queue.
- What to notice: the share that stops settles quickly; the longest queue needs many days, because rare long queues are caught only by a rare connected car.
- The traffic is simulated (Newell’s car-following, Lecture 6, with random arrivals at 600 veh/h); the method is the one used on real connected-vehicle data.
- This picture is a probe diagram. Purdue calls its version the “Purdue Probe Diagram”.
- No single connected car tells you much, but thousands of them, overlaid on one cycle for the same intersection and the same time of day, reveal the queue, the arrivals on green and the delay.
- Think: which number would you trust after one week, and which would you not? Why does the share converge faster than the longest queue?
Trajectories at work: traffic signals
This is how real signals are now judged: connected-car trajectories, no detectors in the road.
Michigan · retiming
7 % of traffic, GM vehicle trajectories, 34 signals in Birmingham, MI
Delay −20 %, stops −30 % (up to)
Purdue · report cards
0 detectors
Arrivals on green, split failures, level of service, from commercial connected-vehicle data
Nevada, Reno · arterials
1 corridor, many signals
Coordination evaluated, and the corridor split into groups by where drivers actually go
More in Lecture 5 (queues and shock waves) and Lecture 12 (a real signal controller in the loop).
- Michigan: Henry Liu’s group retimed 34 signals in Birmingham, Michigan using only GM vehicle trajectories, about 7% of traffic.
- Delay fell by up to about 20% and stops by up to about 30% (Wang et al., Nature Communications, 2024).
- Earlier, with DiDi, the same group optimized signals in Jinan, China from ride-hailing trajectories (Zheng et al., TRB, 2018).
- Purdue: Darcy Bullock’s group computes arrivals on green, split failures and level of service from connected-vehicle data alone (Saldivar-Carranza et al., TRR, 2021).
- The same group covers diamond and diverging diamond interchanges (J. Transportation Technologies, 2021 and 2022).
- Reno: Jianyuan Xu and Zong Tian at the University of Nevada, Reno use trajectories to evaluate arterial coordination (Xu et al., IJTST, 2025) and to split a corridor into coordinated groups by where drivers actually go (Xu and Tian, TRR, 2023).
- Think: 7 % of cars is enough to retime a signal. Would 7 % be enough to count how many cars use the road? Why not?
Trajectories at work: automated vehicles
Self-driving cars learn to drive from human trajectories, and must be tested on dangerous moments.
Predict in real driving, one crash in how many trips?
Learn how people drive
A deep learning car-following model, trained on 2,000 real following events (Shanghai)
Test robot drivers
Keep only the rare, dangerous moments: far faster tests, still unbiased
Watch one driver
SHRP2: 3,400 drivers, 5.4 million trips, 1,541 crashes on video
NoteMore
- The squares: one per trip. Reveal turns one red: a crash. Dangerous moments are that rare, so testing an automated car on public roads alone would take enormous mileage.
- Naturalistic driving data follow one driver for months, with cameras and sensors in their own car, instead of every vehicle on one stretch of road. The largest, the SHRP2 study (2010–2013), instrumented the cars of more than 3,400 US drivers.
- Deep learning trains a neural network, a program with a great many adjustable numbers, on examples until it reproduces them.
- Zhu, Wang and Wang (TR-C, 2018) used deep reinforcement learning, learning by trial and reward, to build a human-like car-following model from 2,000 events in the Shanghai Naturalistic Driving Study.
- Testing: Feng et al. (Nature, 2023) trained background vehicles on naturalistic driving data, then edited their behaviour to keep only the safety-critical moments. Tests run far faster, and the crash rates they estimate stay statistically unbiased.
- Car-following and lane-changing models are calibrated on trajectories (Lectures 8 and 10).
- More in Lecture 8 (car-following), Lecture 9 (automated vehicles and phantom jams), Lecture 10 (calibration) and Lecture 12 (reinforcement learning).
- SHRP2 figures: 5.4 million trips, 1,541 crashes and 2,705 near-crashes in the data file (National Operations Center of Excellence, “Overview: the SHRP 2 Naturalistic Driving Study”, transportationops.org/Bigdata/NDS).
- 5.4 million ÷ 1,541 is about 3,500.
- Think: if one trip in 3,500 ends in a crash, how many trips must a test fleet drive to see 100 crashes? Why does “keep only the dangerous moments” help?
Beyond this course: travel demand
Can trajectories feed travel demand models? Yes, but not the dense ones in this lecture.
Illustration · © 2026 Wuping Xin · CC BY-NC-SA 4.0
| Dense (NGSIM, highD) | Sparse (phones, ride-hailing) | |
|---|---|---|
| Good for | traffic flow, driver behaviour | origins, destinations, route choice |
| The catch | one short stretch of road | not a random sample of travellers |
NoteMore
- Left, dense trajectories: a camera, drone or tall building watches one stretch of road. Every vehicle is recorded 10 to 25 times a second, but only for a few hundred metres. The violet dots are one car’s recorded positions.
- Right, sparse traces: a phone, a ride-hailing app or a connected car reports where it is every few seconds to minutes (the teal dots). You see whole trips across a city, but only for some vehicles, and the route between two pings (dashed) must be guessed: map matching.
- Sparse traces are now a major input to demand models. Early work: origin–destination (OD) matrices from phone location data (Çolak et al., TRR, 2015) and map matching of smartphone GPS (Bierlaire, Chen and Newman, TR-C, 2013). Recent work:
- OD flows from probe trajectories alone, with no counts or surveys, for an urban road network (Cao et al., J. Intelligent Transportation Systems, 2024).
- Trajectories plus detector counts, when the share of vehicles that report differs from one OD pair to another (Leurent, Sun and Xie, TRR, 2023).
- Route choice from incomplete traces, where parts of each trip are missing (Mai et al., TR-B, 2023).
- At scale: OD demand for metropolitan highway networks across the US, estimated from aggregated, anonymised Google Maps traffic trends instead of census data (Zhang et al., arXiv, 2025).
- The catch: only some travellers are observed, and not a random sample, so the data must be expanded to the whole population (Chu et al., TRR, 2026, model that share road by road) and checked.
- When freeways were closed in Philadelphia and Los Angeles in 2023, three of four vendors’ phone datasets still showed devices travelling on the closed roads (Zhang, Stewart and Darzi, PLOS ONE, 2025).
- Travel demand models (who travels where, when, by which mode and route) are the subject of other courses. This one stays with how traffic flows once the trips are on the road.
- Think: a phone app reports a ping every 30 s. A car at 15 m/s moves 450 m between pings. Could you tell which of two parallel streets it took?
Where do trajectories come from?
This course needs dense trajectories of every vehicle. Who records them?
| Dataset | Where | How |
|---|---|---|
| NGSIM (FHWA, 2005–06) | US-101, I-80, two city streets | video from tall buildings, 10 Hz |
| highD (2017–18) | German highways | drone video, 25 Hz, about 110,000 vehicles |
| inD, rounD, exiD | German intersections, roundabouts, ramps | drone video |
| pNEUMA (EPFL, 2018) | central Athens | 10 drones, about half a million trajectories |
| I-24 MOTION | 4.2 miles of I-24, Nashville | 276 pole-mounted cameras |
| TGSIM (FHWA) | Chicago, Washington DC | video, people beside automated cars |
| Waymo, Argoverse 2 | US cities | sensors on self-driving cars |
- Full trajectories of every vehicle are rare and precious. In Lab 2 you load real NGSIM ones.
- Each row is a sensor plus software. Two things can go wrong: a car is missed, or put in the wrong place.
- NGSIM filmed US-101 and Lankershim Boulevard in Los Angeles, I-80 in Emeryville, California, and Peachtree Street in Atlanta, about 500–700 m each, from tall buildings. highD recorded 16.5 hours near Cologne. pNEUMA covers about 1.3 km² of central Athens.
- I-24 MOTION records every vehicle, every morning. TGSIM filmed human drivers next to cars with Level 2 driver assistance. Waymo Open Motion and Argoverse 2 record the scene around one vehicle.
- The Data page lists each with its licence and how to get it.
- Think: which of these datasets could show you a phantom jam like the ring road’s? Which could not, and why?
Missed cars: what a self-driving car sees
First, missed cars, from the table’s last row: a self-driving car’s laser scanner.
Predict one sweep at a Boston intersection, seen from above. How many vehicles?

© 2026 Wuping Xin · CC BY-NC-SA 4.0

© 2026 Wuping Xin · CC BY-NC-SA 4.0
NoteHow to read it
- One turn of the laser scanner (LiDAR) on a test car (yellow) arriving at a busy intersection in Boston, seen from above. The dotted circles are 10, 20, 30, 40 and 50 m from the car.
- Every dot is a laser echo, coloured by height (dark purple low, yellow high). The rings near the car are beams landing on the road; the long lines are kerbs and building edges.
- Reveal: white boxes are the vehicles within 50 m, as people labelled them afterwards.
- Red, dashed: 3 vehicles got no echo at all. They were there, hidden behind others.
- From thousands of such sweeps, software builds the trajectories in the Waymo and Argoverse datasets. What a sensor cannot see is Lecture 2.
- nuScenes scene-0757, Boston Seaport, a 32-beam roof LiDAR, one keyframe: about 34,000 echoes within 50 m.
- The dark disc around the car is ground the beams cannot reach: even the lowest beam points past it, and the car’s own body blocks the rest. Behind each vehicle there is a wedge with no echoes: its shadow.
- A vehicle can sit entirely inside another’s shadow, which is how the three red ones were missed.
- Think: the car’s software must still drive safely around those three. How could it know they might be there?
Cars in the wrong place: NGSIM rebuilt
Next, cars in the wrong place, from the table’s first row: NGSIM saw every car, but each slightly off.
Predict every car within 30 cm. How wrong can its acceleration be?
The lesson: fit a model to raw positions and it learns the noise. Check accelerations first.
NoteHow to read it
- Black: the car’s real speed (left) and acceleration (right). It slows from 15 to 5 m/s and back; it never accelerates harder than 1.05 m/s².
- Violet: what you get from the recorded positions. Speed is the change in position over 0.2 s; acceleration is the change in that speed. Each step divides a small error by a small time, so the error grows.
- Grey bands: beyond 1 g (9.8 m/s²). No car on a road brakes or speeds up that hard.
- Smoothing averages the positions over 1 or 2 s before differentiating. The noise shrinks, but so does every real quick change.
- NGSIM turned video into positions automatically, and raw NGSIM shows exactly this: accelerations no car can produce, speeds that jump in steps, and followers that drive through their leader (Punzo, Borzacchiello and Ciuffo, TR-C, 2011; Coifman and Li, TR-B, 2017).
- Three fixes: smoothing before differentiating (Thiemann, Treiber and Kesting, TRR, 2008); reconstruction, so every trajectory obeys physics and every leader–follower pair stays consistent (Montanino and Punzo, TR-B, 2015, for I-80); and re-extraction, re-tracking vehicles in the original video by hand (Coifman and Li, 2017, who found 11 % more vehicles and argued that some errors cannot be cleaned away).
- With the rebuilt I-80 data, Montanino and Punzo’s models reproduced the observed jams better. This matters again in Lectures 8 and 10, where models are fitted to trajectories.
- Think: if position is accurate to half a metre, and samples are 0.1 s apart, how large an error in speed can one bad sample create?
- Half a metre over 0.1 s is 5 m/s, or 18 km/h. Differentiate again for acceleration and the error is 50 m/s², five times gravity. That is why raw accelerations look absurd.
Further reading: trajectories
- Bierlaire, M., Chen, J. and Newman, J. (2013). A probabilistic map matching method for smartphone GPS data. Transportation Research Part C 26, 78–98. https://doi.org/10.1016/j.trc.2012.08.001
- Cao, Y., Yao, J., Tang, K. and Kang, Q. (2024). Dynamic origin–destination flow estimation for urban road network solely using probe vehicle trajectory data. Journal of Intelligent Transportation Systems 28(5), 756–773. https://doi.org/10.1080/15472450.2023.2209910
- Chu, H., Huynh, N., Kwon, T. J. and Ghods, A. H. (2026). Scalable traffic volume estimation using probe vehicle data and penetration rate modeling: large-scale implementation. Transportation Research Record, online 2026. https://doi.org/10.1177/03611981261455024
- Coifman, B. and Li, L. (2017). A critical evaluation of the Next Generation Simulation (NGSIM) vehicle trajectory dataset. Transportation Research Part B 105, 362–377. https://doi.org/10.1016/j.trb.2017.09.018
- Çolak, S., Alexander, L. P., Alvim, B. G., Mehndiratta, S. R. and González, M. C. (2015). Analyzing cell phone location data for urban travel. Transportation Research Record 2526, 126–135. https://doi.org/10.3141/2526-14
- Feng, S., Sun, H., Yan, X., Zhu, H., Zou, Z., Shen, S. and Liu, H. X. (2023). Dense reinforcement learning for safety validation of autonomous vehicles. Nature 615, 620–627. https://doi.org/10.1038/s41586-023-05732-2
- Krajewski, R., Bock, J., Kloeker, L. and Eckstein, L. (2018). The highD dataset. IEEE ITSC, 2118–2125. https://doi.org/10.1109/ITSC.2018.8569552
- Leurent, F., Sun, D. and Xie, X. (2023). On heterogenous sampling rates in origin–destination matrix estimation based on trajectory data and link counts. Transportation Research Record 2677(1), 1169–1180. https://doi.org/10.1177/03611981221103589
- Mai, T., Bui, T. V., Nguyen, Q. P. and Le, T. V. (2023). Estimation of recursive route choice models with incomplete trip observations. Transportation Research Part B 173, 313–331. https://doi.org/10.1016/j.trb.2023.05.004
- Montanino, M. and Punzo, V. (2015). Trajectory data reconstruction and simulation-based validation against macroscopic traffic patterns. Transportation Research Part B 80, 82–106. https://doi.org/10.1016/j.trb.2015.06.010
- Punzo, V., Borzacchiello, M. T. and Ciuffo, B. (2011). On the assessment of vehicle trajectory data accuracy and application to the NGSIM program data. Transportation Research Part C 19(6), 1243–1262. https://doi.org/10.1016/j.trc.2010.12.007
- Saldivar-Carranza, E., Li, H. and Bullock, D. M. (2021). Diverging diamond interchange performance measures using connected vehicle data. Journal of Transportation Technologies 11, 628–643. https://doi.org/10.4236/jtts.2021.114039
- Saldivar-Carranza, E., Li, H., Mathew, J., Hunter, M., Sturdevant, J. and Bullock, D. M. (2021). Deriving operational traffic signal performance measures from vehicle trajectory data. Transportation Research Record 2675(9), 1250–1264. https://doi.org/10.1177/03611981211006725
- Saldivar-Carranza, E., Rogers, S., Li, H. and Bullock, D. M. (2022). Diamond interchange performance measures using connected vehicle data. Journal of Transportation Technologies 12, 475–497. https://doi.org/10.4236/jtts.2022.123029
- Thiemann, C., Treiber, M. and Kesting, A. (2008). Estimating acceleration and lane-changing dynamics from Next Generation Simulation trajectory data. Transportation Research Record 2088, 90–101. https://doi.org/10.3141/2088-10
- Wang, X., Jerome, Z., Wang, Z., Zhang, C., Shen, S., Kumar, V. V., Bai, F., Krajewski, P., Deneau, D., Jawad, A., Jones, R., Piotrowicz, G. and Liu, H. X. (2024). Traffic light optimization with low penetration rate vehicle trajectory data. Nature Communications 15, 1306. https://doi.org/10.1038/s41467-024-45427-4
- Xu, J. and Tian, Z. (2023). OD-based partition technique to improve arterial signal coordination using connected vehicle data. Transportation Research Record 2677, 252–265. https://doi.org/10.1177/03611981221098692
- Xu, J., Tian, Z., Wang, A., Xie, G. and Valenzuela, L. (2025). Development and assessment of trajectory-based arterial through percent arrivals on red for arterial signal coordination performance evaluation. International Journal of Transportation Science and Technology 18, 131–147. https://doi.org/10.1016/j.ijtst.2024.06.001
- Zhang, C., Arora, N., Bian, C., Li, Y., Ng, W., Tomkins, A., Yan, B., Zhang, J. and Osorio, C. (2025). Origin-destination travel demand estimation: an approach that scales worldwide, and its application to five metropolitan highway networks. arXiv:2507.00306. https://arxiv.org/abs/2507.00306
- Zhang, P., Stewart, K. and Darzi, A. (2025). Examining trip-level errors in passively collected mobile device data for data quality assurance. PLOS ONE 20(4), e0321970. https://doi.org/10.1371/journal.pone.0321970
- Zheng, J., Sun, W., Huang, S., Shen, S., Yu, C., Zhu, J., Liu, B. and Liu, H. X. (2018). Traffic signal optimization using crowdsourced vehicle trajectory data. TRB 97th Annual Meeting, paper 18-05789. https://trid.trb.org/View/1496953
- Zhu, M., Wang, X. and Wang, Y. (2018). Human-like autonomous car-following model with deep reinforcement learning. Transportation Research Part C 97, 348–368. https://doi.org/10.1016/j.trc.2018.10.024
Part 3 · Three numbers describe traffic
Flow, density and speed
A time-space diagram holds every car; often three numbers are enough, and where you stand decides what you count.
| Number | Units | How you count it |
|---|---|---|
| Flow q | veh/h | cars crossing a line, per hour |
| Density k | veh/km | cars on a stretch, at one instant |
| Speed v | km/h | how fast they move |
In a steady stream the three are linked: q = k\,v (Appendix A1).
How sensors really measure them, and when they disagree: Lecture 2.
NoteQuick question
Cars 25 m apart drive past you at 36 km/h. How many pass in an hour?
TipAnswer
1,440 veh/h. One car every 25 m is k = 40 veh/km, and q = k\,v = 40 \times 36.
- Check it on the ring: 22 cars on 230 m is a density of about 96 veh/km.
- The simulation starts them all at the steady speed for that spacing, 3.7 m/s (13.3 km/h), so the flow past any point is q = 96 \times 13.3 \approx 1280 veh/h.
Count it yourself
Count cars at the orange line and on the violet stretch. Do the two counts agree with q = k\,v?
NoteHow to read it
- The road: one lane, 400 m, traffic left to right. Every car drives at the speed you set; the gaps between cars vary at random around the average spacing. Colour is speed, red slow, green fast
- Orange line: a counter across the road, like a loop detector. Flow q is the number of cars that crossed it, divided by the time
- Violet stretch (200 m): cars inside it have a violet outline. Density k is the number of cars on it, per km. It jumps as cars enter and leave, so the tile shows its average since the count started
- Check: after a minute or so, k \times v and the counted flow agree within a few percent. Move a slider and the count starts again
- Why they agree: in a steady stream one car passes every s/v seconds, so q = v/s = k\,v (Appendix A1)
- Think: the counts agree because every car has the same speed. What would break the check if cars drove at different speeds?
- Lecture 2 answers this: a line and a stretch see different average speeds, and q = k\,v holds only with the stretch’s (space-mean) speed.
More cars, more flow?
Pack more and more cars onto a road.
Does the flow keep rising?
NoteBefore you try: predict
Sketch flow against density, empty road to jam: a rising line, a hill, or something else?
Try it: the fundamental diagram
Slide the density up from an empty road, and watch the dots it leaves. (The real curve: Lecture 3.)
NoteHow to read it
- The model: Greenshields (1935) assumed speed falls in a straight line as density rises, v = v_f\,(1 - k/k_j): free-flow speed v_f on an empty road, zero at the jam density k_j
- The big dot is the road at the density you set; its colour is the speed (red slow, green fast). Grey dots: densities you have visited
- Flow q = k\,v = v_f\,k\,(1 - k/k_j): a hill. Few cars: fast but few. Many cars: many but slow. Flow is largest in between
- Capacity (the open dot) is the top of the hill: q_{\max} = v_f k_j/4 at the critical density k_c = k_j/2
- Two roads, one flow: every flow below capacity can happen at two densities, one free-flowing, one congested
- This curve is the fundamental diagram, the subject of Lecture 3.
- Think: with v_f = 100 km/h and k_j = 150 veh/km, Greenshields predicts 3,750 veh/h, about twice what one freeway lane really carries (roughly 1,800–2,200 veh/h).
- Real data, and the triangle that fits them better, come in Lecture 3.
Part 4 · Wrap-up
This semester, you will learn to…
1 Weird traffic
2 Sensors
3 Fundamental diagram
4 Conservation
5 Shock waves
6 Bottlenecks
7 Simulators
8 Drivers
9 Phantom jams
10 Fitting
11 Estimation
12 Digital twins
Explain where jams come from and how they move L3–6
Build your own traffic simulator in Python all term
Measure traffic from video, drones and sensors L1–4
Fit models to data, and know how far to trust them L10
Use AI well, and know when a simple rule wins L9, 11, 12
Run a digital twin with a real signal controller L12
- The route above lists the twelve lectures; the colours match the goals below it.
- “Digital twin” here means a simulation run with a real traffic signal controller plugged in, its clock kept in step with the simulation (hardware- and software-in-the-loop), as you will see live in Lecture 12.
Three challenges
🌶️ Fewest cars
Drivers adjust at 0.5 m/s². What is the fewest cars on the ring that still make a jam? Why does a jam need enough cars?
Try it in: Watch it happen
🌶️🌶️ Just enough acceleration
With 22 cars, what is the smallest maximum acceleration a that keeps traffic smooth?
Try it in: Watch it happen
🌶️🌶️🌶️ The tipping point
Find the C at which the last car’s swing equals the first follower’s. Theory says 1/2. Why don’t you get it?
Try it in: Try it: C decides
Summary
Answer in your head, then tap.
Who caused the ring-road jam?
Nobody: tiny wobbles grew into a wave
Which way does a jam move?
Backward, at 15–20 km/h on freeways
Every driver is stable. Is the line?
Not always: C = \lambda T decides
Can one car dissolve a jam?
Yes: slow and steady absorbs the waves
A trajectory’s slope tells you…
Its speed; flat means stopped
More cars on a road: more flow?
Up to capacity, then less
Next week: two sensors, two average speeds.
- In full: jams can appear out of nothing, and they travel backward. A driver who is stable alone can still be part of an unstable line of cars: C = \lambda T decides. One smooth, slow car can dissolve a ring-road jam.
- Trajectories and the time-space diagram contain all the information about a traffic stream; spacing is the vertical gap, headway the horizontal one.
- Flow, density and speed summarize it, and q = kv links them; flow peaks at the road’s capacity. Next week: what sensors really measure, and why “average speed” has two different answers.
This week’s lab: Lab 1 · Phantom Jams on Your Laptop · Play more: Shock Wave Builder
Notation
| Symbol | Meaning (units) |
|---|---|
| t | time (s) |
| x(t) | a vehicle’s position along the road: its trajectory (m) |
| v = dx/dt | speed (m/s or km/h) |
| a = d^2x/dt^2 | acceleration (m/s²) |
| s | spacing: distance to the car ahead, front to front (m) |
| h | headway: time to the car ahead (s) |
| q | flow: vehicles passing a point per hour (veh/h) |
| k | density: vehicles per km of road (veh/km) |
| v_f,\ k_j | free-flow speed (km/h); jam density (veh/km) |
| k_c,\ q_{\max} | critical density (veh/km); capacity (veh/h) |
| T | reaction time, Herman et al. (s) |
| \lambda | sensitivity: how strongly a driver responds (1/s) |
| C = \lambda T | the one number that decides stability |
Appendix: the maths
A1 · Why q = k\,v
Take a steady stream: every car drives at speed v, with spacing s from one front bumper to the next.
- The headway, the time between two cars passing a point, is the time to cover one spacing: h = s/v.
- Flow is cars per unit time: one car every h, so q = 1/h.
- Density is cars per unit length: one car every s, so k = 1/s.
Put together:
\begin{aligned} q &= \frac{1}{h} = \frac{v}{s} \\ &= \frac{1}{s}\cdot v = k\,v. \end{aligned}
Units: veh/km × km/h = veh/h. Lecture 2 shows that q = k\,v holds for any traffic, not only a steady stream, once flow, density and speed are measured over the same region of the time-space diagram (Edie’s definitions).
A2 · The 1959 model, in speed changes
Let every car cruise at the same speed v_0, and write u_n(t) = \dot x_n(t) - v_0 for car n’s speed change. The constant v_0 drops out of a difference, so the model becomes
\begin{aligned} \dot u_{n+1}(t) &= \lambda\,\Delta_n(t-T), \\ \Delta_n &= u_n - u_{n+1}, \end{aligned}
where \Delta_n is the speed difference between car n and the car behind it. It is linear: double the leader’s disturbance and every response doubles. That is why one number can decide everything. Measure time in reaction times, \tau = t/T, and the model depends on \lambda and T only through
C = \lambda\,T.
A3 · One follower: where 1/e and \pi/2 come from
Let the leader settle back to cruising, u_n = 0. The follower obeys
\dot u(t) = -\lambda\,u(t-T).
Try u(t) = e^{zt}, the usual guess for a linear equation. Then z = -\lambda e^{-zT}. Multiply by T and write \mu = zT:
\mu = -C\,e^{-\mu}.
The follower settles down if every solution \mu has a negative real part; it creeps back without overshooting if there is a negative real solution.
Smooth return. For real \mu, rewrite the equation as \mu\,e^{\mu} = -C. The left side has its smallest value, -1/e, at \mu = -1. So a real solution exists exactly when -C \ge -1/e:
C \le \frac{1}{e} \approx 0.37.
Oscillating, but settling. For larger C the solutions are complex: the follower overshoots and oscillates. It stops settling when a solution reaches the imaginary axis, \mu = i\theta:
\begin{aligned} i\theta &= -C\,e^{-i\theta} \\ &= -C\cos\theta + iC\sin\theta. \end{aligned}
The real parts give 0 = -C\cos\theta, so \theta = \pi/2. The imaginary parts give \theta = C\sin\theta, so C = \pi/2.
| C | One follower |
|---|---|
| C \le 1/e | returns smoothly |
| 1/e < C < \pi/2 | oscillates, then settles |
| C > \pi/2 | oscillates, and the oscillation grows |
A4 · A line of cars: where 1/2 comes from
Now let the car ahead wobble steadily at angular frequency \omega: u_n = A\,e^{i\omega t}. A linear model answers at the same frequency, u_{n+1} = G\,u_n. Put both into A2’s model:
\begin{aligned} i\omega\,G &= \lambda e^{-i\omega T}(1 - G), \\ G &= \frac{\lambda e^{-i\omega T}}{i\omega + \lambda e^{-i\omega T}}. \end{aligned}
The wobble shrinks from car to car if |G| \le 1, that is |1/G|^2 \ge 1. With r = \omega/\lambda:
\begin{aligned} \Big|\frac{1}{G}\Big|^2 &= \big|1 + i r e^{i\omega T}\big|^2 \\ &= 1 - 2r\sin\omega T + r^2. \end{aligned}
So the line damps a wobble of frequency \omega exactly when
\begin{aligned} r^2 &\ge 2r\sin\omega T, \\ \frac{\omega}{\lambda} &\ge 2\sin\omega T. \end{aligned}
- Slow wobbles decide it. For small \omega, \sin\omega T \approx \omega T, and the condition becomes 1/\lambda \ge 2T, that is C \le 1/2.
- That is enough for every wobble. Since \sin x \le x, if C \le 1/2 then 2\sin\omega T \le 2\omega T \le \omega/\lambda for every \omega.
So a line of these drivers damps every disturbance exactly when
C = \lambda\,T \le \frac{1}{2}.
Between 1/2 and \pi/2, each follower settles on its own (A3), but slow wobbles grow from car to car: a phantom jam. Lecture 9 builds on this with the drivers of Lecture 8.