## 3 Fast-MPC Algorithm Establishment
### QP Solver  
For tackling the constrained optimization conundrum posed by the nominal predictive controller at each time instance, we introduce the vector \(U(k)\in\mathbb{R}^{n_{n}N_{c}}\) and determine the optimal control sequence through the utilization of a QP solver. This entails a particular manipulation of the objective function presented in Equation (12). \[J(k)=\min_{U(k)}\left\|X_{o}(k)-X_{ref}(k)\right\|_{Q}^{2}+\left\|U(k)\right\| _{R}^{2}+\kappa\varepsilon(k)^{2} \tag{14}\]where  
\[X_{o}(k)=\bar{A}x(k)+\bar{B}U(k)+\bar{N}\bar{\zeta}(k) \tag{15}\]  
\[X_{ref}=\left[x_{ref}(k+1),x_{ref}(k+2),\ldots,x_{ref}\big{(}k+N_{p}\big{)} \right]^{T} \tag{16}\]  
with  
\[\bar{A}=\left[ \begin{array}{ccccc}A_{d}^{\ \ \ T}&A_{d}^{\ \ \ T}&\cdots&A_{d}^{N_{c} \ \ T}&\cdots&A_{d}^{N_{p}\ \ T}\end{array} \right]^{T}\]  
\[\bar{B}=\left[ \begin{array}{ccccc}B_{d}&\mathbf{0}_{6\times 1}&\mathbf{0}_{6 \times 1}&\cdots&\mathbf{0}_{6\times 1}\\ A_{d}B_{d}&B_{d}&\mathbf{0}_{6\times 1}&\cdots&\mathbf{0}_{6\times 1}\\ \vdots&\vdots&\ddots&\cdots&\vdots\\ A_{d}^{N_{c}-1}B_{d}&A_{d}^{N_{c}-2}B_{d}&\ddots&\cdots&B_{d}\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ A_{d}^{N_{p}-1}B_{d}&A_{d}^{N_{c}-2}B_{d}&\cdots&\cdots&A_{d}^{N_{p}-N_{c}}B_{ d}\end{array} \right]\]  
\[\bar{N}=\left[ \begin{array}{ccccc}N_{d}&\mathbf{0}_{6\times 3}&\mathbf{0}_{6 \times 3}&\ldots&\mathbf{0}_{6\times 3}\\ A_{d}N_{d}&N_{d}&\mathbf{0}_{6\times 3}&\ldots&\mathbf{0}_{6\times 3}\\ \vdots&\vdots&\ddots&\ldots&\vdots\\ A_{d}^{N_{p}-1}N_{d}&A_{d}^{N_{p}-2}N_{d}&\ddots&\ldots&N_{d}\\ \vdots&\vdots&\ddots&\ldots&\vdots\\ A_{d}^{N_{p}-1}N_{d}&A_{d}^{N_{p}-2}N_{d}&\ldots&\ldots&A_{d}^{N_{p}-N_{c}}N_{ d}\end{array} \right]\]  
\[\bar{\zeta}(k)=\left[\zeta(k)^{T},\zeta(k+1)^{T},\cdots,\zeta(k+N_{c})^{T} \right]^{T}\]  
By removing some constant terms, the objective function (14) can be transformed into the following form:  
\[J(k)=\frac{1}{2}\bigg{[} \begin{array}{c}U(k)\\ \varepsilon(k)\end{array} \bigg{]}^{T}H\bigg{[} \begin{array}{c}U(k)\\ \varepsilon(k)\end{array} \bigg{]}+\bigg{[} \begin{array}{c}U(k)\\ \varepsilon(k)\end{array} \bigg{]}^{T}F\bar{\varepsilon}(k) \tag{17}\]  
where  
\[\bar{\varepsilon}(k)=\bar{A}x(k)+\bar{N}\bar{\zeta}(k)-X_{ref}(k)\]  
\[H=\left[ \begin{array}{cc}2\big{(}\bar{B}^{T}\bar{Q}\bar{B}+R\big{)}&\mathbf{ 0}_{n_{k}N_{c}\times 1}\\ \mathbf{0}_{1\times n_{k}N_{c}}&2\kappa\end{array} \right]\]  
\[F=\left[ \begin{array}{c}\bar{B}^{T}\bar{Q}\\ 0\end{array} \right]\]  
\[\bar{Q}=\text{diag}\{Q,\ldots,Q\}\]  
\[\bar{R}=\text{diag}\{R,\ldots,R\}\]  
We express the constraint form of the optimization problem (17) as  
\[\bar{A}\bar{x}(k)+\bar{B}U(k)\leq X^{ul} \tag{18}\]  
where  
\[\bar{A}=\left[ \begin{array}{c}\bar{C}_{A}\\ -\bar{C}_{A}\end{array} \right],\quad\bar{B}=\left[ \begin{array}{c}\bar{C}_{ B}\bar{B}\\ -\bar{C}_{B}\bar{B}\end{array} \right],\quad X^{ul}=\left[ \begin{array}{c}X^{u} \\ -X^{l}\end{array} \right]\]\[\bar{C}_{A}=\mathbf{I}_{N_{P}}\otimes\left[ \begin{array}{cccccc}1&0&0&0&0&0\\ 0&0&0&\frac{1}{\bar{v}_{x}}&0&0\\ 0&0&0&0&0&1\\ 0&0&0&0&0&0\end{array} \right]\]  
\[\bar{C}_{B}=\mathbf{I}_{N_{P}}\otimes\left[ \begin{array}{cccccc}1&0&0&0&0&0\\ 0&0&0&\frac{1}{\bar{v}_{x}}&0&0\\ 0&0&0&0&0&1\\ 0&\frac{I_{0}}{N_{m}N_{l}}&0&0&0&0\end{array} \right]\]  
\[\bar{X}^{u}=\left[ \begin{array}{cccccc}\delta_{\max}&\beta_{\max}&\phi_{\max }&\tau_{n\max}\end{array} \right]\]  
\[\bar{X}^{l}=\left[ \begin{array}{cccccc}\delta_{\min}&\beta_{\min}&\phi_{ \min}&\tau_{n\min}\end{array} \right]\]  
\[X^{u}=\left[ \begin{array}{cccccc}\bar{X}^{u},&\bar{X}^{u},&\ldots&\bar{X}^{ u}\end{array} \right]^{T}\]  
\[X^{l}=\left[ \begin{array}{cccccc}\bar{X}^{l},&\bar{X}^{l},&\ldots&\bar{X}^{ l}\end{array} \right]^{T}\]  
The vectors \(X^{l}\) and \(X^{u}\) contain the minimum and maximum values of the state quantity and control quantity constraints, respectively. The Kronecker product is denoted by the symbol \(\otimes\).