# Stochastic Model Predictive Control for Urban Traffic Networks
## 3 Stochastic MPC-Based Model
### MPC Framework  
As one of the most powerful control technologies, since it can efficiently solve control problems with complex constraints, model predictive control (MPC) has been widely used in industrial applications [35]. The main idea of MPC is to access an optimal sequence of future control actions by designing a suitable predictive model. At each control step, only the first element of the optimal sequence is implemented. The horizon is then rolled forward one step and the procedure is repeated with the updated information. Since it has the ability to deal with complex constraints and avoid myopic control schemes in large-scale control problems, various MPC approaches are proposed to coordinate and control the traffic signals for urban traffic network. Furthermore, uncertainties should be reasonably modeled and handled for traffic networks. It is significant to access the optimal signal timing plan of traffic networks. As a result, in the following, we focus on designing a stochastic MPC model to optimize the signal splits for urban traffic networks. Applying Label (7) to all links of an urban traffic network, we can derive the dynamic equation of the network as follows:  
\[\mathbf{x}(k+1)=\mathbf{x}(k)+\mathbf{Bu}(k)+\mathbf{Dd}(k)+\mathbf{e}(k), \tag{13}\]  
where \(\mathbf{x}(k)\), \(\mathbf{u}(k)\), \(\mathbf{d}(k)\) and \(\mathbf{e}(k)\) denote the state vector, control vector, demand vector and disturbance vector, respectively. \(\mathbf{B}\) is the control input matrix, which is used to denote some basic network characteristics (e.g., topology, saturation flows, fixed staging and turning rates), and \(\mathbf{D}\) is the demand matrix. Assume the length of the prediction horizon length of the control problem is \(P\). For notational simplicity, we define \(\xi_{i,z}=(\varepsilon_{1},\varepsilon_{2},...,\varepsilon_{P})\) whose element \(\varepsilon_{k}\) denotes the predicted traffic demand \(d_{i,z}(k_{0}+k|k_{0})\)\((k=1,2,...,P)\) corresponding to one link \(z\) of the network. As noted in [27], we can use the historical traffic information to estimate the mean value \(\mu_{k}\) and variance \(\sigma_{k}\) of \(\varepsilon_{k}\). Then, the mean vector \(\mu\) and the covariance matrix \(\Sigma\) of \(\xi_{i,z}\) can be computed and given in advance as follows:  
\[\mu=\ \ [\mu_{1},\mu_{2},...,\mu_{P}]^{T}, \tag{14}\]  
\[\Sigma=\left[ \begin{array}{cccc}\sigma_{1}^{2}&r_{1,2}\sigma_{1}\sigma_{2}&...&r_{1,P}\sigma_{1}\sigma_{P}\\ r_{1,2}\sigma_{1}\sigma_{2}&\sigma_{2}^{2}&...&r_{2,P}\sigma_{1}\sigma_{P}\\ \vdots&\vdots&\ddots&\\ r_{1,N}\sigma_{1}\sigma_{P}&r_{2,N}\sigma_{2}\sigma_{P}&...&\sigma_{P}^{2}\\ \end{array} \right], \tag{15}\]  
where \(r_{i,j}\) is the correlation coefficient between random variables \(\xi_{i}\) and \(\xi_{j}\). Then, the probability density function of the traffic demand of link \(z\) is  
\[\psi(\xi_{i,z})=\lambda\mathbf{e}^{-\frac{1}{2}(\xi_{i,z}-\mu)^{T}\Sigma^{-1}( \xi_{i,z}-\mu)}, \tag{16}\]  
where \(\lambda\) is a constant. Assume the current time index is \(k_{0}\). The length of the prediction horizon of the control problem is \(P\). Since there may exist uncertainty in the state variable ( \(x_{i,r}(k)\)), aiming to minimize the vehicle queue lengths and reduce the oscillation of control variable, we define the control cost function as an expected value model  
\[\min_{\mathbf{u}}\ E\big{[}f(\mathbf{x},\mathbf{u})\big{]}, \tag{17}\]  
\[f(\mathbf{x},\mathbf{u})=\sum_{k=1}^{P}\ \|\ \mathbf{x}(k_{0}+k|k_{0})\ \|_{Q}^{2}+\sum_{k=0}^{P-1}\ \|\ \mathbf{u}(k_{0}+k+1|k_{0})-\mathbf{u}(k_{0}+k|k_{0})\ \|_{R}^{2}, \tag{18}\]  
subject to Labels (10)-(16) and the cycle constraints \(C_{i}=L_{i}+\sum_{p\in\mathbb{N}_{i}}u_{i,p}\) which are defined in Section 2.1. \(Q\) and \(R\) are diagonal weighting matrices. The diagonal elements of \(Q\) are set equal to \(1/N_{i,r}\). Matrix \(R\) reflects the penalty imposed on control effort.