Escolar Documentos
Profissional Documentos
Cultura Documentos
Mathematical Modeling
In this chapter, we present an outline of mathematical modeling, a partial differential equation
as a mathematical model for traffic flow. Also we discuss about basic variables of traffic
model, relationship among velocity, flux and density. Also we represent specific speed-density
relationship and specific flow-density relationship. Our discussions on this chapter follow from
[1], [5], [7] and [8].
1.1 Outline of Mathematical Modeling
Mathematical modeling is an inevitable component of scientific and technical progress. The
formulation of the problem of mathematical modeling, an object leads to a precise plan of
actions. It can be conditionally split into three stages: model-algorithm code (refer to the
diagram).
Figure 1.1: Diagram of Mathematical Modeling
At the first stage, the equivalent of the object is chosen reflecting its major properties in a
mathematical form- the lows, controlling it, connections peculiar to the components and so on.
Object
Computer
code
Mathematical
modeling
Numerical
algorithm
2
The mathematical model is investigated using theoretical methods, enabling one to obtain
important preliminary knowledge about the object. The second stage is the choice or
development of the algorithm for the realization of a model on the computer. The model is can
call them the electronic equivalents of the investigated objects, already suitable fir direct tests
on the experimental facility the computer.
1.2 Mathematical Model of Traffic Flow
Let us consider a single-line highway.
Let
[ ] ( )
2 1
, x x M
t
= Number of cars in [ ]
2 1
, x x at time t. We assume
[ ] ( )
2 1
, x x M
t
=
( )dx x t
x
x
2
1
,
where ( ) x t, =car density distribution function which is continuously differentiable.
Then by the law of conservation of number of cars (i.e. by the mass conservation law) we have
[ ] ( ) [ ] ( )
+ 2 1 2 1
, , x x M x x M
t t t
(Number of cars entering per unit time at
1
x ) t - (Number of
cars leaving per unit time at
2
x ) ( )
2
t o t +
[ ] ( ) [ ] ( )
+ 2 1 2 1
, , x x M x x M
t t t
( ) ( ) [ ] ( )
2
2 1
, , t o t x t q x t q +
2
1
x
x
( ) ( )
dx
t
x t x t t
+ , ,
= ( ) ( ) [ ] ( ) t o x t q x t q +
2 1
, ,
where flux ( ) x t q , :=Number of cars which pass the point x per unit time at time t.
2
1
x
x
( ) ( )
dx
t
x t x t t
+ , ,
=
( ) t o dx
x
q
x
x
+
2
1
For 0 t we have
0
2
1
,
_
dx
x
q
t
x
x
As
1
x
2
x then
0
x
q
t
(1.2) (
3
Equation (1.2) is a first order partial differential equation called the equation of continuity with
two unknowns ( ) x t, and ( ) x t q , in one equation and is not solvable. Therefore, one needs to
model the flux ( ) x t q , as a function ( ) x t, in order to obtain the equation (1.2) in a closed
form. We may have the following two cases.
1. Linear Model (Case 1):
We assume all cars have some constant velocity
v
>0. Then from the relationship among
velocity, flux and density, the flux
v q
yields the equation of continuity (1.2) in the form
0
x
v
x
(1.3)
a linear first order partial differential equation(PDE) called linear advection equation, which in
closed form i.e. solvable.
2. Non-linear Model (Case 2):
In this case we consider velocity
) ( v v
(1.4)
as a function of density then we have the equation (1.2) as the form
( ) ( )
0
x
v
t
(1.5)
Which is a first order PDE and non linear in
This yield
0
0
,
_
+ +
x d
dv
v
t
x d
dv
x
v
t
(1.6)
Which is linear in derivatives but non-linear in
=
d L +
1
. In this case,
.
8
The first steady-state speed-density relation is introduced by Greenshields, who proposed a
linear relationship between speed and density that is
( )
,
_
max
max
1
v v
Various relationships were developed following the Greenshields direction. We use the basic
linear speed-density relation (linear function) which is of the form
( )
,
_
max
max
1
v v
(1.8)
Where
max
v
= maximum speed (free flow speed)
max
,
_
max
2
max
v q
(1.9)
Now if we put the velocity-density function
( )
,
_
max
max
1
v v
of equation (1.8) into the
general non-linear model PDE (1.5), then the explicit non-linear PDE is obtained as in the form
0 1 .
max
max
,
_
,
_
v
x t
(1.10)
1.6 Specific Flow-Density Relationship
The speed-density relation of freeways interpreted as being linear by Greenschilds (1935)
exerts dominant influences on the relation between the flow
q
(vehicles/sec.) and the density
(vehicles/km.). Lighthill and Whitham conjectured a flow density relation from the
9
information that at low density values speed
q
v
was regarded as a function of the flow and
at high density values the headway
N
( N is the number of vehicle at certain location) was
regarded as a function of speed
q
v
.
The homogeneous velocity is considered that means it does not depend on the highway
location
x
or at time
t
explicitly. It follows that ( ) v v and the equation (1.7) gives the rate
of flow (flux) is a function of density that is
( ) ( ) v q (1.11)
It is obvious that the maximum speed,
max
v
is achieved at the smallest density 0
min
then
the equation (1.11) gives the results
( ) 0 0 q
( ) 0
max
v
( ) ( ) 0
max max max
v q
(1.12)
The rate of traffic flow must be positive for all values of density,
max
0 < <
must achieve its
maximum value
max
q
somewhere in the interval.
Further the slop of the traffic flow is
( )
d
dv
v
d
dq
+
(1.13)
The flow-density relation of Lighthill and Whitham is shaped into parabolic curve, called
fundamental diagram of traffic flow, whose maximum value of the flow shows the expected
value of the capacity of a motorway section.
10
Figure 1.4: Fundamental diagram of traffic flow
Since our velocity-density relationship (1.8) is linear. So the flow-density relation (1.9) is
parabolic and concave. The highest flow occurs when its slop vanishes, i.e.
0
2
1
max
max
,
_
v
d
dq
(1.14)
It gives that the maximum traffic flow is achieved at a point of the fundamental diagram for
2
max
11
Chapter 2
Analytical Solution for the Traffic Flow Model
In this chapter, we present the analytic solution of the traffic flow model with linear and non-
linear PDEs by the method of characteristics. We also discuss about the existence and
uniqueness of the analytic solution of the traffic flow model based on [7] and [10].
2.1 Method of Characteristics
The method of characteristics is a method that can be used to solve the initial value problem for
general first order partial differential equation (PDE). We consider the first order linear PDE
( ) ( ) ( ) 0 , , , +
u x t C
t
u
t x B
x
u
t x A (2.1)
in two variables along with the initial condition
( ) ( ) x u x u
0
0 ,
.
The goal of the method of characteristics, when applied to the equation (2.1) is to change co-
ordinates from ( ) t x, to a new co-ordinate system
( ) s x ,
0
in which the PDE becomes an
ordinary differential equation (ODE) along certain curves in the
t x
plane. Such curves,
( ) ( ) [ ] { } < < s s t s x 0 : , along which the solution of the PDE reduces to an ODE, are called
characteristic curves or just the characteristics. The new variable
s
will vary and the new
variable
0
x
will be constant along the characteristics. The variable
0
x
will change along the
initial curve in the
t x
plane. Notice that if we choose
( ) t x A
ds
dx
, (2.2)
and ( ) t x B
ds
dt
, (2.3)
12
Then we have
( ) ( )
t
u
t x B
x
u
t x A
ds
dt
t
u
ds
dx
x
u
ds
du
, ,
and along the characteristics, the PDE becomes an ODE
0 ) , ( + u t x C
ds
du
(2.4)
The equation (2.2) and (2.3) will be referred to as the characteristic equations.
2.1.1 General Strategy
The general strategy for applying the method of characteristics to a PDE of the form (2.1) is
presented bellow
Step-1: At first we solve the two characteristic equations (2.2) and (2.3). We find the constant
of integration by setting
( )
0
0 x x
. Now we have the transformation from ( ) t x, to
( ) s x ,
0
and
x x ( ) s x ,
0
, t t ( ) s x ,
0
.
Step-2: We solve the ODE (2.4) with initial condition
( ) ( )
0
0 x u u
where
0
x
are the initial
points on the characteristic curves along the 0 t axis in the
t x
plane.
Step-3: Now we have a solution
( ) s x u ,
0
. We solve for
0
x
and
s
in terms of
x
and
t
by using
step-1 and put these values in
( ) s x u ,
0
to get the solution to the original PDE (2.1) as ( ) t x u , .
13
2.2 Analytical Solution of the linear PDE (linear
Advection Equation)
We consider the linear PDE (linear advection equation), which is written as,
0
x
v
t
The Cauchy problem is defined by this equation on the domain
0 , < < t x
with the
initial condition
( ) ( ) x x
0
0 ,
.
Here we assume that the velocity
v
is constant. For simplicity we assume that the velocity
v
is
positive i.e.
v
>0.
If
0
x
v
t
Confirming that
x
x v
t
Where ( ) x v is a smooth function.
Then we have
14
( ) ( )
( ) ( ) ( ) ( ) x v t x t x
x
x v
t
x v
x
x v
t
,
_
, ,
It follows that the evolution of ( ) t x, along any curve ( ) t x satisfying
( ) ( ) ( ) t x v t x
( )
0
0 x x
(A)
Satisfies a simple ODE
( ) ( ) ( ) ( ) ( ) ( ) t x v t t x t t x
dt
d
, ,
The curves determined by (A) are called characteristics. In this case the solution is not constant
along these curves, but can be easily determined by solving two sets of ODE.
It can be shown that if
( ) x
0
,
_
,
_
v
x t
(2.5)
( ) ( ) x x t
0 0
,
The IVP (2.5) can be solved by the method of characteristics as follows:
The PDE in the IVP (2.5) may be written as
15
( )
0
x
q
t
Where
( )
,
_
max
max
1 .
v q
0
2
1
0
max
max
,
_
x
v
t
x d
dq
t
Now 0
dt
dx
x t dt
d
By integrating
0 d
( ) t cons x t tan , (2.6)
Where
,
_
max
max
2
1
v
dt
dx
(2.7)
Equation (2.6) and (2.7) give
( )
0
max
max
2
1 x t v t x +
,
_
(2.8)
16
Which are the characteristics of the IVP (2.5)
Figure 2.1: The Characteristics for Traffic Flow Model
Now from equation (2.6) we have
0
dt
d
( ) c t x , (2.9)
Since the characteristics through ( ) t x, also passes through
( ) 0 ,
0
x
and ( ) c t x , is constant on
this curve, so we use the initial condition to write
( ) ( ) ( )
0 0 0
0 , , x x t x c
(2.10)
Equation (2.9) and (2.10) yield
( ) ( )
0 0
, x t x
(2.11)
Using equation (2.8),(2.11) takes the form
0
x
17
t
( )
,
_
,
_
t v x t x
max
max 0
2
1 ,
(2.12)
This is the analytic solution of the IVP (2.5)
This solution is in implicit form because
,
_
x
v
t
(2.13)
( ) ( ) x x t
0 0
,
In that case,
,
_
max
max
2
1
v
is analytic. So the Cauchy-Kovaleveskaya theorem can be applied
for the IVP (2.13) (Cauchy problem).
The Cauchy-Kovaleveskaya theorem guarantees that the Cauchy problem (2.13) has a unique
analytic solution.
18
Chapter 3
Numerical Schemes for the Traffic Model
In this chapter, we consider the model with two sided boundary conditions and a suitable
numerical scheme for this is the Lax-Friedrichs scheme [1], [5].
3.1 Linear Finite Difference Scheme
3.1.1 Basics of Discretization
We present finite difference approximations to obtain solutions of general non-linear scalar
conservation laws
( )
0
x
f
t
for
t x < 0 ,
(3.1)
At first we suppose that the characteristics speed satisfy ( ) 0 > f for all states that occur
in the solution of (3.1). Thus we also provide initial data
( ) ( ) x x
0
0 ,
(3.2)
and data at left hand boundary
( ) ( ) t t a
a
,
(3.3)
The equations (3.1), (3.2) and (3.3) lead to an initial boundary value problem (IBVP) and the
IBVP is well-posed if ( ) 0 > f .
In order to approximate solution to (3.1), we will discretize spatial domain ( ) b a,
b x x x x a
l l
< < < <
2
1
2
3
2
1
2
1
...
And the temporal domain (
T , 0
)
19
T t t t t
N N
< < < <
1 1 0
... 0
We will define the computational grid cells to be the intervals
,
_
+
2
1
2
1
,
i i
x x
With the spatial grid size,
2
1
2
1
+
i i
i
x x x
.
We also define the temporal grid size, n n
n
t t t
+
+
1
2
1
.
We will integrate the differential equation (3.1) over the space-time rectangle
,
_
+
2
1
2
1
,
i i
x x
( )
1
,
+
n n
t t for an illustration of spatial and temporal discretization figure-3.1
We get,
( ) ( ) dt t x f dt t x f dx t x dx t x
n
n
n
n
i
i
i
i
t
t
i
t
t
i
x
x
n
x
x
n
+ + +
,
_
,
_
,
_
,
_
+
+
+
1 1
2
1
2
1
2
1
2
1
, , , ,
2
1
2
1
1
No approximations involve with this equation.
2
1
i
x
2
1
+ i
x
2
1
x
a
T
N
t
1 + n
t
n
t
0
20
2
1
l
x
Figure 3.1: Spatial and Temporal Discretization
We will discretize the conservation law by approximating the conserved densities
( )dx t x
x
i
i
x
x
n
i
i
+
2
1
2
1
,
1
and
the flux function
dt t x f
t
f
n
n
t
t
i n
n
i
+
,
_
,
_
+ +
+
+
1
,
1
2
1
2
1
2
1
2
1
We will require our discretization to satisfy the conservative difference
] [
2
1
2
1
2
1
2
1
2
1
1
+
+
+
+
+
n
i
n
i
i
n
n
i
n
i
f f
x
t
initially, we define
2
1
2
1
) (
1
0
0
i
i
x
x i
i
dx x
x
Further, at the left-hand boundary
a x
2
1
we define
f
2
1
2
1
+
n
=
2
1
1
+
n
t
+1
)) ( (
n
n
t
t
a
dt t f
21
3.1.2 A Finite Difference Scheme for the IBVP
We consider our specific non-linear traffic model problem as an initial and two point boundary
value problems
(IBVP)
'
T t t t
T t t t
b x a x x t
b x a T t t
x
f
t
0 b
0 a
0 0
0
); ( b) (t,
); ( a) (t, B.C. and
); ( ) , ( I.C. with
, , 0
) (
(3.4)
Where
( )
,
_
max
max
1 .
v f
(3.5)
As we consider that the cars are running only in the positive x-direction, so the speed must be
positive,
i.e.
0 )
2
1 ( ) (
max
max
v f
(3.6)
in the range of
.
To develop this scheme, we discretize the space and time. We discretize the time derivative
t
,
is obtained by first order forward difference in time and the
discretization of
( )
x
t x
,
is obtained by first order central difference in space.
22
Forward Difference in Time
From Taylors series we write
( ) ( )
( ) ( )
. . .
,
! 2
,
, ,
2
2 2
+
+ +
t
t x k
t
t x
k t x k t x
( ) ( ) ( )
( ) k o
k
t x k t x
t
t x
, , ,
( ) ( ) ( )
k
t x k t x
t
t x , , , +
t t
x t
n
i
n
i i n
+
1
) , (
(3.7)
Central Difference in Space
From Taylors series we write
( ) ( )
( ) ( )
+
+ +
2
2 2
,
! 2
,
, ,
x
t x f h
x
t x f
h t x f t h x f
( ) ( )
( ) ( )
2
2 2
,
! 2
,
, ,
x
t x f h
x
t x f
h t x f t h x f
( ) ( ) ( )
h
t h x f t h x f
x
t x f
2
, , , +
x
f f
x
x t f
n
i
n
i i n
+
2
) , (
1 1
(3.8)
We assume the uniform grid spacing with step size k and h for time and space respectively
k t t
n n
+
+1
and
h x x
i i
+
+1
.
23
We also write
n
i
for ( ) t x, .
Putting (3.7) and (3.8) in (3.4), the discrete version of the non-linear PDE formulates the first
order finite difference scheme of the form
0
2
1 1
1
+
+
x
f f
t
n
i
n
i
n
i
n
i
[ ] ) ( ) (
2
1 1
1 n
i
n
i
n
i
n
i
f f
x
t
+
+
,
1 , , 0 ; , , 1 N n M i
(3.9)
This difference equation is known as Lax-Friedrichs scheme.
Where
,
_
max
2
max
) (
) (
n
i n
i
n
i
v f
(3.10)
In the finite difference scheme, the initial data
0
i
for all
M i , , 1
; is the discrete versions of
the given initial value
) (
0
x
and the boundary data
n
a
and
n
b
for all
1 , , 0 N n
are the
discrete versions of the given boundary values
) (x
a
and
) (x
b
respectively.
Unfortunately, despite the quite natural derivation of the method (3.9), it suffers from severe
stability problems and is useless in practice. i.e. the scheme (3.9) is unstable. But if we replaces
n
i
by ) (
2
1
1 1
n
i
n
i +
+ then the unstable method (3.9) is stable provided
x
t
is sufficiently
small, as we will observe in the Proposition1.
Hence (3.9) takes the form
[ ] ) ( ) (
2
) (
2
1
1 1 1 1
1 n
i
n
i
n
i
n
i
n
i
f f
x
t
+ +
+
+ ; (3.11)
1 , , 0 ; , , 1 N n M i
This difference equation is known as Lax-Friedrichs scheme
24
Proposition (Stability condition)
The stability and the physical constraints conditions of the explicit finite difference scheme
(3.11) is guaranteed by the simultaneous conditions
1
max
x
t v
and
2 ), ( max
0 max
k x k
i
i
.
3.1.3 Stencil of the Lax-Friedrichs Scheme
Figure 3.2: Stencil of the Lax-Friedrichs Scheme
25
3.1.4 Comparison of Analytical and Numerical
Solution
Figure 3.3 shows the comparison of the analytical and numerical solution in the bound (t,x)-
plane and t=[0,6] min, x=[0,10] km.
Analytical Solution Numerical Solution
Figure 3.3: Comparison of Analytical Solution and Numerical solution
26
3.2 Conclusion
In this report paper we have considered the macroscopic traffic flow model. First we
have shown the fundamental of traffic variables, analytical solution of the traffic flow
model. We consider our specific non-linear traffic model problem as an initial and two
point boundary value problems and use a suitable numerical scheme for this, that is the
Lax-Friedrichs scheme.
27
BIBLIOGRAPHY
[1] Roksanara Hemel, Analytical and Numerical Methods for PDE - lecture note,
Department of Mathematics,Jahangirnagar University,Savar, Dhaka.
[2] L.S. Andallah, Analytical and Numerical Methods for PDE - lecture note,
Department of Mathematics,Jahangirnagar University,Savar, Dhaka.
[3] L.S. Andallah, Shajib Ali, M.O.Gani, M.K. pandit and J.Akhter A finite
Difference Scheme for a Traffic Flow Model based on a linear Velocity-Density
Function Jahangirnagar University Journal of Science, volume 32,Number 1,June
2009.
[4] LeVeque, R.J.(1992) Numerical Methods for Conservation Laws,
nd
2
Edition,Springer.
[5] Klar, A.R.D.Kuhne and R.Wegener (1996) Mathematical Models for Vehicular
Traffic, Technical University of Kaiserlautern, Germany.
[6] Haberman,R.(1977) Mathematical models, Prentice-Hall,Inc.
[7] Kuhne,R. and P.Michalopoulous (1997) Continuum Flow Model.
[8] Bretti, G.R. Natalini and B.Piccoli,(2007) A Fluid Dynamic Traffic Model on Road
Networks,Comp. Methods Eng.,CIMNE, Barcelona, Spain.
[9] Wikipedia, the free Encyclopedia Traffic flow from retrieves online.
28