# Freeway Traffic Congestion Reduction and Environment Regulation via Model Predictive Control
## 3 Traffic Flow Models  
### METANET Model  
METANET is a widely used macroscopic second-order traffic flow model. It can simulate traffic behaviors at specific time and location of the highway with arbitrary topology and characteristics, including fundamental segments, on-ramp, and intersections [2]. Besides, it can replicate traffic waves at bottlenecks, as well as capacity degradation caused by congestions. It discretizes the traffic flow temporally and spatially. The time interval is \(T_{s}\). As shown in Figure 1, the highway \(m\) is spatially divided into \(N_{m}\) segments with equal length \(L_{m}\). Average density \(\rho_{m,i}(k)\), speed \(v_{m,i}(k)\) and flow \(q_{m,i}(k)\) are three basic traffic variables. \(k=0,1,\ldots,K\), where \(K\) is the timeline. METANET with VSL and RM can be expressed as follows:  
The average density is calculated as follows:  
\[\rho_{m,i}(k+1)=\rho_{m,i}(k)+\frac{T_{s}}{\lambda_{m}L_{m}}[q_{m,i-1}(k)-q_{m,i}(k)+q_{o}(k)], \tag{1}\]  
where \(\lambda_{m}\) is the number of lanes; \(\rho_{m,i}(k)\) is the density of segment \(i\) at \(kT_{s}\); and \(q_{o}(k)\) is the flow entered into mainline from on-ramps.  
The average speed is calculated as follows:  
\[\begin{array}{rcl}v_{m,i}(k+1)&=&v_{m,i}(k)+\frac{T_{s}}{\tau}\{V[\rho_{m,i} (k)]-v_{m,i}(k)\}+\frac{T_{s}}{L_{m}}v_{m,i}(k)[v_{m,i-1}(k)\\ &-&v_{m,i}(k)]-\frac{vT_{s}}{\tau L_{m}}\frac{\rho_{m,i}(k+1)-\rho_{m,i}(k)}{ \rho_{m,i}(k)+\kappa}-\frac{\delta T_{s}v_{m,i}(k)q_{o}(k)}{L_{m}\lambda_{m}[ \rho_{m,i}(k)+\kappa]}\end{array} \tag{2}\]  
where \(v\), \(\tau\), \(\delta\) and \(\kappa\) are parameters of the model. \(v_{m,i}(k)\) represents the speed of segment \(i\) at \(kT_{s}\). \(V[\rho_{m,i}(k)]\) is average desired speed. \(-\frac{\delta T_{s}v_{m,i}(k)q_{o}(k)}{L_{m}\lambda_{m}[\rho_{m,i}(k)+\kappa]}\) denotes the decreased of speed resulted by entered vehicles from on-ramps.  
The average flow is calculated as follows:  
\[q_{m,i}(k)=\lambda_{m}\rho_{m,i}(k)v_{m,i}(k). \tag{3}\]  
Figure 1: Discretized highway link.  
The average desired speed is calculated as follows:  
\[V[\rho_{m,i}(k)]=\min(v_{f,m}\exp[-\frac{1}{\alpha_{m}}(\frac{\rho_{m,i}(k)}{ \rho_{cr,m}})^{\alpha_{m}})],(1+a)v_{ctrl,i}), \tag{4}\]  
where \(\alpha_{m}\) is parameters of METANET; \(a\) is non-compliance rate; \(\rho_{cr,m}\) is critical density; \(v_{f,m}\) is free speed; and \(v_{ctrl,i}\) is the value of VSL executed on segment \(i\).  
Due to the effects of congestion, capacity of origins or traffic lights, if demands exceed the capacity of some segment received, queue will be formed, marked as \(w_{o}\). Take the on-ramp \(o\) located in segment \(i\) for example, the queue length of origins is calculated as follows:  
\[w_{o}(k+1)=w_{o}(k)+T_{s}\cdot[d_{o}(k)-q_{o}(k)] \tag{5}\]  
\[q_{o}(k)=r_{o}(k)\hat{q}_{o}(k) \tag{6}\]  
\[\hat{q}_{o}(k)=\min\{\hat{q}_{o,1}(k),\hat{q}_{o,2}(k)\} \tag{7}\]  
\[\hat{q}_{o,1}(k)=d_{o}(k)+w_{o}(k)/T_{s} \tag{8}\]  
\[\hat{q}_{o,2}(k)=Q_{o}\min\{1,\,\frac{\rho_{\max}-\rho_{m,i}(k)}{\rho_{\max}- \rho_{cr,m}}\}, \tag{9}\]  
where \(\rho_{\max}\) is the maximal density. The outflow \(q_{o}(k)\) depends on the enforced RM and traffic variables of segments in which on-ramps located. If \(r_{o}(k)\in[r_{\min},1]\), it denotes the RM rate. If there is RM, the flow \(r_{o}(k)\) ultimately left on-ramp \(q_{o}(k)\) in \([kT_{s},(k+1)T_{s}]\) is defined as a portion of maximum outflow \(\hat{q}_{o}(k)\) without RM. \(r_{o}(k)=1\) denotes RM is absent, otherwise \(r_{o}(k)<1\). If \(\hat{q}_{o,1}(k)<\hat{q}_{o,2}(k)\), \(\hat{q}_{o}(k)\) is determined by the demand \(d_{o}\) at \(kT_{s}\). Otherwise, it depends on capacity \(Q_{o}\) when the density of the mainline is under-critical, i.e., \(\rho_{m,1}(k)<\rho_{cr,m}\), or the reduced capacity result from congestion of the mainline, i.e., \(\rho_{m,1}(k)>\rho_{cr,m}\).