Traffic Flow

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

TEACHING MATHEMATICS AND ITS APPLICATIONS Volume 18, No.

3, 1999 115

Modelling Traffic Flow: Solving and Interpreting Differential


Equations
MARK McCARTNEY and MALACHY CAREY

Submitted March 1999, accepted May 1999

Downloaded from http://teamat.oxfordjournals.org at Seoul National University on June 6, 2010


Abstract vator to the discussion of the ideas of mathemat-
A simple mathematical model for how traffic flows ical modelling, or as an investigative project into
along a road is introduced. The resulting first-order the properties of the model.
ordinary differential equations can be used as an
application of solution techniques taught at A-level Models for traffic flow
and first year undergraduate level, and as a moti- Consider a single one way stretch of road with a
vator to encourage students to think critically about single entrance for traffic to flow onto the road and
the physical interpretation of the results which the a single exit for traffic to flow off. Such a stretch of
equation produces. road is usually referred to as a single link (a two
way stretch of road between two points A and B
Introduction would be represented by two links; one going from
WHEN students study differential equations they A to B and the other from B to A).
are typically introduced to a range of important As mentioned in the Introduction, there are
applications from physical science, such as simple many highly sophisticated mathematical models
harmonic motion (SHM), Newton's law of cooling for the flow of traffic along a single link, and these
and radioactive decay. The student is rarely en- models fall into the two broad categories of
couraged to reflect critically on the nature of these macroscopic and microscopic. In microscopic
mathematical models and this is probably for two models the motion of each individual vehicle is
main reasons. First, models such as these noted simulated in relation to the motion of the driver in
above give very good representations of the corre- front (this class of models is referred to as car
sponding basic physical processes and so there following models1). Macroscopic theories, how-
isn't a lot for the student to be critical about. ever, ignore the behaviour of individual drivers
Secondly, the physical processes being modelled and instead attempt to model gross structures of
tend to be somewhat divorced from the students' traffic flow in terms of properties such as traffic
everyday experience and so it can be difficult for density (vehicles/metre) and flow (vehicles/sec-
the students to feel that they are in a position to ond). In both cases the range of models which
comment. have been developed extends from the extremely
A topic such as how traffic flows along a stretch simple4 to the extremely complex.5
of road is, however, well within the experience of
all students. It is also a topic of substantial re- The mathematician's idea of perfect road users
search interest to a whole range of academics such One of the things which makes the succcessful
as mathematicians, civil engineers, geographers, mathematical modelling of traffic so difficult is
ecologists and management scientists and has been that, at its root, what we are trying to model is
modelled in a number of ways utilising ideas from human driver behaviour; and all humans are dif-
areas such as fluid flow,1 statistical physics2 and ferent. Drivers have different preferred "cruising"
chaos theory. 3 This range of approaches indicates speeds, react differently to the behaviour of their
the complexity of the problem. In this paper, nearest neighbour drivers who are directly in front
however, we shall introduce a very basic model and behind them, and some drivers even brake for
which results in a first-order ordinary differential no apparently good reason while on a clear road in
equation that can be solved using the integrating perfectly good conditions! If only drivers would
factor or complementary function plus particular behave in a more uniform way the modelling job
integral method. The model could be usefully would be much simpler. So what is the mathema-
utilised in teaching in a number of ways; as an tician's idea of the perfect set of road users? Well,
application of differential equations, or as a moti- quite simply, it would be a set of drivers who all
i The Institute of Mathematics and its Applications 1999
116 TEACHING MATHEMATICS AND ITS APPLICATIONS Volume 18, No. 3, 1999

drive at exactly the same speed along a link of traffic exiting)/(time taken) = v/r. From this we
(irrespective of how close together they are) and postulate the uncongested form of q{y) as
so take exactly the same time (which we call the
trip time, r) to travel from entrance to exit. This q(v)=-v. (3)
would mean, in terms of a macroscopic model,
that for an initially empty road with inflow u{t) Substituting (3) into (2) gives
(vehicles/unit time) entering the link the outflow dv 1
from the exit would be given by q(t) (vehicles/unit (4)
time) where, _ + - , = „(,).

Downloaded from http://teamat.oxfordjournals.org at Seoul National University on June 6, 2010


