Inflow Outflow Effect and Shock Wave Analysis in a Traffic Flow Simulation

This paper investigates the effect of inflow, outflow and shock waves in a single lane highway traffic flow problem. A constant source term has been introduced to demonstrate the inflow and outflow. The classical Lighthill Whitham and Richards (LWR) model combined with the Greenshields model is used to obtain analytical and numerical solutions. The model is treated as an IBVP and numerical solutions are presented using Lax Friedrichs scheme. Godunov method is also used to present shock wave analysis. The numerical procedures adopted in this investigation yield results which are very much consistent with real life scenario in terms of traffic density and velocity.


Introduction
The problem of traffic congestion is becoming endemic due to increased levels of population.Traffic conditions in many major metropolitan areas are becoming increasingly congested, affecting the operational efficiency of whole networks as well as the travel cost of each trip.Therefore, traffic flow models are becoming more important in traffic engineering and the transportation policy making process.In an effort to minimize congestion, an accurate method for modeling the flow of traffic is imperative.Mainly two approaches are widely used in describing traffic flow phenomena mathematically.The first one is the microscopic model which describes flow by tracking individual vehicles using car-following logic.On the other hand, macroscopic models are concerned with describing the flow-density relationship for a traffic stream (a group of vehicles).Macroscopic models are more suitable for modeling traffic flow since less supporting data and computation are needed.In this paper, we have studied macroscopic traffic flow models.
Computer simulation of traffic is a widely used method in research of traffic modeling, planning and development of traffic networks and systems.Many research groups are involved in dealing with the problem with different kinds of traffic models for several decades [1]- [3].In most cases, the source terms that have been appeared in traffic flow equations [4] [5] represent inflow and outflow in a single-lane highway.In this paper, some necessary modifications have been made in existing macroscopic models to represent the effect of constant rate inflow and outflow.This analysis also focuses on the existence and propagations of stationary shock waves.The approximation of scalar conservation laws is carried out by using conservative methods, such as the Lax-Friedrichs scheme and classical Godunov scheme with the use of suitable initial and boundary conditions.

Mathematical Modeling and Procedures
If a vehicle in a single lane highway can be assumed to be a molecule, then the traffic can be defined to be an incompressible fluid which cannot be compressed after a certain density.In 1955 and 1956, Lighthill, Whitham and Richards proposed a macroscopic traffic flow model which is known as the LWR model [6].According to this model, the traffic flow is represented using a first order partial differential equation.Based on a hyperbolic system of conversation laws, this equation is defined as following: where ( ) is the density of cars and ( ) , q q t x = denote the traffic flow rate (flux) all of which are functions of space, x ∈  and time, t + ∈  .Flux ( ) , q t x can be written as the product of the density and of the mean velocity  of the cars, i.e.

( )
Inserting this relationship in (1), we obtain A linear relationship between velocity and density proposed by Greenshields [7] is given by the following equation: where max v is the maximum velocity and max ρ is the maximum density of the road.This specific relationship between traffic velocity, flux and density is presented in Figure 1.According to [8], inserting the linear velocitydensity closure relationship (3) into (2), we obtain the specific first order non-linear partial differential equation of the form:

Role of Source Term in Traffic Flow Models
A source term in the Equation ( 4) for the vehicular density may represent entries or exits.We are concerned with the role of source terms in traffic flow models based on hyperbolic systems of conservation laws in order to account for entries and exits or local changes of the traffic in the considered road [4] [9].After introducing a source term ( ) , , s t x ρ , Equation (4) becomes ( ) If we consider the source  to be a constant, the Equation (5) becomes We will examine the effects of inflow and outflow using Equation (6).

Shock Waves in Traffic Streams
The flow of traffic along a stream can be considered similar to a fluid flow.Consider a stream of traffic flowing with steady state conditions, i.e., all the vehicles in the stream are moving with a constant velocity, density and flow.Suddenly due to some obstructions in the stream (like an accident or traffic block) the steady state characteristics changes and they acquire another state of flow.In the context of traffic flow theory, the boundary which distinguishes one flow state from another is called a shock wave.Now to analyze shocks in a single lane highway, we consider the traffic flow Equation (1).We propose that ( ) , , q x t q x t ρ = from the realization that the typical car velocity depends on the level of congestion, i.e. the car density.Under this assumption Equation (1) becomes ( ) Since the mean velocity v should clearly be a decreasing function of ρ , reaching zero at the fully con- gested level max ρ , then the flux ( ) q ρ , computed from the relation ( ) , must be concave, with zeros at both 0 ρ = and max ρ ρ = , and achieving its maximum value in between, say at * .

ρ ρ =
In order to constitute one such function, we choose the following simple relation ( )

Analytical Solution and Characteristics
The non-linear PDE ( 6) can be solved if we know the traffic density at a given initial time, i.e. if we know the traffic density at a given initial time 0 t we can predict the traffic density for all future time 0 , t t ≥ in principle.Then we have to solve an initial value problem (IVP) of the form: We solve the IVP (9) using method of characteristics and the analytical solution is given by ( ) Again for a first-order PDE, the method of characteristics discovers curves along which the PDE becomes an ordinary differential equation (ODE).We use the crossings of the characteristics to find shock waves.Intuitively, we can think of each characteristic line implying a solution to ρ along itself.Thus, when two characteristics cross two solutions are implied.This causes shock waves and the solution to ρ becomes a multi-valued func- tion.In this case the analytical solution to (7) subject to initial data ( ) ( )

