15.6 Neuron Models ended by dropping diffusion. Here there is none: cars on a road obey a pure conservation law with a nonlinear flux, so information travels only along characteristics, can pile up into shocks, and can open into fans. Everything from 9.10 First-Order PDEs: Advection & Characteristics, 9.11 Nonlinear Waves: Burgers' Equation & Shocks and 10.10 The Finite Volume Method returns, with a twist: the shock is a traffic jam, and its speed can be negative. We then ask where the continuum picture fails, using one ODE per car, and close Module 15 with its toolbox.
Transcript
- The last lesson ended by dropping diffusion. Here there is none. Cars on a road obey a pure conservation law: the cars on a stretch change only by crossing its ends, so rho t plus q x equals zero, with flux q equal to density times speed. Let speed depend on density alone and the flux is nonlinear: the Lighthill-Whitham-Richards model. With no diffusion, information travels only along characteristics, so waves can pile into shocks and open into fans. The twist is that a traffic jam can move backward.
- The simplest speed law is Greenshields' straight line: speed falls from v max to zero as density rises to rho max. The flux is a parabola, zero on an empty road and zero when cars are parked, with its maximum at the critical density, half of rho max. That maximum is the capacity, v max rho max over 4. Take 20 metres per second and 0.125 cars per metre: capacity is 0.625 cars per second, 2250 cars per hour, at 62.5 cars per kilometre and 10 metres per second. With both maxima 1, capacity is 0.25.
- Expand the flux and rho is constant along lines whose speed is q prime, v max times 1 minus 2 rho over rho max. Two facts. Waves are slower than the cars, so a driver overtakes them. And q prime changes sign at the critical density: in dense traffic waves travel backward, so the front of a jam dissolves while its back grows. At rho max the wave speed is minus v max. Smooth data, 0.4 plus 0.1 sine of 2 pi x, break when characteristics first cross, at t star equal 0.7958.
- A red light. Integrating over a box around a jump gives the Rankine-Hugoniot speed: flux difference over density difference, which for Greenshields is v max times 1 minus the sum of the two densities over rho max. Traffic at 0.3 of rho max meets a stopped queue at rho max: the speed is minus 0.3 v max, minus 6 metres per second, so the tail of the queue moves up the road. After a 30 second red it is 180 metres long, holding 22.5 cars: 15.75 arrived, plus 6.75 already there. Godunov puts the shock at minus 0.141.
- A green light: the queue sits upstream, the road ahead is empty. Characteristics run at minus v max on the left and plus v max on the right, so they fan apart, leaving density rho max over 2 times 1 minus x over v max t. At the light itself the density is half of rho max for all time, so the queue discharges at capacity, 0.625 cars per second, never faster. Godunov agrees: the central flux is 0.25, with the neighbouring cells at 0.5100 and 0.4900.
- Godunov's flux is the exact Riemann flux at each face: the minimum of q over the interval when density rises, the maximum when it falls, and the capacity when the interval straddles the critical density. On smooth data it is first order: observed orders 0.972, 0.983, 0.992 as the grid doubles from 100 to 800. The fan is slower, 0.717 to 0.786. The time step matters too. In a jam test the first undershoot appears at 1.26, densities go negative at 1.37, and the run overflows at 1.38.
- LWR says drivers adopt the right speed instantly. Real drivers lag. The optimal velocity model puts one equation on each car: acceleration is a times the speed its headway allows. Linearise around uniform flow and a wave has lambda squared plus a lambda equal to a V prime times e to the i k minus 1. Long waves grow exactly when V prime exceeds a over 2, that is, above the critical density. With a equal 0.8 it is 0.63246. At 0.62 every mode decays; at 0.8 the fastest mode grows at 0.031487.
- Run 100 cars at density 0.8, seeded at 10 to the minus 3, to time 2500. Uniform flow is gone: the cars stop and go. The mean flux is 0.15125 against the uniform 0.16, a 5.5 percent drop. Speeds run from nearly stopped to 0.437, over twice the equilibrium 0.2. The pattern drifts backward at 0.5980, close to the LWR speed of minus 0.6. And the minimum headway is 0.823, below 1: cars overlap. A Godunov solution can only translate and sharpen. LWR explains what happens once a jam exists, not why it forms.
- That closes Module 15: seven systems, one toolbox. What is conserved? Where is the equilibrium, and are its eigenvalues stable? How does it bifurcate as a parameter moves? And what step does the fastest scale demand? Module 16 turns this toolbox into builds: a solver you assemble, then a full speed browser simulation. Two capstones exist, the wind tunnel and the flight simulator. Next is the Reaction-Diffusion Pattern Lab: a Gray-Scott map of F and k, painted seeds, and an implicit option for the stiff step.
Cars as a conserved fluid
Let be the number of cars per unit length and their speed, so the flux is . Cars on a stretch change only by crossing the ends:
This is exactly the integral law of 2.10 Green, Stokes & the Divergence Theorem and the 1D continuity equation of 11.2 Conservation of Mass: The Continuity Equation. It becomes a model when we say how fast drivers go. The Lighthill-Whitham-Richards (LWR) model (names and the 1950s date from memory) assumes speed is a function of density alone, . The simplest choice is Greenshields’ straight line (also from memory),
with free speed and bumper-to-bumper density . The graph of against is the fundamental diagram: a parabola, zero at (empty road) and at (parked cars), with maximum at the critical density . That maximum is the road’s capacity .
Example. Take m/s (72 km/h) and cars/m (8 m per car). Capacity is cars/s, which is cars/hour, reached at cars/km and a speed of m/s. (Real lanes carry about cars/hour, from memory, so the numbers are plausible, but the straight-line law is a guess, not a measurement.) Below I use units with , so , capacity .
Characteristics, forward and backward
Expand the flux: , with
As in 9.10 First-Order PDEs: Advection & Characteristics, is constant along lines . Two facts matter. First, and , so waves travel slower than the cars: a driver overtakes the wave. Second, changes sign at the critical density. In sparse traffic, information moves forward; in dense traffic, backward, so a driver at the back of a jam learns about the jam only by running into it, while the jam’s front edge dissolves behind. At the speed is , far faster than real jam fronts (about to km/h, from memory), one visible flaw of the straight line.
Since is negative, a higher density travels slower. Unlike Burgers’ equation, denser parts lag. Smooth data breaks when , at .
A red light: the shock
Integrating over a box containing a jump at (the derivation of 9.11 Nonlinear Waves: Burgers' Equation & Shocks) gives the Rankine-Hugoniot speed
the average of the characteristic speeds on the two sides because is quadratic. A jump is physical only if characteristics enter it from both sides: , the entropy condition. For a concave flux this means : density may jump up as you move downstream, never down. Cars decelerate abruptly into a jam; they cannot jump out of one.
Example: a red light. Traffic of density meets the stopped queue at behind a red light. Then m/s: the tail of the queue moves backward, up the road, at m/s. After a s red the queue is m long. Check by counting cars: the queue holds cars. They arrived at flux cars/s for s ( cars), plus the cars already on that stretch. Total . The shock speed is conservation of cars written as a speed.
A green light: the rarefaction fan
Now the queue sits upstream () and the road ahead is empty (). Characteristic speeds are on the left and on the right, so they fan apart, leaving a wedge with no characteristics, exactly as in Burgers. Characteristics through the corner carry constant with :
At the light itself, , the density is for all time: the queue discharges at capacity, cars/s, not at free flow. The front of the queue releases backward at . This is why a long queue clears slowly: a road feeds cars through a bottleneck at capacity, never faster.
Godunov’s scheme for traffic
The finite-volume update of 10.10 The Finite Volume Method is , with Godunov’s flux the exact Riemann flux at the face. For any flux, that is the minimum of over if , and the maximum of over otherwise. With concave :
The middle case is the green light: a sonic point, where the flux is capacity. Godunov’s method gets it right automatically.
Checks (grid on , , time ; sim and an independent numpy marcher agree to every digit shown):
- Red light, meeting : where crosses , the shock is at ; exact .
- Jam front, meeting : shock at ; exact .
- Green light: the flux through the central face is exactly, with the two cells beside it at and .
Convergence. The table gives the error against the exact solution (cell averages by sampling) with , for smooth data on a periodic unit road at , before breaking, and for the green-light fan on at .
| smooth error () | ||||
| smooth order | ||||
| fan error () | ||||
| fan order |
Smooth data give first order (4.1 Local Error, Global Error & Order). The fan converges more slowly, with orders creeping upward; I did not run finer grids to see whether they reach (I suspect the kinks at the fan edges). For a shock, the error divided by the jump times is cells for : a fraction of a cell, erratic rather than a power law.
The time step. Information must not cross more than one cell per step, so . Test a jam of density on in traffic of density on a periodic unit road, , to . A stable monotone scheme never makes new extrema, so no density can fall below . At the minimum is to . The first undershoot appears at ; at the minimum is ; at it is (negative cars); at the run overflows. Sim and numpy agree. The bound is conservative, but violating it is real (10.5 Wave Equation Numerics & the CFL Condition).
The ring road and the limit of LWR
LWR says drivers instantly adopt the speed . Real drivers take time. The optimal-velocity model (Bando and coauthors, 1990s, from memory) puts one ODE on each car: car relaxes toward the speed its headway allows,
This is the Greenshields law in headway (, ). Uniform flow is the same equilibrium in both models; they differ only through the response rate , the reciprocal of the driver’s lag. Set .
Stability. Put and linearise: with . A wave has
For long waves, , with (substitute and match powers of ). The first term is a wave moving at the LWR characteristic speed; the second decides growth. Uniform flow is unstable to long waves exactly when , i.e. above the critical density
I read the factor as the cost of driver lag: as the model tends to LWR, and the criterion holds at every density. This resembles Whitham’s sub-characteristic condition (from memory), but I did not derive the link.
Numbers (ring of cars, , so ; “Jacobian” is the numpy eigenvalue of the full linearisation, “sim” is the RK4 car simulation with seeded at amplitude , rate fitted from to ):
| most unstable mode | Re (quadratic) | Jacobian | sim | |
|---|---|---|---|---|
Below every mode decays; above it the fastest mode is not the longest. At , against , so the long-wave expansion is good to about . The pattern moves relative to the road at , against the LWR characteristic speed : it moves backward.
Where it ends. Seed mode at at and run to (RK4, ; independent check with scipy’s DOP853, rtol ). Averaged over the last time units: flux against the equilibrium , a drop; speeds range from about (stopped) to (over twice the equilibrium ); minimum headway . That last number is below : cars overlap, since the model has no collision avoidance. I ran one seed; I did not test how the average depends on it.
The picture is the honest limit of LWR. A Godunov solution on the same ring, started from the same density, can only translate and sharpen: a monotone scheme creates no new maxima. LWR cannot turn a smooth uniform flow into stop-and-go traffic, though a lag makes real ones do so (a circular-track experiment with real cars, from memory, found this). LWR is for what happens when a jam exists (queue growth, discharge), not why one forms.
What both models leave out
One lane, one kind of driver, no lane changes or on-ramps, and a speed law chosen by hand. The numbers above belong to equation sets, not to roads.
Module 15 in one table
Seven lessons, seven systems, one toolbox.
| lesson | what is conserved or balanced | what loses stability | what limits the step |
|---|---|---|---|
| population | births against deaths | Allee threshold, harvesting fold | Euler turns logistic into a map |
| predator-prey | LV: | Hopf of Rosenzweig-MacArthur | Euler spirals outward |
| epidemics | final size by Newton | ||
| chemical kinetics | atoms | Brusselator Hopf at | Robertson stiffness |
| reaction-diffusion | species with fluxes | Turing band | explicit diffusion limit |
| neurons | charge | HH Hopf at , FHN at | per ms on the upstroke |
| traffic | cars |
The same four questions were asked each time. What is conserved, so the model is a balance? Where is the equilibrium, and do the eigenvalues of its Jacobian lie in the left half-plane (7.7 Nonlinear Systems & Linearization)? As a parameter moves, how does it bifurcate (3.9 Bifurcations)? And what step does the fastest scale demand (4.5 Stability Regions & Stiffness)? Entries in the table are quoted from those lessons, not re-derived here.
Where this goes next
That ends the models. Module 16 turns the toolbox into builds: longer pages with a solver you assemble step by step, then a full-speed browser simulation. Two capstones already exist, 16.1 Capstone: 2D Virtual Wind Tunnel and 16.2 Capstone: 6-DOF Flight Simulator with Autopilot. The next one in the plan, 16.3 Capstone: Reaction–Diffusion Pattern Lab, returns to this module’s 15.5 Reaction–Diffusion & Turing Patterns: a Gray-Scott pattern lab that explores the whole map, takes painted seeds and adds an implicit option for the stiff step.
The exercise: Godunov flux, step and the stability threshold
The playground marches a red and a green light with the Godunov update (written without comparisons) and reports the shock position and the discharge flux. In the exercise you write the flux, the step, the growth rate of a ring-road mode and the critical density.
Concept checks
Problems
A road has m/s and cars/m (Greenshields). Find the capacity in cars per hour, the critical density, and the wave speed at cars/m.
Show worked solution
Capacity car/s cars/hour, at the critical density cars/m (speed m/s). At , and m/s: waves move backward at m/s while the cars still move forward at m/s.
With m/s, free traffic of density meets a slower stream of density . Find the shock speed, check the entropy condition, and say how long the front takes to move m upstream.
Show worked solution
m/s. Characteristic speeds are and m/s; , so characteristics enter the shock from both sides. Moving m upstream takes s.
For the optimal-velocity model with on a ring at : (a) find ; (b) find the response rate above which the long-wave instability disappears; (c) is stable?
Show worked solution
(a) . (b) Stability needs , so . (c) , so long waves decay. (The criterion comes from the long-wave limit . Short waves of a finite ring were not examined here.)
Key Takeaways
- Cars obey ; Greenshields’ has capacity at the critical density (a modelling guess, not a law).
- Characteristic speeds are slower than the cars and negative above critical density: jams move backward.
- A red light is a shock of speed (for meeting , ), checked by counting cars in a m queue; a green light is a fan that discharges at capacity.
- Godunov’s flux is the min or max of over the interval; it converged at order to on smooth data, more slowly on a fan, and holds shocks to a fraction of a cell.
- The time step bound is conservative but real: undershoot at , negative density at , overflow at on the jam test.
- On a ring the optimal-velocity model has the same equilibrium as LWR but loses stability when ; the measured growth rate matches the Jacobian, and the pattern moves at , near the LWR speed .
- LWR cannot grow a jam from smooth flow, because it has no driver lag; the car model can, at the cost of overlapping cars.
- Module 15’s toolbox: conservation, equilibrium stability, bifurcation and a step limit from the fastest scale. Next is the first capstone of Module 16, the reaction-diffusion pattern lab.