Modeling and Density Estimation of an Urban Freeway Network Based on Dynamic Graph Hybrid Automata

In this paper, in order to describe complex network systems, we firstly propose a general modeling framework by combining a dynamic graph with hybrid automata and thus name it Dynamic Graph Hybrid Automata (DGHA). Then we apply this framework to model traffic flow over an urban freeway network by embedding the Cell Transmission Model (CTM) into the DGHA. With a modeling procedure, we adopt a dual digraph of road network structure to describe the road topology, use linear hybrid automata to describe multi-modes of dynamic densities in road segments and transform the nonlinear expressions of the transmitted traffic flow between two road segments into piecewise linear functions in terms of multi-mode switchings. This modeling procedure is modularized and rule-based, and thus is easily-extensible with the help of a combination algorithm for the dynamics of traffic flow. It can describe the dynamics of traffic flow over an urban freeway network with arbitrary topology structures and sizes. Next we analyze mode types and number in the model of the whole freeway network, and deduce a Piecewise Affine Linear System (PWALS) model. Furthermore, based on the PWALS model, a multi-mode switched state observer is designed to estimate the traffic densities of the freeway network, where a set of observer gain matrices are computed by using the Lyapunov function approach. As an example, we utilize the PWALS model and the corresponding switched state observer to traffic flow over Beijing third ring road. In order to clearly interpret the principle of the proposed method and avoid computational complexity, we adopt a simplified version of Beijing third ring road. Practical application for a large-scale road network will be implemented by decentralized modeling approach and distributed observer designing in the future research.


Introduction
A traffic flow network is a typical example of a complex network system [1,2]. Dynamic modeling of the traffic flow network is quite a challenging task in traffic flow analysis and control. Various traffic flow models have been proposed to study complex traffic phenomena on a road network, e.g., as the mathematically most consistent macroscopic traffic flow, the well-known LWR model proposed by Lighthill, Whitham [3] and Richards [4], which formulates the relationship among the key traffic flow parameters such as density, flow etc. using continuous time partial differential equations. The second-order model is presented by Payne [5]. From the view of application, Daganzo [6,7] network. The corresponding observer gains are found by using the Lyapunov function approach for the switched dynamics of estimation error system and solving Linear Matrix Inequalities (LMI).
The rest of the paper is organized as follows. In Section 2, we provide some relevant background material about dynamic graph and hybrid automata and propose the modeling framework of Dynamic Graph Hybrid Automata. In Section 3, the DGHA framework is used to model traffic flow network by embedding the CTM into it. In Section 4, we deal with the design of the switched state observer. In Section 5, we illustrate the obtained results by applying them to the simplified version of Beijing third ring road. The paper is concluded in Section 6.

Preliminaries
First of all, we briefly review dynamic graph theory [23] and hybrid automata theory [25] and then combine dynamic digraph with hybrid automata to propose a new model framework which we call Dynamic Graph Hybrid Automata (in short, DGHA) [19,20].

Dynamic Graph
A graph [23] is a pair (V, E), where V is a finite set of vertices or nodes, and E is a set of undirected edges, each being an unordered pair {i, j} and expressing a link between two vertices i, j ∈ V. A digraph is a pair (V, E), where V is a finite set of vertices or nodes, and E is a set of directed edges e ij ∈ V × V, i = j, expressing a link from vertex i ∈ V to vertex j ∈ V.
A vertex-weighted graph or digraph is a triple (V, E, F), where (V, E) is a graph or digraph, F : V → X is a function to assign a weight x i ∈ X for every vertex i, and X is a pre-specified set. An edge-weighted graph or digraph is a triple (V, E, G), where (V, E) is a graph or digraph, G : E → Y is a function to assign a weight y ij for every edge {i, j} or e ij , and Y is a pre-specified set. A fully-weighted graph or digraph (V, E, F, G) has weights assigned to both vertices and edges. Depending on the context, the weight sets X, Y may be real numbers, complex numbers, integers, or even elements of a group or a field, etc.
The set V of vertices of a graph or digraph (V, E) is said to be dynamic if its number |V| is time-varying. The set E of edges of a graph or digraph (V, E) is said to be dynamic if the edges are time-varying on-off switches. The vertex-weight function (respectively, edge-weight function) is called dynamic if the weights x i (respectively, y ij ) are time-varying. A fully-weighted graph or a digraph is called to be dynamic when any one of the four entities (V, E, F, G) is dynamic. Remark 1. Dynamic set V of vertices means that some vertices may be added or removed. When a vertex is added or removed, the corresponding edge linking is also appended or eliminated. Dynamic set E of edges implies that edges may be added or deleted over time. We also say that the graph or digraph has a switched set of edges.

