First Hurdle Second Draft

18
Yan Qi Huan [email protected] Ph 11 First Hurdle Fall 2015 Caltech 1

Transcript of First Hurdle Second Draft

Page 1: First Hurdle Second Draft

Yan Qi [email protected]

Ph 11 First Hurdle

Fall 2015

Caltech

1

Page 2: First Hurdle Second Draft

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1 Qualitative Explanation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Discussion of Relevant Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Modelling of Traffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.1 Basic Concepts of the model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.2 Implementation of Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.2.1 Parameters of Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2.2 Algorithm and Logic of Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2.3 Illustration of Typical Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Discussion of Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.1 Traffic Density as a function of time before collision . . . . . . . . . . . . . . . . . . . . . . . 9

3.1.1 Low Equilibrium Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.1.2 High Equilibrium Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.1.3 Average speed as a function of Equilibrium Density . . . . . . . . . . . . . . . . . . . 12

3.2 Traffic Density as a function of time after collision . . . . . . . . . . . . . . . . . . . . . . . . 123.2.1 Overview of time-dependent traffic behaviour . . . . . . . . . . . . . . . . . . . . . . . 123.2.2 Length of the Traffic Jam caused . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2.3 An Aside: Lane of the Accident Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.2.4 Recovery of the system to Steady-State . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.3 Discrete Nature of the Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2

Page 3: First Hurdle Second Draft

1 Introduction

We have one key aim in this report, namely to determine the density of cars during a traffic jam alongboth sides of a highway, as a function of position and time. To this end, we shall label the density of carsby ρ(x, t), and it will be the primary subject of investigation in this report. To be clear, ρ will defined asthe number of cars per unit length of the highway, with the number of cars summed across all lanes on oneside of the highway. With a thorough understanding of the behaviour of ρ(x, t), we will be able to answerthe other parts of the question, namely:

1. How do the different mechanisms of traffic formation on both sides of the highway affect the dynamicsof traffic and the behaviour of ρ(x, t)?

2. How does the length of the backup change over time?

3. How long does it take for traffic to resume its steady-state value on both sides of the highway?

1.1 Qualitative Explanation

To begin with, we immediately identify that the densities along both sides of the highway must bedifferent, and we will adopt the notation that the side with the car crash will be labelled as the c side, whilethe other or observer will be labelled as the o side.

We will first start by discussing why the traffic jam forms in the first place, and this will help us increating a mathematical model to understand the behaviour more fully. We will start with the side with theaccident, the c side.

Since the accident was specified to be a fender bender, we will assume that the involved cars occupyexactly 1 lane on the 4-lane highway. It is apparent why traffic will form on the c side as a result of theaccident. This is because in the region of the accident site, the width of the highway is reduced to 3 lanes.Therefore, the traffic in the same lane as the cars in the accident are forced to change lanes to an unobstructedlane. While waiting for an opportunity to change into an open lane, they will be travelling at a very slowspeed or might even be stationary, and this causes a build-up of traffic in the accident lane. Furthermore,as the traffic in the adjacent lanes will have to slow down to allow cars to change into their lanes, this willalso cause an increase in traffic density in the lanes which are not directly affected by the accident.

Next, we will look at why there is a traffic jam on the o side of the road. This seems to be somewhatsurprising, given that there is no obstruction on this side of the road. The main reason, it seems, is thatthere is a tendency for people to slow down and observe what is happening on the other side of the highwaywhen they observe a traffic jam or an accident that has occurred. This is caused by the curiosity of thedrivers, and as the saying goes “curiosity killed the cat”, while in this case, curiosity killed the free-flowingtraffic and turned it into a needless traffic jam.

Lastly, we will also look at the recovery of the system back to its steady state. For the c side, the carsinvolved in the accident will eventually be towed or driven off, thus clearing the bottleneck and restoring thefull capacity of the highway. Following this, on the o side, as the traffic jam on the c side dissipates, therewill no longer be any reason to slow down, and thus they, too, return to their steady speed.

1.2 Discussion of Relevant Variables

