Internat. J. of Sci. and Eng., Vol. 5(x)2013:xx-xx, xxxx 2013, Nahid Sultana et al.

International Journal of Science and Engineering (IJSE)

Home page: http://ejournal.undip.ac.id/index.php/ijse

Simulation of Flow Model with Traffic Controller Boundary

Nahid Sultana1, Masuma Parvin2, Ronobir Sarker3, Laek Sazzad Andallah4

1Bangladesh University, Dhaka, Bangladesh, Email: [email protected] 2 Daffodil International University, Dhaka, Bangladesh, E-mail: [email protected] 3Bangladesh University of Business and Technology, Dhaka, Bangladesh, E-mail: [email protected] 4Jahangirnagar University, Savar, Dhaka, Bangladesh, E-mail: [email protected]

ABSTRACT- This paper considers a fluid dynamic traffic flow model appended with a closure linear velocity-density relationship which provides a first order hyperbolic partial differential equation (PDE) and is treated as an initial boundary value problem (IBVP). We consider the boundary value in such a way that one side of highway treat like there is a traffic controller at that point. We present the analytic solution of the traffic flow model as a Cauchy problem. A numerical simulation of the traffic flow model (IBVP) is performed based on a finite difference scheme for the model with two sided boundary conditions and a suitable numerical scheme for this is the Lax-Friedrichs scheme. Solution figure from our scheme indicates a desired result that amplitude and frequency of cars density and velocity reduces as time grows. Also at traffic controller point, velocity and density values change as desired manner. In further, we also want to introduce anisotropic behavior of cars(to get more realistic picture) which has not been considered here. Keywords - tensity function; tinite difference scheme; macroscopic traffic flow model; nonlinear velocity; tumerical simulation. Submission: March 12, 2013 Corrected : June 20, 2013 Accepted: June 23, 2013 Doi: 10.12777/ijse.x.x.xx-xx

[How to cite this article: Sultana, N., Parvin, M. , Sarker, R., Andallah, L.S. (2013). Simulation of Traffic Flow Model with Traffic Controller Boundary. International Journal of Science and Engineering, 5(1),6-11. Doi: 10.12777/ijse.x.x.xx-xx ]

I. INTRODUCTION and backward, depending on vehicle density in a given At present time we cannot deal our life not a single area. day without vehicles likes bus, car, taxi, rickshaw etc. for In the fluid flow analogy, the traffic stream is treated our communication. So traffic flow and congestion is as a one dimensional compressible flow. This leads to related to our transportation. At this time traffic two basic assumptions :( a) traffic flow is conserved and congestion is one of the vital problems in our country b) there is a one-to-one relationship between speed and like other developing countries of the globe. density or between flow and density. As mentioned by In mathematics traffic flow is the study of interactions (Daganzo1995), the difference between traffic and fluid between vehicles, drivers, and infrastructure (including as follows: A fluid particle responds to the stimulus from highways, signage, and traffic control devices), with the the front and from behind, however a vehicle is an aim of understanding and developing an optimal road anisotropic particle that mostly responds to frontal network with efficient movement of traffic and minimal stimulus. Many research groups are involved in dealing problems. with the problem with different kinds of traffic models Traffic Phenomena are complex and nonlinear, like the Microscopic car following model, the depending on the interactions of a large number of macroscopic fluid dynamic model and The Mesoscopic vehicles. Due to the individual reactions of human (Kinetic) model. All models describe various situations drivers, vehicles do not interact simply following the with different assumptions and simplifications. In this laws of mechanics, but rather show phenomena of cluster paper, we attention on macroscopic formation and shock wave propagation, both forward xx © IJSE – ISSN: 2086-5023, xxxxxxxx 2013, All rights reserved