Remark 2.
In what follows, for a digraph (V, E), we denote by Pre(i) = {l ∈ V : e li ∈ E} the set of all upstream neighbouring vertices and Post (i) = {j ∈ V : e ij ∈ E} the set of all downstream neighbour ones of vertex i, respectively. Thus N i = Pre(i) ∪ Post(i) is the set of all neighbour vertices of vertex i. We also introduce notationN i = {i} ∪ N i .

Hybrid Automaton
A hybrid automaton [25] with continuous input and output H is a collection H = (S, Init, U, f , δ, Inv, G, R, Y, g), where • S = Q × X is a state space of hybrid state variables (q, x), where Q is a finite set of discrete states q and X ⊆ R n is a n-dimensional state space of continuous state vector x; • Init ⊆ S is a set of initial hybrid states; • U ⊆ R m is a set of continuous input variable u; • f : S → X is a vector field describing the continuous state dynamics defined by A hybrid automaton can also be expressed by a digraph as shown in Figure 1 [25]. We notice that in this paper we focus on discrete time system defined by a difference equation for the continuous part of the hybrid automaton.

Dynamic Graph Hybrid Automata
Now we combine a dynamic graph with hybrid automata to propose a new model which we call Dynamic Graph Hybrid Automata (DGHA, for short). An early version of the model was given in references [19][20][21]. In what follows, we restate it in the way of parallel composition of hybrid automata. Definition 1. DGHA model is a hybrid automaton H over a digraph (V, E) which described by the following four parts: (1) Fully weighted dynamic digraph. In G = (V, E, H, Φ), V = {1, · · · , N} is a finite set of N fixed vertices, and E = e ij : i, j ∈ V is a set of directed edges, H and Φ are sets of the automata and the functions that assign the vertex weights and edge weights, respectively, which are described in detail as follows; (2) Vertex dynamics. The elements in H = {H i : i ∈ V} are hybrid automata to describe the dynamics of vertex i ∈ V, whose components are similarly defined as in Subsection B. (3) Edge weight functions. The set Φ = φ ij : e ij ∈ E consists of the functions φ ij : Y i × Y j → R m that assign a weight φ ij (y i , y j ) for each edge e ij ∈ E; (4) Composition of hybrid automata. In DGHA = (V, E, H), H = (S, Init, f , δ, Inv, G, R) is the closed hybrid automaton over the digraph (V, E) obtained by parallel composition of hybrid automata in H, i.e., S = Q × X with Q = Q 1 × · · · × Q N and X = X 1 × · · · × X N ; Init = Init 1 × · · · × Init N ; f : S → X is defined as f =f 1 × · · · ×f N andf i : S | i → X i describes the dynamics of vertex i by substituting u i (t) in the the following equation with the following relation: where S | i denotes the projected subspace of S on the state components with indices inN i , and for any i ∈ V the output y i is given by transition map δ : S → Q is defined by the following rule: A DGHA model can also be expressed by a digraph as shown in Figure 2.

Remark 3.
In Definition 1, the vertex set V and edge set E are assumed to be fixed. However, instead of the fixed edge set E, one can use a dynamically switching edge set E (t) = δ ij (t)e ij : i, j ∈ V by introducing a Boolean function δ ij : R → {0, 1} to indicate appearing or disappearing of edges, which can be used to express the traffic lights, i.e., δ ij (t) = 0 if the light is red, and δ ij (t) = 1 if the light is green. In this case, the edge weight function will be also affected by the switching function and thus become δ ij (t) φ ij y i (t) , y j (t) . In this paper, we focus on modeling urban freeway, so we do not further discuss this kind of models more in detail.

