# Stochastic Model Predictive Control for Urban Traffic Networks
## 2 Modeling of Traffic Dynamics
### Traffic Dynamics  
To optimize traffic signal splits, [PERSON] and [PERSON] proposed a Store-and-forward (SF) method [10] in 1963. In the SF method, they designed a simplified linear model to describe traffic dynamics in UTN. Since the linear model allows the use of high efficient control and optimization technology for signal coordination in large-scale networks, the SF method has been widely used for modeling and optimization of traffic signal splits in road networks [11; 12; 13; 14; 15; 16; 19; 20]. Therefore, in this paper, we use an improved SF method [20; 22] to model the traffic dynamics. The technique defines a simple vehicle-conservation equation between two signalized intersections.  
Assume that the link \(r\) (as shown in Figure 1a) connects intersection \(i\) to intersection \(j\). The traffic dynamics on \(r\) can be defined by the following equation:  
\[x_{i,r}(k+1)=x_{i,r}(k)+T\cdot\left(q_{i,r}^{in}(k)-q_{i,r}^{out}(k)\right)+e_ {i,r}(k), \tag{1}\]  
where \(q_{i,r}^{in}(k)\) (\(q_{i,r}^{out}(k)\)) and \(e_{i,r}(k)\) are the inflow (outflow) and the disturbances (e.g., unexpected traffic fluctuations caused by accidents or parking garage) of link \(r\), respectively. In fact, Equation (1) describes the \"vehicle-conservation\" on the link \(r\). It should be noted that [PERSON] [32] has cleverly used the \"Kirchhoff Current Law\" to define the \"vehicle-conservation\" of an intersection.  
Figure 1: Traffic dynamics on a link. (**a**) dynamics on a non-input link; (**b**) dynamics on an input link.  
In addition, the inflow \(q_{i,r}^{in}(k)\) and outflow \(q_{i,r}^{out}(k)\) are calculated by assuming the offset between intersection \(i\) and intersection \(j\) is equal to zero. They are given by the following two equations:  
\[q_{i,r}^{in}(k)=\sum_{w\in L_{i,r}^{in}}\tau_{j,w;j,r}\cdot q_{j,w}^{out}(k), \tag{2}\]  
\[q_{i,r}^{out}(k)=\frac{S_{i,r}}{C}\cdot\sum_{p\in v_{i,r}}u_{i,p}(k), \tag{3}\]  
where \(L_{i,r}^{in}\) denotes the incoming links of the link \(r\). \(v_{i,r}\) is the set of phases that provides the right of way to the link \(r\) of intersection \(i\).  
Then, by plugging Equations (2) and (3) into Equation (1), the following state equation can be obtained:  
\[x_{i,r}(k+1)=x_{i,r}(k)+T\cdot\Big{(}\sum_{w\in L_{i,r}^{in}}\tau_{j,w;j,r} \cdot q_{j,w}^{out}(k)-\frac{S_{i,r}}{C}\cdot\sum_{p\in v_{i,r}}u_{i,p}(k) \Big{)}+e_{i,r}(k). \tag{4}\]  
Furthermore, it should be noted that when the link \(r\) is one of the incoming links of the UTN (shown in Figure 1b), the inflow \(q_{i,r}^{in}(k)\) should be calculated by the following equation:  
\[q_{i,r}^{in}(k)=d_{i,r}(k), \tag{5}\]  
where \(d_{i,r}(k)\) is the traffic demand (vehicles which enter the network through the link \(r\) of intersection \(i\)). Meanwhile, the Equation (4) should be rewritten as  
\[x_{i,r}(k+1)=x_{i,r}(k)+T\cdot\Big{(}d_{i,r}(k)-\frac{S_{i,r}}{C}\cdot\sum_{p \in v_{i,r}}u_{i,p}(k)\Big{)}+e_{i,r}(k). \tag{6}\]  
For simplicity of notation, we merge Equations (4) and (6). Then, a general description of the dynamics on the link \(r\) can be defined as  
\[x_{i,r}(k+1)=x_{i,r}(k)+T\cdot\Big{(}\sum_{w\in L_{i,r}^{in}}q_{j,w}^{out}(k) +d_{i,r}(k)-\frac{S_{i,r}}{C}\cdot\sum_{p\in v_{i,r}}u_{i,p}(k)\Big{)}+e_{i,r} (k). \tag{7}\]