Internat. J. of Sci. and Eng., Vol. 5(x)2013:xx-xx, xxxx 2013, Nahid Sultana et al. model because it is more efficient and easy to implement interaction of many vehicles by discussing the than other modeling approaches. fundamental traffic variables like density, velocity and The macroscopic traffic model was first developed by flow. In particular, a linear velocity-density relationship Lighthill and Whitham (1955) and Richard (1956). This which yields a quadratic flux-density relation yields a model is also shortly called LWR. According this model, formulation of traffic problem as a first order non-linear vehicles in traffic flow are considered as particles in fluid; partial differential equation. The exact solution of the further the behavior of traffic flow is described by the nonlinear PDE as a Cauchy problem is presented. method of fluid dynamics and formulated by hyperbolic Moreover, in order to incorporate initial and boundary partial differential equation. This model is used to study data, the non-linear first order (PDE) is appended by traffic flow by collective variables such as traffic flow rate initial and boundary value which leads to formulate an (flux) q(x,t) , traffic speed v(x,t) and traffic density initial boundary value problem (IBVP).Certainly, a numerical method is needed for the numerical r(x,t) , all of which are functions of space, xÎ R and implementation of the IBVP in practical situation and it is time t Î R + . The most well-known LWR model is completely unavoidable to use numerical method to formulated by the conservation equation solve real traffic problem. A numerical scheme for the ¶r ¶q(r ) model which is applicable for any velocity density model + = 0 including discontinuous one is presented in (Kuhne et al., ¶t ¶x 1997). But in this scheme two sided boundary condition The problem of computer simulation techniques of is needed and the accuracy of the scheme is not the traffic flow models has become an interesting area in satisfactory. However, there is a requirement of using the field of numerical solution methods for several one sided boundary condition. In (Andallah et al., 2009) decades. For instance, in (Daganzo1995) the author author considers explicit upwind difference scheme for shows that if the kinematics wave model of freeway traffic model where he considers one sided boundary traffic flow in its general form is approximated by a condition. In this paper first, we present the derivation of particular type of finite difference equation, the finite the macroscopic traffic flow model with corresponding difference results converge to the kinematics wave variables relationship among velocity, flux and density. solution despite the existence of shocks in the latter. Then, we present the analytic solution of the traffic flow Errors are shown to be approximately proportional to model with linear and nonlinear partial differential the mesh spacing with a co-efficient of proportionality equation (PDE) by the method of characteristics and the that depends on the wave speed, on its rate of change existence and uniqueness of the analytic solution of the with density and on the slope and curvature of the initial traffic flow model. We develop a finite difference scheme density profile. The asymptotic errors are smaller than for our traffic flow model as an (IBVP) which has been those of Lax’s first order, centered difference method presented before numerical simulation section. We which is also convergent. In the paper (Zhang 2001) the develop computer programming code for the author develops a finite difference scheme for non- implementation of the numerical scheme and perform equilibrium traffic flow model. numerical experiments in order to verify some This scheme is an extension of Godunov’s scheme qualitative traffic flow behavior for various traffic (Randall .J .Leveque, 1992) to system. It utilizes the parameters. Finally, we present the numerical solutions of a series of Riemann problems at cell simulation. boundaries to construct approximate solutions of the non-equilibrium traffic flow model under general initial II. MACROSCOPIC TRAFFIC FLOW MODEL conditions. Moreover, the Riemann solutions at both left (upstream) and right (downstream) boundaries of a We present an outline of mathematical modeling, a highway allow the specification of correct boundary partial differential equation as a mathematical model for conditions using state variables (e.g. density and / or traffic flow. Also we represent specific speed-density speed) rather than fluxes. Preliminary numerical results relationship and specific flow-density relationship and indicate that the finite difference scheme correctly the well-known LWR model (Haberman, 1977 and Klar et computes entropy-satisfying weak solutions of the al., 1996) based on the principle of mass conservation. original model. In Bretti et al. (2007) the authors We assume all cars have some constant velocity v > 0. consider a mathematical model for fluid dynamic flows Then from the relationship among velocity, flux and on networks which is based on conservation laws. The density, the flux q = rv yields the equation of approximation of scalar conservation laws along arcs is ¶r ¶q carried out by using conservative methods, such as the continuity + = 0 in the form classical Godunov scheme and the more recent discrete ¶t ¶x velocities kinetic schemes with the use of suitable ¶r ¶r boundary conditions at junctions. Riemann problems are + v = 0 solved by means of a simulation algorithm which ¶t ¶x (1) processes each junction. In the paper (Haberman, 1977 and Klar et al., 1996) authors consider the LWR model. a linear first order partial differential equation (PDE) This model describes traffic phenomena resulting from called linear advection equation, which in closed form i.e. xx © IJSE – ISSN: 2086-5023, xxxxxxxx 2013, All rights reserved