In this section, we will go into further detail on which variables we deem important in solving for thedensity of traffic ρ(x, t). Furthermore, as a preparation for the actual modelling in the next section, we willstate very generally how we expect certain variables to behave, to act as a guideline in the formulation ofthe actual model.

3

Page 4: First Hurdle Second Draft

For simplicity’s sake, all cars will be taken to be identical. For both sides, we identify the followingimportant variables:

1. Steady-state density of cars, ρeq (measured in car m−1)

2. Steady-state average velocity of cars, veq. Note that ρeq and veq are related to the equilibrium flux ofcars qeq (defined as the number of cars flowing past a point per unit time) by the continuity equation,q = ρv.

3. Maximum velocity of the vehicles vmax. This could either be the legal speed limit or the maximumsafe/practical vehicular speed.

4. Acceleration of the vehicles, a. We would expect that generally, cars would accelerate as long as theyare below the speed limit, and are keeping a safe distance from the next car.

5. Number of lanes on the highway, which is fixed as 4 on both sides in this case.

We can also identify variables that are specific to only one side of the highway, since they have differentmechanisms for the formation of traffic. For the side with the car crash (the c side), we have:

1. Lane the accident occurs in, as this will affect the number of lanes that the drivers in the affected lanecan switch into

On the other hand, for the other side (the o side), we have:

1. Speed of vehicles vo, as a function of the density of cars on the c side. We would expect that the valueof vo would decrease as ρc increases, since the drivers would be more curious at the increased trafficon the c side, and thus slow down more to observe what is going on.

2 Modelling of Traffic

2.1 Basic Concepts of the model

The phenomenon of the formation of traffic jams is well-studied, and there have been many modelsdeveloped to study and predict the behaviour of traffic. The two most prominent methods have been to:

1. Treat the cars as a continuous “fluid”, and use differential equations to model the flow of this fluidthrough a “pipe”, which is the highway.

2. Treat the cars as discrete entities in a cellular automata model, placing them in a discrete latticeand having them obey certain fixed rules regarding how they interact with neighbouring cars. Thisapproach was described in detail by Nagel & Schreckenberg [1], where they described an algorithm tomodel the movement of free-flowing traffic for a single lane, as well as a short description on bottlenecksituations.

In this report, we shall follow the second approach. In addition to adopting the key ideas of Nagel &Schreckenberg’s model for single-lane free-flowing traffic, we have improved on their method by includingthe presence of a fixed obstacle, as well as modelling the changing of lanes by the vehicles affected by theobstacle in a multi-lane system.The main advantage of this approach is that it allows us to model explicitlyhow the cars behave when they encounter an immovable obstacle that is placed at an arbitrary position.More specifically, we can specify how cars change lanes in response to different waiting times in differentlanes, something which is more difficult to control using the fluid method.

4

Page 5: First Hurdle Second Draft

2.2 Implementation of Simulation

2.2.1 Parameters of Simulation

The simulation was implemented in Python, with the following parameters as stated below:

Parameter Significance Typical ValuesNcells Number of cells simulated for each lane 10000 cellsNlanes Number of lanes on each side of the road 4vmax Maximum velocity on the road 5 cells timestep−1

tmax Number of time steps to run the simulation for 100∼1000 time stepsρeq Number density of cars in the absence of an obstacle 0.1∼0.4 car cell−1

veq Average velocity of cars in the absence of an obstacle 2.5 cell timestep−1

pslow,c Probability that any given car with velocity v > 1 on the c sidewill slow down randomly during any given time step

0.2

pslow,o Probability that any given car with velocity v > 1 on the o sidewill slow down randomly during any given time step. Since thisprobability of slowing down is proportional to ρc, thus a highertraffic density on the c side will cause the o traffic to slow downmore. The factor of 1

2 is there so that the resultant values ofpslow,o are within a reasonable range of around 0.5.

ρc(x)2ρeq

pout Probability that a car that is stuck (sufficiently close) behind theaccident in the same lane as the accident will switch out to anadjacent lane, if it is able to.

