# Design of a Morphing Aircraft Based on Model Predictive Control
## 3 Controller Design
### Model Predictive Controller Design
\begin{split}&\left[\begin{array}{c}\mathbf{\mathcal{M}}_{[k]}\\ \mathbf{0}\\ \vdots\\ \mathbf{0}\end{array}\right]\mathbf{x}_{[k|k]}+\left[\begin{array}{cccc}\mathbf{0}& \cdots&\cdots&\mathbf{0}\\ \mathbf{\mathcal{M}}_{[k+1]}&\mathbf{0}&\cdots&\vdots\\ \mathbf{0}&\mathbf{\mathcal{M}}_{[k+2]}&\mathbf{0}&\vdots\\ \vdots&\mathbf{0}&\ddots&\mathbf{0}\\ \mathbf{0}&\cdots&\mathbf{0}&\mathbf{\mathcal{M}}_{N_{p}}\end{array}\right]\cdot\left[ \begin{array}{c}\mathbf{x}_{[k+1|k]}\\ \mathbf{x}_{[k+2|k]}\\ \vdots\\ \mathbf{x}_{[k+N_{p}|k]}\end{array}\right]\\ &+\left[\begin{array}{cccc}\mathbf{\mathcal{F}}_{[k]}&\mathbf{0}&\cdots&\mathbf{0}\\ \mathbf{0}&\mathbf{\mathcal{F}}_{[k+1]}&\mathbf{0}&\cdots&\vdots\\ \vdots&\mathbf{0}&\ddots&\mathbf{0}\\ \vdots&\cdots&\mathbf{0}&\mathbf{\mathcal{F}}_{[k+N_{p}-1]}\end{array}\right]\cdot \left[\begin{array}{c}\mathbf{u}_{[k|k]}\\ \mathbf{u}_{[k+1|k]}\\ \vdots\\ \mathbf{u}_{[k+N_{p}-1|k]}\end{array}\right]\leq\left[\begin{array}{c}\mathbf{\beta }_{[k]}\\ \mathbf{\beta}_{[k+1]}\\ \vdots\\ \mathbf{\beta}_{N_{p}}\end{array}\right]\end{split}  \tag{30}\]  
where in Formulas (27) and (28),  
\[\begin{split}&\mathbf{X}_{[k]}\triangleq\left[\mathbf{x}_{[k+1|k]}\quad \mathbf{x}_{[k+2|k]}\quad\cdots\quad\mathbf{x}_{[k+N_{p}|k]}\right]_{(nN_{p})\times 1} ^{T}\\ &\mathbf{U}_{[k]}\triangleq\left[\mathbf{u}_{[k|k]}\quad\mathbf{u}_{[k+1|k]}\quad \cdots\quad\mathbf{u}_{[k+N_{p}-1|k]}\right]_{(pN_{p})\times 1}^{T}\\ &\bar{\mathbf{\mathcal{M}}}\triangleq\left[\mathbf{\mathcal{M}}_{[k]_{m \times n}}\quad\mathbf{0}_{m\times n}\quad\cdots\quad\mathbf{0}_{1\times n}\right]_{(mN _{p}+l)\times n}^{T}\\ &\overline{\mathbf{\mathcal{M}}}\triangleq\left[ \begin{array}{cccc}\mathbf{0}_{m \times n}&\cdots&\cdots&\mathbf{0}\\ \mathbf{\mathcal{M}}_{[k+1]_{m\times n}}&\mathbf{0}&\cdots&\vdots\\ \mathbf{0}_{m\times n}&\mathbf{\mathcal{M}}_{[k+2]_{m\times n}}&\mathbf{0}&\vdots\\ \vdots&\mathbf{0}&\ddots&\mathbf{0}\\ \mathbf{0}_{l\times n}&\cdots&\mathbf{0}&\mathbf{\mathcal{M}}_{N_{l\times n}}\end{array} \right] \\ &\overline{\mathbf{\mathcal{F}}}\triangleq\left[ \begin{array}{cccc}\mathbf{\mathcal{F}}_ {[k]_{m\times p}}&\mathbf{0}&\cdots&\mathbf{0}\\ \mathbf{0}_{m\times p}&\mathbf{\mathcal{F}}_{[k+1]}&\cdots&\vdots\\ \vdots&\mathbf{0}&\ddots&\mathbf{0}\\ \vdots&\cdots&\mathbf{0}&\mathbf{\mathcal{F}}_{[k+N_{p}-1]}\\ \mathbf{0}_{l\times p}&\cdots&\cdots&\mathbf{0}_{l\times p}\end{array} \right]\\ &\bar{\mathbf{\mathcal{B}}}\triangleq\left[\mathbf{\beta}_{[k]_{m\times 1}}\quad\mathbf{\beta}_{[k +1]_{m\times 1}}\quad\cdots\quad\mathbf{\beta}_{N_{l\times 1}}\right]_{(mN_{p}+l)\times 1}^{T}\\ &\bar{\mathbf{\mathcal{B}}}\triangleq\left[\mathbf{\beta}_{[k]_{m\times 1}}\quad\mathbf{ \beta}_{[k+1]_{m\times 1}}\quad\cdots\quad\mathbf{\beta}_{N_{l\times 1}}\right]_{(mN_{p}+l) \times 1}^{T}\\ &\bar{\mathbf{\mathcal{B}}}\triangleq\left[\mathbf{\beta}_{[k]_{m\times 1}}\quad\mathbf{ \beta}_{[k+1]_{m\times 1}}\where \(\overline{\overline{\mathbf{\mathcal{M}}}}\) is a \((mN_{p}+l)\times(nN_{p})\) matrix, and \(\overline{\overline{\mathbf{\mathcal{F}}}}\) is a \((mN_{p}+l)\times(pN_{p})\) matrix. Equation (30) can be simplified as follows:  
\[\mathbf{\mathcal{M}}\mathbf{x}_{[k]k]}+\overline{\overline{\mathbf{\mathcal{M}}}}\mathbf{X}_{[ k]}+\overline{\mathbf{\mathcal{F}}}\mathbf{U}_{[k]}\leq\mathbf{\beta} \tag{32}\]  
Substituting Equation (19) into Equation (32) and via rearranging, the following expression is obtained:  
\[ \begin{split}&\mathbf{\mathcal{M}}\mathbf{x}_{[k]k}+\overline{\mathbf{ \mathcal{M}}}(\mathbf{\Phi}\mathbf{x}_{[k]k}+\Gamma\mathbf{U}_{[k]})+\mathbf{\mathcal{F}}\mathbf{U} _{[k]}\leq\mathbf{\tilde{\beta}}\\ \Rightarrow&(\mathbf{\bar{\mathcal{M}}}\mathbf{\Gamma}+\mathbf{ \mathcal{\tilde{F}}})\mathbf{U}_{[k]}\leq\mathbf{\tilde{\beta}}-(\mathbf{\bar{\mathcal{ M}}}+\mathbf{\bar{\mathcal{M}}}\mathbf{\Phi})\mathbf{x}_{[k]k}\end{split}  \tag{33}\]  
where \(\mathbf{x}_{[k]k}\) is the initial state variable at time \(k\), which is known.