Internat. J. of Sci. and Eng., Vol. 5(x)2013:xx-xx, xxxx 2013, Nahid Sultana et al. solvable. In this case we consider velocity v = v(r) By integrating 0 = > r t, x = cons tant ò dr = ( ) (2) (8) as a function of density then we have the equation (1) as 2 the form dx æ 3r ö Where = v ç1- ÷ (9) ¶r ¶(rv(r )) dt max ç r 2 ÷ + = 0 (3) è max ø ¶t ¶x 2 æ 3r ö Which is a first order PDE and nonlinear in r .This yield Equation (8) and (9) gives x(t) = v ç1- ÷t + x0 max ç r 2 ÷ ¶r ¶r dv ¶r è max ø + v + r = 0 (10) ¶t ¶x dr ¶x Which are the characteristics of the IVP (7).Now from (4) ¶r æ dv ö ¶r equation (8) we have Þ + ç v + r ÷ = 0 dr ¶t è dr ø ¶x = 0 \r(x,t) = c (11) dt which is linear in derivatives but non-linear in r , termed Since the characteristics through , also passes as quasi-linear equation. We use a non-linear speed- (x t) density relation (non-linear function) which is of the through (x0 ,0) and r(x,t) = c is constant on this curve, form so we use the initial condition to write 2 0 0 æ ö c = r(x,t) = r(x ,0)= r0 (x ) (12) ç æ r ö ÷ v(r ) = v 1- ç ÷ (5) Equation (11) and (12) yield max ç ç r ÷ ÷ è è max ø ø r x,t = r x0 (13) ( ) 0 ( ) with the aid of equation (5) give a relationship for the Using equation (10), (13) takes the form traffic flux (flow) as a function of density that is 2 presented in the following form: æ æ 3r ö ö r(x,t) = r ç x - v ç1- ÷t ÷ This is the analytic 3 0 ç max ç 2 ÷ ÷ æ r ö è è rmax ø ø q(r) = v ç r - ÷ (6) max ç 2 ÷ solution of the IVP (7). è r max ø

Now if we put the velocity-density function III. A FINITE DIFFERENCE SCHEME FOR THE æ 2 ö ç æ r ö ÷ NUMERICAL SOLUTION OF THE IBVP v(r ) = vmax 1- ç ÷ of equation (5) into the ç ç r ÷ ÷ è è max ø ø We investigate a finite difference scheme for our general non-linear model PDE (4), then the explicit non- considered traffic model problem as an initial and two linear PDE is obtained as in the form point boundary value problems 2 ì¶r ¶f (r) ¶r ¶ æ æ r öö 0, t t T, a x b ç . ç1 ÷÷ 0 ï + = 0 £ £ £ £ + r vmax - 2 = ¶t ¶x ¶t ¶x ç ç r ÷÷ ï è è max øø ï íwith I.C. r(t0 , x) = r0 (x); a £ x £ b Where With r(t , x) = r (x) (7) 0 0 ïand B.C. r(t, a) = r (t); t £ t £ T Then we are required to solve the initial value problem ï a 0 (IVP) (7). The IVP (7) can be solved by the method of ï r(t, b) = r (t); t £ t £ T î b 0 characteristics as follows: The PDE in the IVP (7) may be æ r ö ¶r ¶q(r ) f (r) = r.v ç1- ÷ (14) writtenas, + = 0 where max ç r ÷ ¶t ¶x è max ø æ r 2 ö As we consider that the cars are running only in the q r = r.v ç1- ÷ positive x-direction, so the speed must be positive, ( ) max ç 2 ÷ è rmax ø 2r i.e. f ¢(r) = v (1- ) ³ 0 ¶r dq ¶r max r Þ + = 0 max in the range of (15) ¶t dr ¶x r .

¶r æ 3r 2 ö ¶r To develop this scheme, we discretize the space and time. Þ + v ç1- ÷ = 0 max ç 2 ÷ ¶r ¶t è rmax ø ¶x We discretize the time derivative in the IBVP (14) at ¶t dr ¶r ¶r dx Now = + = 0 any discrete point (t , x ) for dt ¶t ¶x dt n i i = 1,L, M ; n = 0,L, N -1; by the forward

xx © IJSE – ISSN: 2086-5023, xxxxxxxx 2013, All rights reserved

Internat. J. of Sci. and Eng., Vol. 5(x)2013:xx-xx, xxxx 2013, Nahid Sultana et al.