0.3

pin Probability that a car that has passed the accident (and is stillsufficiently close to the accident) and is in an adjacent lane to theaccident lane will switch into the accident lane, if it is able to.

0.7

dbef Quantifies the “sufficiently close” for switching out of the accidentlane. Cars that are this distance or closer to the accident in theaccident lane will have a possibility of switching to an adjacentopen lane.

2 cells

daft Quantifies the “sufficiently close” for switching into the accidentlane. Cars that are this distance or closer to the accident in a laneadjacent to the accident lane will have a possibility of switchinginto the accident lane if it is open.

4 cells

2.2.2 Algorithm and Logic of Simulation

The simulation starts by initialising an array of with Nlanes rows and Ncells columns with the None

Python data-type, indicating that no cars are present. The large number of 10000 cells are chosen to reduceedge effects, especially those at the right (exit) edge, since cars can freely exit at the right edge without anybottleneck, so cars near to the right edge are able to accelerate until most of them hit the speed limit.

Afterwards, with some probability ρeq, each entry in the array is initialised to contain an integer repre-senting the velocity of the car occupying that point. The velocities of the cars are set to follow a Gaussiandistribution with mean veq (which is 2.5 cell timestep−1 in our case) and standard deviation 1. The valuesof the Gaussian distribution are rounded to the nearest integers. Since cars should not be stationary at thebeginning, nor should they exceed the speed limit, hence any values that are less than 1 or more than 5 areset to 1 and 5 respectively.

During each time step from 1 to tmax, we apply the following operations in order:

5

Page 6: First Hurdle Second Draft

1. Change Out Lane: Cars that are located in the accident lane, behind the accident location(in term of x position), within a certain distance dbef of the accident location, and havevelocities less than 3 will change into an adjacent location with probability pout. If bothadjacent lanes are filled with cars, then the car will stay in its spot. Otherwise, it will switch to thelane which has a larger distance to the next car in front of it (that is, it will choose the lane that hasmore free space for it). The variable dbef is set to 2, to model the fact that in real life, cars oftenchange lanes only when they get close to the actual accident site and realise that there is an immovableobstacle in front of them, and thus they are forced to change lanes. Furthermore, the speed ceilingof 3 represents the fact that cars will think about changing lanes only if they experience a slowdownin traffic, otherwise they would assume that nothing is wrong and continue as normal. Lastly, theprobability pout of changing out of the accident lane is set to be a rather low value of 0.3, as thisrepresents the difficulty of changing lanes during heavy traffic, since other cars are unlikely to give way,so the car has to stop and wait for some time before he can successfully change out of the accidentlane.

2. Change In Lane: Cars that are located in lanes adjacent to the accident lane, after theaccident location (in terms of x position), and are within a certain distance daft of theaccident location will change into the accident lane with probability pin, given that theaccident lane is open and that it offers a larger distance to the next car than the current lane. Thisrepresents the fact that there is often a void in the accident right after the accident site, so cars inadjacent lanes will change into the accident lane to take advantage of the lack of traffic in that lane.The parameter daft is set at 4, representing the distance beyond which cars are no longer likely toswitch into the accident lane since the traffic is likely to have spread out. Also, pin is relatively highat 0.7, since there is likely to be few cars present in the accident lane right after the accident site so itis easy to switch into that lane.

3. Accelerate: All cars increase their velocities by 1 unit if possible, as long as their velocitydoes not exceed the maximum velocity, and also will not cause them to hit the car right in front ofthem if they moved at that velocity for 1 time step, assuming that the car in front stays stationary.The reason why we assume that the front car is stationary when deciding whether or not accelerate isbecause in reality, cars will always keep a safety distance between them, so the driver should keep asafe distance even if the front car makes an emergency brake.