Remark 4.
In general, the functions φ ij y i , y j are nonlinear. When the hybrid automata of vertices are all linear or affine linear, one can further express these functions by linear ones in a way of multiple mode switchings. In this case, the vertex hybrid automata may be changed accordingly, depending on the edge modes and the modes of all neighbour vertices (see the application below in traffic flow model).

DGHA Model For Urban Freeway Network
As a generalized model framework, the DGHA can be applied to various complex network systems in different fields. When applying it to a traffic flow network, one can adopt different types of traffic variables to describe traffic state in road segments, e.g., two-dimensional traffic variables of traffic densities and vehicle average velocity. But in this paper we apply the DGHA to model traffic flow of an urban freeway network by embedding the well-known CTM into the DGHA. That means we only use the traffic densities to describe traffic state in road segments. As for urban street networks with intersections, we need DGHA with switching edges to describe traffic lights, which goes beyond our research in this paper.
We improve our previous work in [19][20][21] in the following aspects. Firstly, we introduce a partition of state subspace such that the combination modes of cells can be described by convex polytopes. Meanwhile, by adopting parallel composition algorithm of automata to obtain a hybrid automaton with high dimension over the whole road network. We finally deduce a Piecewise Affine Linear System (PWALS) of the overall road network. Based on the obtained PWALS, we further analyze the types and number of combination modes of cells and give a corresponding computational formula of the number of modes. An algorithm is developed on the basis of DGHA framework, and one can apply this algorithm to implement modelling of traffic networks with arbitrary topology structures and sizes.

The Dual Digraph Description of Road Network
In most literature, a road network is modeled as a digraph according to its original structure [22], i.e., each intersection or bottleneck point is represented as a vertex and the road section between adjacent intersections or bottleneck points is represented as the directed edge. However, in contrast to this traditional methodology, in our DGHA model, we adopt the dual digraph of the original structure of the road network. More precisely, each road section connecting two adjacent intersections or bottleneck points is partitioned into one or several segments and these segments, which are called cells, are modeled as vertices of the digraph. Two vertices are connected by an directed edge if there is traffic flow transition between them along the arrowed direction.
In our opinion, the dual digraph description has at least three advantages. Firstly, the network is easily extended by adding vertices and edges of the digraph. Secondly, weights describing dynamic procedures can be added in vertices as customary as in the weight digraph theory. Finally, traffic flow directions can be clearly indicated by the directed edges of the digraph and transited flows can be expediently described by dynamic weights and switchings, and especially, the edge switchings between vertices can describe the traffic light signals.
In this paper, we use fully weighted dynamic digraph G = (V, E, H, Φ) to describe urban freeway network, where V = {1, 2, · · · , N} denotes the set of all partitioned road segments of a given road network, E = e ij : i, j ∈ V denotes the set of all the directed edges indicating the transition of traffic flow, and the set H of automata and the set Φ of edge weighted functions will be illustrated later. Compared with the traditional modeling method, directed edges clearly indicate the transition of traffic flows and their weights express the traffic volumes transited during a pre-specified time interval. For the description of urban street network with intersections, we can express the switchings of traffic lights, instead of the fixed set E, by adopting a switching edge set E(t).

Dynamics of Traffic Flow in Road Segment
To the best of our knowledge, the CTM [6,7] can well describe traffic flow, where the triangular fundamental diagram or the trapezoid fundamental diagram is adopted to approximatively express flow-density relationship [17,18,22]. In this paper, we use traffic density ρ i to express the traffic state of road segment i, and also adopt the triangular fundamental diagram shown in Figure 3 for road segment i, where C i is the traffic capacity (vph), V i is the free flow speed (mph), W i is the traffic wave speed (mph), ρ 0 i is the critical density (vpm), and ρ m i is the maximum/jam density (vpm).
To express the dynamics of vertex i, we use the hybrid automaton , whose entries are illustrated as follows: , and the continuous state space is X i = R since only density ρ i is adopted as continuous state variable; • Init i ⊂ S i can be given arbitrarily; • The input variable u i represents the changed flow of road segment i during the time period [tT, (t + 1)T], where T is the sample time period. Thus we have the input space The vector field f i : S i × U i → X i is described by the following equation: where a i = T/L i and L i is the length of the road segment (cell) i. Here and henceforth for simplicity we omit the time t in various variables and use ρ + i to express ρ i (t + 1); • The transition map δ i is defined according to the guard conditions, i.e., a transition happens if and only if the corresponding invariant set is damaged and the guard condition is satisfied; The reset map R i is identical and thus is omitted; Figure 3. Triangular fundamental diagram.

