• 沒有找到結果。

動態車流模式平行計算之研究

N/A
N/A
Protected

Academic year: 2021

Share "動態車流模式平行計算之研究"

Copied!
5
0
0

加載中.... (立即查看全文)

全文

(1)

行政院國家科學委員會補助專題研究計畫成果報告

※※※※※※※※※※※※※※※※※※※※※※※※

動 態 車 流 模 式 平 行 計 算 之 研 究

※※※※※※※※※※※※※※※※※※※※※※※※

計畫類別:R個別型計畫 □整合型計畫

計畫編號:NSC89-2411-H-009-075-

執行期間:89年0月01日至90年07月31日

計畫主持人:卓訓榮

共同主持人:

本成果報告包括以下應繳交之附件:

□赴國外出差或研習心得報告一份

□赴大陸地區出差或研習心得報告一份

□出席國際學術會議心得報告及發表之論文各一份

□國際合作研究計畫國外研究報告書一份

執行單位:國立交通大學統計研究所

90

10

31

(2)

行政院國家科學委員會專題研究計畫成果報告

動態車流模式平行計算之研究

計畫編號:NSC89-2411-H-009-075

執行期限:89年8月1日至90年7月31日

主持人:卓訓榮

研究人員:羅仕京, 林其蔚

執行機構及單位:國立交通大學運輸工程與管理學系

一、 中文摘要 完整智慧型運輸系統需應用的評估、預測模式, 有:O/D推估模式、車流模式、交通量預測模式。根 據經驗,動態O/D推估模式、動態車流模式、動態交 通量預測模式均需要大量的運算時間,特別是應用 於整體路網上時,不僅在隨策略構建模式上有很大 的困難,構建出的模式也需要很長的運算時間。以 車流模擬模式而言,早期交通模擬模式之探討與構 建以提供研究無阻斷車流的路況為主,而後依據不 同路況,車流組成等等影響逐步複雜化。但隨著模 式之複雜化,求解越形困難;依據演算經驗,模式 越複雜所需的演算時間越長,如此即使模式能捕捉 描述動態車流的即時特性,卻無法提供即時預測資 訊,供管理者因應時記錄況擬定策略或評估策略執 行的優劣。若以模擬方式,則有不收斂的問題。因 此要實際應用動態車流模式於智慧型運輸系統中, 有效的計算方式為一發展重點。本研究由探討動態 車流模式於智慧型運輸系統之應用著手,回顧並分 析動態車流模式。進而探討動態車流模式數值計算 方法,發展數值平行計算方法。最後,探討評析各 種動態車流模式平行計算程式與平行計算環境之適 用性。 關鍵詞: 平行計算、動態車流模式、守恆律、MPI Abstract

By traffic flow theory, planners can construct models describing relationships between traffic systems and environment, designers can evaluate traffic systems, and operators can check if there is something wrong in the system. Especially, in the develop trend of ITS, the analysis of traffic flow can provide the application of raw traffic data and real time prediction of traffic situation. In this study, we follow and expand the research, which we have done before, and trying to compare the computing efficiency of dynamic traffic model. Whitham, Lightwill, and Richard applied the wave equation to traffic flow theory in 1955 first. Most of the models cannot be solved

inefficiency. Thus, we cannot provide dynamic travel information to travelers by the prediction of dynamic traffic model. In this study, we are going to discuss the parallelization of numerical method of dynamic traffic flow model, so as to make them can be applied to ITS. Our research focuses on the efficiency of parallel computing of different models. Trying to find suggestions and recommendations of solving dynamic traffic flow models and applies the information to ITS are the main purpose of this research.

Keywords: dynamic traffic flow, MPI, conservation law, parallel computation

二、Motivation and Objectives

Traffic simulation system is a very important component of the Advanced Traffic Management System[1-2, 11]. Such a system includes traffic flow simulation software that is able to simulate traffic on freeways and arterial networks. The simulation software has to consist with hardware such as input/output devices, which provide real-time traffic data measurements from traffic detectors (loops or cameras) in a traffic network, and data on the road geometry or other traffic characteristics. The system uses a mathematical traffic flow model to perform traffic flow simulation and predict the traffic conditions in real-time. These predictions can be used for real-time traffic control and drivers’ guidance. Since real-time computation is emphasized in ATMS development, we propose a dynamic traffic model and parallelize the numerical method in this study. The main purposes are trying to accelerate the computation of dynamic traffic simulation [1-2, 8-10]and to evaluate the efficiency of Message Passing Interface (MPI), which is the common methodology of parallel computation.