¶r(x, t) r , v etc. We choose maximum velocity, difference formula. The discretization of is max max ¶t = 84km/hour. It is notified that for satisfying the obtained by first order forward difference in time and CFL condition we pick the unit of velocity as km/sec. We 4V. ¶r(x, t) consider: = 40 / and perform numerical the discretization of is obtained by first order experiment for 1, 2, 3 and 4 minutes in Dt = 2400 time ¶x Î4V. :ď฀RȮǨďǪ f central difference in space. steps (temporal grid size) for a highway of 120 km in 401 spatial grid points with step sizes Dx =100 meters. We A. Forward Difference in Time: consider the initial density r(0, x) and the constant From Taylor’s series we write boundary value , 0 = 21/0.1 and ( , 100) in such a 2 2 ¶r(x,t) k ¶ r(x,t) way that rightmost side of traffic highway behaves as r(x,t +k) =r(x,t) +k + +... ¶t 2! ¶t2 there is a trafficÎ controller at right Î side .So we define , 100 as follows: ¶r(x,t) r(x,t + k) - r(x,t) 0; , 120 60 Þ = - o(k ) = ¶t k Î ; , 120 > 60 Figure 1, shows the propagatingf traffic≤ waves at 1st, 2nd, ¶r(x,t) r(x,t + k) - r(x,t) Î 4V. \ » 3rd and 4thminute’sÎ.we observef from the figure (1) that ¶t k at 1 min, the density at right most side becomes zero at 2 n+1 n ¶r(t n , xi ) r i - r i and 3 minutes. Density becomes high at 4 minutes and \ » (16) average at 1 minute. ¶t Dt

B. Central Difference in Space:

From Taylor’s series we write

¶f (x,t) h2 ¶2 f (x,t) f (x+h,t) = f (x,t)+h + +... ¶x 2! ¶x2 ¶f (x,t) h2 ¶2 f (x,t) , , f (x-h t) = f (x t)-h + 2 -L ¶x 2! ¶x ¶f (x,t) f (x + h,t)- f (x - h,t) Þ » ¶x 2h

n n ¶f (tn , xi ) fi+1 - fi-1 Þ » (17) x 2 x ¶ D We assume the uniform grid spacing with step size k and h for time and space respectively t n+1 = t n + k n and xi+1 = xi + h .We also write r i for r(x,t) . Putting (16) and (17) in (14), the discrete version of the Figure 1: density of traffic flow at different times. non-linear PDE formulates the first order finite difference scheme of the form r n+1 - r n f n - f n i i + i+1 i-1 = 0 In the figure 1, the curve manifested as blue color, Dt 2Dx represents the density at 1 minutes .also manifested as green color represents density at 2 minutes and n+1 n Dt n n ri = ri - [f (ri+1) - f (ri-1)] , manifested as black color represents density at 3 2Dx minutes, also manifested as magenta color represents 1, , ; 0, , 1 (18) i = L M n = L N - density at 4 minutes. Figure 2, represents the respective This difference equation is known as Lax-Friedrichs Computed velocity profile according to the certain scheme. Points of the highway. The velocity is computed by the æ (r n )2 ö following relation Where f (r n ) = v ç r n - i ÷ 2 i max ç i ÷ æ æ r ö ö è rmax ø ç ÷ v(r ) = vmax 1- ç ÷ ç ç r ÷ ÷ IV. NUMERICAL SIMULATION è è max ø ø

In this section we present the numerical simulation results for some specific cases of flow parameters like xx © IJSE – ISSN: 2086-5023, xxxxxxxx 2013, All rights reserved

Internat. J. of Sci. and Eng., Vol. 5(x)2013:xx-xx, xxxx 2013, Nahid Sultana et al.