= u{t-r). We refer to equations (3) and (4) as the uncon-
(1) gestedflowmodel and to illustrate its behaviour we
Thus the outflow is just the inflow shifted by the consider a number of examples.
trip time r. We will refer to equation (1) as the
perfect road user model. Linearly increasing inflow and the ultimate in "road
rage"
A differential equation model for traffic flow Consider the general linear inflow,
A slightly more complex macroscopic model for u(t) = a (5)
traffic flow along a single link assumes that the rate
of outflow q from the link is a function of the total where a, j3 > 0 and v(0) = 0.
number (or volume, v) of vehicles on the link at Substituting (5) into (4) and using (3) gives the
time t. By conservation of vehicles the rate of outflow from the link as
change of the volume of vehicles on the link must
equal the inflow—the outflow or, q{t) = a + 0(t-T)-(a- fir) e - ( 1 / r ) (

dv = u(t - T) - (a - (3T) e- (1/r) '. (6)


— = u{t)-q{v). (2)
Notice that
In this case the model consists in solving (2) for = u(t-r). (7)
physically reasonable forms of q(v).
Thus, in this case, the asymptotic form of the
Choosing the form of q(v); uncongested traffic flow outflow is simply given by the inflow shifted by the
Any road will have a typical light traffic trip trip time r, i.e. the traffic behaves asymptotically
time, r, associated with it. This trip time is the time as it it were made up of "perfect road users".
it will take a typical vehicle to traverse the link Equation (6) is illustrated in Figure 1 for the case
from entrance to exit in uncongested conditions. where u(t) = 10? and the trip time r = 10.
Obviously, if the volume of traffic on the link Figure 1 also illustrates a physically bizarre
becomes too large we would expect the trip time property of the uncongested flow model, which
to increase as the link becomes congested. But holds irrespective of the form of the inflow and the
initially we shall ignore this effect and assume that link trip time r; namely that the onset of an inflow
the link can allow traffic to flow freely irrespective generates (instantaneously) an outflow from the
of the number of vehicles on it at any given time. exit. Mathematically, this results from the fact that
Of course if such a mythical road existed it would the outflow, q, is a function of the volume of
be the answer to every Minister of Transport's traffic, v, on the link with no regard to where
dreams. On such a road, traffic jams would never along the link the traffic actually is (i.e. the model
occur and the ever increasing volume of traffic on does not take any account of the spatial variation
roads, which is the cause of the increased stress along the length of the road). Physically it can be
levels of many an urban commuter, would cause interpreted as the model instantaneously and uni-
no problem. But, as we shall see, in the context of formly spreading inflowing traffic along the entire
our differential equation model such a road is not length of the link and hence allowing the vehicles
quite as marvellous as it might appear. which enter at t = 0 to move from the entrance to
Consider a link with a volume v vehicles distrib- exit at infinite speed. This makes for a particularly
uted evenly along it. If the traffic moves freely nasty form of "road rage" where drivers decide to
through the link we would expect the last vehicle take advantage of the clear road ahead and drive
to exit the link after time r and so the average as fast as they can, and worse still, it turns out that
outflow from the link would be given by (volume they have unusually high performance cars!
TEACHING MATHEMATICS AND ITS APPLICATIONS Volume 18. No. 3, 1999 117

400

300

Downloaded from http://teamat.oxfordjournals.org at Seoul National University on June 6, 2010


200
U(t)=10t, T=10

o
100 perfect road users
uncongested flow model

0 10 20 30 40 50

time t
Fig. 1. Comparison between perfect road user model and uncongested flow model for linearly increasing traffic inflow

Journeys which take forever quickly and secondly, the final piece of traffic
Consider thee case where there is an initial entering the road moves infinitely slowly! Before
volume of traffic. Vo, on the link and there is no becoming too concerned with the existence of a
inflowing traffic, i.e. we solve (4) subject to road on which you may be trapped forever, or on
u(t) = 0 and v(0) = F o , and use (3) to obtain which you may move superluminally depending on
the somewhat demonic whim of where you are in
(8) the queue of traffic, let's look at another example.

Note that the model predicts that the time Blocks of traffic
required for all the traffic to clear the link is Consider a "block" of traffic of the form
infinite! Physically we can interpret this as meaning
0 /<0
that vehicles at the "tail end" of the block of traffic
move infinitely slowly. Even with this being the u(t) = { «0 0< t<T (11)
case, however, it is easy to show that the average 0 t>T
time, T, spent by a vehicle on the link is the trip
time r, i.e. The uncongested flow model predicts outflowing
traffic of the form,

_ (9)
f° <<°
where, substituting equation (8) into equation (3), q(t) = i Uo(\ - e~('M) 0<t<T.
(7 /r) r T
(«o(l-e- " )e( -')/ T>t
v(/) = K o e - ( l ^ ' . (10)
(12)
Thus we have two general predictions from our Figure 2 shows results generated by equation (12)
uncongested flow model so far. First (from the for a range of trip times r with UQ — 100 and
previous section), traffic entering an initially clear T = 30. Note that the outflows have been shifted
road at t = 0 moves along the road infinitely along the time scale to allow direct comparison
118 TEACHING MATHEMATICS AND ITS APPLICATIONS Volume 18, No. 3, 1999

100 nnrfnrf rniri n**nr


..-•• \ i :|
\ i '. i
i.' / , • • ' \ \ : i uncongested flow model
80 \ l
'•'
- - - -T = 1
\ \ ':

\ \ '• *=2
V x =5
S 60 \ • • ;

Downloaded from http://teamat.oxfordjournals.org at Seoul National University on June 6, 2010


. T = 10
\ *• •
\ \ •
\ \

/ i '. \ \ u(t) = 100 0<t<30


40
1 i '•
= 0 otherwise

i '• 1
i '• <
20 ! i :'
' ' •' 1
.'" / : i

i :]

-10 0 10 20 30 40 50

timet
Fig. 2. Comparison between perfect road user model and uncongested flow model for a block of inflowing traffic.

with the perfect road user model. Two points are Congested traffic: death by traffic jam
worth noting from Figure 2. In the uncongested flow model the volume of
First, as noted earlier, the uncongested flow traffic on the link can increase without bound and
model predicts traffic at the start of the block of the link will never become congested, because
traffic moves infinitely quickly and traffic at the increased volumes of traffic will never adversely
end of the block moves infinitely slowly. Secondly, affect traffic outflow. This is, of course, not what
as T —* 0 the outflows become more like the results we would expect to happen in real life. As the link
of the perfect road user model. Or conversely, as T volume increases we would expect flow to become
increases we can regard the outflows from the hindered and eventually jam. A simple way to
uncongested flow model as resulting from an model this is with the quadratic function
increased "diffusing" or "spreading" of the perfect
road user model.
(.3)
Such "diffusing" and "spreading" of traffic pro-
files does, of course, actually happen in real life, 0 otherwise
and so here we have he model predicting a where J is the "jam volume" at which traffic flow
real traffic phenomenon. This behaviour finds its stops. Note that for small values of v (or large
root in the model assumption that outflow, q, is a values of J) the quadratic model behaves like the
function of link volume only. As mentioned be- uncongested flow model. Also note that the out-
fore, physically this can be interpreted as the flow from the link cannot exceed the maximum
model instantaneously and uniformly spreading value of 7/4r. We refer to equations (2) and (13)
inflowing traffic along the length of the link. Thus as the congestedflowmodel.
although the uncongested flow model predicts (at The differential equation which results from
least qualitatively) a real phenomenon it does so substituting (13) into (2) has an analytic solution
from use of a crude physical assumption and so we only in the case of very simple inflows. As an
wouldn't expect good quantitative agreement at example we consider the case of constant inflow
this point between the model and the real world. where
TEACHING MATHEMATICS AND ITS APPLICATIONS Volume 18, No. 3, 1999 119

0 /<0 Thus, in the case of a constant inflow Uo, for a


«(') = (14) link with given jam volume J and light traffic trip
Uo t>0
time T, the link will jam in time 7jam if
and the initial volume of traffic on the link is zero,
Uo > J/4T. (22)
i.e. v(0) = 0.
Substituting (14) and (13) into (2) and rearran- Further, given the form of (13), if the link jams
ging and integrating gives then it will never "unjam", even if the inflow is
stopped. Once the link volume reaches J outflow
1 dx stops, and there is no mechanism in the model to
(15)

Downloaded from http://teamat.oxfordjournals.org at Seoul National University on June 6, 2010


UQJT -JX + X2' allow the link volume to fall below J again. Thus
the link remains jammed for all future time with an
The form of the solution of this integral depends ever increasing volume of inflowing traffic, produ-
on the sign of the discriminant of the quadratic in cing the worst possible nightmare scenario for the
the integrand.6 Solving (15) for v(t) and then back motorist: an eternal traffic jam with the potential
substituting into (13) to find the outflow q gives the of an increasing multi-vehicle pile up.
following solutions. This situation can be averted by stopping the
(a) For a2 =J2 - 4U0JT > 0 inflow of traffic at a time t < Tjam, thus allowing
the link to clear before a jam occurs.
Figure 3 shows the effect of reducing the jam-
ming volume, J, on a link. In Figure 3, Uo = 100
<?(>) =
and T = 10 and so from equation (22) the critical
jam volume, below which the link will experience a
jam is J = 4000. Note also in Figure 3 the un-
x(a + {J- 2UOT) tanh (£}-)) (16) congested flow model is equivalent to the con-
gested flow model with J = oo, and so as J is
where increased the results from the congested model
approach those of the uncongested model.
a= y/j2 - 4U0JT. (17)
Note that A numerical example
liml In this section we apply the models as set out
= U0. (18)
f-XX> above to some realistic data cast in the form of a
question which could conveniently be used in class.
Thus as t —> oo the steady state outflow is equal
to the inflow.
Question
Consider an initially empty, 5 km stretch of
2T road. At time t — 0 traffic begins to flow onto
(19) the road at a constant rate of 1.2 vehicles/second
2V+t and with speed of 72 km/hr (=20 m/s). The average
And again, as t —> oo the steady state outflow length of each vehicle is 5 m.
equals the inflow. (a) Under such conditions does the congested
(c) For a 2 = J2 - 4U0JT < 0 flow model predict that the road will jam? If
so, when?
What is the outflow predicted by
(b) the perfect road user model,
(c) the uncongested flow model,
2 - tan"' (d) the congested flow model,
2
x tan 2 L 10 minutes after inflow commences?
(20)

In this case the link will jam (i.e. q(t) = 0) at Solution


time First, we lay out the values of the parameters
which we require, namely inflow rate, Uo, trip
Tjam — ' «" - ( ' y
:tan
-l
(2I) time, r, and jam volume, J. We are given
t/o = 1-2 vehicles/second. We take r = 250 s, which
120 TEACHING MATHEMATICS AND ITS APPLICATIONS Volume 18, No. 3, 1999

100-
s
uncongested flow model
80-
' • ' . ' '
(q(v)=v/t)
'"^••^ congested flow model
' • ' / • • ' '

(q(v) = V(J-V)/JT);
£> 60-

Downloaded from http://teamat.oxfordjournals.org at Seoul National University on June 6, 2010


/ • /
J-5000
ll- j = 4000
il! 4 , ' ' ' * " *

!*••'
\ \ - J = 3000
\ J = 2000
f
\

\ \

11
t
\ T=10
20-
',

0- 1 \
\
1

1 ' 1 ' 1 ' 1


20 40 60 80 100
timet
Fig. 3. Comparison between perfect road user model and uncongested and congested flow models for a constant inflow of traffic.

is simply the time taken for a vehicle travelling at fact that the models predict novel phenomena such
20 m/s to travel 5000 m from entrance to exit of the as infinite journey time, "road rage" and the
road. Finally we set J = 1000, which is the maxi- prospect of "death by traffic jam". Finally, the
mum number of vehicles, of length 5 m, which can best way to improve these simple models is to
be placed "bumper to bumper" along 5000 m of include spatial dependence and thus move from
road. the solution of an ordinary differential equation
with variables of time, flow and volume to the
(a) Using (22), the congestedflowmodel jams if solution of a partial differential equation with
C/o > J/4T, which is true for the above data. variables of space, time, flow and density. This
Thus jamming does occur, and using (21), more realistic formulation of the problem is
the jam begins at Tjam as 43 minutes. commonly known as the Lighthill, Whitham1 or
We can easily evaluate the predicted outflows Lighthill, Whitham and Richards model.7
from the 3 models at t = 600 seconds using (1),
(12) and (20) to give, References
1. Wan, F. Y. M., "Mathematical Models and Their Analysis."
(b) 1.2 vehicles/second, (c) 1.09 vehicles/second, Harper and Row, 1989.
and (d) 0.9 vehicles/second. 2. Prigogine, I. and Herman, R., "Kinetic Theory of Vehicular
Traffic." American Elsevier, 1971.
Concluding remarks 3. Low, D. J. and Addison, P. S., A nonlinear temporal head-
way model of traffic dynamics, Nonlinear Dynamics, 1998,
The simple traffic flow models that have been 16, 127-151.
considered in this paper will provide students with 4. Resnick, M., "Turtles, Termites and Traffic Jams." MIT
an opportunity to exercise their skills in differential Press, 1995.
equations and integration. They can also be used 5. Paramics web site: http:Hwww.paramics.com/
6. Tallarida, R. I., "Pocket Book of Integrals and
to encourage students to look critically at the Mathematical Formulas." 2/e, CRC Press, 1992.
solutions they obtain and interpret them physi- 7. Daganzo, C. F., "Fundamentals of Transportation and
cally. Hopefully this latter process is aided by the Traffic Operations." Pergamon, 1999.
TEACHING MATHEMATICS AND ITS APPLICATIONS Volume 18, No. 3, 1999 121

Mark McCartney is a Research Officer at the University of Ulster. Previous to his appointment at the University
of Ulster he was a Lecturer in Mathematics at the University of Abertay Dundee. His research interests include
theoretical atomic physics and the mathematical modelling of traffic flow.
Malachy Carey is professor of Management Science in the Faculty of Business and Management at the University
of Ulster. Prior to that he was a Senior Research Fellow at the University of Oxford, and before that Associate
Professor at Carnegie-Mellon University in Pittsburgh. His current research interests are in modelling flows,
congestion and pricing for road traffic networks and in operations managements and scheduling for public transport.

Downloaded from http://teamat.oxfordjournals.org at Seoul National University on June 6, 2010


Address for correspondence: Operations Research Group, Faculty of Business and Management, University
of Ulster at Jordanstown, BT37 OQB, Northern Ireland, ([email protected]), ([email protected])

You might also like