4. Decelerate: For all cars, if their current velocity is larger than the distance to the nextcar, set it to be equal to the distance to the next car. This procedure means we check that allcars will not hit the car right in front of them if they travel at their current velocity for 1 time step andassuming that the front car is stationary. Once again, the assumption that the front car is stationaryis to model the safety distance that drivers keep from the car in front of them. If they will hit the carin front of them, then the driver will decelerate just sufficiently to prevent hitting the front car.

5. Randomised Change: All cars with velocities greather than 1 will decrease their velocitiesby 1 unit with a probability pslow. This simulates random fluctuations in the cars’ velocities, andcan be explained, for instance, when drivers accidentally brake too hard, causing jerky changes invelocities. pslow is set to a value of 0.2 to represent the fact that this random phenomenon occursrelatively rarely. Also, cars with velocities 1 are excluded from this random decrease, since it isunlikely that a car will stop on its own on a highway.

6. Advance: All cars move forward by a distance equal to their current velocities. Cars at theright edge disappear, while new cars appear from the left edge with the same probability and velocitydistribution as the initialisation step.

For simplicity, we assume that no other lane changes occur except for the specified ones. This processis repeated for tmax time steps, and the traffic density at that time is computed across all values of x. Thetraffic density is defined as:

6

Page 7: First Hurdle Second Draft

ρ(x) =Total number of cars across all lanes in the interval [x− 50, x+ 49]

Number of cells across all lanes in the interval [x− 50, x+ 49]

That is, we compute a moving average with a window of 100 cells, to smooth out the irregularities dueto the discrete nature of the system. We can also define the average velocity of the traffic at a certainpoint in space v̄(x) in a very similar way.

v̄(x) =Total velocities of all cars across all lanes in the interval [x− 50, x+ 49]

Total number of cars across all lanes in the interval [x− 50, x+ 49]

2.2.3 Illustration of Typical Results

We show some typical simplified results below.

[..2..14..233...24..2.4.......311.424.2..4....3..1.]

[.2..20..200...30..2.1....4...00.100.1..2...3...2.1]

[...20.1.00.1..0.1..1.1......30.100.1..2...3..2..1.]

[.2.0.1.10.1..2.1..2.1..2....0.100.1..2...3.1...2.1]

[2.1.1.10.1.1..1..2.1..2...3..100.1..2...3.1..2..10]

[.1.1.10.1.1..2..2.1.1...2...200.1..2...3.1.1...200]

[1.1.10.1.1..2.1..1.1..2....300.1.1...2..1.1..2.00.]

[.1.10.1.1..2.1..2.1.1....3.00.1.1.1....2.1..2.10.1]

[1.10.1.1..2.1..2.1.1..2...10.1.1.1..2...1.1..10.1.]

[.10.1.1..2.1..2.1.1.1....30.1.1.1.1...2..1..20.1..]

[10.1.1..2.1.1..1.1.1..2..0.1.1.1.1..2...2..20.1.1.]

For this run, we did not create an accident as an obstacle and only simulated one lane for simplicity.Notethat although we are only showing 50 cells per lane, the simulation is in fact simulating all 10000 cells. Thenumbers represent the velocity of the car in that cell, while dots represent cells which are empty. The axisof time is downwards, with the initial state on top and the successive state directly below it.

By applying the 6 steps above (but omitting steps 1 and 2 since there is no obstacle), we can followany particular car or interest and trace its path in space over time. As a very rough verification of theapplicability of our model, we see that there are “waves” of backward propagating zeros, indicating regionsof slow/stationary traffic. These “phantom waves” where traffic jams are formed spontaneously without anyobservable cause and then proceed to propagate backwards are actually found to occur often in real traffic,and has been described extensively in literature, including [1], [2] and [3].

Now, we place an accident in the centre of the array, which is represented by “X”.

[......3.2423.2.....1..2..X.3..2312.4.341.431.22423]

[.......1000.1...3....2..2X...2000.1.100.100.10000.]

[...5...000.1..2.....4.1.0X...000.1.100.100.10000.1]

[......300.1..2...3...1.10X...00.1.100.100.10000.1.]

[......00.1..2...3...3.100X...0.1.100.100.10000.1.1]