Multi-Mode Description of Transited Traffic Flows
The edge weight function φ ij : Y i × Y j → R in the set Φ = φ ij : e ij ∈ E expresses traffic flow practically transited from upstream cell i to downstream cell j. According to the rule of the CTM, the transited traffic flow is defined by a nonlinear function where r j is the flow that can be received by cell j and s i is the flow that can be supplied by cell i, both during the time interval tT, (t + 1) T .
In what follows, we give a two-mode switching description of linear functions via two modes "D = Downward wave, U = Upward wave": Remark 5. Two modes "D" and "U" describe the relation of the traffic flow between the road segments i and j. "D" mode means that the road segment j can release the traffic flow from i, while "U" mode indicates that the road segment j blocks the traffic flow from i.

Composition for DGHA Model of Traffic Flow Network
In literature [56], used a combination of LWR model with Godunov based numerical solutions [53] to solve the Riemann problem where the initial condition is a piecewise constant function with two values ρ and ρ r for the upstream (left) and downstream (right) densities. Either a shockwave or a rarefaction wave originates from the junction of the two densities. A shockwave develops if f (ρ ) > f (ρ r ). Similarly, a rarefaction develops if f (ρ ) < f (ρ r ). However, in the paper the hybrid switching automata approach proposed is to solve the traffic characteristics and system evolution by considering a Riemann problem with a piecewise constant initial condition. Now we discuss the composition rules of the vertex automata affected by the edge weight functions described in Sections 3.2 and 3.3 above. That is, we combine the dynamics of traffic flows in road segments with the transited traffic flows described by the two-mode switching linear functions to deduce the DGHA model of traffic flow network.
We assume that the merging interrelationship of flows in segments l ∈ Pre(i) and dividing interrelationship of flows in segments j ∈ Post(i) have been separated according to the rules via merging or dividing ratio [6,8], so that we can independently deal with the transited flows between any two segments (l, i) or (i, j). In other words, assuming that ζ li and η ij are the merging and dividing ratios respectively, the Equation (7) is modified by the merging and dividing rules Thus, according to the composition rules of hybrid automata in Equation (2), the function u i in Equation (4) is given as follows: Especially, when only linear connections exist, e.g., in a urban ring freeway, we have Pre (i) = {l} and Post (i) = {j} in Equation (11), and thus ζ li = 1 and η ij = 1, which is the case we assume for simplicity in the following statement. Now we use the way of modes in Equation (8) to express the Equation (11) into a switching procedure between a series of linear equations. In other words, we analyze the modes of vertex i in connected network by combining discrete states Q i and modes of all the edges connected with vertex i. It is obvious that these modes depend on the states of the vertices inN i , and each mode can be expressed by a group of inequalities of state variables ρ k , k ∈N i . Thus, we use a partition of state subspace Θ i = ∏ k∈N i X k to express these modes so that the Equation (4) with Equation (11) is expressed by a piecewise affine linear system (PWALS).
For the special case of Pre (i) = {l} and Post (i) = {j}, Equation (11) into Equation (4) gives the following equation: In order to Equation (12) into a PWALS, we partition the subspace and thus in each of the subsets the flows q li = min{s l , r i } and q ij = min{s i , r j } can be expressed by linear relations.
First of all, we show that the cell i generally possesses seven modes with relation to upstream l shown in Table 1, where Table 1, the practical modes depend on the traffic capacities C l , C i . In fact, we can list the following three cases: C l > C i , C l < C i and C l = C i . In the case of C l > C i , there exist six combined modes "FDF, FUF, CUF, CUC, FUC, FDC"; In the case of C l < C i , there exist six combined modes "FDF, CDF, CDC, CUC, FUC, FDC"; In the case of C l = C i , mode "FUF" (resp. "CDC") will be merged into mode "FDF" (resp. "CUC") and thus there exist only five combined modes "FDF, CDF, CUC, FUC, FDC", where "FDF" and "FDC" indicate free flow, "CUC" and "FUC" are congested flow, and "CDF" is saturated flow. Similarly, one can analyze the modes of i with respect to downstream j. Table 1. Modes of i with relation to upstream l.

