American Journal of Computational Mathematics
Vol.06 No.02(2016), Article ID:65971,11 pages
10.4236/ajcm.2016.62007
Inflow Outflow Effect and Shock Wave Analysis in a Traffic Flow Simulation
Ahsan Ali1, Laek Sazzad Andallah2
1Department of Electronics and Communications Engineering, East West University, Dhaka, Bangladesh
2Department of Mathematics, Jahangirnagar University, Dhaka, Bangladesh

Copyright © 2016 by authors and Scientific Research Publishing Inc.
This work is licensed under the Creative Commons Attribution International License (CC BY).
http://creativecommons.org/licenses/by/4.0/


Received 21 February 2016; accepted 24 April 2016; published 27 April 2016
ABSTRACT
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.
Keywords:
Macroscopic Model, Source Term, Shock Wave, Lax Friedrichs Scheme, Godunov Method

1. 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.
2. 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:
(1)
where
is the density of cars and
denote the traffic flow rate (flux) all of which are functions of space,
and time,
. Flux
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
(2)
A linear relationship between velocity and density proposed by Greenshields [7] is given by the following equation:
(3)
where
is the maximum velocity and
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 velocity- density closure relationship (3) into (2), we obtain the specific first order non-linear partial differential equation of the form:
(4)
Figure 1. The fundamental
diagram and
diagram according to Greenshields.
2.1. 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

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).
2.2. 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 

Since the mean velocity 








3. 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 


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 



4. 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.
4.1. 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 






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 prob-
lems and is useless in practice, i.e. the scheme becomes unstable. But if we replace 



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
4.2. 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 

Every time step


where 






Since information travels along characteristics at a finite speed, non?neighboring cells will not interact with each other, provided that we pick 
5. Results and Discussion
Based on the numerical methods discussed above, we now present outcomes from various simulations in this section.
5.1. 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 
where xa and xb are the positions of left and right boundary respectively. We take 



In Figure 2, the first case represents numerical solution based on Lax-Friedrichs scheme without any inhomogeneities in the considered road. But the second case in Figure 2 represents numerical solution of the same traffic flow problem which consists of an additional constant rate inflow in the 5th km position of our 10 km considered highway.
Figure 2. Comparison of numerical solutions in order to observe the effect of inflow in 5th km position.
5.2. 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

Here, the maximum density is 




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 





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
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 8th 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 Figure 5(b), the average velocity of cars decreases for high density in the inflow source position placed at 5th 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. Layout of a 10 km highway with an inflow source term at 5th km and outflow sink term at 8th km position.


Figure 4. Comparative position of cars between initial and six minutes in case of Lax-Friedrichs Scheme (a) when 


According to the flux profile, it is clear that flux of traffic increases at 5th km position due to the constant rate inflow and decreases at 8th km position for constant rate outflow through a sink situated at that 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. 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.
5.3. Shock Wave Analysis Using Godunov Method
From the construction of characteristics summarized in the implicit solution (11), it follows that the information


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

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 5th km position and outflow at 8th km position.
yielding a solution 






Figure 7. (a) Corresponding velocity profile without any inflow or outflow; (b) Velocity profile with an inflow at 5th km position and outflow at 8th km position.
Figure 8. Numerical solutions using Godunov method in different time steps.

Note that at approximately

Therefore, the blow up time is 


6. 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
Figure 9. A multivalued solution.
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.
Cite this paper
Ahsan Ali,Laek Sazzad Andallah, (2016) Inflow Outflow Effect and Shock Wave Analysis in a Traffic Flow Simulation. American Journal of Computational Mathematics,06,55-65. doi: 10.4236/ajcm.2016.62007
References
- 1. Daganzo, C.F. (1995) A Finite Difference Approximation of the Kinematic Wave Model of Traffic Flow. Transportation Research Part B: Methodological, 29, 261-276.
- 2. Zhang, H.M. (2001) A Finite Difference Approximation of a Non-Equilibrium Traffic Flow Model. Transportation Research Part B: Methodological, 35, 337-365.
- 3. Bretti, G., Natalini, R. and Piccoli, B. (2007) A Fluid-Dynamic Traffic Model on Road Networks. Comput Methods Eng., © CIMNE, Barcelona.
- 4. Ali, A., Andallah, L.S. and Hossain, Z. (2015) Numerical Solution of a Fluid Dynamic Traffic Flow Model Associated with a Constant Rate Inflow. American Journal of Computational and Applied Mathematics, 5, 18-26.
- 5. Bagnerini, P., Colombo, R.M. and Corli, A. (2006) On the Role of Source Terms in Continuum Traffic Flow Models. Mathematical and Computer Modelling, 44, 917-930.
http://dx.doi.org/10.1016/j.mcm.2006.02.019 - 6. Lighthill, M.J. and Whitham, G.B. (1955) On Kinematic Waves. II. A Theory of Traffic Flow on Long Crowded Roads. Proceedings of the Royal Society of London. Series A, 229, 317-345.
http://dx.doi.org/10.1098/rspa.1955.0089 - 7. Greenshields, B.D. (1935) A Study of Traffic Capacity. Highway Research Board, 14, 448-477.
- 8. Andallah, L.S., Ali, S., Gani, M.O., Pandit, M.K. and Akhter, J. (2009) A Finite Difference Scheme for a Traffic Flow Model Based on a Linear Velocity-Density Function. Jahangirnagar University Journal of Science, 33, 61-71.
- 9. Haberman, R. (1977) Mathematical Models: Mechanical Vibrations, Population Dynamics and Traffic Flow. Prentice-Hall, Inc., Englewood Cliffs.
- 10. Le Veque, R.J. (1992) Numerical Methods for Conservation Laws. Birkhauser, Berlin.
- 11. Hoogendoorn, S.P., Luding, S., Bovy, P.H.L., Schreckberg, M. and Wolf, D.E. (2005) Traffic and Granular Flow ’03. Springer.
http://dx.doi.org/10.1007/3-540-28091-x - 12. Trangenstein, J.A. (2007) Numerical Solution of Hyperbolic Conservation Laws. Department of Mathematics, Duke University, Durham, NC 27708-0320.
https://services.math.duke.edu/~jliu/math226/ - 13. Hasan, M., Sultana, S., Andallah, L. and Azam, T. (2015) Lax-Friedrich Scheme for the Numerical Simulation of a Traffic Flow Model Based on a Nonlinear Velocity Density Relation. American Journal of Computational Mathematics, 5, 186-194.
http://dx.doi.org/10.4236/ajcm.2015.52015 - 14. Tabak, E.G. (2004) Notes for PDE I (Traffic Flow) Spring 2004 [PDF Document]. Retrieved from Lecture Notes Online Website.
http://math.nyu.edu/faculty/tabak/PDEs/

















