You are on page 1of 60

Dynamic Traffic: Simple Traffic Flow

Models
By

Conor O’ Neill

2015

Project report submitted in partial fulfilment of examination

requirements leading to the award of BSc in Mathematical

Sciences

Dublin Institute of Technology

Supervised by

Dr. Chris Hills


Dynamic Traffic: Simple Traffic Flow Models

Table of Contents

Introduction ............................................................................................................................... 3
Chapter 1: Background .............................................................................................................. 7
1.1 What is a traffic flow model? ........................................................................................... 7
1.2 A Physical Interpretation of Differential Equations ......................................................... 9
1.2.1 Ordinary Differential Equations ................................................................................ 9
1.2.2 Partial Differential Equations .................................................................................. 10
1.3 The Method of Characteristics....................................................................................... 12
1.3.1 The Nature of Solutions to PDEs ............................................................................. 12
1.3.2 Geometric Approach to Characteristics .................................................................. 14
1.3.3 Parameterisation ..................................................................................................... 15
1.3.4 Algebraic Approach ................................................................................................. 19
Chapter 2: The Simple Traffic Flow Model .............................................................................. 22
2.1 Conservation of Mass .................................................................................................... 24
2.2 Linear Model of Velocity ................................................................................................ 26
2.3 Characteristics................................................................................................................ 29
2.4 The Simple Model in Motion ......................................................................................... 31
Chapter 3: Other Models and Shocks ...................................................................................... 37
3.1 LWR models ................................................................................................................... 37
3.2 Shocks ............................................................................................................................ 41
3.3 Characteristic Lines and Shocks ..................................................................................... 48
Conclusion ............................................................................................................................... 55
Appendix .................................................................................................................................. 56
Chapter 1 Graphs ................................................................................................................. 56
Chapter 2 Graphs ................................................................................................................. 56
Chapter 3 Graphs ................................................................................................................. 57
References ............................................................................................................................... 60

2
Dynamic Traffic: Simple Traffic Flow Models

Declaration

Project title: DYNAMIC TRAFFIC: SIMPLE TRAFFIC FLOW MODELS

Student name: CONOR O’ NEILL

Student Number: C11431488

I certify that this Project which I now submit for examination in partial fulfilment of
the requirements for the award of BSc (Honours) Mathematical Sciences is entirely
my own work and has not been taken from the work of others save and to the
extent that such work has been cited and acknowledged within the text of my work.

This project was prepared according to the regulations of the Dublin Institute of
Technology.

Signed:________________________________

Date: ________________

3
Dynamic Traffic: Simple Traffic Flow Models

Acknowledgements

A great deal of thanks is owed to all those who have helped me and guided me
writing this project the last year. Thank you to my friends and family, particularly
my mother Elizabeth O’ Neill and my girlfriend, Laura Nic Aodh, who have given
me the focus to apply myself fully to my college work and the support to keep me
optimistic.

Thanks also to my supervisor, Dr. Chris Hills who has given me guidance and
encouragement throughout the writing of this report which has been invaluable.

4
Dynamic Traffic: Simple Traffic Flow Models

Introduction

In 2011, an international survey was carried out by The World Bank Group[1] which
estimated that there are 0.491 road motor vehicles per person in Ireland. In some
countries this ratio is greater than 1. Road traffic is a common backdrop to the
modern age and the patterns inherent therein are intrinsically mathematical.

Day to day, we see gridlock in city centres and we hear debates about the efficiency
of different traffic solutions such as roundabouts and motorways. We read about
traffic jams and road accidents in newspapers. Granted, much of the time these
problems are caused by unusual factors such as road works or sporting events but
some of the time the problem is infrastructure. There are sharp turns with poor
visibility that cause accidents but how much visibility is enough and how many
speed bumps are enough?

It seems that our understanding of traffic flow is in its infancy as we fervently


debate the benefits of different public transport systems and rarely is everyone
satisfied with a particular solution to a traffic problem. I chose this project to take
the opportunity to investigate traffic flow as an evolving topic of study and discover
just what problems those who study it face. The aim of this project is to construct
and examine simple models which will emulate patterns found in traffic systems.
These models will facilitate further examination and understanding of traffic flow
and present it to the reader in a concise and transparent way.

The systems in question will be examined using partial differential equations. We


will learn about the method of characteristics used to solve these differential
equations. We will examine the behaviour of traffic under different assumptions
and conditions. Simple mathematical models such as Greenshield’s model will be
studied using an understanding of differential equations. This model will be used as
a basis for study.

5
Dynamic Traffic: Simple Traffic Flow Models

The nature of modelling will be discussed. The background theories behind the
models used in this project will be explained and contextualised. The flaws in these
theories will be examined and demonstrated as well as their strengths.

This project will require significant research on my part into both traffic systems,
the modelling methods to be used, partial differential equations and visual
programming for mathematics. This project will present its material in a manner
suitable for students in their fourth year of an undergraduate degree in
mathematics. The visual aids in this project will be digitally drawn using the
technical computing environment Maple using flexible and robust algorithms. The
code for these drawings will be added to the appendix and will be formatted in such
a way as to make the changing of key variables in important formulae simple and
intuitive.

6
Dynamic Traffic: Simple Traffic Flow Models

Chapter 1: Background

In this chapter, the nature of mathematical models, partial differential equations


and the method of characteristics will be explained. The mathematical background
needed to understand the material covered in later chapters will also be explained.

1.1 What is a traffic flow model?


A mathematical model is an expression or set of expressions which can be used to
simulate, predict or examine real world phenomena. Models are arrived at through
a scientific process. The mathematician will first gather information on the system
they wish to model. In the case of traffic flow, this might involve conducting field
research by using tools to measure traffic speeds, density etc. Information is also
gathered from published sources and models proposed by other mathematicians.

Once the required information has been gathered, a mathematical model is


proposed. This model is incomplete and may be flawed so the mathematician tests
the model by comparing it’s predictions to results found in the field or in controlled
experiments. When an inconsistency is discovered, the model is reconsidered and
refined. This is done by reviewing the source material and researching new sources
as well as proposing alternative models. Generally, the model is considered
complete when it is shown to be predictive of the real system and is in a form that
the mathematician believes is concise.

In this project, traffic models will be described using mathematical techniques,


particularly differential equations. Differential equations in general are expressions
concerning a function and its derivatives. Differential equations of only one
independent variable are called ordinary differential equations (or ODEs). The
independent variables mentioned here are simply variables that do not change with
respect to other variables.

Some differential equations contain functions of more than one independent


variable and, as such, they involve partial derivatives. These equations are known as
partial differential equations (or PDEs) and are more complex than ODEs. Many
different methods exist for solving PDEs depending on their structure and the
7
Dynamic Traffic: Simple Traffic Flow Models

conditions of the problem. Similarly to ODEs, PDEs may have initial and boundary
conditions.

As with most mathematical topics, differential equations have real-world


interpretations that illustrate them. What follows is an examination of these
interpretations.

8
Dynamic Traffic: Simple Traffic Flow Models

1.2 A Physical Interpretation of Differential Equations


The derivative of a function is simply the ratio of an infinitesimal change in the
function over an equally small change in one of the function’s independent
variables. One common way to interpret this is as the rate at which the value for the
function changes as the variable changes. In a dynamic system, variables change
with respect to one another and therefore differential equations are used to describe
how they behave.

1.2.1 Ordinary Differential Equations


ODEs are the simpler of the two and should already be familiar to the reader.
Consider the following derivative:

𝑑𝑠
=𝑣 (1.1)
𝑑𝑡

This describes a system where the variable 𝑠 changes with respect to the variable 𝑡
at a rate 𝑣. If 𝑠 is defined as the distance from an initial point and 𝑡 is defined as
time, 𝑣 is then the rate of change of distance with respect to time. In this context, 𝑣
is velocity.

This interpretation is literal and can be used to describe a body in motion. Further,
the second derivative of 𝑠 with respect to time can be taken, arriving at the rate of
change of speed with respect to time, i.e. acceleration.

9
Dynamic Traffic: Simple Traffic Flow Models

Fig 1.2.1 (left) shows the change in distance over time.


Fig 1.2.2 (right) graphs the derivative of figure 1.2.1,
the change in velocity over time.

By examining figures 1.2.1 and 1.2.2, one can see how 𝑠 increases over time in a non-
1
linear way. The equation used to generate this graph was 𝑠 = 2 𝑡 2 . The vertical axis
𝑑𝑠
in figure 1.2.2 is 𝑑𝑡 = 𝑡 and can be thought of as the slope of figure 1.2.1. In other

words, figure 1.2.2 graphs the rate of change of velocity and the appearance of a
non-linear change in distance over time in figure 1.2.1 is due to acceleration.

Equation (1.1) is simply a scientific definition of velocity but in the models we will
construct later, there will be functions that have rates of change in more than one
variable such as density. Hence more advanced techniques must be employed to
describe them, namely partial differential equations.

1.2.2 Partial Differential Equations


Similarly to ODEs, PDEs are equations containing a function and its derivatives.
PDEs describe how the function in question behaves as its variables change.
Consider the height of a surface as a function of two independent directional
variables. A PDE can be used to describe how that height varies with respect to

10
Dynamic Traffic: Simple Traffic Flow Models

changes in both of those variables. In general terms, PDES can be used to describe
how a dynamic system varies. The following PDE describes such a dynamic system:

𝜕𝑢 𝜕𝑢
𝑎(𝑥, 𝑦) + 𝑏(𝑥, 𝑦) + 𝑐(𝑥, 𝑦)𝑢(𝑥, 𝑦) = 𝑑(𝑥, 𝑦). (1.2)
𝜕𝑥 𝜕𝑦

In this general, first order, linear PDE, 𝑎, 𝑏, 𝑐 and 𝑑 are functions of 𝑥 and 𝑦 and 𝑧 =
𝑢(𝑥, 𝑦) is a surface with height z at the point (x, y). The equation combines the
derivatives of the height with respect to x and y with particular coefficient functions
to accurately describe the surface.

Fundamentally, equations (1.1) and (1.2) describe systems containing independent


variables and particularly how the solution function changes with respect to those
variables. Equation (1.2) describes a system containing partial derivatives with
respect to two independent variables. For instance, traffic density can be modelled
as functions of multiple measurable variables. In the case of density, these variables
may include time and position along a stretch of road. This is the theory behind our
first traffic flow model, described in chapter 2.

