Sei sulla pagina 1di 11

Chapter 3

Numerical schemes for the traffic model


In this chapter, we present a finite difference scheme of the first order partial differential
equation (PDE) based on [10], [12]. The finite difference scheme was devised and first
tested by L. F. Pichardson and it was later improved by H. Liebmann. In this scheme
the partial differential coefficient is replaced by their finite difference approximations.
On the basis of this study, we present the discretization of the macroscopic traffic
model by finite difference formula which leads to formulate an explicit upwind difference
scheme (E.U.D.S) for the numerical solution of the traffic model as a first order
quasilinear PDE. We also establish the stability condition and well-posed-ness of the
explicit scheme for traffic flow model.

3.1 Linear Finite Difference schemes


3.1.1 Basics of discretization
We present finite difference approximations to obtain solutions of general nonlinear
scalar conservation laws
∂ρ ∂f ( ρ )
+ =0 for x ∈ℜ, t > 0 − − − −(3.1)
∂t ∂x
In the beginning, we suppose that the characteristics speed satisfy λ = f ′( ρ ) > 0 for all
states that occur in the solution of (3.1). Thus we also provide initial data
ρ ( x,0 ) = ρ 0 ( x ) − − − −(3.2)
and data at the left-hand boundary
ρ ( a, t ) = ρ a ( t ) − − − −(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 λ = f ′( ρ ) > 0 .

In order to approximate solution to (3.1), we will discretize spatial domain ( a, b )


a=x 1 < x 1 < ... < x 3 <x 1 =b
− l− l−
2 2 2 2

and the temporal domain ( 0, T )


0 = t 0 < t 1 < . . . < t N −1 < t N = T

Numerical schemes for the traffic flow model


23
 
We will define the computational grid cells to be the intervals x 1 , x 1 with the
 i− i+ 
 2 2 

∆x i ≡ x −x
spatial grid size, i+
1
i−
1
2 2

1
We also define the temporal grid size, ∆t n + 2 ≡ t n +1 − t n

We will integrate the differential equation (3.1) over the space-time rectangle

 
x 1 , x 1
 i− i+  (
× t n , t n +1 ) for an illustration of spatial and temporal discretization figure-
 2 2 

3.1, we get,

x 1 x 1

     
i+ i+
t n +1 n +1
t

∫ ρ ( x, t )dx = ∫ ρ ( x, t )dx + ∫
2 2
n +1 n
f  ρ  x 1 , t  dt − ∫ f  ρ  x 1 , t  dt
 i−   i+ 
x
i−
1 x
i−
1 tn   2  tn   2 
2 2

No approximations involve with this equation.

x 1 x 1 x 1 x 1
− i− i+ l−
2 2 2 2

a b
N
T t

t n +1

tn

Fig 3.1: Spatial and temporal discretization

Numerical schemes for the traffic flow model


24
We will discretize the conservation law by approximating the conserved densities
x 1
i+

∫ ρ ( x, t )dx
1 2

ρ ≈ i
n n

∆x i x 1
i−
2

n+
1
1
t n +1   
and the flux functions f 2
≈ ∫ f  ρ  x 1 , t  dt
i+
1 1  i+ 
2
∆t
n+
2 tn   2 

We will require our discretization to satisfy the conservative difference


1
n+
∆t  n + 12 n+ 
2 1

ρ in +1 = ρ in − f
 i+ 1 − f 2
1  − − − − (3.1)
∆x i  2 i −
2 

x 1
i+
1 2

ρ = ∫ ρ ( x ) dx − − − −(3.2)
0
Initially, we define i 0
∆x i x 1
i−
2

x =a
Further, at the left-hand boundary −
1 we define
2

1 t n +1
n+ 1
f

1
2
=
n+
1 ∫ f ( ρ ( t ) )dt
a
tn
2
∆t 2

3.1.2 Explicit schemes for linear advection equation


To demonstrate the scheme, we consider the linear advection equation as follows:
∂ρ ∂ρ
+c =0 − − − −(3.3)
∂t ∂x
where f ( ρ ) = cρ and c > 0 .
Then equation (3.3) gives the explicit upwind difference scheme for linear advection
equation (3.3) as
1
n+
c∆t
[ρ ]
2
ρ in +1 = ρ in − i
n
− ρ in−1 − − − −(3.4)
∆x i

Numerical schemes for the traffic flow model


25
3.2 Explicit Schemes for nonlinear equation
We consider a nonlinear equation
∂ρ ∂f ( ρ )
+ =0 − − − −(3.5)
∂t ∂x
where is f ( ρ) nonlinear.
Then the equation (3.5) provides the explicit upwind difference scheme is of the form
1
n+

ρ in +1 = ρ in −
∆t 2 n
∆x i
[
f i − f i −n1 ]

3.3 Stability of the scheme


Courant, Friedrichs and Lewy, in their fundamental paper (1928) on difference methods
for partial differential equations, formulated a necessary condition now known as the
CFL condition for the convergence of a difference approximation in terms of the
concept of a domain of dependence. For the model problem (3.3), we have seen the

solution is ρ( x, t ) = ρ 0 ( x − ct ) , where the function ρ0 is determined by the initial

conditions. The solution at the point x i , t


n
( ) is obtained by drawing the characteristic

(
through this point back to where it meets the initial line at Q , x i − ct ,0 - Fig 3.2.
n
)
Now the scheme (3.4) can be written as the averaging process
ρ in +1 = (1 − γ ) ρ in + γ ρin−1 − − − −(3.6)
1
1 n+

where γ
n+ c∆t 2
is the dimensionless courant number.
i
2
:=
∆x i

Q x

Fig 3.2: Typical domain of dependence

Numerical schemes for the traffic flow model


26
The value of ρi depends on the values of ρ at two points on the previous time
n +1

level: each of these depends on two points on the time level t n −1 and so on. As

illustrated in Fig. 3.2, the value of ρin +1 depends on data given in a triangle with

(
vertex x i , t
n +1
)
, and ultimately on data at the points on the initial line

x i −n −1 , x i −n , . . . , x i −1 , x i .

So, ρi
n +1
depends on data given at all points of the triangle. This triangle is called the

domain of dependence of ρi , or of the point x i , t


n +1 n +1
( )
, for this particular numerical

scheme.
The corresponding domain of dependence of the partial differential equation is the

characteristic path drawn back from x i , t


n +1
( )
to the initial line.

The CFL condition then states that for a convergent scheme the domain of dependence
of the partial differential equation must lie within the domain of dependence of the
numerical scheme. It also gives a restriction on the size of the time step, for the
condition that the characteristic must lie within the triangle of dependence requires that

1
n+
c∆t 2 n+
1
≤ 1 , that is γ i 2 ≤ 1 . The expression on the R.H.S of equation (3.6) would
∆x i
become a convex combination.

3.4 Error analysis of the scheme

We recall the scheme (3.6)


ρ in +1 = (1 − γ ) ρ in + γ ρin−1 − − − −(3.7)
1
n+

where γ := V ∆t 2

max
∆x i
This can be interpreted as follows. In fig-3.2, the characteristic through the point

P = ( x i , t n +1 ) meets the previous line t = t n at the point Q , which by the CFL

condition

( )
must lie between the points A = x i , t and B = x i −1 , t
n n
( )

Numerical schemes for the traffic flow model


27
t P

B Q A C

n +1
n

j x
Fig 3.3: Error Analysis of the scheme

Moreover the exact solution ρ( x, t ) is constant along the characteristic, so that


ρ( P ) = ρ( Q ) . Knowing an approximate numerical solution at all the points on the line

t n , we can therefore interpolate the value of ρ( Q ) and use this to give the required

value ρi
n +1
(
. If we use linear interpolation, approximating ρ x, t n ) by a linear function

of x determined by the approximations at the two points A and B , we obtain (3.6)

exactly when V max is constant because AQ = γ∆x and QB = (1 − γ ) ∆x ; when varies


smoothly this still gives a good approximation.
Notice also that all the coefficients in (3.7) are non-negative so that a maximum
principle applies, provided that γ ≤1 at all mesh points. We can therefore obtain an
error bound for the linear, variable coefficient problem. We must first consider more
carefully what domain is given, and what boundary conditions; although the physical
problem may be given on the whole line, for all values of x , a numerical solution must
be confined to a finite region. Suppose, for example, that the region of interest is
0 ≤ x ≤ X , so that we have boundaries at x = 0 and x = X . Since the partial
differential equation is hyperbolic and first order, we will usually have only one
boundary condition. The direction of the characteristics shows that we need a boundary
condition at x = 0 , we therefore have just one boundary condition. The exact solution
of the partial differential equation would when be determined by drawing the

Numerical schemes for the traffic flow model


28
characteristic backward from the point P , until it reaches either the initial line t = 0 , or
a boundary on which a boundary condition is given.

The truncation error of the scheme is defined as usual and expansion about x i , t
n
( )
gives, if ρ is sufficiently smooth,
ρ in +1 − ρ in ρ in − ρ in−1
Ti :=
n
+ Vmax
∆t ∆x
n n
 1    1 
~  ρ t + ∆tρ tt + . . . + Vmax  ρ x − ∆xρ xx + . . .
 2 i   2  i
1
= ( ∆tρ tt − Vmax ∆xρ xx ) + . . . − − − −(3.8)
2
Even if V max is constant, we still find
1
T In = − (1 − γ )Vmax ∆xρ xx + . . .;
2
hence generally the method is first order accurate. Suppose the difference scheme is

applied for i =1, 2, . . . , I , at the points x i = i∆x with I∆x = X , and the boundary

(n
)
value Ρ0 = ρ 0, t is given. Then for the error ei = Ρi − ρ i we have as usual
n n n n

ein +1 = (1 − γ ) ein + γein−1 − ∆tTi n − − − −(3.9)

and e 0 = 0 , from which we deduce that if 0 ≤ γ ≤1 at all points


n

E n +1 := max ein +1 ≤ E n + ∆t max Ti n


i i

If we suppose that the truncation error is bounded, so that


Ti n ≤T − − − −(3.10 )

for all i and n in the domain, the usual induction argument shows that
E n ≤ n∆tT ≤ t F T − − − −(3.11)

if Ρi = ρ ( x i ) .
0 0

This result is sufficient to prove first order convergence of the upwind scheme along a
refinement path which satisfies the CFL condition everywhere, provided that the
solution has bounded second derivatives.

Numerical schemes for the traffic flow model


29
3.5 Numerical scheme for the traffic flow model
Based on the discussion in the previous sections we investigate a finite difference
scheme for our considered traffic flow model.
As mentioned at section 2.1, traffic model yields

∂    ρ 
2
∂ρ   = 0
+ ρ.V max 1 −   − − − −(3.12 )
∂t ∂x    ρ max  
  
where x ∈( a, b ) ; t ∈( 0, T )
The initial and boundary conditions are given by
ρ ( x,0 ) = ρ 0 ( x ) and ρ ( a, t ) = ρ a ( t ) − − − −(3.13)
The equations (3.12) and (3.13) produce an initial boundary value problem (IBVP)

which is well-posed for left hand boundary if velocity, V max > 0 and for the right hand

boundary if velocity, V max < 0.


Equation (3.12) may be written as
∂ρ ∂q( ρ )
+ =0 − − − −(3.14)
∂t ∂x
   ρ 
2

 
where q( ρ ) =  ρ .V max 1 −  
  ρ max  
  
Firstly, we would like to derive an appropriate numerical scheme for the equation
(3.14).
1
n+
In the case of linear part of the equation (3.12), f 1
2
= V max ρ .
i+
2

In order to develop the scheme, we discretize the space and time. The discretization of

∂ρ( x, t )
is obtained by first order forward difference in time and the discretization of
∂t

∂ρ( x, t )
is obtained by first order backward difference in space.
∂x
∂ρ ∂ρ
The possible finite difference approximations for and :
∂t ∂x
Forward difference in time:
From Taylor’s series we write
∂ρ ( x, t ) h 2 ∂ 2 ρ ( x, t )
ρ ( x , t + h ) = ρ ( x, t ) + h + + ...
∂t 2! ∂t 2

Numerical schemes for the traffic flow model


30
∂ρ ( x, t ) ρ ( x, t + h ) − ρ ( x, t )
⇒ = − o( h )
∂t h
∂ρ ( x, t ) ρ ( x, t + h ) − ρ ( x, t )
∴ ≈ − − − −(3.15)
∂t h
Similarly, backward difference in space
∂ρ ( x, t ) ρ ( x, t ) − ρ ( x − k , t )
≈ − − − −(3.16 )
∂x k
We assume the uniform grid spacing with step size h and k for time and space

respectively t n +1 = t n + h and xi +1 = xi + k .

We also write ρi for ρ( x, t ) in equation (3.15) and (3.16).


n

Now equation (3.14) takes the form

ρ in +1 − ρ in q in − q in−1
+ =0
n+
1
∆ xi
∆t 2

1
n+

⇒ ρ in +1 = ρ in −
∆t 2 n
∆x i
[
q i − q in−1 ] − − − −(3.17)

  ρn 
2

= ρ   i  
max 1 − 
n n
where q V 
i
 i
ρ 
  max  
This is the explicit upwind difference scheme for the equation (3.12).
Therefore, equation (3.17) leads the desired numerical scheme for the traffic model.

3.6 Stencil of the scheme


Stencil visualizes the flow of the scheme. The stencil for the E.U.D.S (3.4) is presented
below:

ρin +1

ρin−1 ρin

Fig 3.4: Stencil of the scheme

Numerical schemes for the traffic flow model


31
3.7 Stability and well-posed-ness of the numerical
scheme
We recall the traffic flow model as
∂ρ ∂f ( ρ )
+ =0
∂t ∂x
 ρ2 
where f ( ρ ) = ρV ( ρ ) = ρVmax 1 − 

 ρ max
2

As mentioned at 3.3, we conclude that the stability condition of the scheme for traffic

1
n+

flow model is γ = V max ∆t


2
≤1.
∆x i

 ρ2 
Now we have, f ( ρ ) = ρV ( ρ ) = ρVmax 1 − 2
 

 ρ max 
 ρ3 

= V max  ρ − 2 
ρ max 
 
 3ρ 2 
∴ f ′( ρ ) = V max 1 − 2
 

 ρ max 
We know that the explicit upwind difference scheme is well-posed iff f ′( ρ ) > 0.

 3ρ 2 
V 
It is evident that max  1 − >0
ρ max
2 
 
Here, V max is essentially positive.

 3ρ 2 
So, 1 − >0

 ρ max
2

3ρ 2
⇒ <1
ρ max
2

⇒ 3ρ 2 < ρ max
2

1
⇒ρ < ρ max
3
⇒ ρmax > 3 ρ

This is the condition of well-posed ness.

Numerical schemes for the traffic flow model


32
With the condition of well-posed ness, we see that
 3ρ 2 
f ′( ρ ) = Vmax 1 − 2  ≤ V max

 ρ max 
The stability condition of the EUDS for the nonlinear problem is given by
1
n+
λ ∆t 2
γ= ≤ 1, f ′( ρ ) ≤ λ − − − −(3.18)
∆x i
Therefore, the stability condition (3.17) becomes
1
n+
V max ∆t 2
γ= ≤1
∆x i
1
i.e. ∆t n + 2 ≤ V ∆x
max i

with this condition of stability, the condition of well-posed ness can be incorporated by

ρ max = c * max( ρ 0k ) ; c≥ 3
k

Numerical schemes for the traffic flow model


33

Potrebbero piacerti anche