Mode
Condition of (ρ l , Next, we combine the modes of i with relation to l and j to obtain the modes of cell i in the connected network by using the corresponding subsets Θ ik . In this case, Equation (12) is expressed into a piecewise affine linear system with the following twelve linear subsystems: or if "FUCDF" : H i(10)ρi ≤ h i (10) ; (11) ; or if "CUCUC" : H i(12)ρi ≤ h i (12) . (13) where the matrices H ik , h ik , k = 1, · · · , 12 are listed in Appendix A to express Θ ik = {ρ i : H ikρi ≤ h ik }. We add Θ i0 = Θ i \ ∪ 12 k=1 Θ ik , and thus have Θ i = ∪ 12 k=0 Θ ik . Similarly, we can deal with all the cells in an urban ring freeway which is partitioned into N cells. Finally, we can obtain all modes of the freeway network by finding intersections of all the convex polytopes Θ ik , i = 1, · · · , N, k = 1, · · · , 12, in the state space R N .
Let S = S(N) be the number of all the combined modes of the freeway network with N cells, and D s ⊂ R N , s = 1, · · · , S, be the convex polytopes describing the combined modes. We use x = [ρ 1 , · · · , ρ N ] T ∈ R N to denote the traffic density vector of all the cells, use the vector u ∈ R M to represent the traffic demand from on-ramps of the freeway network, and assume that the dividing ratio of the cell i with an off-ramp to the downstream cell j is η ij . Thus traffic flow of the freeway network can be modeled by a PWALS with S subsystems and a switching function σ : [0, +∞) → {1, 2, · · · , S} among these subsystems: where the switching function σ(t) is determined by the convex polytopes D s , i.e., σ(t) = s if and only if x(t) ∈ D s ; for s = 1, · · · , S, vector F s , matrices A s and B s consist of the parameters in the fundamental diagrams and the dividing ratios of all the cells.

Analysis of the Number of Combined Modes
As the basis of other work, such as density estimation and on-ramp metering, it is essential to analyze the complexity of combined modes. Now we take an urban freeway with N partitioned cells as an example to investigate the combined mode number S(N).
We prove that S(N) satisfies the following relation: with initial conditions S(1) = 2 and S(2) = 5. The proof is as follows. As seen in Figure 4, if the current cell is in mode "F", there are only three possible modes combined with the downstream cells, i.e., "FDF", "FUC", "FDC". Otherwise, there exist only two possible combination modes when the current cell is in mode "C", i.e., "CDF", "CUC". Hence, we have the following equation: where S F (N − 1) and S C (N − 1) are the mode numbers of the first N − 1 cells when the (N − 1)th cell is in mode "F" and "C", respectively. On the other hand, we have S F (N − 1) = S(N − 2) since "F" can appear after any modes. Moreover, Substituting these two expressions into Equation (16), we obtain the following equation: and thus verify the Equation (15).
Although we focus on the analysis of urban freeway networks, we can use similar method to investigate other types of road networks. However, since these combination modes are affected by various factors, such as traffic lights, the types and the number of merge connections and diverge connections, the situation may become more complex. On the other hand, we should point out that although we list all the combination modes for a given road network theoretically, further studies are needed to check whether all the modes exist practically and how these modes change during traffic flow evolution.
In the literature [34], the number of modes is 2 N for a road segment with N cells. They only considered the modes in the vertices and ignored the multi-mode switchings of the edges. In our DGHA model, the modes of vertices and edges are both considered. Consequently, the modes are more than the those in [34].

State Observer Design
State observers have been considered as effective tools of state estimation in the control theory, and various types of state observers have been developed and widely applied in practical fields. In this section, we choose the Luenberger-type switching observer in [43] to estimate traffic densities based on the PWALS Equation (14) for a freeway network divided into N cells.
We suppose that M fixed or floating sensors are installed on some road segments and aim to estimate the densities on all the segments of the whole freeway network via the PWALS Equation (14) and the traffic data obtained from the sensors.
Let y(t) ∈ R M be the measured output vector of the sensors and assume that it has the following relation to the densities: where C is the output matrix depending on the type, number and location of the sensors. We also assume that (A s , C) , s = 1, 2, · · · S, are observable or detectable.
In this paper, we assume the switching rule of the observer is the same with that of the PWALS Equation (14). Thus, based on the Equation (14) and the measured output Equation (23), we construct the following piecewise affine linear observer ( Figure 5): wherex (t) ∈ R N is the estimation of the state x(t), K s , s = 1, · · · , S, are the observer gain matrices which will be designed below, the switching function σ : [0, +∞) → {1, 2, · · · , S} is the same with that of the PWALS Equation (14) and thus is determined by the convex polytopes D s , s = 1, · · · , S, i.e., σ(t) = s if and only if x(t) ∈ D s .  Figure 5. The schematic diagram of state observer.
Therefore, the state estimation error e(t) = x(t) −x(t) can be described by the following switched linear system: In order to ensure lim t→∞ e(t) = 0 for any switching signal σ(t), the switched linear Equation (19) must be asymptotically stable for any switching signal σ(t). We apply the common quadratic Lyapunov function approach for the following subsystems to compute the observer gain matrices K s : First of all, we state two well-known lemmas as follows.

Lemma 1.
Assume that (A s , C) , s = 1, 2, · · · S, are observable or detectable. If there exists a positive definite symmetric matrix P satisfying the following Lyapunov inequalities: the gain matrices K s , s = 1, · · · , S, ensure that, for any switching signal σ(t), the estimation error of the observer Equation (18) exponentially converge to zero.

Lemma 2.
Let X s = PK s . Then the inequalities Equation (21) are equivalent to the following LMIs with respect to P and X s : Thus, we can find the gain matrices K s = P −1 X s , s = 1, · · · , S by solving the LMIs Equation (22). In fact, the condition in Equation (21) or (22) provides a sufficient and necessary one for the existence of the observer Equation (18). In other words, if the condition Equation (21) or (22) is not satisfied, one has to change the structure of the observer or even to find another type of state estimation approach. The same case happens in other estimation methods such as Kalman filter, where one cannot always find the Kalman gain matrix.

Test Data and Parameter Settings
Beijing third ring freeway ( Figure 6) is approximately 48 km long and includes 62 on-ramps and 62 off-ramps. We apply the proposed model and state observer to the outer ring freeway. According to consistency rule of cells [21], the outer ring freeway can be partitioned into 128 cells. As shown in Section 3, if a centralized Equation (15) is used for the freeway with 128 cells, there exist 8.44342 × 10 48 combination modes, which results in high computational complexity. Therefore, in this paper, in order to clearly interpret the principle of the proposed method and avoid computational complexity, we take into account a simplified version of the outer ring freeway. For the practical application we will consider a decentralized model and a distributed observer in the future research. The simplified outer ring freeway (Figure 7) contains 20 cells, 4 on-ramps and 4 off-ramps. Each cell has three lanes and the length of the cells is listed in Table 2. The parameters of all cells are given in Table 3.
Moreover, since Modelica language [20,57] has the advantage of modeling hybrid systems, we choose the open source software OpenModelica to develop a program library to implement the traffic flow model and state estimation.   For the experimental data, we collected 6 h (from 6:00 a.m. to 12:00 a.m.) traffic flow data of 4 on-ramps, 4 off-ramps and traffic densities of 4 road segments of the outer ring freeway on 19 May 2015. Then we used a microscopic model of the outer ring freeway built by Paramics [58] to simulate the traffic flow from 6:00 a.m. to 12:00 a.m. and collect the densities (we call them the simulated densities) by virtual sensors in all the segments, where the real traffic flows of 4 on-ramps and 4 off-ramps were used as the traffic demand and to determine the dividing ratios. The real initial densities of the 4 road segments were used as the initial traffic state of all the cells. In simulation procedure, by setting the dividing ratio, and adjusting the whole microscopic simulator, the modes of traffic flow change in the following sequence order: 20F → 16F4C → 12F2C2F4C → 6F3C3F2C2F4C → 6F3C3F8C → 16C → 7F1C1F3C1F3C3F1C, where kF or kC denotes continuous k cells in mode F or C.
The corresponding matrices A s = [a i,j ] and vectors F s = [ f i ], s = 1, 2 · · · 20, are listed in Appendix B. For the outer ring freeway with 4 on-ramps the matrix B s = [b i,j ] is a constant matrix with the entries b 3,1 = 0.0149, b 8,2 = 0.0116, b 13,3 = 0.0109, b 18,4 = 0.0238, and b i,j = 0 for the other entries in B s . Here the sample time period T = 5s such that the condition V i T ≤ L i , i = 1, 2 · · · 20, is satisfied.
Nowadays various sensor technologies can be applied to collect traffic data, including floating vehicle, loop detector, microwave and video. Different source data can provide different measurement outputs and thus one gets different types of matrix C in the measurement output Equation (23). One can even utilize the fused data or multi-dimensional data of several types of sensors at the same time.

Analysis of Simulation Results
The simulation results for the whole simplified outer ring freeway are shown in Figure 8 in the way of time-space diagram, where Figure 8a shows the real traffic densities from 6:00 a.m. to 12:00 a.m., and Figure 8b presents the estimated densities by the observer. It is clear that some segments with red color represent a real congestion state. Especially, heavy traffic jams happen in the morning rush hour from about 7:00 a.m. to 10:00 a.m. and the congestion time periods are different for different road segments. Error curve(see Figure 9) shows that the error converges to zero at about 200 s, the speed is acceptable and the gain matrices are appropriate.  One can further compare estimated densities with the simulated ones in all road segments. For example, the cells 14 and 20 are presented to exhibit more in detail the the density comparison (see Figure 10). From Figures 8 and 10, it is clear that the proposed modeling approach and the observer are feasible, and the estimated densities well approximate to the simulated ones. Table 4 shows the performance indicator of the state observer by using the mean square error (MSE) which is defined by the Equation (23) From the MSE of each cell, we can further compute the mean value of 20 cells is approximately 11.34%. The results indicate that the designed model-based switched state observer has a good estimated performance.

Conclusions and Future Work
In the paper, a modeling framework named Dynamic Graph Hybrid Automata (DGHA) has been proposed by combining a dynamic graph with hybrid automata. Then this framework was applied to model traffic flow over an urban freeway network by embedding the Cell Transmission Model (CTM) into the DGHA.
In the modeling procedure, the dual digraph of road network structure was adopted to describe the road topology, hybrid automata were used to describe multi-modes of dynamic densities in road segments, and the nonlinear expressions of the transmitted traffic flow between two road segments were transformed into piecewise linear functions in terms of multi-mode switchings. By using a combination algorithm for the dynamics of traffic flow, the modeling procedure is modularized and rule-based, and thus is easily-extensible. Thus it can be used to model an urban freeway network with arbitrary topology structures and sizes. Furthermore, mode types and number in the model of the whole freeway network were analyzed, and, consequently, a Piecewise Affine Linear System (PWALS) model of urban freeway was deduced. Finally, based on the PWALS model, a switched state observer was designed to estimate the traffic densities of the urban freeway, where a set of observer gain matrices were computed by using the Lyapunov function approach. The proposed modeling approach and the observer were validated to be feasible by the simplified example of Beijing third ring freeway.
However, there are some drawbacks which require further improvements in the future research. First, we adopt centralized model and observer, which, as shown above, results in huge number of combined modes and computational difficulty. So from the view of practical application, decentralized model and decentralized observer are required to reduce computational complexity.
Second, the assumption that the switching function of the observer is the same with that of the model means that the switching of the observer is driven by the model states. However, in practice it may be difficult to implement and one needs to identify mode switchings by designing a discrete event observer, which will result in unsynchronized mode switchings between the practical object and the observer and thus bring about larger estimation error. So, in this case, another type of switched observer is required to be design for the state estimation.
Third, in the application example, we took the simplified version of Beijing third ring road, and used the incompletely collected traffic data and the simulation data obtained by Paramics. That means we need real experiments for the practical application to further verify our proposed approach.

Conflicts of Interest:
The authors declare no conflict if interest.