## 3 Methods
### System Architecture and Related Models
#### 3.1.4 State-Compensation Flow Model  
In this section, the state-compensation model is shown, which can be used in the controller in the next step. Therefore, the state-compensation model with discrete space and time is derived based on the above model. The macro density and speed, which can be calculated from the vehicle's state on the different segments with discrete space and time, can be represented in detail as follows:  
\[\delta k_{i}(t+1)=\delta k_{i}(t)+\frac{T}{L_{i}}[q_{i-1}(t)-q_{i}(t)] \tag{15}\]  
\[\begin{split}\delta v_{i}(t+1)=&\delta v_{i}(t)+ \frac{1}{\tau}\{\Gamma\delta k_{i}(t)-\delta v_{i}(t)\}\\ &+\frac{T}{L_{i}}\frac{\Delta_{1}\Delta_{2}}{\delta k_{i}(t)+k_{ i}^{d}+\xi}(\sqrt{\Delta_{2}\Delta_{3}}-\Delta_{1}\Delta_{3})-\frac{\mu(t) \cdot T}{\tau\cdot L_{i}}\cdot\frac{\delta k_{i+1}(t)-\delta k_{i}(t)}{\delta k _{i}(t)+k_{0}+\xi}\\ &\Delta_{1}=\delta k_{i-1}(t)+k_{\text{seg},i-1}^{d}\end{split} \tag{16}\]  
\[\Delta_{2}=\delta v_{i-1}(t)+V_{an}(k_{i-1}^{d}) \tag{17}\]  
\[\Delta_{3}=\delta v_{i}(t)+V_{an}(k_{i}^{d}) \tag{18}\]  
\[\Gamma=\frac{dV_{an}[k_{i}(n)]}{dk_{i}(n)}\mid k_{i}^{d}=V_{an}\,^{\prime}[k_ {i}^{d}] \tag{19}\]  
The state-compensation of the density and speed of each segment can be expressed as follows:  
\[\delta k_{i}(t)=k_{i}(t)-k_{i}^{d}(t) \tag{20}\]\[\delta v_{i}(t)=v_{i}(t)-v_{i}^{d}(t) \tag{22}\]  
where \(v_{i}^{d}(t)\) presents the desired speed of \(i^{th}\) road segment at time \(t\). \(k_{i}^{d}(t)\) represents the desired density of the \(i^{th}\) segment. \(v_{i}(t)\) represents the online speed of the \(i^{th}\) road segment in the traffic network. \(k_{i}(t)\) represents the online density of the \(i^{th}\) segment in the road network. And the state-compensation model is represented as follows:  
\[\left[\begin{array}{c}\delta k_{i}(t+1)\\ \delta v_{i}(t+1)\end{array}\right]=\left[\begin{array}{cc}1&0\\ \frac{\Gamma\Gamma}{\tau}&1-\frac{\Gamma}{\tau}\end{array}\right]\left[ \begin{array}{c}\delta k_{i}(t)\\ \delta v_{i}(t)\end{array}\right]+\left[\begin{array}{cc}1&0\\ 0&1\end{array}\right]\left[\begin{array}{c}\mathcal{K}_{i}(t)\\ \mathcal{V}_{i}(t)\end{array}\right] \tag{23}\]  
where  
\[\mathcal{K}_{i}(t)=\frac{T}{L_{i}}[q_{i-1}(t)-q_{i}(t)]+\dot{\theta}_{i}(t) \tag{24}\]  
\[\mathcal{V}_{i}(t)= \tag{25}\]  
Therefore, the controller can be designed based on the state-compensation model to improve traffic performance under uncertainty. That is to say, the vehicle speeds in different segments are controlled to address the bottleneck problem. The variables \(\mathcal{K}_{i}(t)\),\(\mathcal{V}_{i}(t)\) are used as control inputs. \(\mathcal{K}_{i}(t)\) is used to verify whether the controller's output speed for the road segment is reasonable. The speed of the \(i^{th}\) road segment is greater than the \((i-1)^{th}\) road segment at time \(t+1\) when \(\dot{\theta}_{i}(t)\) is greater than 0. The speed of the \(i^{th}\) road segment is less than or equal to the \((i-1)^{th}\) road segment at time \(t+1\) when \(\dot{\theta}_{i}(t)\) is less than or equal to 0. If the value is not reasonable, the calculation result of this time is abandoned. The value in the second position of the set calculated will be checked and then used, and so on. \(\mathcal{V}_{i}(t)\) means that the controller applies the result to the vehicle located in the \(i^{th}\) road segment at time \(t\). Control information can be applied to the vehicle in the actual operation by the embedded vehicle intelligence receiving terminal.