# Adaptive Cruise Control for Cut-In Scenarios Based on Model Predictive Control Algorithm
## 4 Host Vehicle Trajectory Tracking Control
### Problem Solving  
In order to determine the analytical solution of the problem, the MPC optimization problem needs to be transformed into a constrained quadratic program [29], as shown in the following formula:  
\[\min_{U(k+m)}\left\{\mathbf{U}(k+m)^{T}\mathbf{K}_{1}\mathbf{U}(k+m)+2\mathbf{K}_{2}\mathbf{U}(k+m)\right\} \tag{62}\]  
subject to:  
\[\mathbf{\Omega}\mathbf{U}(k+m)\geq\mathbf{T} \tag{63}\]  
where \(\mathbf{K}_{1}\), \(\mathbf{K}_{2}\), \(\mathbf{\Omega}\), and \(\mathbf{T}\) are coefficient matrices. According to the principle of the MPC [30], the future behavior of the system is predicted according to the prediction model at each moment of system sampling, and the performance indicators of system in the future moment are optimized. The control sequence is obtained by solving the corresponding optimization problem and the first control quantity is applied to the system; then the prediction time domain is aligned one step forward. Finally, the process is repeated continuously. Therefore, according to the inter-vehicle longitudinal kinematics established in Section 4.1, the future behavior of the ACC system is predicted, as shown in the following equation:  
\[\overset{\wedge}{\mathbf{X}}(k+p|k)=\overset{-}{\mathbf{A}}x(k)+\overset{-}{\mathbf{B}} \mathbf{U}(k+m)+\overset{-}{\mathbf{G}}\mathbf{W}(k+p) \tag{64}\]  
\[\overset{\wedge}{\mathbf{Y}}(k+p|k)=\overset{-}{\mathbf{C}}x(k)+\overset{-}{\mathbf{D}} \mathbf{U}(k+m)+\overset{-}{\mathbf{E}}\mathbf{W}(k+p)+\overset{-}{\mathbf{Z}} \tag{65}\]  
where,  
\[\overset{\wedge}{\mathbf{X}}(k+p|k)=\left[ \begin{array}{c}\overset{\wedge}{x}(k +1|k)\\ \overset{\wedge}{x}(k+2|k)\\ \vdots\\ \overset{\wedge}{x}(k+p|k)\end{array} \right],\ \overset{\wedge}{\mathbf{Y}}(k+p|k)=\left[ \begin{array}{c}\overset{\wedge}{y}_{c}(k+1|k)-y_{ref}^{\wedge}(k+1|k)\\ \overset{\wedge}{y}_{c}(k+2|k)-y_{ref}^{\wedge}(k+1|k)\\ \vdots\\ \overset{\wedge}{y}_{c}(k+p|k)-y_{ref}^{\wedge}(k+1|k)\end{array} \right]\]  
\[\mathbf{U}(k+m)=\left[ \begin{array}{c}u(k)\\ u(k+1)\\ \vdots\\ u(k+m-1)\end{array} \right],\ \mathbf{W}(k+p)=\left[ \begin{array}{c}w(k)\\ w(k+1)\\ \vdots\\ w(k+p-1)\end{array} \right]\]  
where \(\overset{\wedge}{x}(k+1|k)\) is the system state prediction of time \(k+1\) at \(k\) time; similarly, \(\overset{\wedge}{y}_{c}(k+1|k)\) is the prediction of the system output. The control sequence \(u(k)\), \(u(k+1)\), \(\ldots\), \(u(k+m-1)\) is the control variable to be solved. \(w(k)=w(k+1)=\ldots=w(k+p-1)\) is the disturbance in the system; that is, the acceleration of the preceding vehicle, which is a constant value in the entire prediction time horizon. The prediction matrices in Equations (64) and (65) are:  
\[\overset{-}{\mathbf{A}}=\left[ \begin{array}{c}\mathbf{A}\\ \mathbf{A}^{2}\\ \vdots\\ \mathbf{A}^{p-1}\end{array} \right],\overset{-}{\mathbf{B}}=\left[ \begin{array}{ cccc}\mathbf{B}&0&\cdots&0\\ \mathbf{AB}&\mathbf{B}&\cdots&\vdots\\ \cdots&\cdots&\vdots&0\\ A^{p-1}\mathbf{B}&A^{p-2}\mathbf{B}&\cdots&\sum\limits_{i=0}^{p-m}A^{i}\mathbf{B}\end{array}  \right],\]  
where,  
\[\overline{C}_{b}=\left[ \begin{array}{ccc}\mathbf{C}_{b}&&&\\ &\mathbf{C}_{b}&&\\ &&\ddots&\\ &&&\mathbf{C}_{b}\end{array} \right]\]  
\[\mathbf{Y}_{\text{min}}=\left[ \begin{array}{c}\mathbf{y}_{\text{min}}\\ \mathbf{y}_{\text{min}}\\ \vdots\\ \mathbf{y}_{\text{min}}\end{array} \right]\mathbf{Y}_{\text{lmax}}=\left[ \begin{array}[ ]{c}\mathbf{y}_{\text{lmax}}\\ \mathbf{y}_{\text{max}}\\ \vdots\\ \mathbf{y}_{\text{max}}\end{array} \right]\]  
\[\mathbf{y}_{\text{min}}=\left[ \begin{array}{c}d_{c}\\ v_{Hinit}\\ a_{Hinit}\\ Jerk_{min}\end{array} \right]\mathbf{y}_{\text{max}}=\left[ \begin{array}{c}Inf \\ v_{Hmax}\\ a_{Hmax}\\ Jerk_{max}\end{array} \right]\]  
where \(Inf\) represents infinity. \[\left[ \begin{array}{c}-\mathbf{I}\\ \mathbf{I}\end{array} \right]\mathbf{U}(k+m)\geq\left[ \begin{array}{c}-\mathbf{U}_{\text {max}}\\ \mathbf{U}_{\text{min}}\end{array} \right] \tag{69}\]  
where,  
\[\mathbf{\Omega}=\left[