# Hybrid Model-Based Traffic Network Control Using Population Games
## 3 Mathematical Description of a Urban Traffic Network
### Continuous Modeling of a Urban Traffic Network  
The vehicular storing change in a link \(i\in\mathcal{E}\) can be modeled as a mass balance, given by  
\[w_{i}l_{i}=c_{i}+q_{i}-h_{i},\text{ with }\mathcal{I}_{p}\
eq\{\phi\}, \tag{5}\]  
where \(h_{i}\) and \(l_{i}\) represent the queue output flow and queue length changes, respectively. The input flow change \(q_{i}\) is given by  
\[q_{i}=\sum\limits_{j\in\mathcal{I}_{p}}\tau_{(j,i)}h_{j}, \tag{6}\]  
with \(\tau_{(j,i)}\) being the turn rate from the input link \(j\in\mathcal{I}_{p}\) to node \(p\in\mathcal{V}\) direct towards the output link \(i\in\mathcal{O}_{p}\). Using (6) and (5), we have  
\[w_{i}l_{i}=c_{i}+\sum\limits_{j\in\mathcal{I}_{p}}\tau_{(j,i)}h_{j}-h_{i}. \tag{7}\]  
The output traffic flow change of link \(i\) is modeled as  
\[\begin{array}{rclrcl}\dot{h}_{i}&=&o_{i}-h_{i}&if&s_{i}&=&1,\\ h_{i}&=&0&if&s_{i}&=&0,\end{array} \tag{8}\]  
i.e., the traffic flow change is given by the difference between the output vehicular flow capacity for link i while the traffic light is green (saturation flow \(o_{i}\)), and the queue output flow change is \(h_{i}\).  
Additionally, the green time variation \(\dot{g}_{i}\) is expressed as  
\[\begin{array}{rclrcl}\dot{g}_{i}&=&1&if&s_{i}&=&1,\\ g_{i}&=&0&if&s_{i}&=&0,\end{array} \tag{9}\]  
which is constant when the traffic light state \(s_{i}\) is equal to \(1\) (green time), since the green time \(g_{i}\) increases linearly from its minimum value \(\underline{g}_{i}\) to its maximum value \(\overline{g}_{i}\). The second term in (9) indicates that there is no green time variation if the traffic light state \(s_{i}\) is equal to \(0\) (yellow or red).  
Finally, considering (7)-(9) and a \(n=|\mathcal{E}|\) link network, we can represent the system as the differential-algebraic system of equations (DAE) \(E_{\sigma}\xi=A_{\sigma}\xi+B_{\sigma}\), with the discontinuous coefficients matrix form  
\[\left[\begin{array}{ccc}E_{\Omega}&0&0\\ 0&\mathbf{s}_{\sigma}&0\\ 0&0&\mathbf{s}_{\sigma}\end{array}\right]\left[\begin{array}{c}\dot{\mathbf{x }}\\ \dot{\mathbf{h}}\\ \dot{\mathbf{g}}\end{array}\right]= \tag{10}\] \[\left[\begin{array}{ccc}0&A_{\tau}&0\\ 0&\mathbf{\hat{s}}_{\sigma}&0\\ 0&0&\mathbf{\hat{s}}_{\sigma}\end{array}\right]\left[\begin{array}{c}\mathbf{ x}\\ \mathbf{h}\\ \mathbf{g}\end{array}\right]+\left[\begin{array}{c}\mathbf{c}\\ \mathbf{s}_{\sigma}\mathbf{o}\\ \mathbf{s}_{\sigma}^{T}\end{array}\right]^{\prime}\]  
where \(\mathbf{s}_{\sigma}=\left[s_{1}^{*},\ldots,s_{n}^{*}\right]\) is the network configuration in a given mode \(\sigma\). \(E_{\Omega}\in\mathbb{R}^{n\times n}\) is a diagonal matrix whose elements are the \(E_{\Omega}^{i}=w_{i}\in\Omega\). \(\mathbf{\hat{s}}_{i}^{*}=1-s_{i}^{*}\), and \(\mathbf{\hat{s}}_{\sigma}=diag\big{(}\big{[}\mathbf{\hat{s}}_{1}^{*},\ldots, \mathbf{\hat{s}}_{n}^{*}\big{]}\big{)}\). \(\mathbf{\hat{s}}_{i}^{*}=-2s_{i}^{*}+1\), and \(\mathbf{\hat{s}}_{\sigma}^{*}=diag\big{(}\big{[}\mathbf{\hat{s}}_{1}^{*}, \ldots,\mathbf{\hat{s}}_{n}^{*}\big{]}\big{)}\). The matrix \(A_{\tau}\in\mathbb{R}^{n\times n}\) is built by the proper selection of the turn rates.  
Rewriting (10) as an _homogeneous system_, we have  
\[E_{\sigma}\xi=A_{\sigma}\xi, \tag{11}\]  
whose matrix form is  
\[\left[\begin{array}{ccccc}E_{\Omega}&0&0&0&0\\ 0&\mathbf{s}_{\sigma}&0&0&0\\ 0&0&\mathbf{s}_{\sigma}&0&0&0\\ 0&0&0&\mathbf{I}_{n}&0&0\\ 0&0&0&0&\mathbf{I}_{n}&0\\ 0&0&0&0&0&\mathbf{I}_{n}\end{array}\right]\left[\begin{array}{c}\dot{ \mathbf{1}}\\ \dot{\mathbf{h}}\\ \dot{\mathbf{g}}\\ \dot{\mathbf{s}}\\ \dot{\mathbf{c}}\\ \dot{\mathbf{o}}\end{array}\right]=\left[\begin{array}{ccccc}0&A_{\tau}&0 &0&\mathbf{I}_{n}&0\\ 0&\mathbf{\hat{s}}_{\sigma}&0&0&0&\mathbf{s}_{\sigma}\mathbf{I}_{n}\\ 0&0&\mathbf{\hat{s}}_{\sigma}&\mathbf{I}_{n}&0&0\\ 0&0&0&0&0&0\\ 0&0&0&0&0&0\end{array}\right]\left[\begin{array}{c}\dot{\mathbf{1}}\\ \dot{\mathbf{h}}\\ \dot{\mathbf{g}}\\ \mathbf{s}\\ \mathbf{c}\\ \mathbf{o}\end{array}\right].\]