The NaSch model: Phantom traffic jams

energy-china-transit-traffic-2_30863_600x450
Most people have probably already encountered the phenomenon: One is cruising down the freeway, when suddenly the traffic thickens and slows to a complete stop. When traffic resumes moving one notes there was no apparent reason for the halt, no accident, no detour, no construction. Traffic jams seem to appear out of the blue without any apparent reason. The first model of freeway traffic to successfully explain the occurence of these “phantom traffic jams” was invented at the university of Cologne by Kai Nagel and Michael Schreckenberg in ’92. They proposed a probabilstic cellular automaton (CA) model for single-lane freeway traffic.

Using very simple rules, this model is able to reproduce the basic phenomena of real traffic, such as the occurance of the traffic jams out of nowhere. The model is a minimal model in the sense that any further simplification of the rules no longer produces realistic simulation results. A proper modelling of the “fine-structure” of traffic, however, necessitates the introduction of additional and/or the modification of the existing rules.

The NaSch model (as a cellular automaton) discretizes both space and time. The road is divided into cells of (approximately) 7.5 m length. Each cell can be in one of two states, being either occupied by a car or not. The state of car j (j=1,\dots,N) is characterized by its position r_j and velocity v_j (v_j=1,\dots,v_{\rm max}). The state of the system at time t+1 can be obtained from the state at time t by applying the following four rules to all cars at the same time (parallel update):

  1. Acceleration
    v_j(t) \rightarrow v_j(t+\frac{1}{3}) = \text{min}(v_j(t)+1,v_{\rm max})
    or in code:

    for (var i=0;i<no_of_cars;i++) {
       if(cars[i].velocity < maxV) {
          cars[i].velocity = cars[i].velocity + 1;
       }
    }
    
  2. Braking
    v_j(t+\frac{1}{3}) \rightarrow v_j(t+\frac{2}{3}) = \text{min}(v_j(t+\frac{1}{3}),r_{j+1}(t)-r_{j}(t))
    or in code:

    for (var i=0;i<no_of_cars;i++) {
       cars[i].velocity = Math.min( cars[i].velocity,
               (cars[(i+1)%no_of_cars].position+c - cars[i].position ) % c -1 );
       }
    
  3. Randomization
    With probability p:
    v_j(t + \frac{2}{3}) \rightarrow v_j(t+1) = \text{max}(0,v_j(t+\frac{2}{3})-1)
    or in code:

    for (var i=0;i<no_of_cars;i++) {
       var r = Math.random();
       if( (cars[i].velocity > 0) && ( r <  l ) ) {
          cars[i].velocity = cars[i].velocity - 1;
       }
    }
    
  4. Driving
    r_j(t) \rightarrow r_j(t+1) = r_j(t) + v_j(t+1)
    or in code:

    for (var i=0;i<no_of_cars;i++) {
        cars[i].position=(cars[i].position+cars[i].velocity / steps);
    }
    

One time step in the simulation corresponds to roughly 1 second. The NaSch model does not attempt to describe traffic flow accurately on a microscopic level. The motion of a single car may therefore exhibit unnatural features, but averaging over a large number of cars or a large timescale produces quite realistic results. Macroscopic effects, such as spontaneous formation of a jam, can therefore be readily understood from the model by varying the car density d and the braking probability p.

Below a the output of a JavaScript implementation of the CA is shown. The one-dimensional street is divided into 200 cells and subject to periodic boundary conditions. Car density and braking probability can be set using the spinner boxes. Cars are randomly colored. The lower plot has time on the y-axis and shows that the congestions themselves move in the direction opposite to the direction of the cars. The avg. velocity is given by \bar{v}=\frac{1}{N}\sum_{j=1}^N v_j and the avg. flow as \bar{j} = d \bar{v} with d the density.

For a braking probability of p=0.15 the avg. flow peaks around d=0.2. For higher densities the congestions build up, which reduce the \bar{v} strongly and lead to a suppression of the avg. flow.










avgV2

flow2