[......0.1..2...3...3.1000X....1.100.100.10000.1.1.]

[.......1..2..2...2..10000X.....100.100.10000.1.1.1]

[..3......2..2...3..200000X.....00.100.10000.1.1.1.]

[......4...1...2...2000000X.....0.100.10000.1.1.1.1]

[..3......3.1.....30000000X......100.10000.1.1.1.1.]

7

Page 8: First Hurdle Second Draft

Here, we observe that the traffic naturally piles up as a result of the immoveable obstacle, hence showingthat the accident does indeed create a traffic jam as expected. In this simple 1-lane case, the cars are unableto change lanes and thus will pile up indefinitely. Henceforth, we will increase the complexity of the systemby increasing the number of lanes to 4, and we will not show the traffic arrays here as it will become muchmore complicated to study directly. Instead, we will study the ρ(x) graphs.

Figure 1: Typical ρ(x) graph for t = 100 time steps, ρeq = 0.4 car cell−1

The figure above shows the ρ(x) graph, with the parameters as stated in the caption. The red lineindicates the point x = 10000, which is the point of the accident (this figure and the subsequent one weresimulated with Ncells = 20000 instead of the usual 10000 for illustration purposes), while the green lineindicates the average density of traffic over the middle 60% x-positions in the array, to avoid edge effectsfrom the 2 sides. We clearly see an expected rapid increase of traffic density right before the accident.Somewhat paradoxically, we also see that traffic density decreases significantly after the accident site, andthis can be explained by the fact that during the time when the cars are stuck in the jam, the cars in front areable to move a far distance away, hence creating a large gap in traffic. Thus, the cars that have just emergedfrom the traffic jam are able to accelerate continuously, since there is little traffic. This is reminiscent of ourreal-life experience as well, where traffic suddenly becomes much smoother than usual once one has passedthe point of the accident.

We can also observe the average velocity v̄(x) of the traffic.

8

Page 9: First Hurdle Second Draft

Figure 2: Typical v̄(x) graph for t = 100 time steps, ρeq = 0.4 car cell−1

Here we observe an inverse trend as expected, with low velocities before the accident site and highervelocities right after the accident site.

3 Discussion of Results

3.1 Traffic Density as a function of time before collision

As the question prompts require us to work out a profile of traffic density as a function of time beforethe collision, we will take out the accident, and investigate the profile of cars over time.

3.1.1 Low Equilibrium Density

We start with a low equilibrium traffic density with ρeq = 0.2. The results are illustrated below, and aretypical of low traffic densities up to approximately 0.3. The colours and the legend for this graph (and formost of the following graphs) indicate different values of time.

9

Page 10: First Hurdle Second Draft

Figure 3: v̄(x, t) and ρ(x, t). Traffic over time for one side of the road, with no accident, ρeq = 0.2. Thecolours and the numbers in the legend indicate the point in time each snapshot was taken.

There are several key features of note. Firstly, we see that the average speed is rather high at around3.1, indicating mostly free flow traffic since the maximum velocity is 5. Moreover, it is difficult to discernany long-term patterns in either the average velocity or traffic density, indicating that the gaps betweenadjacent vehicles are large enough such that they do not affect each other significantly. Therefore, therandom fluctuations in traffic density and velocity over space and time are likely to be caused purely by therandomisation step. In summary, this illustrates that at low traffic densities, most cars are able to movefreely and there is no large-scale behaviour.

3.1.2 High Equilibrium Density

We contrast this with our findings for a high equilibrium traffic density with ρeq = 0.7. These results aretypical of traffic densities from approximately 0.4 upwards.

10

Page 11: First Hurdle Second Draft

Figure 4: v̄(x, t) and ρ(x, t). Traffic over time for one side of the road, with no accident, ρeq = 0.7. Don’tworry! Your eyes aren’t failing you, nor have the printers failed. The displaced patterns are part of themodel’s predictions.