Let us now discuss a method of solving PDEs particularly important to this project.

11
Dynamic Traffic: Simple Traffic Flow Models

1.3 The Method of Characteristics


The method of characteristics is a technique used for solving first order PDEs. There
are special application methods that make it suitable for higher order PDEs but they
are outside the scope of this report. It can be used to solve linear and quasi-linear
PDEs.

A linear PDE is characterised by the dependant variable and its derivatives


appearing with degree no greater than one. An 𝑛th order quasi-linear PDE, however,
need only be linear with respect to the partial derivatives of the dependant variable
with degree n. For instance,

𝜕𝑢 𝜕𝑢
𝑦 + 5x + 𝑥2𝑢 = 0
𝜕𝑥 𝜕𝑦

is a linear PDE whereas

3
𝜕 2 𝑢 𝜕𝑢 𝜕 2 𝑢 𝜕𝑢 2 𝜕𝑢 2
𝑢 + +𝑢+( ) −( ) = 𝑥
𝜕𝑥 2 𝜕𝑥 𝜕𝑦 2 𝜕𝑥 𝜕𝑦

is a quasi-linear PDE of degree 2. The coefficients of the second derivatives are all
functions of 𝑥, 𝑦, 𝑢, 𝑢𝑥 and 𝑢𝑦 that is, functions of the independent variables and
derivatives of the dependant variable lower than 2. Notice derivatives of dependant
variables lower than 𝑛 (𝑛 = 2 in the above case) can appear outside of the
aforementioned coefficients as part of non-linear functions.

The method of characteristics works by reducing the PDE to a set of ODEs which
can be solved more simply. We will find an expression that tells us how 𝑢 changes
along special curves called characteristic curves and by “stitching” them together,
we can form the solution surface. These curves will be found using initial
conditions, boundary conditions and parameterisation.

1.3.1 The Nature of Solutions to PDEs


Recall from section 1.1, a PDE is a description of the relationships between the rates
of change of variables in some system. Without loss of generality, one may consider
this system to be a multi-dimensional surface. The equation defining this surface is
the solution to the PDE describing its derivatives. For example, fig 1.2.1 is the

12
Dynamic Traffic: Simple Traffic Flow Models

solution to a two dimensional PDE (equation 1.3) under initial conditions (which
will be discussed in section 1.3.4) and its solution surface.

The following PDE under the boundary condition given

𝑦𝑢𝑥 − 𝑥𝑢𝑦 + 𝑥 − 𝑦 = 0 and 𝑢(𝑥, 0) = 𝑥(𝑥 + 1) (1.3)

is satisfied by

𝑢(𝑥, 𝑦) = 𝑥 + 𝑦 + 𝑥 2 + 𝑦 2 .

The equation 𝑧 = 𝑢(𝑥, 𝑦) uses the solution function to graph a surface in three
dimensions that allows us to visualise the solution. This surfaced is graphed in
Figure 1.3.1 below.

Fig. 1.3.1 A 3D visualisation of the solution surface to (1.3). See appendix for maple
script

13
Dynamic Traffic: Simple Traffic Flow Models

Note that the surface in figure 1.3.1 is only one possible representation of the
solution. For instance, we may think of one of the independent variables to be time
and use an electronic environment such as maple to animate the evolution of the
function as time passes. This is shown in the 3rd maple script in the appendix which
lets 𝑡𝑖𝑚𝑒 = 𝑦. Animations done in this way are analogous to the surface. The
animation could be understood simply as a display of the cross-section of the
equivalent surface changing in values for the time variable. The animation scripted
in this report looks at the cross-section which shows only the 𝑥 and 𝑧 axis in the
range 𝑦 = [−5,5].

Although we rely on initial or boundary conditions in order to find particular


solutions, the PDE alone tells us a lot about the solution. In the next section we will
see how it does this. It is possible to manipulate the PDE into a statement that
describes characteristic curves on the solution surface explicitly. This can be
achieved by examining the geometry of the solution surface implied by the PDE.

1.3.2 Geometric Approach to Characteristics


Much of the research for this section was done on the lecture notes of Prof. Y.
Xinwei, University of Alberta[2]. Consider the general, first order, quasi-linear PDE

𝑎(𝑥, 𝑦, 𝑢)𝑢𝑥 + 𝑏(𝑥, 𝑦, 𝑢)𝑢𝑦 = 𝑐(𝑥, 𝑦, 𝑢). (1.4)

This PDE can be expressed, as the dot product of the coefficient vector and the
gradient vector equal to zero as follows,

𝑎(𝑥, 𝑦, 𝑢) 𝑢𝑥 𝑎(𝑥, 𝑦, 𝑢) 𝑢𝑥
[𝑏(𝑥, 𝑦, 𝑢)] . [ 𝑢𝑦 ] = 0 ↔ [𝑏(𝑥, 𝑦, 𝑢)] ⊥ [ 𝑢𝑦 ].
𝑐(𝑥, 𝑦, 𝑢) −1 𝑐(𝑥, 𝑦, 𝑢) −1

This expression also states that the two vectors are orthogonal, which is important
to note. The gradient vector is comprised of the first derivatives of 𝑢 with respect to

14
Dynamic Traffic: Simple Traffic Flow Models

each of its independent variables. At any particular point (𝑥, 𝑦, 𝑢), the gradient can
be evaluated by substituting the particular values for 𝑥 and 𝑦. The resulting vector
describes the direction of the steepest increase in 𝑢 (in two dimensions this is
commonly referred to as slope). In other words, the gradient vector describes the
overall rate of change of the function at a point (𝑥, 𝑦, 𝑢).
𝑢𝑥
𝑢
In order to understand the relation between [ 𝑦 ] and the solution surface, let 𝑆 be
−1
a surface defined implicitly as 𝑆(𝑥, 𝑦, 𝑧) = 𝑢(𝑥, 𝑦) − 𝑧. Notice how if 𝑆 = 0, 𝑧 =
𝑢(𝑥, 𝑦). It can also be seen from this equation that 𝑆𝑥 = 𝑢𝑥 , 𝑆𝑦 = 𝑢𝑦 and 𝑆𝑧 = −1.
i.e.

𝑆𝑥 𝑢𝑥
[𝑆𝑦 ] = [ 𝑢𝑦 ] = ∆𝑆
𝑆𝑧 −1

It is known that generally, ∆𝑆 is a normal vector to the surface 𝑆 = 𝐴 (for some


𝑢𝑥
constant A) and by extension, in this case, [ 𝑢𝑦 ] is normal to 𝑧 = 𝑢(𝑥, 𝑦). Recall that
−1
𝑎 𝑢𝑥 𝑎
[𝑏 ] is perpendicular to [ 𝑢𝑦 ], thus we now know that [𝑏 ] must lie in the tangent
𝑐 −1 𝑐
plane to the solution surface 𝑧 = 𝑢(𝑥, 𝑦) at all points (𝑥, 𝑦).

In order to find 𝑢(𝑥, 𝑦), we construct parametric curves characterised as being


contained within the solution surface. These curves can be found easily as any
𝑎
integral curve of [𝑏 ] must also be tangent to the surface at (𝑥, 𝑦). The integrating
𝑐
constants generated by finding these integral curves can be calculated by examining
initial and boundary conditions.

1.3.3 Parameterisation
In geometry, parameterisation is the practice of creating a set of one or more
variables which can be use to describe a geometric object or surface. In the

15
Dynamic Traffic: Simple Traffic Flow Models

Cartesian plane, 𝑥 and 𝑦 may be functions of these variables. One parameter could
be used to denote the distance along a curve while it would take at least two to
describe position on a surface. For instance, consider the following
parameterisation.

𝑦(𝑠) = 𝑠 2 , 𝑥(𝑠) = 𝑠 − 1

We can eliminate 𝑠 to arrive at an equivalent expression in 𝑥 and 𝑦 alone.

𝑠 =𝑥+1

=> 𝑦 = (𝑥 + 1)2

In other words, 𝑠 may be units of lenth along the curve 𝑦 = (𝑥 + 1)2 . We may also
inspect the rate of change of 𝑥 and 𝑦 along the curve by calculating

𝑑𝑦 𝑑𝑥
= 2𝑠 and =1
𝑑𝑠 𝑑𝑠

Consider a parameterisation of 𝑥, 𝑦 and 𝑢 which gives us the family of parametric


𝑎
curves we need to solve the PDE. It was discussed earlier that the vector [𝑏 ] lies on
𝑐
the tangent plane to the solution surface. This means that we can find that family of
curves by choosing a parameter 𝑠 such that

𝑥 ′ (𝑠) = 𝑎(𝑥, 𝑦, 𝑢), (1.5)


𝑦 ′ (𝑠) = 𝑏(𝑥, 𝑦, 𝑢), (1.6)
𝑢′ (𝑠) = 𝑐(𝑥, 𝑦, 𝑢). (1.7)

We can then arrive at expressions in 𝑥, 𝑦 and 𝑢 by integrating and solving the


resulting simultaneous equations. Together these expressions will describe the
16
Dynamic Traffic: Simple Traffic Flow Models

shape of the characteristic curves. We can integrate to find the union of these
curves to create the solution surface. The method of characteristics is illustrated in
the following example.

Example 1.1:

Consider the following first order, linear partial differential equation.

𝑢𝑥 + 𝑢𝑦 = 𝑢

Using equations (1.5) - (1.7) as a guide, we choose the parametric equations,

𝑥 ′ (𝑠) = 1
𝑦 ′ (𝑠) = 1
𝑢′ (𝑠) = 𝑢

These equations can be integrated to find 𝑥, 𝑦 and 𝑢 in terms of 𝑠, i.e.

𝑥(𝑠) = 𝑠 + 𝛼 (1.8)
𝑦(𝑠) = 𝑠 + 𝛽 (1.9)
𝑢(𝑠) = 𝛾𝑒 𝑠 (1.10)

This leads to the following definition of the characteristic curves,

𝑦 = 𝑥 + 𝐴 where 𝐴 = 𝛽 − 𝛼

We know now that the characteristics are parallel straight lines. We can also
eliminate 𝑠 in equation (1.10) to get

𝑢 = 𝐵𝑒 𝑥 (1.11)

17
Dynamic Traffic: Simple Traffic Flow Models