We consider the boundary condition in such a way Secondly if we consider increase the numerical grid that front of traffic highway behaves like a traffic points along the highway, then we should observe that controller. The right boundary is given as velocity at rightmost point of highway is zero. ) This . restriction on velocity occurs periodically which is clear from the figure. ; From the figure 3, we observe that at time t=1 min, − − = Density is approximately 1.5 vehicles per time. But at ; , time t=2 min, when we restrict car flow at the end point of highway, the flux is zero. It is obvious because at that ;; ≤ •, > 60 time no car will pass through the end point and so the rate For first 60 seconds, it behaves like that there is no of number of passing car will be zero. At time t=3, there restriction on traffic flow and we observe from the figure is no restriction and so all cars begin to move and flux that at 1 min, the velocity at right most side of highway is rises to approx. 3.We observe that as time grows high. But after 1 min, traffic controller restricts the fluctuation of flux decreases and flux get its extreme traffic flow, and so velocity of traffic flow at right most value at the end point of considered highway. side becomes very small. (From the figure it may seems that velocity is not too small at rightmost point of V. CONCLUSION highway. This is due to two reasons. Firstly since the average velocity of cars is high so at small neighborhood In this work we have considered the macroscopic of rightmost part we observe that rate of change of traffic flow model. First we have shown the fundamental velocity is very high. of traffic variables, analytical solution of the traffic flow model. We present the shock waves of traffic flow. 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. Finally we show the numerical results for flux, density and velocity putting boundary value as flux. We have also chosen right boundary condition in such a way that it behaves like a traffic controller. We have considered a linear relationship between density and velocity but in practice this is not realistic. Firstly density function is not continuous in practice. Secondly if the next car’s acceleration increases then the previous car would accelerate its velocity despite of higher density. So velocity at a point would depend on right limit of density, velocity and rate of change of velocity. We would work on this relationship in further.

REFERENCES [1] Andallah, L. S. , Hossain , M. M. and Gani, M. O.(2011). A finite difference scheme for a fluid dynamic traffic flow model appended Figure 2: velocity profiles with two-point boundary condition. J. Bangladesh Math. Soc. (ISSN 1606-3694) 31 (2011) 43-52 DOI: http://dx.doi.org/10.3329/ganit.v31i0.10307 [2] Kabir, M.H., Gani,M.O.and Andallah,,L.S. (2010). Numerical Simulation of a Mathematical Traffic Flow Model Based on a Nonlinear Velocity-Density Function. Journal of Bangladesh academy of sciences, vol.34.No.1, pp.15-22. ISSN 0378-8121 DOI: 10.3329/jbas.v34i1.5488 [3] Klar,A., Kuhne,R.D.and Wegener,R.(1966). Mathematical Models for Vehicular Traffic, Technical University of Kaiserlautern, Germany. Surveys on Mathematics for Industry. doi.org/10.1006/jmaa.1999.6493, [4] Leveque, R.J. (1992).Numerical Methods for Conservation Laws,1st edition. Computational Methods for Astrophysical Fluid Flow, Springer (1998). http://www.amazon.com/Numerical-Methods-Conservation- Randall-LeVeque/dp/3764327235 ISBN 0-521-00924-3; [5] Trangestain, A. John (2000). Numerical Solution of Partial Differential Equations, February22, February 22, 2000, Durham. [6] Stephen ... Mech. 5, 633-634 (2005)/ DOI 10.002/pamm.200510293, 2005 WILEYVCH Verlag GmbH & Co. KGaA ... xx © IJSE – ISSN: 2086-5023, xxxxxxxx 2013, All rights reserved

Internat. J. of Sci. and Eng., Vol. 5(x)2013:xx-xx, xxxx 2013, Nahid Sultana et al.

[6] K. W. MORTON AND D. F. MAYERS, Numerical Solutions of Partial Methodological · Volume 35, Issue 4, May ,2001 (Elsevier),Pp.337- Differential Equations: An Introduction, Cambridge University Press, 365. http://dx.doi.org/10.1016/S0191-2615(99)00054-5 second ed., 2005. doi: 10.1029/2002JB002329. [9] Bretti, G., Natalini, R.and Piccoli,B. (2007).A Fluid- Dynamic Traffic [7] Daganzo C.F.(1995).A finite difference approximation of the Model on Road Networks(Springer), Arch Comput Methods kinematic wave model of traffic flow, Transportation Research Part Eng.,CIMNE, Barcelona,Spain.Vol- 14: 139–172 B: Methodological, Elsevier, Volume 29, Number 4, August 1995 , pp. http://link.springer.com/content/pdf/10.1007/s11831-007-9004- 261-276(16). DOI: http://dx.doi.org/10.1016/0191- 8.pdf . DOI 10.1007/s 11831-007-9004-8 2615(95)00004-W [10] Richard Haberman, Mathematical Models: Mechanical Vibrations, [8] Zhang, H. M. (2001).A finite difference approximation of a non- Population Dynamics, and Traffic Flow, Prentice-Hall, Englewood equilibrium traffic flow model, Transportation Research Part B: Cliffs, NJ, 1977. ISBN: 0135617383 / 9780135617380

xx © IJSE – ISSN: 2086-5023, xxxxxxxx 2013, All rights reserved