In stark contrast, we see that in this case, the average velocity has dropped to 0.42. More significantly,we can clearly identify the backward-propagating waves of high traffic density, dubbed “jamitons” by [2].We can take a clearer look at these backward-propagating waves:

Figure 5: Close-up of backward-propagating “jamitons” for ρeq = 0.7

Here, we can clearly identify that the shape is maintained as it moves backwards with an almost constantspeed. This phenomenon is ubiquitous, and occurs seemingly spontaneously without any observable cause.This shows that for high traffic density situations, it is possible (and highly likely) that these spontaneous“phantom traffic jams” will appear.

11

Page 12: First Hurdle Second Draft

3.1.3 Average speed as a function of Equilibrium Density

To wrap up the section on traffic behaviour before the collision, we present here a graph of simulatedaverage car velocity at t = 200 as a function of the equilibrium density of traffic.

Figure 6: Average velocity of traffic v̄(x, t) at t = 200 as a function of equilibrium density ρeq. Equation oftrendline is v̄ = 7.80e−4.375ρeq

As expected, there is a sharp decrease in velocity as the equilibrium traffic density increases, correspondingto the fact that cars have less room to accelerate and thus are forced to slow down and stop more often.Overlaid onto the data points is an exponential trendline, which appears to explain the trend rather well,although our model does not provide an analytical reason for this trend.

3.2 Traffic Density as a function of time after collision

We shall now move onto our analysis of the actual problem, that of the buildup of traffic over time, inthe presence of an obstacle, which are the cars involved in the accident. In this section, we will restrict theanalysis to values of ρeq = 0.4.

3.2.1 Overview of time-dependent traffic behaviour

In this section, we placed an accident on the 2nd lane from the left of the c side, and modelled the trafficon both sides as a function of time and position.

12

Page 13: First Hurdle Second Draft

Figure 7: v̄(x, t) and ρ(x, t) for the c and o side

Here, we see that our model does indeed predict the main phenomenon described in the problem. Thatis, the formation of a traffic jam due to the accident located at x = 5000. Let us first look at the top twographs, which show the average velocities and traffic density for the c side.

We observe that there is an obvious growth of the extent of the traffic jam over time, and it maintains itstriangle-shaped profile over time, which is similar to the shape we observed in Figure 1 and Figure 2 wherewe plotted the traffic conditions only for 1 particular point in time. In the next section, we will investigatein more depth the length and growth of this traffic jam.

Before we move on to the results for the o side, we should note that since the two sides of the road aremoving in opposite directions, there is a need to clarify the convention that we are using to label the xpositions. In our case, the x axis is always oriented such that vehicles move in the direction of increasing x.Therefore, we see that the increase in traffic density for the o side actually occurs when x > 5000, and thismakes sense since the vehicles are travelling in the opposite direction, so they will see the traffic jam on thec side (which takes place at x < 5000 for the c side) to be at coordinates x > 5000.

13

Page 14: First Hurdle Second Draft

Figure 8: Orientation of x axes for both sides of the road

Moreover, we see that, unsurprisingly, the resulting disruption (in terms of both the increase in densityor the decrease in velocity)is much less pronounced than the one on the c side, and this corroborates withour real-life experience that while there is a disruption on the o side, it will never be as major as the resultingjam on the c side.

3.2.2 Length of the Traffic Jam caused

To measure the length of the traffic jam caused, we will first need to define what exactly is meant by this“length”. Here, we shall define this length as the distance between the accident site and the first point beforethe peak of traffic density where the traffic returns to its equilibrium average density value. This distance isillustrated in Figure 9. In the figure, we see that the length of the traffic jam is indicated by the blue line,which is the distance from the accident site to the first point before the peak of traffic density (red point)where the traffic returns to its equilibrium value (black point). The condition on the peak is necessary sothat we do not pick the other side of this peak instead.

Figure 9: The definition of the length of the traffic jam for t = 200 is indicated by the blue arrows. Theblack arrow points to the point where the traffic returns to its equilibrium average (the thin green line),while the red arrow points to the peak of the traffic density.

The results for the c side are as follows:

14

Page 15: First Hurdle Second Draft

Figure 10: Simulated length of the traffic jam on the c side L as a function of time t. Overlaid in red is alinear trendline with equation L(t) = 0.62t+ 88.

Here, we see that the length of the traffic jam on the c side is actually found to obey a linear trend verywell, and this can partially be explained by the fact that there is a roughly constant flux of cars entering theaccident region, but only a smaller flux of cars exiting. Hence, there is a net constant flux of cars enteringthe region, leading to constant rate of increase.

However, it is important to note the limitations of this linear trend, since the intercept of the line isnonzero but is in fact positive. This means that we will expect that nearer to t = 0, this trendline willturn downwards, making its shape near 0 look something qualitatively like a square root graph (having largegradient near 0 and flattening out afterwards).

In theory, this process can also be repeated for the o side to obtain a relation of the length of the trafficjam on the o side as a function of time. However, as can be seen from Figure 7, there is little variationin the traffic jam length for the o side as a function of time, so this particular set of data is unsuitable foranalysis. In theory, it could be possible to increase the time variation for the o side by making the functionthat governs the probability of a car on the o side slowing down pslow,o more sensitive to increases in trafficdensity ρ on the c side.

3.2.3 An Aside: Lane of the Accident Site

Here we will mention an interesting phenomenon that was discovered but due to space and time con-straints, will not be reported here. It was discovered that the lane that the accident site occurs in actuallyaffects the dynamics of the system. This is because in the design of the algorithm, as part of the driver’sresponse to the accident, drivers in the same lane as the accident are allowed to change to adjacent lanes sothat they will not wait indefinitely behind the obstacle. Therefore, if the accident occurs in the lanes on theedge of the road, the traffic will dissipate at a slower rate, as the affected cars only have 1 lane that theycan switch into, as opposed to the 2 possible alternatives if the accident had occurred in a middle lane.

3.2.4 Recovery of the system to Steady-State

Finally, as specified by the question, we are required to find the time it takes for traffic to resume toits steady-state value on both sides of the highway. To do so, we simply let the traffic evolve for a certainamount of time steps (fixed to be 200 time steps in this report), and then we remove the obstacle and observe

15

Page 16: First Hurdle Second Draft

the evolution of the traffic afterwards.

The following graph shows the evolution of traffic on the c side as a function of space and time, for timesfrom 200 times steps to 600 time steps.

Figure 11: Density of traffic on the c side as a function of space and time. The obstacles were removed att = 200.

We can see two concurrent phenomena occurring together. Firstly, there is the backwards propagatingshockwave that we have observed earlier. This backward shockwave occurs for any free flowing traffic, so itis of no surprise that it appears here as well. More importantly, this wave is not maintaining its shape overtime, but its amplitude is decaying, indicating that the traffic is on its way to recovering to the steady-state.We can measure the peak of this wave to estimate how long the traffic will take to return to normal.

Figure 12: Peak Density of traffic ρ on the c side as a function of time. The obstacles were removed att = 200. Linear trendline is overlaid in red with equation ρ(t) = −1.05 × 10−4t+ 0.559

Here, we observe that after the obstacle was removed at time t = 200, the peak traffic actually marginallyincreases and stays constant for about 200 time steps, before starting to decrease at about t = 400. This isbecause the system takes some time to respond to any change in its condition, so in the meantime the wavecontinues propagating backwards and continues growing. For time steps from t = 450 to 600, we observethat there is roughly a linear relation with respect to time, so we fit a linear trendline with a gradient ofapproximately −0.0001 cell timestep−1. Hence, from the value of ρ = 0.496 at t = 600, it will take roughly800 additional time steps for it to reach ρ = 0.42, which is close to the equilibrium value, within the traffic’snatural variations. As we will derive in the next section, each time step is roughly 0.8 seconds, so this

16

Page 17: First Hurdle Second Draft