where 𝐵 = 𝛾𝑒 −𝛼

The value of 𝐵 in equation (1.11) depends on which characteristic curve is being


considered. Thus, the shape of the characteristic curves is that of exponential
curves. Both A and B depend only on what characteristic curve is in question. This
is an important fact as it means one is simply a function of the other. i.e.

𝐵 = 𝑓(𝐴)
=> 𝑢 = 𝑓(𝑦 − 𝑥)𝑒 𝑥 (1.12)

The function 𝑓 here is unknown but can be found using initial conditions. For
instance, let

𝑢 = 1 on 𝑦 = 0

This condition gives the value for 𝑢 along the 𝑥 axis which can be used to
extrapolate the value for 𝑢 at all points. This is done by using the initial condition to
discover the nature of the function 𝑓. When 𝑦 = 0, we get

𝑢 = 𝑓(0 − 𝑥)𝑒 𝑥 = 1
=> 𝑓(−𝑥) = 𝑒 −𝑥
=> 𝑓(𝑥) = 𝑒 𝑥

By implementing the boundary conditions and solving equation (1.12) for 𝑓(𝑥), we
can re-write 𝑓(𝑦 − 𝑥) and get the particular solution

𝑢 = 𝑒 𝑦−𝑥 𝑒 𝑥
=> 𝑢 = 𝑒 𝑦 .

The surface that would be described by this solution is z = ey .

18
Dynamic Traffic: Simple Traffic Flow Models

1.3.4 Algebraic Approach


Alternatively, the parametric equations (1.5 − 1.7) can be rewritten to arrive at the
following equalities, known as the Lagrange-Charpit equations or the characteristic
equations of the PDE

𝑑𝑥 𝑑𝑦 𝑑𝑢 (1.13)
𝑑𝑠 = = =
𝑎 𝑏 𝑐

Two pairs of these alternative parametric equations can be integrated and solved to
find two functions 𝜑(𝑥, 𝑦, 𝑢) and 𝜔(𝑥, 𝑦, 𝑢). The general solution is then given by an
arbitrary function 𝐹(𝜑, 𝜔). The process is very much the same as the geometric
approach in section 1.2.2. The key difference being we avoid the parameter 𝑠 and
instead use differential algebra to arrive at the functions 𝜑 and 𝜔.

Example 1.2:

Consider the problem

𝑥𝑢𝑥 + 𝑦𝑢𝑦 − 𝑢 − 1 = 0

The Lagrange-Charpit equations are

𝑑𝑥 𝑑𝑦 𝑑𝑢
= =
𝑥 𝑦 𝑢+1

We now find 𝜑 and 𝜔. The key to finding these functions is that 𝑑𝜑 = 𝑑𝜔 = 0


along the characteristic curves. Take the first two terms of the parametric equations
and look for an expression that will help find one of the functions in question.

19
Dynamic Traffic: Simple Traffic Flow Models

𝑑𝑥 𝑑𝑦
=
𝑥 𝑦

=> 𝑦𝑑𝑥 = 𝑥𝑑𝑦

=> 𝑦𝑑𝑥 − 𝑥𝑑𝑦 = 0

Using the quotient rule for derivatives,

𝑥
=> 𝑦 2 𝑑 ( ) = 0
𝑦

𝑥
=> 𝑑𝜑 = 𝑑 ( ) = 0
𝑦

𝑥
=> 𝑑𝜑 =
𝑦

Similarly, comparing the first and third terms, we have

𝑑𝑥 𝑑𝑢
=
𝑥 𝑢+1

=> (𝑢 + 1)𝑑𝑥 − 𝑥𝑑𝑢 = 0

𝑥
=> 𝑑( ) = 0 = 𝑑𝜔
𝑢+1

Thus

𝑦 𝑢+1
𝜑 = 𝑥 and 𝜔 = 𝑥

and from 𝜔, we get 𝑢 = 𝑥𝜔 − 1. Since both 𝜑 and 𝜔 depend upon what


characteristic is in question, either one may be written as a function of the other.
i.e.

20
Dynamic Traffic: Simple Traffic Flow Models

𝑦
𝑢 = 𝑥𝑓 ( ) − 1
𝑥

This point in the solution process is equivalent to equation (1.12) in the problem in
section 1.2.2. The method of characteristics will come up again throughout this
project in order to better explain and work with the mathematics that will arise.

21
Dynamic Traffic: Simple Traffic Flow Models

Chapter 2: The Simple Traffic Flow Model

This chapter will explain some of the core concepts around which the models in this
project are built. This chapter will also introduce the first model we will study, the
Greenshield model. The method of characteristics will be applied here to develop
some of the mathematics being studied in order to understand how to use traffic
models like Greenshield’s. We will also construct an initial traffic density
distribution and observe how it changes over time.

Figure 2.0.1 Shows a distribution of cars along a one-lane road segment.

The models in this report will describe ρ, traffic density. Traffic density is a measure
of the number or cars per unit distance along a road. In figure 2.0.1 above, traffic
density in the region [𝑎, 𝑏] is less than in [𝑏, 𝑐]. This is because the region [b,c] has
less space between cars i.e. more cars per unit of distance. Density is a non-negative
function and in these models will be a function of two variables, position and time.
We focus on traffic density as the variable of interest because it most directly relates
to congestion and allows us to observe the traffic system as a whole. Alternative
methods follow a single car or focus on particular patterns within the system such
as particularly dense clusters of cars and treat them as travelling waves of
congestion.

In these models, ρ will vary with respect to both position in a system and time.
Models will also be constructed to describe the velocity of cars at a certain point
and time in terms of ρ. What follows is an explanation of the initial, intuitive
models from which more complex, realistic models will be devised. These later

22
Dynamic Traffic: Simple Traffic Flow Models

models will explore factors like drivers being aware of the density ahead of them
and how traffic density changes as traffic lights turn green or red.

Firstly, let us consider the simple model. In order to construct a model one must
consider the physical system in question. It is necessary to identify a rule or physical
law that the system abides by and then express that law mathematically in context.

For traffic flow systems, it is reasonable to consider conservation of mass to be one


such suitable law.

23
Dynamic Traffic: Simple Traffic Flow Models

2.1 Conservation of Mass

The law of conservation of mass states “in the absence of a source or a sink, the
total mass of any material system is neither increased nor diminished by reactions
between the parts”. The use of the term ‘mass’ in physics refers to the amount of
matter in a system but in the context of this project, when discussing the
conservation of mass, it means traffic density. The most important implication of
this law is that any change to the total mass of the system must result from mass
being added to or removed from the system.

First, consider a one-dimensional stretch of one-way road from 𝑥 to 𝑥 + 𝛿𝑥 at a time


𝑡. The density of cars along this road will be described as some continuous function
of position and time 𝜌 = 𝜌(𝑥, 𝑡).

The concept of the conservation of mass is simply that cars along this stretch of
road cannot be created or destroyed nor can they enter or leave the system except
at the points x and x + 𝛿𝑥. The change in density over a time 𝛿𝑥 is demonstrated in
figure 2.1.1 below. The fields either side of [𝑥, 𝑥 + 𝛿𝑥] show a change in cars i.e. the
blue cars to the right in the first image represent the movement that is about to
take place of the two blue cars from the centre region.

Fig. 2.1.1 shows a length of road [𝑥, 𝑥 + 𝛿𝑥] and the movement of cars in and out.

This leads to the conclusion that the change in the number of cars on the road over
a time 𝛿𝑡 is simply the number of cars on the road at time 𝑡 + 𝜕𝑡 minus the number
of cars present at time 𝑡. The expression for the number of cars in a stretch of road
of length 𝛿𝑥 is approximately ρ(𝑥, 𝑡)𝛿𝑥. We now formulate the change in the
number of cars over a period of time 𝛿𝑡 to be

24
Dynamic Traffic: Simple Traffic Flow Models

ρ(𝑥, 𝑡)𝛿𝑥|--𝑡+𝛿𝑡 − ρ(𝑥, 𝑡)𝛿𝑥|--𝑡 (2.1)

The distance cars travel in time 𝛿𝑡, denoted 𝛿𝑠, is given by 𝛿𝑠 = 𝑣𝛿𝑡 where 𝑣 is the
velocity of the cars and is non-negative.
The change in the number of cars on the road over a time 𝛿𝑡 is simply the number
of cars that have entered at the point 𝑥 minus the number that have left at the point
𝑥 + 𝛿𝑥. The number of cars passing through the point 𝑥, thus entering the region, in
time 𝛿𝑡 is given by the number of cars per unit of distance times distance travelled
in that time. i.e.

ρ(𝑥, 𝑡)𝑣𝛿𝑡|𝑥 .

This leads to the second expression for change in the number of cars which is as
follows:

ρ(𝑥, 𝑡)𝑣𝛿𝑡|--𝑥 − ρ(𝑥, 𝑡)𝑣𝛿𝑡|--𝑥+𝛿x (2.2)

Equations (2.1) and (2.2) can be equated as they are both expressions for the
change in the number of cars in the system derived from the law of conservation of
mass.

By simplifying the resulting equation, allowing 𝛿𝑥 and 𝛿𝑡 to tend to zero and solving
for 𝜕ρ/ 𝜕𝑡 gives:

𝜕ρ 𝜕(ρv)
+ = 0. (2.3)
𝜕𝑡 𝜕𝑥

This equation is general and simply describes a natural relationship between these
rates of change. One can see from equation (2.3) that the velocity 𝑣 is a critical
component of the equation and how we model 𝑣 will have a significant impact on

25
Dynamic Traffic: Simple Traffic Flow Models

the nature of the model. Let us now explore one way to do this, called the linear
model of velocity particularly, the Greenshield model.

2.2 Linear Model of Velocity

The velocity of cars can be described in terms of the other variables we have
discussed in previous sections.

Velocity may change with respect to 𝑥. In reality, drivers make changes to the speed
of their car due to their position on the road. Coming up to a turn or on an incline,
they may slow down or be forced to by speed bumps. Any vehicle undergoing a
change in velocity goes so over a distance, however the models we will discuss may
not reflect this as they do not follow individual cars.

Consider now how velocity might change with respect to time. At different times of
day, speed may be limited differently. At night, visibility is lower and so a driver’s
desired speed is lower for safety. For a car undergoing acceleration, velocity changes
over time. Additionally, for a car in motion, as time changes so does position, which
has already been identified as an important variable when considering velocity.

