## 3 MPC Controller Design and Longitudinal Speed Compensation
### Longitudinal Speed Compensation  
#### 3.4.1 Influence on Prediction Error  
In order to guarantee that the optimization problem is a convex problem, existing research has assumed that the longitudinal speed is not a variable in prediction horizon of the MPC controller. The prediction equation of vehicle states in the prediction horizon can be expressed as:  
\[\left\{ \begin{array}{l}\overline{\mathbf{X}}=\overline{\mathbf{\Psi}}_{ \text{t}}\mathbf{x}(t)+\overline{\mathbf{H}}_{\text{t}}\overline{\mathbf{U}}+ \overline{\Omega}_{\text{t}}\mathbf{K}+\overline{\Theta}_{\text{t}}\overline{ \mathbf{D}}\\ \overline{\mathbf{Y}}=\mathbf{C}\overline{\mathbf{X}}+\mathbf{f}\end{array} \right. \tag{17}\]  
\[\overline{\mathbf{X}}=\left[ \begin{array}{c}\mathbf{x}_{\text{t}}^{1}\\ \mathbf{x}_{\text{t}}^{2}\\ \vdots\\ \mathbf{x}_{\text{t}}^{\text{Nc}}\\ \vdots\\ \mathbf{x}_{\text{t}}^{\text{Np}}\end{array} \right]\overline{\mathbf{U}}= \left[ \begin{array}{c}u_{\text{t}}^{1}\\ u_{\text{t}}^{2}\\ \vdots\\ u_{\text{t}}^{\text{Nc}}\\ \vdots\\ u_{\text{t}}^{\text{Nc}}\end{array} \right]\mathbf{K}=\left[ \begin{array}{ c}k_{\text{t}}^{1}(\text{s})\\ k_{\text{t}}^{2}(\text{s})\\ \vdots\\ k_{\text{t}}^{\text{Nc}}(\text{s})\\ \vdots\\ k_{\text{t}}^{\text{Np}}(\text{s})\end{array} \right]\mathbf{\overline{D}}= \left[ \begin{array}{c}\mathbf{d}_{\text{c}}\\ \mathbf{d}_{\text{c}}\\ \vdots\\ \mathbf{d}_{\text{c}}\\ \vdots\\ \mathbf{d}_{\text{c}}\end{array} \right]\mathbf{\overline{\Psi}}_{\text{t}}= \left[ \begin{array}{c}\mathbf{A}_{\text{c}}\\ \mathbf{A}_{\text{c}}^{2}\\ \vdots\\ \mathbf{A}_{\text{c}}^{\text{Nc}}\\ \vdots\\ \mathbf{A}_{\text{c}}^{\text{Np}}\end{array} \right]\]  
\[\overline{\mathbf{H}}_{\text{t}}=\left[ \begin{array}{ccccc}\mathbf{B}_{ \text{c}}&0&\cdots&0&0\\ \mathbf{A}_{\text{c}}\mathbf{B}_{\text{c}}&\mathbf{B}_{\text{c}}&0&\cdots&0&0 \\ \vdots&\cdots&\cdots&0&0&0\\ \mathbf{A}_{\text{c}}^{\text{Nc}-1}\mathbf{B}_{\text{c}}&\cdots&\mathbf{B}_{ \text{c}}&0&\cdots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\ \mathbf{A}_{\text{c}}^{\text{Np}-1}\mathbf{B}_{\text{c}}&\cdots&\mathbf{A}_{ \text{c}}^{\text{Np}-\text{k}-1}\mathbf{B}_{\text{c}}&\cdots&\mathbf{A}_{ \text{c}}\mathbf{B}_{\text{c}}&\mathbf{B}_{\text{c}}\end{array} \right]\]  
\[\overline{\mathbf{\Omega}}_{\text{t}}=\left[ \begin{array}{ccccc}\mathbf{E}_{ \text{c}}&0&\cdots&0&0\\ \mathbf{A}_{\text{c}}\mathbf{E}_{\text{c}}&\mathbf{E}_{\text{c}}&0&\cdots&0&0 \\ \vdots&\cdots&\cdots&0&0&0\\ \mathbf{A}_{\text{c}}^{\text{Nc}-1}\mathbf{E}_{\text{c}}&\cdots&\mathbf{E}_{ \text{c}}&0&\cdots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\ \mathbf{A}_{\text{c}}^{\text{Np}-1}\mathbf{E}_{\text{c}}&\cdots&\mathbf{A}_{ \text{c}}^{\text{Np}-\text{k}-1}\mathbf{E}_{\text{c}}&\cdots&\mathbf{A}_{ \text{c}}\mathbf{E}_{\text{c}}&\mathbf{E}_{\text{c}}\end{array} \right]\]  
\[\overline{\Theta}_{\text{t}}=\left[ \begin{array}{ccccc}1&0&\cdots&0&0&0\\ \mathbf{A}_{\text{c}}&1&0&\cdots&0&0\\ \vdots&\cdots&\cdots&0&0&0\\ \mathbf{A}_{\text{c}}^{\text{Nc}-1}&\cdots&\mathbf{A}_{\text{c}}&1&\cdots&0 \\ \vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\ \mathbf{A}_{\text{c}}^{\text{Np}-1}&\cdots&\mathbf{A}_{\text{c}}^{\text{Np}- \text{k}-1}&\cdots&\mathbf{A}_{\text{c}}&1\end{array} \right]\]  
The optimal sequence of future input can be solved using Equations (12)-(16) and expressed as:  
\[\Delta\overline{\mathbf{u}}^{*}=\left[\Delta\overline{F}_{1},\Delta\overline{ F}_{2},\cdots,\Delta\overline{F}_{\text{Nc}-k},\cdots,\Delta\overline{F}_{\text{Nc}} \right]^{T} \tag{18}\]However, the longitudinal speed is a variable in the prediction horizon.