corresponds to a time period of roughly 10 minutes, which is certainly of the correct order of magnitude.Of course, this linear trend will not continue indefinitely, and the gradient will taper off when the trafficapproaches steady-state. Therefore, it is possible that the actual time taken will be somewhat larger thanthis predicted value since the linear extrapolation may not be accurate for large t.

Moving on to analyse the situation for the o side, we have the following figure that compares the trafficfor both sides of the road side by side. Note that this set of data is slightly different from that of Figure11 (the simulation was run again with random initial conditions but identical settings), since the maximumtime for this simulation was 800 as opposed to 600 for Figure 11.

Figure 13: Density of traffic on the c and o side as a function of space and time. The obstacles were removedat t = 200.

We observe that for the o side, the wave propagates in the opposite direction as the c side, and this isnaturally true because as mentioned before, the cars on the o side are travelling the opposite direction ascars on the c side. Hence, a smaller x coordinate on the c corresponds to a larger x coordinate on the oside, and we see that the peaks in traffic density are essentially following each other rather closely. However,we also note that unlike the wave on the c side which appears to be slowly spreading out and dissipating,the wave on the o side appears to be maintaining its shape over time. This has been shown to be true evenwith simulations up to time steps of 1000, and therefore this model predicts that the traffic in the o sidewill not settle down to steady-state but the wave will instead propagate back indefinitely. While there is noclear-cut explanation for this behaviour, one possible reason is that the behaviour of the cars in the o side isnot sufficiently sensitive to changes in ρ in the c side, hence it does not “detect” the drop in traffic densitythat has taken place over time and change accordingly.

3.3 Discrete Nature of the Model

As with any other method that aims to describe a continuous system using a discrete model, it isimportant for us to stop and think verify that our assumptions are valid. In the case of this problem,the real-life problem is essentially continuous since cars are able to move forward any arbitrary amount of

17

Page 18: First Hurdle Second Draft

distance, and they are also able to travel at a continuous range of speeds. Moreover, it is impossible that alldrivers make decisions to accelerate, decelerate, change lanes etc at the same times.

Therefore, in order for our discrete approximations to make sense, the time scale should correspond to asmall enough step, such that the discretisation is not significant on a large scale. Moreover, we require thatthe spatial scale of 1 cell size to be roughly equal to one car distance, since in our model we assume thatexactly one car can occupy one cell. We choose an arbitrary car for our length scale, and in this case I havechosen the Toyota Camry [4] with a length of 4.8 m, which we approximate as 5 m.

Next, we will need to fix a value for the maximum speed limit, which we will fix at 108 km h−1 = 30 m s−1

as a reasonable and convenient maximum speed for the cars. Therefore, since the maximum speed was set at5 cell timestep−1 earlier, this means that 25 m timestep−1 corresponds to 30 m s−1 and hence one time stepcorresponds to 5

6 s ≈ 0.8 s. Since it is reasonable to assume that each driver responds to external changeswithin a span of 0.8 s, it can hence be said that our model is relatively realistic.

4 Conclusion

In this rather lengthy report, we have discussed the mechanisms that lead to traffic formation on both sidesof the highway, with and without an accident in place. Following that, a highly customizable numerical modelinvolving the cellular automata concept was formulated and implemented in Python. Through the model,we were able to investigate various interesting facets of the problem, including the backward-propagatingtraffic wave, the creation of the traffic jam when the accident occurs, the dissipation of the jam once thevehicles are removed, and the interesting correlations in traffic densities of the c and o lanes.

References

[1] Kai Nagel, Michael Schreckenberg, A cellular automaton model for freeway traffic. Journal de PhysiqueI, EDP Sciences, 1992, 2 (12), pp.2221-2229.

[2] M. R. Flynn et al., On “jamitons,” self-sustained nonlinear traffc waves, arXiv:0809.2828 [math.AP]

[3] F. Berthelin et al., A Model for the Formation and Evolution of Traffic Jams, Archive for RationalMechanics and Analysis, 2008, 187 (2), pp 185-220

[4] http://www.edmunds.com/toyota/camry/2015/features-specs/

18