Velocity also changes with respect to density as cars in a congested length of road
must travel slower than those on a road free of other cars.

Evidently velocity changes with respect to 𝑥, 𝑡 and ρ, however, this relationship is


not prescribed to us. We must make some assumptions to arrive at a traffic model.

The first model we will construct, the Greenshield model, considers velocity to
change with respect to ρ alone.

How a model defines velocity varies depending on what concepts are being
considered and neglected. For example, one might consider drivers to react
instantly to changes in their environment. All such considerations should be
directly reflected by the model.

The linear velocity model is so called because velocity changes linearly with another
variable, in this case 𝜌(𝑥, 𝑡). The considerations for Greenshield’s model are

26
Dynamic Traffic: Simple Traffic Flow Models

1) As density decreases, velocity increases. As density increases, velocity


decreases. For the sake of simplicity, Greenshield’s model considers this
relation to be linear.
2) When density is at a maximum, velocity is reduced to zero.
Cars in the system cannot move when density is at a maximum because they
are so tightly packed that there is no space for them to move. We may say
ρ
𝑣 ∝ 1 − ρ where 𝜌0 is maximum density.
0

3) When density is zero, velocity is limited by a speed limit.


In order to this, we can take the formula from consideration 2) which tends
to 1 as density tends to zero, and multiply the right hand side by the speed
limit in mind.

The following is the resulting model:

𝜌
𝑣 = 𝑐 (1 − ) (2.4)
𝜌0

In this model, c is the speed limit and 𝜌0 is maximum density, a constant. This
succinct equation describes every concept we outlined in the paragraph above and
in equation (2.3), 𝑣 can be replaced with this expression.

𝜕𝜌 𝜕 𝜌
+ (𝜌𝑐 (1 − )) = 0
𝜕𝑡 𝜕𝑥 𝜌0

𝜕𝜌2
𝜕𝜌 𝜕𝜌
=> + 𝑐 ( − 𝜕𝑥 ) = 0
𝜕𝑡 𝜕𝑥 𝜌0

The chain rule gives

𝜕𝜌2 𝜕𝜌 𝜕𝜌2 𝜕𝜌
= = 2𝜌
𝜕𝑥 𝜕𝑥 𝜕𝜌 𝜕𝑥

27
Dynamic Traffic: Simple Traffic Flow Models

𝜕ρ 𝜕(ρv) 𝜕𝜌 2𝜌 𝜕𝜌
=> + = + 𝑐 (1 − )
𝜕𝑡 𝜕𝑥 𝜕𝑡 𝜌0 𝜕𝑥

𝜕𝜌 2𝜌 𝜕𝜌
=> + 𝑐 (1 − ) =0 (2.5)
𝜕𝑡 𝜌0 𝜕𝑥

Using assumptions grounded in simple physics, we have approached the problem of


modelling traffic density in a realistic way. By discussing what the important
variables are and how they interact, we have arrived at Greenshield’s model.
Applying differential algebra, we have arrived at a quasi-linear PDE which takes all
of our work so far into account. This allows us to study the model more closely
under the purview of the calculus at the core of this report.

28
Dynamic Traffic: Simple Traffic Flow Models

2.3 Characteristics

Let us examine the nature of the characteristic curves of the PDE in equation (2.5).
The equation

𝜕𝜌 2𝜌 𝜕𝜌
+ 𝑐 (1 − ) =0
𝜕𝑡 𝜌0 𝜕𝑥

is quasi-linear because the dependant variable appears in a coefficient function of


one of the partial derivatives. The method of characteristics, therefore, is a valid
solution method. We will use the parameterisation method to solve this equation.
𝑎(𝑥, 𝑦, 𝑢)
First, we identify the coefficient vector [𝑏(𝑥, 𝑦, 𝑢)] by interpreting the PDE as being
𝑐(𝑥, 𝑦, 𝑢)
of the form 𝑎𝑢𝑥 + 𝑏𝑢𝑦 = 𝑐. In this case 𝑦 = 𝑡, 𝑢 = 𝜌 and

2𝜌
𝑎(𝑥, 𝑦, 𝑢) 𝑐 (1 − )
[𝑏(𝑥, 𝑦, 𝑢)] = [ 𝜌0 ].
𝑐(𝑥, 𝑦, 𝑢) 1
0

It follows that the parametric equations (according to equation (1.5)-(1.7)) should


be defined as

2𝜌
𝑥 ′ (𝑠) = 𝑐 (1 − ),
𝜌0

𝑡 ′ (𝑠) = 1,

𝜌′ (𝑠) = 0.

Let us now integrate to find the parameterised versions of 𝑥, 𝑦 and 𝜌.

𝑡 =𝑠+𝑎

2𝜌
𝑥 = 𝑐 (1 − )𝑠 + 𝑏
𝜌0

𝜌=𝐴

29
Dynamic Traffic: Simple Traffic Flow Models

It is important to note that along these characteristics 𝜌 is equal to 𝐴, a constant.


This is true for all traffic models based on the conservation of mass in the same way
as our model. In order to arrive at an expression for the shape of the characteristics,
we eliminate 𝑠 by comparing 𝑥 and 𝑡.

𝑠 =𝑡−𝑎

2𝜌
=> 𝑥 = 𝑐 (1 − ) (𝑡 − 𝑎) + 𝑏
𝜌0

2𝜌 2𝜌
=> 𝑥 = 𝑐 (1 − ) 𝑡 − 𝑎𝑐 (1 − ) + 𝑏
𝜌0 𝜌0
Since 𝜌 = 𝐴, a constant,

2𝜌
=> 𝑏 − 𝑎𝑐 (1 − )=𝐵
𝜌0
for some constant 𝐵.

2𝐴
=> 𝑥 = 𝑐 (1 − )𝑡 + 𝐵 (2.6)
𝜌0

This expression describes straight lines on the 𝑥 − 𝑡 plane, differing in their value
for 𝐴 and 𝐵 only. These are the characteristic curves that arise from using the linear
velocity model described in section 2.2. As shown in section 1.3.3, The constants B
and A may be expressed in terms of one another.

𝐴 = 𝑓(𝐵)

Since 𝜌(𝑥, 𝑡) = 𝐴 on characteristic curves, the solution 𝜌(𝑥, 𝑡) can be written as a


function of these characteristics;

2𝜌
𝜌(𝑥, 𝑡) = 𝑓 (𝑥 − 𝑐 (1 − ) 𝑡) (2.7)
𝜌0
Using this equation, we can now explore how traffic density evolves over time by
constructing initial conditions.

30
Dynamic Traffic: Simple Traffic Flow Models

2.4 The Simple Model in Motion

In this section we will use equation (2.7) to create distributions of density along a
stretch of road (i.e. in the 𝑥-𝜌 plane). First, we will let 𝑡 = 0 and make a distribution
based on the resulting expression 𝜌(𝑥, 0) = 𝑓(𝑥). We will then generalise that
distribution for 𝜌(𝑥, 𝑡).

Consider the initial conditions of the density function defined as