三、Results and Discussions

In this study, we consider a dynamic traffic flow, which is based on the LWR model[4-7]. The LWR

(3)

behavior. The model proposed in this paper is based on the assumption of conservation law of vehicles on one-dimension with interchange between road lanes. The proposed model is a one-dimensional PDE system, so as to describe a multilane freeway. In addition, a several numerical example is employed to illustrate our model.Based on the model, we use finite volume method (FVM) to compute the numerical solutions we want to know, we also use the data to simulate the variance of traffic flow. Besides, we will use parallel computing to compute our problem, and compare the simulation time.

Conventionally, in the field of macroscopic traffic flow modeling, the LWR model is the most usage model, which is derived from the notation of mass conservation. The LWR model is written as

β = ∂ ∂ + ∂ ∂ x q t k , (1)

where

k

represents the traffic density,

q

represents the traffic flow, and

β

represents the effect of entrances and exits. The model can be generalized to describe the traffic flow on a multilane road by specifying the LWR equations for each lane and permitting certain density fluctuations across lanes. Coupling two LWR equations together, then we can get a coupled system PDEs[3] as following:       − = ∂ ∂ + ∂ ∂ = ∂ ∂ + ∂ ∂ ) , ( ) , ( 2 1 2 2 1 1

k

k

F

x

q

t

k

k

k

F

x

q

t

k

. (2)

The situation of density exchange between neighboring lanes is determined by the difference of density between the two lanes. From Wilhelm’s[2] studies, there is a model which is assumed that under equilibrium, each lane has the same density, so the lane changes were proportional to the density difference between neighboring lanes. Thus,

) ( ) , (k1 k2 a k2 k1 F = − , (3) where a is adjusted coefficients, it represents the ratio of lane change. The choice of the lane changing function was largely theoretical and largely empirical.

The model becomes:



=

+

=

+

)

(

)

(

)

(

)