Numerical Solution Methods
In this section, we present the discretization of the traffic flow model by finite difference formula.According to [10], we formulate Lax-Friedrichs scheme for the numerical solution of the traffic flow model with inflow and outflow at particular positions in a single lane highway based on linear velocity-density function.We also present here the well-posedness and stability condition of the investigating scheme.Secondly, we discuss the first order Godunov method based on [11] [12], applied to single conservation laws to analyze the propagation of shock waves.

Numerical Solution using Lax-Friedrichs Method
The Lax-Friedrichs method is a numerical method for the solution of hyperbolic partial differential equations based on finite differences.The method can be described as the FTCS (forward in time, centered in space) scheme.For Lax-Friedrichs scheme, we consider our specific non-linear traffic model problem as an IBVP characterized with two sided boundary conditions using [13]: ; In order to develop the scheme, we discretize the space and time.We discretize the time derivative t ρ ∂ ∂ and space derivative q x ∂ ∂ in the IBVP (12) at any discrete point ( , The discretization of t ρ ∂ ∂ is obtained by first order forward difference in time and the discretization of obtained by first order central difference in space.The discrete version of the PDE ( 12) is given by: ( ) ( ) But unfortunately, despite the quite natural derivation of the method (13) it suffers from severe stability problems and is useless in practice, i.e. the scheme becomes unstable.But if we replace n i ρ by ( ) the unstable method becomes stable provided that t x ∆ ∆ is sufficiently small.Hence (13) takes the form of ( ) ( ) ( ) where, ( ) ( ) This difference Equation ( 14) is known as Lax-Friedrichs scheme.
It is verified that the well-posedness and stability of the Lax-Friedrichs scheme is guaranteed by the simultaneous conditions ( )

Numerical Solution Using Godunov's Method
The main challenge in simulating the traffic flow Equation (7) numerically is that the solutions are typically not smooth, due to the presence of shockwaves.Hence general finite difference methods are not well suited in this task.For this reason, Godunov method [12] [14] is applied in single conservation laws in order to find out the numerical solution.We consider a discrete spatial grid with mesh size x ∆ and a discretized dependent variable j ρ whose average over a grid cell is given by ( ) ρ is updated by an equation of the form ( ) where 1 2 j q + is an approximation to the flux ( ) averaged over the time interval ( ) , t t t + ∆ .Hence the only task left to compute the approximate fluxes 1 2 j q + .So we compute exact fluxes corresponding to an approximate profile ( ) , n x t ρ consistent with the local numerical averages n j ρ .We chose the simplest profile which consists of a piecewise constant function, defined by Since information travels along characteristics at a finite speed, non-neighboring cells will not interact with each other, provided that we pick t ∆ small enough that characteristics coming from two adjacent interfaces do not intersect.This completes the description of the (first order) Godunov method, applied to single conservation laws.

Results and Discussion
Based on the numerical methods discussed above, we now present outcomes from various simulations in this section.

Comparison of Numerical Solution for Two Specific Cases
Using the procedure for Lax-Friedrichs scheme presented in Section 4.1, we now demonstrate the effect of constant rate inflow in traffic flow simulation.We present the numerical solution for two specific cases.For this, we use the initial condition ( ) and boundary conditions given by and , 1 1 where x a and x b are the positions of left and right boundary respectively.We take max 0.167 v = (0.1 km/sec) = 60.12 km/hour, satisfying the physical constraint condition

Density, Velocity and Flux Profiles Using Lax-Friedrichs Scheme
In this section we present numerical experiments using Lax-Friedrichs scheme for some specific cases of flow parameters like max ρ , max v etc.We consider the initial condition given by the equation: .So that vehicles can move with low velocity at that position.Therefore the inflow source term has no significant effect in both of these cases.Under light traffic condition, vehicles are able to travel freely at their desired speed.We have also introduced an outflow sink term at the 8 th km position where some vehicles are able to leave from our 10 km single lane highway.Consequently, the density of vehicles slowly decreases at outflow position.As a result, at outflow position, drivers are able to attain their own comfortable driving speed.
Figure 5(a) and Figure 5(b) respectively shows the density profiles and velocity profiles for three different times.In Figure 5(a), we see that the density of traffic at inflow position slowly acquires reduced wave height as time goes on.But in case of outflow placed at 8 th km position, as time goes on, the density of cars increase.This particular situation occurs because the rate of flow in the single lane highway is continuously increasing but the number of cars that leave through the sink is constant.
In    According to the flux profile, it is clear that flux of traffic increases at 5 th km position due to the constant rate inflow and at 8 th km position for constant rate outflow through a sink situated at position.
We now compare two special cases to visualize the effect of inflow and outflow in a single lane highway.In each case we perform numerical simulation for 6 minutes using Lax-Friedrichs scheme.

Shock Wave Analysis Using Godunov Method
From the construction of characteristics summarized in the implicit solution (11), it follows that the information    ( ) ( ) Note that at approximately 2 t = , the solution deforms by developing a vertical slope at 3.7 x ≈ . This corresponds to the first crossing of characteristics [14].Smooth solutions of a single conservation law can blow up (develop discontinuities or singularities) in finite time.
Therefore, the blow up time is 2 t = which describes a road condition where cars are approaching red traffic light.After the blow-up time the implicit solution given by ( 11) is multivalued.The profile corresponding to the initial data above, evaluated at 4 t = , is presented in Figure 8.At the point where the solution switches from a characteristic branch to another, the solution ρ will be discontinuous.An example of this construction is shown in Figure 9 with a dotted line; the locus of discontinuity is called a shock wave [12] [14].

Conclusion
In this paper, a modification of classical LWR model has been presented to investigate the significant effects of constant rate inflow and outflow in a single lane highway.Although the model has been developed for a single lane highway, due to the presence of off ramps and on ramps, this model can be extended for multilane highway easily.This investigation also shows that Godunov method outperforms finite difference methods in presence of stationary shock waves.Various numerical simulations carried out through this investigation will obviously make important contributions to the existing models so that we can minimize traffic congestion problems in an efficient way.

Figure 1 .
Figure 1.The fundamental v ρ − diagram and q ρ − diagram according to Greenshields.
the spatial domain [0 km, 10 km].We perform the numerical experiment for 6 minutes in 0.1 t ∆ = time steps for a highway of 10 km with step size 100 x ∆ = meters = 0.25 which guarantees the stability condition γ = 0.0668 < 1.In Figure2, the first case represents numerical solution based on Lax-Friedrichs scheme without any inhomogeneities in the considered road.But the second case in Figure2represents numerical solution of the same traffic flow problem which consists of an additional constant rate inflow in the 5 th km position of our 10 km considered highway.

Figure 2 .
Figure 2. Comparison of numerical solutions in order to observe the effect of inflow in 5 th km position.

3 .
maximum density is max 550 ρ = cars/km.The constant two-sided boundary conditions for Lax-Friedrichs scheme are given by ( ) consider constant rate inflow source term 10 s = in the interval [5 km, 5.1 km] and outflow sink (negative source) term 10 w = − in the interval [8 km, 8.1 km].The layout of the considered 10 km highway is presented in Figure At first we demonstrate the density profile figures with comparative initial and 6 minute position of cars with respect to the certain points of 10 km highway.For Figure 4(a) the maximum velocity is max 30 v = km/hour whereas max 60 v = km/hour for Figure 4(b) and max 90 v = km/hour for Figure 4(c).At each situation, we observe that the density of cars increases at 5 th km position and decreases at 8 th km position of our considered 10 km highway.This particular situation arises due to the effect of constant rate inflow and outflow at 5 th km and 8 th km position respectively.Since the maximum velocity in 4(a) is max 30 v = km/hour which is very low so the density of cars at inflow position exceeds our fixed maximum density max 550 ρ = cars/km i.e. leads us to the situation of congested traffic at inflow position.So in this case, we can consider the inflow as a local disturbance in traffic flow stream.In Figure 4(b) and Figure 4(c), the maximum velocity of cars is comparably high than that of the case discussed in Figure 4(a).In both of the following cases, density of cars considerably increases at inflow position but does not exceed the jam density i.e. density at inflow position fulfills the condition jam ρ ρ <

Figure 5 (
b), the average velocity of cars decreases for high density in the inflow source position placed at 5 th km, and vice-versa for outflow position.

Figure 5 (
c) represents the flux profile for different minutes.The flux of traffic is computed by the following relation ( )

Figure 3 .
Figure 3. Layout of a 10 km highway with an inflow source term at 5 th km and outflow sink term at 8 th km position.

Figure 4 .
Figure 4. Comparative position of cars between initial and six minutes in case of Lax-Friedrichs Scheme (a) when max 30 v = km/hour; (b) max 60 v = km/hour and (c) when max 90 v = km/hour.

Figure 6 (
a) represents the density of cars for 6 minutes in a 10 km highway without any entries or exits.

Figure 6 (
b) represents the effect of both inflow and outflow in the main stream density of cars.

Figure 7 (
a) and Figure 7(b) represents the corresponding velocity profiles.

Figure 5 .
Figure 5. (a) Density profile and (b) Velocity profile and (c) Flux profile in 10 km highway with inflow at 5 th km position and outflow at 8 th km position.

Figure 6 .
Figure 6.(a) Density profile simulation for 6 minute without any inflow or outflow; (b) Density profile simulation for 6 minutes with an inflow at 5 th km position and outflow at 8 th km position.yielding a solution ( ) , t x ρ

Figure 7 .
Figure 7. (a) Corresponding velocity profile without any inflow or outflow; (b) Velocity profile with an inflow at 5 th km position and outflow at 8 th km position.

Figure 8 .
Figure 8. Numerical solutions using Godunov method in different time steps.