𝜌0 𝑥<0
𝜌(𝑥, 0) = {𝜌0 (1 − 𝑥) 0 < 𝑥 < 1. (2.8)
0 𝑥>1

These initial conditions describe a density distribution involving a region of


maximum density leading into a region of decreasing density followed by a region
without cars. Such a distribution may be reflected by cars leaving a traffic jam via a
motorway on-ramp.

The plot in figure 2.4.1 illustrates the constructed function.

31
Dynamic Traffic: Simple Traffic Flow Models

Fig 2.4.1: Example initial density distribution of a traffic system.

See appendix for maple script

This graph was generated by setting 𝜌0 = 1 and removing tickmarks on the density
axis. Consider now how this graph might change over time. To formulate this we
find an expression for the equation (2.8) at the point (x, t). We generalise each of
the three regions for which ρ(x, 0) is defined separately, considering the expression
for density as in equation (2.7).

The first region, that is the region furthest in the negative 𝑥 direction, is bounded
by the inequality

𝑥 < 0.

This is taken at 𝑡 = 0 and so 𝜌(𝑥, 0) = 𝑓(𝑥). After this initial state the argument of

the function 𝑓 becomes x − c (1 − ρ ) t. The above inequality should thus change to
0

2𝜌
𝑥 − 𝑐 (1 − ) 𝑡 < 0,
𝜌0

but in this first region 𝜌 = ρ0 which does not depend on the argument of 𝑓, thus

2𝜌0
𝑥 − 𝑐 (1 − ) 𝑡 < 0.
𝜌0

=> 𝑥 − 𝑐(−1)𝑡 < 0

=> 𝑥 + 𝑐𝑡 < 0

=> 𝑥 < −𝑐𝑡 (2.9)

The rest of the boundaries of the regions can be generalised by following the same
procedure for the second and third regions. The second region is bounded for

32
Dynamic Traffic: Simple Traffic Flow Models

0 < 𝑥 < 1,

and becomes

2𝜌
0 < 𝑥 − 𝑐 (1 − ) 𝑡 < 1.
𝜌0

In order to remove ρ from this inequality (and thereby simplify it) we must find the
generalised for of 𝑓 for this region. Initially 𝜌 = 𝑓(𝑥) gave 𝜌 = ρ0 (1 − 𝑥) but now we
find

2𝜌 2𝜌
𝜌 = 𝑓 (𝑥 − 𝑐 (1 − ) 𝑡) = 𝜌0 [1 − 𝑥 + 𝑐 (1 − ) 𝑡]
𝜌0 𝜌0

2𝑐𝜌
=> 𝜌 = 𝜌0 [1 − 𝑥 + 𝑐𝑡 − 𝑡]
𝜌0

=> 𝜌 = 𝜌0 − 𝜌0 𝑥 + 𝜌0 𝑐𝑡 − 2𝑐𝜌𝑡

=> 𝜌(1 + 2𝑐𝑡) = 𝜌0 (1 − 𝑥 + 𝑐𝑡)

𝜌0 (1 − 𝑥 + 𝑐𝑡)
=> 𝜌 =
1 + 2𝑐𝑡

It follows that centre region should lie in the range

𝜌0 (1 − 𝑥 + 𝑐𝑡)
2
0 < 𝑥 − 𝑐 [1 − 1 + 2𝑐𝑡 ]𝑡 < 1
𝜌0

(1 − 𝑥 + 𝑐𝑡)
=> 0 < 𝑥 − 𝑐 [1 − 2 ]𝑡 < 1
1 + 2𝑐𝑡

=> 0 < 𝑥(1 + 2𝑐𝑡) − 𝑐[1 + 2𝑐𝑡 − 2(1 − 𝑥 + 𝑐𝑡)]𝑡 < 1 + 2𝑐𝑡

=> 0 < 𝑥 + 2𝑐𝑡𝑥 − 𝑐[1 + 2𝑐𝑡 − (2 − 2𝑥 + 2𝑐𝑡)]𝑡 < 1 + 2𝑐𝑡

=> 0 < 𝑥 + 2𝑐𝑡𝑥 − [𝑐𝑡 + 2(𝑐𝑡)2 − (2𝑐𝑡 − 2𝑐𝑡𝑥 + 2(𝑐𝑡)2 )] < 1 + 2𝑐𝑡
33
Dynamic Traffic: Simple Traffic Flow Models

=> 0 < 𝑥 + 2𝑐𝑡𝑥 − [𝑐𝑡 + 2(𝑐𝑡)2 − 2𝑐𝑡 + 2𝑐𝑡𝑥 − 2(𝑐𝑡)2 ] < 1 + 2𝑐𝑡

=> 0 < 𝑥 + 2𝑐𝑡𝑥 − 𝑐𝑡 − 2(𝑐𝑡)2 + 2𝑐𝑡 − 2𝑐𝑡𝑥 + 2(𝑐𝑡)2 < 1 + 2𝑐𝑡

=> 0 < 𝑥 + 𝑐𝑡 < 1 + 2𝑐𝑡

=> −𝑐𝑡 < 𝑥 < 1 + 𝑐𝑡 (2.10)

Finally, we find the range of the third region which, at time 𝑡 = 0 is

𝑥>1

Generalise in the same way as the other two regions, this becomes

2𝜌
𝑥 − 𝑐 (1 − )𝑡 > 1
𝜌0

In this region 𝜌 = 0 so

𝑥 − c𝑡 > 1

=> 𝑥 > 1 + 𝑐𝑡 (2.11)

And so we have the piecewise function for ρ(x, t) based on the initial function in
equation (2.8) using the ranges for the regions n equations (2.9 − 2.11) defined as

𝜌0 𝑥 < −𝑐𝑡
𝜌0 (1−𝑥+𝑐𝑡)
𝜌(𝑥, 𝑡) ={ −𝑐𝑡 < 𝑥 < 1 + 𝑐𝑡 (2.12)
1+2𝑐𝑡
0 𝑥 > 1 + 𝑐𝑡

34
Dynamic Traffic: Simple Traffic Flow Models

It can be seen in the conditions of equation (2.8) that the edges of the function’s
sub-domains are dependent on time. As time increases, the length of the centre
region grows. This is intuitive as both of the points (−𝑐𝑡, 𝜌) and (1 + 𝑐𝑡, 𝜌) change
simply due to the motion of cars. As time passes, stopped cars at the point (−𝑐𝑡, 𝜌)
begin to move because the density around them decreases.

By definition, the third region must remain empty. However, the point (1 + 𝑐𝑡, 𝜌)
moves to the right as cars at that point also move to the right and in order to
preserve its emptiness, the third region’s left boundary must also move with the
cars. We know the speed of these cars to be approximately c because 𝑙𝑖𝑚 𝑣 = 𝑐.
𝜌→0

One might illustrate the piecewise break at 𝑥 = 1 + 𝑐𝑡 lying on the front of the
foremost car.

The following (Fig 2.4.2) is a graph of the evolution of a model with these initial
conditions. In this case, we let 𝑐 = 1 and 𝜌0 = 1, i.e. 𝑣 = 1 − 𝜌.

Fig 2.4.2: Evolution of the model defined as equation (2.9)

See appendix for maple script of both this and an animated version
35
Dynamic Traffic: Simple Traffic Flow Models

As time progresses, the overall distribution becomes flatter and the slope of the
centre region tends to zero. Figure 2.4.2 shows the distribution at five equally
spaced time intervals. In this example, 𝑡 ≥ 0. This is to avoid encountering a more
complex phenomenon that will be discussed in the next chapter.

It can be seen that at all times the centre line passes through the point (0.5,0.5). Let
us now investigate if this is due to the values that were set for 𝑐 or 𝜌0 .

𝜌0 (1 − 0.5 + 𝑐𝑡)
𝜌(0.5, 𝑡) =
1 + 2𝑐𝑡

𝜌0 (0.5 + 𝑐𝑡)
=> 𝜌(0.5, 𝑡) =
1 + 2𝑐𝑡

1 𝜌0 (1 + 2𝑐𝑡)
=> 𝜌(0.5, 𝑡) =
2 1 + 2𝑐𝑡

1
=> 𝜌(0.5, 𝑡) = 𝜌0
2

It appears that at the point 𝑥 = 0.5, the density is a constant value equal to half of
the maximum density. It is interesting to theorise that this is due to the initial
conditions set by the constructed function. This will be investigated in the next
chapter where the next distribution is studied.

Apart from changing the equation for velocity, this model can be expanded upon by
changing the initial conditions. Some initial conditions using this simple model
evolve to exhibit interesting and unusual behaviours. The following chapter
explains one of these behaviours and why it occurs.

36
Dynamic Traffic: Simple Traffic Flow Models

Chapter 3: Other Models and Shocks

In this chapter, further detail into the nature of different traffic models will be
given. This chapter will also discuss a particularly interesting phenomenon, known
as a shock, which arises from various traffic models including the Greenshield’s
model under certain conditions. These conditions and shocks themselves will be
observed and explained using diagrams and mathematical formulae. This chapter
will also examine two other models and compare them to the Greenshield’s model
in terms of empirical accuracy. This will be done using conclusions made by other
studies, namely work done by Z. Lu and Q. Meng[5] on analysing these relations and
by Vikram et al. on the behaviour of Lighthill-Whitham-Richards (LWR) models.
Much of the theory in this chapter was gathered from D. Vikrama, P. Chakrobortya,
S. Mittalb (2013), Exploring the behavior of LWR continuum models of traffic flow in
presence of shock waves[3] and from M. Jabeena (2013), Comparative Study of Traffic
Flow Models and Data Retrieval Methods from Video Graph[6]

3.1 LWR models

In the field of traffic modelling, LWR models are among the most eloquent.
According to M. Treiber and A. Kesting (2013)[4], these models were independently
proposed by Lighthill and Whitham (in 1955) and Richards (in 1956). The theory
behind the models is what links them together and it is based heavily on existing
theories in fluid dynamics. In this way, LWR models conceptualise traffic density as
the density of a body made up of many objects and makes the assumption that
there is little practical different between this concept and fluids. As a result of this
assumption all LWR models assume that each vehicle behaves according to the
same laws, thereby ignoring human nature. Drivers in these models can be thought
of as ‘perfect’ drivers.

The core concepts that LWR models borrow from fluid dynamics are the
conservation of mass, an equilibrium velocity-density relationship and a
fundamental equation of traffic flow. We will discuss each of these concepts now.

37
Dynamic Traffic: Simple Traffic Flow Models

Recall the definition for the law of conservation of mass given in section 2.1 (“the
total mass of any material system is neither increased nor diminished by reactions
between the parts”). In fluid dynamics this law is taken to apply to systems of
flowing mass and LWR models assume this to be analogous to traffic flow. In the
context of fluid and traffic it is sometimes called “the continuity equation”. In
section 2.1, we derived this equation for a simple system.

The fundamental equation of traffic flow that these models share is simply 𝑣𝜌 = 𝑄
where 𝑄 is flow rate. This equation simply states a physical definition but it is
important to note that LWR models can be used to calculate 𝑄 as a variable of
interest.

An example of an equilibrium velocity-density relationship is equation (2.4). This


equation, Greenshield’s model, is only one example of many different (𝑣 − 𝜌 )
relationships used in traffic modelling. Some of these other relations are the
Greenberg and Underwood models.

Greenberg’s model: 𝑣 = 𝑐 ln(𝜌0 /𝜌)

This relation was devised in 1959, 24 years after Greenshield’s was published.
Greenberg recorded data in the Lincoln Tunnel to arrive at his famous relation. The
main criticism of the model is that at lower densities, the speed of cars tends to
infinity (as can be seen in figure 3.1.1 on the next page). Part of the reasoning behind
this feature of the model is that, in the congested Lincoln Tunnel, it is assumed
free-flow never occurs. Lu and Meng (2013) compared Greenshield’s, Greenberg’s
and Underwood’s models by using regression analysis to predict the 𝑣 − 𝜌 curve on
different roads and comparing the predictions to data gathered in the field. They
found Greenberg’s performed well in modelling a notoriously congested road
(Beijing Third Ring Road). Perhaps more surprisingly, they found Greenberg’s
model was among the most accurate in predicting a sparse highway (Jing Jin Tang
Highway).

38
Dynamic Traffic: Simple Traffic Flow Models

Fig. 3.1.1 shows the shape of Greenberg’s relation compared to Greenshield’s.

In this graph, 𝜌0 = 1, 𝑐 = 1. The maple code for this graph can be found in the
appendix.

Underwood’s model: 𝑣 = 𝑐𝑒 −𝜌/𝜌0

Developed in 1961, the Underwood relation was proposed as an exponential relation


that could overcome the weakness of the Greenberg model. This model was also
compared to Greenshield’s and Greenberg’s relations by Lu and Meng (2013).
Unfortunately, this relation tends to differ from data taken from the field at both
very low and very high density. Additionally, the relation lets speed fall to zero only
when density rises to infinity (see figure 3.1.2) and so it cannot be used to accurately
describe highly congested traffic systems. Despite these problems, the model shows
a much better fit to sample distributions at low density than Greenberg or
Greenshield’s models.

39
Dynamic Traffic: Simple Traffic Flow Models

Fig.3.1.2 Shows the Underwood relation compared to Greenshield’s. In this graph,


𝜌0 = 1, 𝑐 = 1. The maple code for this graph can be found in the appendix.

These models each show their own strengths and weaknesses; no particular one of
them is objectively superior to the others. Despite their differences, however, all of
these models provide a good idea of how velocity and density change with each
other in real life. Unfortunately, some of the assumptions that are made by LWR
models are not always valid, particularly in the presence of shocks.

40
Dynamic Traffic: Simple Traffic Flow Models

3.2 Shocks

In this section, we will explain the nature of shocks and why they occur. The
method of characteristics will be used to explore the phenomenon.

In the context of this project, a shock means a sudden radical change or


discontinuity in the density distribution of a stretch of road at a point in time. As
we will see in this section, shocks appear in our models but are physically
unrealistic. They sometimes appear representing instant changes in velocity which
would imply infinite acceleration or deceleration. Remember that the models used
so far in this project do not allow for drivers to sense the road ahead of them and
instead they are thought to react instantly to changes in density on the road. To
better understand what shocks and the mathematics behind them look like,
consider the following initial density distribution.

0 𝑥<0
𝜌(𝑥, 0) = {𝜌0 𝑥 0<𝑥<1 (3.1)
𝜌0 1<𝑥

This function is illustrated by figure 3.2.1 and describes a particular density function
of 𝑥 and 𝑡 at time 𝑡 = 0. The 𝑣 − 𝜌 relation for this example is Greenshield’s
relation, written in chapter 2 as equation (2.4). Previously, we examined a density
function that described a system going from high density to low density in the
positive 𝑥 direction. In that model, the region in which density varied grew wider
and flatter with time. We will see this model behaves in quite the opposite way.

41
Dynamic Traffic: Simple Traffic Flow Models

Fig. 3.2.1 shows an initial density distribution in which 𝜌 = 0 for 𝑥 < 1 and then
climbs linearly until it reaches 𝜌 = 𝜌0 at 𝑥 = 1.

In the scenario presented by figure 3.2.1, density goes from low to high. Recall that
at lower densities, the velocity of cars increases. This means that cars will begin to
slow to a stop as density reaches a maximum, at what we will call a stopping point.
The stopping point is initially at 𝑥 = 1 but gradually that point will travel in the
negative 𝑥 direction as the stopping cars extend the region of maximum density in
the negative 𝑥 direction.

Let us now find ρ at the point (𝑥, 𝑡). This is done in a similar way to the
generalisation of the previous density distribution we looked at. In fact, this model
is based on the same law of conservation that the previous one was, meaning
equation (2.3) is valid here. This is the same for all LWR models. Substituting the
Greenshield’s model for velocity in equation (2.3) leads us once again to equation
(2.7), i.e. for the density distribution in equation (3.1), the following is true,

2𝜌
𝜌(𝑥, 𝑡) = 𝑓 (𝑥 − 𝑐 (1 − ) 𝑡)
𝜌0

2𝜌
In order to generalise equation (3.1) for t, we substitute 𝑥 − 𝑐 (1 − 𝜌 ) for 𝑥 in both
0

42
Dynamic Traffic: Simple Traffic Flow Models

the sub-functions and the boundaries of each region of the piecewise function. In
the first, 𝜌 = 0 which will not change as time passes (as it does not depend upon 𝑥)
but the boundary does contain 𝑥 and so must change like so,

𝑥<0

2(0)
=> 𝑥 − 𝑐 (1 − )𝑡 < 0
𝜌0

=> 𝑥 − 𝑐𝑡 < 0

=> 𝑥 < 𝑐𝑡 (3.2)

In the second region, ρ = ρ0 𝑥 which is generalised as follows

ρ = ρ0 𝑥


=> 𝑝0 (𝑥 − 𝑐 (1 − ) 𝑡)
ρ0
=> ρ = ρ0 𝑥 − ρ0 𝑐𝑡 + 2ρct

=> ρ(1 − 2ct) = ρ0 (𝑥 − 𝑐𝑡)


ρ0 (𝑥 − 𝑐𝑡)
=> ρ =
1 − 2𝑐𝑡

The boundaries for the range of 𝑥 in this region must also be generalised,

0<𝑥<1

Becomes


0 < 𝑥 − 𝑐 (1 − )𝑡 < 1
ρ0

43
Dynamic Traffic: Simple Traffic Flow Models

2ρ0 𝑥 − 𝑐𝑡
=> 0 < 𝑥 − 𝑐 [1 − ( )] 𝑡 < 1
ρ0 1 − 2𝑐𝑡

=> 0 < 𝑥 − 2𝑐𝑡𝑥 − 𝑐[1 − 2𝑐𝑡 − 2(𝑥 − 𝑐𝑡)]𝑡 < 1 − 2𝑐𝑡

=> 0 < 𝑥 − 2𝑐𝑡𝑥 − 𝑐[1 − 2𝑐𝑡 − 2𝑥 + 2𝑐𝑡]𝑡 < 1 − 2𝑐𝑡

=> 0 < 𝑥 − 2𝑐𝑡𝑥 − 𝑐[1 − 2𝑥]𝑡 < 1 − 2𝑐𝑡

=> 0 < 𝑥 − 2𝑐𝑡𝑥 − 𝑐[1 − 2𝑥]𝑡 < 1 − 2𝑐𝑡

=> 0 < 𝑥 − 2𝑐𝑡𝑥 − 𝑐𝑡 + 2𝑐𝑡𝑥 < 1 − 2𝑐𝑡

=> 0 < 𝑥 − 𝑐𝑡 < 1 − 2𝑐𝑡

=> 𝑐𝑡 < 𝑥 < 1 − 𝑐𝑡 (3.3)

In the third region, ρ = ρ0 . This does not depend upon 𝑥 so it will not change but
the boundary condition is generalised.

𝑥>1

becomes

2ρ0
𝑥 − 𝑐 (1 − )𝑡 > 1
ρ0

=> 𝑥 − 𝑐(−1)𝑡 > 1

=> 𝑥 + 𝑐𝑡 > 1

=> 𝑥 > 1 − 𝑐𝑡 (3.4)

Thus the generalised version of equation (3.1) is as follows,

0
𝑥 < 𝑐𝑡
ρ0 (𝑥 − 𝑐𝑡)
𝜌(𝑥, 𝑡) = { 𝑐𝑡 < 𝑥 < 1 − 𝑐𝑡 (3.5)
1 − 2𝑐𝑡 1 − 𝑐𝑡 < 𝑥
𝜌0

44
Dynamic Traffic: Simple Traffic Flow Models

From this expression we can see two things. Firstly, the boundaries for the middle
region draw narrower as time progresses. This is the opposite of the distribution
studied in the chapter 2. Secondly, in the expression for 𝜌 in the centre region, the
1
divisor tends to zero as 𝑡 → 2𝑐. At this point, 𝜌 would be undefined. It is here that

the shock occurs.

At the point 𝑥 = 0 in figure 3.2.1, cars travel with velocity 𝑣 = 𝑐 (𝑐 being the
maximum speed of cars) and must begin to slow down as density increases. As time
passes the first cars along the road, catch up those ahead of them. When this
happens, the point at which density becomes non-zero (and speed falls below 𝑐)
moves in the positive 𝑥 direction and the slope of the middle section of the graph
becomes steeper.

On the other side of the centre region, cars stop moving. This causes a growing line
of cars in a collective state of maximum density. This causes the right hand
boundary of the centre region to move in the negative 𝑥 direction.

The defining aspect of the shock is that the gradient of the line that joins the two
pieces of the function together tends to infinity. This creates a discontinuity which
does not fit into the core theories behind LWR models. LWR models do not account
for the formation of shocks and cannot rationalise the fact that the mathematics
shows two differing values for 𝜌 at one point in space. This phenomenon is simply a
symptom of the flaws in how traffic is conceptualised under LWR models. Drivers,
in reality, are not identical particles with instant reactions and the ability to sense
only the density of traffic in their immediate vicinity.

From the time-lapse graph in figure 3.2.2, we can see that a shock occurs at time 𝑡 =
0.5 (in this graph, 𝑐 = 1 and 𝜌0 = 1)

45
Dynamic Traffic: Simple Traffic Flow Models

Fig 3.2.2 shows the evolution of a system with an initial density distribution

illustrated by the red line here or by figure 3.2.1. See appendix for maple script of

this graph and an animated version.

In figure 3.2.2, the gold line labelled “t = 0.5” is an approximation and actually
represents t evaluated at 0.499. This is to avoid a singularity as that would interfere
with Maple. It is at this point in time that the range of the centre region becomes
zero and the slope of that line becomes infinite. At this point, density appears to be
at both a minimum and a maximum which is physically unrealisable.

As time continues to pass, we see that the centre region overlaps with the left and
right regions, forming a growing space in which density is physically inconsistent.
The cause of this is that the boundaries 𝑥 < 𝑐𝑡 and 𝑥 > 1 − 𝑐𝑡 continue to move in
the positive and negative 𝑥 directions respectively because there is no rules that
suggests the function should change.

If, in reality, drivers were to behave in exactly the way LWR models suggest they do,
there would be a road traffic accident at the point 𝑥 = 0.5, 𝑡 = 0.5 as cars must

46
Dynamic Traffic: Simple Traffic Flow Models

instantly reduce their speed from maximum to zero in order to behave in


accordance with the 𝑣 − 𝜌 relation.

Let us briefly discuss the fact that, similar to the distribution in the previous chapter
which had the same values for 𝑐 and 𝜌0 , density appears to be constant at the point
𝑥 = 0.5. This is even true after the shock has occurred. Let us investigate the
variables upon which, in this model, this phenomenon depends.

𝜌0 (0.5 − 𝑐𝑡)
𝜌(0.5, 𝑡) =
1 − 2𝑐𝑡

1
𝜌0 (1 − 2𝑐𝑡)
=> 𝜌(0.5, 𝑡) = 2
1 − 2𝑐𝑡

1
=> 𝜌(0.5, 𝑡) = 𝜌0
2

This is the same result as for the distribution constructed in chapter 2. Evidently,
this must be due to the 𝑣 − 𝜌 relation. Greenshield’s relation is gives a straight line
in a 𝑥 − 𝜌 graph. In each distribution constructed in this project, a straight line
would join two points, one at 𝜌0 and one at 0. These points would move but with
the same speed in opposite directions, meaning the centre point on those lines was
at a constant value for 𝑥. The centre point would also always be half way between
the lower and higher point because the line joining them was straight. Thus, at any
𝜌0
time, the density at centre point of the lines would be constant and of the value .
2

LWR models have now been shown to be accurate in some circumstances but are
not realistic in their depiction of drivers, meaning so long as shocks are not present
they elegantly approximate the density distribution on a single-lane stretch of road.
In the presence of shocks the model breaks down, suggesting unrealistic traffic
behaviour.

47
Dynamic Traffic: Simple Traffic Flow Models

3.3 Characteristic Lines and Shocks

In this section, the characteristic lines associated with systems that encounter
shocks will be examined. In this sense, we will discuss the differences between the
two density functions we have encountered in this project. We will find that shocks
occur when characteristic lines conflict and that this problem arises when LWR
models are used to describe systems that go from low density to high density.

Recall from chapter 1, section 2 that by using the method of characteristics we


know how 𝜌 changes along characteristic curves. The method shows us that for the
PDE

𝜕ρ 𝜕(ρv)
+ =0 (3.6)
𝜕𝑡 𝜕𝑥

which is the conservation law that all LWR models rely on,


=0
ds

In other words, along the characteristic lines, 𝜌 remains constant. Let us now find
the characteristic curves for the density distribution in equation (2.12).
In the first region, 𝑥 < −𝑐𝑡, 𝜌 = 𝜌0 and so the substituting this into the equation for
the characteristic curves (that is, equation 2.7) we get

2𝜌0
𝜌(𝑥, 𝑡) = 𝑓 (𝑥 − 𝑐 (1 − ) 𝑡)
𝜌0

=> 𝜌(𝑥, 𝑡) = 𝑓(𝑥 − 𝑐(−1)𝑡)

=> 𝜌(𝑥, 𝑡) = 𝑓(𝑥 + 𝑐t).

48
Dynamic Traffic: Simple Traffic Flow Models

Since 𝜌 is constant along these characteristics, this expression corresponds to


straight lines in the 𝑥 − 𝑡 plane defined as

𝑥 + 𝑐𝑡 = 𝛼, where 𝛼 is a constant. (3.7)

On the other hand, in the third region of the same density distribution, 𝑥 < +𝑐𝑡,
𝜌 = 0 and so the characteristics are defined by

2(0)
𝜌(𝑥, 𝑡) = 𝑓 (𝑥 − 𝑐 (1 − ) 𝑡)
𝜌0

=> 𝜌(𝑥, 𝑡) = 𝑓(𝑥 − 𝑐𝑡).

This corresponds to straight lines of the form

𝑥 − 𝑐𝑡 = 𝛽, where 𝛽 is a constant. (3.8)

These are lines perpendicular to the ones on the negative side of the x-axis.
Characteristics in the centre region are defined by a different function which gives
them a slope that varies with 𝑥. The expression for these lines is derived as follows.

𝜌0 (1−𝑥+𝑐𝑡)
In the centre region, 𝜌 = thus the function
1+2𝑐𝑡

2𝜌
𝑓 (𝑥 − 𝑐 (1 − ) 𝑡)
𝜌0

2𝜌0 1 − 𝑥 + 𝑐𝑡
= 𝑥 − 𝑐 (1 − )𝑡
𝜌0 1 + 2𝑐𝑡
1 − 𝑥 + 𝑐𝑡
= 𝑥 − 𝑐 (1 − 2 )𝑡
1 + 2𝑐𝑡
1 + 2𝑐𝑡 − (2 − 2𝑥 + 2𝑐𝑡)
= 𝑥−𝑐( )𝑡
1 + 2𝑐𝑡

49
Dynamic Traffic: Simple Traffic Flow Models

1 + 2𝑐𝑡 − 2 + 2𝑥 − 2𝑐𝑡
= 𝑥−𝑐( )𝑡
1 + 2𝑐𝑡
−1 + 2𝑥
= 𝑥−𝑐( )t
1 + 2𝑐𝑡
−𝑐𝑡 + 2𝑥𝑐𝑡
=𝑥−( )
1 + 2𝑐𝑡
𝑥 + 2𝑥𝑐𝑡 − 2𝑥𝑐𝑡 + 𝑐𝑡
=
1 + 2𝑐𝑡
𝑥 + 𝑐𝑡
=
1 + 2𝑐𝑡

This expression corresponds to straight lines with varying slopes of the form

𝑥 + 𝑐𝑡
= 𝛾,
1 + 2𝑐𝑡 (3.9)
where 𝛾 is a constant.

These characteristic lines are illustrated by the following graph.

50
Dynamic Traffic: Simple Traffic Flow Models

Fig 3.3.1 graphs the characteristic lines of the three regions together
on the 𝑡 − 𝑥 plane. See appendix for Maple script

Each line is an example of a characteristic though the family of characteristic lines


fill the graph. It can be seen here that as time increases, the centre region expands
in both the positive and negative 𝑥 directions. The centre, vertical line is at the
point 𝑥 = 0.5 representing the constant nature of density at that point. This graph
was built in Maple by using the expressions for the characteristic curves in each
region (equations 3.6 − 3.9) in terms of 𝑡. These expressions were the basis for three
functions that would each plot a single characteristic curve in either the first,
second or third region. These functions were then sequenced for values of 𝑥 at
regular intervals and finally displayed together.

The characteristic curves here are integral curves which abide by the existence and
uniqueness theorems[8] which means that none of the characteristics cross, despite
being mutually exhaustive of the points in the plane. So, at no point in time or
space is density ever two different values at once. This seems intuitive but there are
cases where this is not true.

51
Dynamic Traffic: Simple Traffic Flow Models

Consider the characteristics curves for the distribution in equation (3.5). The
expressions for 𝑓(𝑥, 𝑡) in the first and third regions are identical to that of the third
and first regions of the previous distribution, respectively. I.e. the characteristics in
the first region are shaped by 𝜌(𝑥, 𝑡) = 𝜌0 so they are of the form

𝑥 − 𝑐𝑡 = 𝛼.

Similarly, the characteristics in the third region (where 𝜌 = 0) are of the form

𝑥 − 𝑐𝑡 = 𝛽.

The characteristics in the centre region may be calculated in the same way as
before.

𝜌0 (𝑥 − 𝑐𝑡)
𝜌=
1 − 2𝑐𝑡

2𝜌
=> 𝑥 − 𝑐 (1 − )𝑡
𝜌0

2𝜌0 (𝑥 − 𝑐𝑡)
=> 𝑥 − 𝑐 (1 − )𝑡
𝜌0 1 − 2𝑐𝑡

1 − 2𝑐𝑡 − 2(𝑥 − 𝑐𝑡)


=> 𝑥 − 𝑐 ( )𝑡
1 − 2𝑐𝑡

1 − 2𝑐𝑡 − 2𝑥 + 2𝑐𝑡
=> 𝑥 − 𝑐 ( )𝑡
1 − 2𝑐𝑡

1 − 2𝑥
=> 𝑥 − 𝑐 ( )𝑡
1 − 2𝑐𝑡

𝑥 − 2𝑐𝑡𝑥 𝑐𝑡 − 2𝑐𝑡𝑥
=> −( )
1 − 2𝑐𝑡 1 − 2𝑐𝑡

52
Dynamic Traffic: Simple Traffic Flow Models

𝑥 − 2𝑐𝑡𝑥 − 𝑐𝑡 + 2𝑐𝑡𝑥
=>
1 − 2𝑐𝑡

𝑥 − 𝑐𝑡
=>
1 − 2𝑐𝑡

Which corresponds to lines of varying slope of the form

𝑥 − 𝑐𝑡
=𝛾
1 − 2𝑐𝑡

Figure 3.3.2. illustrates this system of characteristic curves. It is immediately


apparent that the characteristics cross. This crossing of characteristics implies that
at a certain point in time, there is a value of 𝑥 for which there is more than one
value for 𝜌. The number of lines intersecting a single point is the number of values
1
for 𝜌 there are at that point. Notice how lines first cross at 𝑡 = 2. In these graphs,
1
𝑐 = 1 and it was previously shown that the shock should appear at 𝑡 = 2𝑐. This point

in time (𝑥 = 0.5, 𝑡 = 0.5) is illustrated more clearly in figure 3.2.2 by the gold line.
The gradient of the function here becomes infinite and so there are an infinite
number of values for 𝜌 at the point (0.5,0.5). This is illustrated in figure 3.3.2 by the
fact that any line beginning in the centre region passes through that point. For 𝑡 >
0.5, it can be seen that there is a fan-shaped array of characteristic curves spreading
out above that point of intersection, where lines from both the green and red
families cross those in the centre. This corresponds to the range in 𝑥 over which
there are three values for 𝜌 for any one value for 𝑥.

53
Dynamic Traffic: Simple Traffic Flow Models

Fig 3.3.2 shows the characteristic lines of the density distribution in


equation (3.2). See appendix for Maple script.

Recall that in models based on equation (2.5), the value for 𝜌 along the
characteristics remains constant. In other words, at any point on a red characteristic
line, 𝜌 = 0 according to the value for 𝜌 in the first region of equation (3.2). For
instance, at the point (0,0), 𝜌 = 0. Similarly, at any point along a green
characteristic line, 𝜌 = 𝜌0 . This means that at a point that lies on both a green and
red line, 𝜌 = 0 and 𝜌 = 𝜌0 . This is mathematically sound but physically unrealisable
for our traffic models.

54
Dynamic Traffic: Simple Traffic Flow Models

Conclusion

In conclusion, this project has developed some of the ideas studied by the reader in
the area of partial differential equations and put them to use, examining
Greenshield’s velocity-density relation. Through this study, we have developed a
better understanding of physical interpretations of PDEs and some of the
mathematics behind traffic flow. The traffic theory studied in this project is also
substantial, the strengths and weaknesses of LWR models have been demonstrated.

The methods used in this project are among the first steps to understanding and
constructing more realistic traffic models. This project has also combined the
subject material into a practical context, hopefully allowing for better
understanding on the part of the reader.

The material covered in this project may also act as a basis for further study into
traffic flow models and the applications of partial differential equations. Further
study could include exploration of the phenomena described in the research piece
“Traffic Modelling - Phantom Traffic Jams and Traveling Jamitons”[8] by M. Fylnn et
al. Included therein are examinations of the similarities to wave motion in traffic
flow models. The propagation of patterns in traffic systems is also covered using
higher order PDEs by M. Treiber and A. Kesting[5].

The calculus, geometry and mathematically orientated programming that I have


learned in the course of writing this project have inspired me to research further
study into those branches of mathematics. Differential calculus and mathematical
programming in particular are likely to feature in my future projects and pursuits.

55
Dynamic Traffic: Simple Traffic Flow Models

Appendix

Chapter 1 Graphs
Fig. 1.2.1-1.2.2 – Graphing rates of change
Restart: with(plots):

S := (1/2)*t^2:
dSdt := diff(S, t):
plot(S, t = -5 .. 100, s = 0 .. 100, view = [0 .. 5, 0 .. 10], thickness = [3], labels = [Time(t),
Distance(s)]);
plot(dSdt, t = -5 .. 5, s = -5 .. 5, view = [0 .. 5, 0 .. 10], thickness = [3], colour = [blue],
labels = [Time(t), Velocity(ds/dt)]);

Fig. 1.3.1 – Example solution surface


restart: with(plots): with(PDEtools):

pde1 := y*(Diff(z(x, y), x))-x*(Diff(z(x, y), y))+x-y = 0;


pdsolve({pde1, z(x, 0) = x*(x+1)}, z(x, y));
plot3d(x^2+y^2+x+y, x = -5 .. 5, y = -5 .. 5);

Animated plot using the equation from fig. 1.3.1 taking y as the time variable.
restart: with(plots):
animate(plot, [x^2+y^2+x+y, x = -10 .. 10], y = -5 .. 10);

Chapter 2 Graphs

Fig. 2.4.1 – Density distribution in its initial state


restart: with(plots):

Z:=(x,t)-> piecewise(x < -t, 1, `and`(-t < x, x < 1+t), (1+t-x)/(1+2*t), 1+t < x, 0):
plot(Z(x, 0), view = [-2 .. 2, 0 .. 2], tickmarks = [5, 0], labels = [x, ρ[0]]);

56
Dynamic Traffic: Simple Traffic Flow Models

Fig. 2.4.2 – Superimposed graphs of the first distribution at different times t={0, 1, 2,
3, 4}
restart: with(plots):
Z:=(x,t)-> piecewise(x < -t, 1, `and`(-t < x, x < 1+t), (1+t-x)/(1+2*t), 1+t < x, 0):
p0:= plot(Z(x, 0), color = [red], legend = [t = 0]):
p1:= plot(Z(x, 1), color = [orange], legend = [t = 1]):
p2:= plot(Z(x, 2), color = [gold], legend = [t = 2]):
p3:= plot(Z(x, 3), color = [green], legend = [t = 3]):
p4:= plot(Z(x, 4), color = [cyan], legend = [t = 4]):
plots[display]([p0, p1, p2, p3, p4], view = [-5 .. 6, 0 .. 1.2], labels = [x, ρ]);

Animated evolution of linear velocity model in fig. 2.4.2


restart: with(plots):
plots[:-animate]('plots[:-implicitplot]', [z = piecewise(x < -t, 1, `and`(-t <= x, x <= 1+t),
(1+t-x)/(1+2*t), 1+t < x, 0), x = -20 .. 20, z= 0 .. 4, labels = [x, ρ]], t = 0 .. 10, view = [-15
.. 15, 0 .. 1.2]);

Chapter 3 Graphs
Fig. 3.1.1 – Greenberg’s relation compared to Greenshield’s

restart: with(plots):

Gs := plot(1-rho, rho = 0 .. 1, v = -10 .. 10, view = [0 .. 1.5, 0 .. 1.5], colour = [black],


thickness = [3]):
Gb := plot(ln(1/rho), rho = 0 .. 1, v = -10 .. 10, view = [0 .. 1.5, 0 .. 1.5], colour = [red],
thickness = [3]):

plots[display]([Gs, Gb], labels = [Density, Velocity]);

Fig. 3.1.2 – Underwood relation compared to Greenshield’s

restart: with(plots):

Gs := plot(1-rho, rho = 0 .. 1, v = -10 .. 10, view = [0 .. 1.5, 0 .. 1.5], colour = [black],


thickness = [3]):
Uw := plot(exp(-rho), rho = 0 .. 10, v = -10 .. 10, view = [0 .. 1.5, 0 .. 1.5], colour = [blue],
thickness = [3]):

plots[display]([Gs, Uw], labels = [Density, Velocity]);

57
Dynamic Traffic: Simple Traffic Flow Models

Fig. 3.2.1 – Initial density distribution for shock example

restart: with(plots):

p0 := plot(1, x = 1 .. 5, thickness = [2]):


p1 := plot(0, x = -5 .. 0, thickness = [2]):
p2 := plot(x, x = 0 .. 1, thickness = [2]):

plots[display]([p0, p1, p2], view = [-2 .. 2, 0 .. 2], labels = [Position, Density])

Fig. 3.2.2 – Time lapse of shock example

restart: with(plots):

P0 := proc (t, c, l) options operator, arrow; plot(0, x = -5 .. t, y = 0 .. 5, thickness = [2],


colour = c, legend = l) end proc:
P1 := proc (t, c, l) options operator, arrow; plot(1, x = 1-t .. 5, y = 0 .. 5, thickness = [2],
colour = c, legend = l) end proc:
P2 := proc (t, c, l) options operator, arrow; plot((x-t)/(1-2*t), x = t .. 1-t, thickness = [2],
colour = c, legend = l) end proc:
P := proc (t, c, l) options operator, arrow; plots[display]([P0(t, c, l), P1(t, c, l), P2(t, c, l)],
view = [-1 .. 2, 0 .. 2]) end proc:

plots[display]([P(1, cyan, t = 1), P(.75, green, t = .75), P(.499, gold, t = .5), P(.25, orange, t
= .25), P(0, red, t = 0)]);

Animated shock example based on Fig 3.2.2

restart: with(plots):

p0 := animate(plot, [1, x = 1-t .. 5, thickness = [2]], t = 0 .. 1):


p1 := animate(plot, [0, x = -5 .. t, thickness = [2]], t = 0 .. 1):
p2 := animate(plot, [(x-t)/(1-2*t), x = t .. 1-t, thickness = [2]], t = 0 .. 1):

plots[display]([p0, p1, p2], view = [-5 .. 5, 0 .. 2]);

Fig. 3.3.1 – A graph showing the characteristic lines of equation (2.9)

restart: with(plots):

neg := proc (c, a) options operator, arrow; plot((a-x)/c, x = -5 .. 5, y = -5 .. 5, colour =


[red]) end proc:
print("Region 1: &rho;=&rho;o, characteristics are x+ct= a -> t=(a-x)/c"):
ph := proc (c, a) options operator, arrow; plot((a-x)/(c-2*a*c), x = -5 .. 6, t = -5 .. 5, view =
[-5 .. 5, 0 .. 5]) end proc:
print("Region 2: &rho;=&rho;o(1-x+ct)/(1+2ct), characteristics are (x+ct)/(1+2ct)= a
&rarr;t=(a-x)/(c-2ac) "):
pos := proc (c, a) options operator, arrow; plot((x-a)/c, x = -5 .. 5, y = -5 .. 5, colour =

58
Dynamic Traffic: Simple Traffic Flow Models

[green]) end proc:


print("Region 3: &rho;=0, characteristics are x-ct= a -> t=(x-a)/c"):

plots[display]([seq(pos(1, i), i = 1 .. 6, .5), seq(neg(1, i), i = 0 .. -6, -.5), seq(ph(1, i), i = .10
.. .90, .10), plot([.5, t, t = 0 .. 10])], view = [-5 .. 5, 0 .. 5], labels = [x, t]);

Fig. 3.3.2- A graph showing he characteristic lines of equation (3.2)

restart: with(plots):

neg2 := proc (c, a) options operator, arrow; plot((x-a)/c, x = -5 .. 5, t = -5 .. 5, colour =


[red]) end proc:
print("Region 1: &rho;=0, characteristics are x-ct= a -> t=(x-a)/c"):
ph2 := proc (c, a) options operator, arrow; plot((x-a)/(c-2*a*c), x = -5 .. 6, t = -5 .. 5, view
= [-5 .. 5, 0 .. 5]) end proc:
print("Region 2: &rho;=&rho;o(x-ct)/(1-2ct), characteristics are (x-ct)/(1-2ct)= a
&rarr;t=(x-a)/(c-2ac) "):
pos2 := proc (c, a) options operator, arrow; plot((a-x)/c, x = -5 .. 5, t = -5 .. 5, colour =
[green]) end proc:
print("Region 3: &rho;=&rho;o, characteristics are x+ct= a -> t=(a-x)/c"):

plots[display]([seq(pos2(1, i), i = 1 .. 6, .125), seq(neg2(1, i), i = 0 .. -6, -.125), seq(ph2(1,


i), i = .10 .. .90, .10), plot([.5, t, t = 0 .. 10])], view = [-.5 .. 1.5, 0 .. .6], labels = [x, t],
tickmarks = [5, 6]);

59
Dynamic Traffic: Simple Traffic Flow Models

References

[1]"World Bank Data: Motor vehicles (per 1,000 people)". The World Bank. Retrieved
2011-08-27.

[2]X. Yu, lecture notes:


https://www.math.ualberta.ca/~xinweiyu/436.A1.12f/PDE_Meth_Characteristics.pdf

[3] D. Vikrama, P. Chakrobortya, S. Mittalb (2013), Exploring the behavior of LWR


continuum models of traffic flow in presence of shock waves. Elsevier Ltd.

[4] M. Treiber, A. Kesting (2013), Traffic Flow Dynamics. Springer Berlin Heidelberg

[5] Z. Lu, Q. Meng (2013), Analysis of Traffic Speed-Density Regression Models.


Department of Civil and Environmental Engineering, National University of
Singapore.

[6] M. Jabeena (2013), Comparative Study of Traffic Flow Models and Data Retrieval
Methods from Video Graphs. Journal of Engineering Research and Applications,
Sardar Vallabhbhai National Institute of Technology.

[7] J. T. Tyson lecture notes: http://www.math.uiuc.edu/~tyson/existence.pdf

[8] M. Flynn, A. Kasimov, J. Nave, R. Rosales, B. Seibold. (2010) Traffic Modelling -


Phantom Traffic Jams and Traveling Jamitons. National Science Foundation (NSF

60

You might also like