(

2 1 2 2 1 2 1 1

k

k

a

x

u

k

t

k

k

k

a

x

u

k

t

k

. (4)

Using the Greenshield’s model

u

=

u

f

(

1

k

/

k

j

)

to represent the speed-density relation, then, we can rewrite the system equation as following:

       − − = ∂ ∂ − + ∂ ∂ − = ∂ ∂ − + ∂ ∂ ) ( ) 2 1 ( ) ( ) 2 1 ( 2 1 2 2 2 2 1 2 1 1 1 1

k

k

a

x

k

k

k

u

t

k

k

k

a

x

k

k

k

u

t

k

j f j f . (5)

The system PDEs above is the model we want to simulate, and we will use Finite Volume Method to simulate and then use parallel computing with MPI to accelerate the simulating time. The process will describe in the following paragraphs.

The finite volume method is in common use as a discretization method for computational fluid dynamics applications. Reasons for its popularity include its ability to be faithful to the physics in general and conservation in particular, to effectively treat boundary conditions and non-uniform grids, and to facilitate multi-grid solution. The advantages of the FVM over Finite Difference Method or Finite Element Method are that the FVM does not require a structured mesh and the boundary conditions can be applied non-invasively.[12] The first step in the FVM is to divide the domain into discrete control volumes, that is, grid generation, then integrate the governing equation over a control volume to yield a discretised equation at its nodal point. This is the key step of the FVM, which is derived from the Gauss theorem

∫∫

∫∫∫

∇•FdV=Σ FNdA M

(6)

At each control volume we generated, there will be an equation related to the nodal point and its adjacency volume nodal point. These equations result in a system of linear algebraic equations. At last, solve the system of equations comprised by each control volume to obtain the distribution of the property at nodal points, and we will obtain the approximation value of each control volume. Because the form of the equations in the system is the same, we take a single equation for example. Consider the equation

) ( ) 2 1 ( m n m mj m f m a k k x k k k u t k − = ∂ ∂ − + ∂ ∂ (7)

Integrate through the volume (the equation here is one dimensional, so we just integrate through axis x, a sketch is explained in Figure 1), and use finite difference to discrete time.

(4)

P

W E

w Control Volume e x

Figure1 one-dimension FVM discretization

The equation becomes

x k k a k k k k u x t k k t m t n t w t e j t m f t m t m δ δ δ )( ) ( ) 2 1 ( 1 1 1 − = − − + − + + + . (8)

Because of the boundary conditions, the equation of side control volume is different from inside ones, we specialize the two equations, and we can get the linear equations as follows:                      − + + − − =         − − +         − − − + =         − +     +         − − − + + − =         − +         − + + + + + + + + + + n) (Volume ) ( ) 2 1 ( ) 2 1 ( 2 ) 2 1 ( 2 Volumes) (Inner ) ( ) 2 1 ( 2 ) 2 1 ( 2 1) (Volume ) ( ) 2 1 ( ) 2 1 ( 2 ) 2 1 ( 2 1 1 1 1 1 1 1 1 1 t mp t np t me j t m f t mP j t m f t mW j t m f t mp t np t mE j t m f t mP t mW j t m f t mp t np t mw j t m f t mE j t m f t mP j t m f k x t x x k k k k u k k k u t x k k k u k x t x x k k k k u k t x k k k u k x t x x k k k k u k k k u k k k u t x δ δ δ δ δ δ δ δ δ δ δ δ δ δ δ δ δ δ (9) The linear equations can be composed into a tri-diagonal matrix, and we can use several ways such as the Gauss eliminate or the Jacobi iteration method to solve it. There will be a realized numerical example later, and we use Jacobi iteration method to find the solutions, and later we use Message Passing Interface (MPI) to accelerate the computation.

Suppose the ratio of lane changing is 0.5, that is, a=0.5, and choose dx=6,dt=0.05 to proceed our simulation. Let lane 1 represents the inside lane, and lane 2 represents the outside lane. Because the vehicles driving on roads always form fleets, so we suppose the boundary condition of both lanes is a periodic function, we choose 70+70sint as the boundary condition of the inside lane, and |70cost| as the boundary condition of the outside condition. The whole simulated model is as follows:

      − − = ∂ ∂ − + ∂ ∂ − = ∂ ∂ − + ∂ ∂ ) ( 5 . 0 ) 200 2 1 ( 120 ) ( 5 . 0 ) 200 2 1 ( 120 2 1 2 2 2 1 2 1 1 1 k k x k k t k k k x k k t k (10)

and the initial condition and the boundary conditions are

t t k t t k C B e x k e x k C I x x cos 70 ) , 0 ( sin 70 70 ) , 0 ( : . 30 40 ) 0 , ( 40 30 ) 0 , ( : . . 2 1 30 2 60 1 = + = + = + = − − (11)

The simulation results of both lanes is follows:

Figure2 Simulation Result of lane1

From the simulation result, we find that the density of traffic flow is changed with time, and there are interactive relations between the adjacency lanes. It quite fit in with real traffic flow conditions.

Figure3 Simulation Result of lane 2

In this study, we employ the Message Passing Interface to parallelize the numerical simulation. The MPI is not a revolutionary new way of programming parallel computers. Rather, it is an attempt to collect the best features of many message-passing systems, improve them where appropriate, and standardize them. There are

(5)

on normal programs. The working platform is parallel PC Cluster system with Linux, and we have 16 PCs in all. We will introduce the place we do parallel in the algorithm, and compare the running efficiency.

There are two places in the algorithm we can parallelize the computation, one is the step of recomposing the matrix, and the other is the step of the Jacobi iteration. Because the elements in the coefficient matrix are dependent upon the density values of previous time level, so we need to recompose the coefficient matrix at each time level. And because all the elements are only related to its value of previous time level, it is independent of other density value at different nodal point, so we can comprise the coefficient separately. As to the step of the Jacobi iteration, because of its property, it can parallel iterate, as long as the border elements between the two divided areas are passing into adjacent areas.

Suppose the converging criteria of the Jacobi iteration is that the error is less than 10-6, and set time steps equals to 1000, with single PC execution, it needs about 1225.39 sec to complete the computation. Use two PC to do parallel computing, it will need about 996.25 sec to complete the computation, the acceleration ratio is about 1.23X. The running time of using different numbers of PCs is listed in the following table. From table 1 we can find that with the increasing number of PCs, the acceleration ratio is decreasing. However, if the number of PCs reaches 16, the computing time increases instead of decrease. Because the proposed model in this study is a simple model, the computing time is not large enough. On the other hand, if the number of PCs increases, the time of data transaction also increases. If the time consuming of data transaction is larger than the reducing time of parallel computing, parallel computing is inefficient than the traditional computation. Therefore, there exists a threshold of the number of parallel computing PCs and the subject is an important topic to research.

PCs 1 2 4 8 16

Time(sec) 1225.39 996.25 658.81 780.50 1238.47 Speedup 1X 1.23X 1.86X 1.57X 0.98X

Table1 Execution Time using different numbers of PCs 四、Comments

This work is a multilane traffic flow model, which is based on the LWR model. The finite volume method is employed to solve the model successfully. In addition, the parallel computation method MPI is also applied successfully to parallelize the simulation. The study can be a base for real-time simulation of traffic flow

researches so as to realize the concept of ATMS. From the literature review, dynamic traffic researches and parallel computing are the interested topics in the field of transportation research. Hence, the result is worth to rearrange and submit to international journals.

五、References

1. Chronopoulos, A. T., and C. M. Johnston, “Parallel Solution of A Traffic Flow Simulation Problem”, Parallel Computing, Vol. 22, pp.1965-1983, 1997. 2. Chronopoulos, A. T., and C. M. Johnston, “A

Real-Time Traffic Simulation System”, IEEE Transactions on Vehiclar Technology, Vol. 47, No. 1, pp.321-331, 1998.

3. Haberman, R., Mathematical Models-Mechanical Vibrations, Population Dynamics, and Traffic Flow, New Jersey, Prentice-Hall Inc., 1977.

4. Lighthill, M. J., and Whitham, G. B., 1955, “ On Kinematics Waves I. Flood Movement in Long Rivers “, London, Proceedings Royal Society, A229, pp.281-316.

5. Newell, G. F., “A Simplified Theory Of Kinematic Waves In Highway Traffic, Part I: General Theory”, Transportation Research Part B, Vol. 27, No. 4, pp.281-287, 1993.

6. Newell, G. F., “A Simplified Theory Of Kinematic Waves In Highway Traffic, Part II: Queueing At Freeway Bottlenecks”, Transportation Research Part B, Vol. 27, No. 4, pp.289-303, 1993.

7. Newell, G. F., “A Simplified Theory Of Kinematic Waves In Highway Traffic, Part III: Multi-Destination Flows”, Transportation Research Part B, Vol. 27, No. 4, pp.305-313, 1993.

8. Vatsa, V. N., and B. W. Wedan, “Parallelization of a Multiblock Flow Code: An Engineering Implementation”, Computers and Fluids, Vol. 28, pp.603-614, 1999.

9. Wong, S. C., “Group-Based Optimisation of Signal Timings Using parallel Computing”, Transportation Research Part C, Vol. 5, No. 2, pp. 123-139, 1997. 10. Zhang, X., and M. R. B. Forshaw, “A Parallel

Algorithm to Extract Information About The Motion of Road Traffic Using Image Analysis”, Transportation Research Part C, Vol. 5, No. 2, pp.141-152, 1997.

11. Zhang, Y., and L. E. Owen, “An Advanced Traffic Simulation Approach for Modeling ITS Application”, Proceedings of IEEE, 1998.

12. 卓訓榮, 羅仕京, “動態巨觀車流數值模擬演算 法回顧與評析”, 中華民國運輸學會第16屆論文 研討會, 中華民國90年11月.

參考文獻

相關文件

FIGURE 5. Item fit p-values based on equivalence classes when the 2LC model is fit to mixed-number data... Item fit plots when the 2LC model is fitted to the mixed-number

Particularly, combining the numerical results of the two papers, we may obtain such a conclusion that the merit function method based on ϕ p has a better a global convergence and

We give some numerical results to illustrate that the first pass of Algorithm RRLU(r) fails but the second pass succeeds in revealing the nearly rank

In the following we prove some important inequalities of vector norms and matrix norms... We define backward and forward errors in

Theorem 5.6.1 The qd-algorithm converges for irreducible, symmetric positive definite tridiagonal matrices.. It is necessary to show that q i are in

Finally, we use the jump parameters calibrated to the iTraxx market quotes on April 2, 2008 to compare the results of model spreads generated by the analytical method with

Plane Wave Method and compact 2D Finite difference Time Domain (Compact 2D FDTD) to analyze the photonic crystal fibe.. In this paper, we present PWM to model PBG PCF, the

Peric: Finite volume method for prediction of fluid flow in arbitrarily shaped domains with moving boundaries, International Journal for Numerical Methods in Fluid, Vol.