# Design of a Morphing Aircraft Based on Model Predictive Control
## 4 Numerical Simulation
### Controller Performance Verification  
The control performance of the two model predictive controllers is validated through simulation. The following simulation experiment is designed: Initially, the wingspan morphing ratio is 0, and the variable-span aircraft is flying level at a height of 5000 m and a speed of 40 m/s. Starting from \(t=10\) s, wingspan morphing begins, gradually increasing the wingspan morphing ratio. By \(t=40\) s, the wingspan morphing ratio reaches 1, and remains constant thereafter. Periodic disturbances are applied simultaneously with the initiation of the wingspan deformation, with a disturbance period of 6.28 s and peak values of 100 N and 100 N-m for the disturbance force and moment, respectively, until the simulation ends at 70 s. Through calculation and testing, the design parameters of the MPC controller were determined. The selection of the control input weight matrix \(R\) needs to balance solvability and control performance. When \(R\) is chosen as the identity matrix, all control inputs are strictly constrained, which can lead to an unsolvable optimization problem. Therefore, the constraint on the second control input is relaxed. The state weight matrix \(Q\) should be greater than \(R\), so that the system prioritizes optimizing the state rather than strictly controlling the input. When the terminal cost matrix \(S\) is large, the optimizer strongly constrains the terminal state, which may result in an unsolvable  
Figure 5: Flight response curves during the morphing process in the simulation verification process: (**a**) flight speed, (**b**) angle of attack, (**c**) pitch angle, (**d**) pitch rate, and (**e**) flight altitude. problem. Conversely, if \(S\) is too small, the optimization problem may become infeasible. To ensure that the controller remains solvable, constraint conditions are designed around the equilibrium points throughout the entire wingspan morphing process. The final weight matrices and constraint conditions are determined as follows:  
\[\mathbf{R}= \begin{bmatrix}1&0\\ 0&0.01\end{bmatrix} ,\mathbf{Q}= \begin{bmatrix}10&0&0&0&0\\ 0&10&0&0&0\\ 0&0&10&0&0\\ 0&0&0&10&0\\ 0&0&0&0&10\end{bmatrix} ,\mathbf{S}= \begin{bmatrix}5&0&0&0&0\\ 0&5&0&0&0\\ 0&0&5&0&0\\ 0&0&0&5&0\\ 0&0&0&0&5\end{bmatrix}  \tag{45}\]  
\[\mathbf{u}_{low}= \begin{bmatrix}u_{low1}\\ u_{low2}\end{bmatrix} = \begin{bmatrix}-40\\ 0\end{bmatrix} ,\mathbf{u}_{high}= \begin{bmatrix}u_{high1}\\ u_{high2}\end{bmatrix} = \begin{bmatrix}40\\ 100\end{bmatrix}  \tag{46}\]  
\[\mathbf{x}_{low}= \begin{bmatrix}x_{low1}\\ x_{low2}\\ x_{low3}\\ x_{low4}\\ x_{low5}\end{bmatrix} = \begin{bmatrix}-4\\ -10\\ -10\\ 0\end{bmatrix} ,\mathbf{x}_{high}= \begin{bmatrix}x_{high1}\\ x_{high2}\\ x_{high3}\\ x_{high4}\\ x_{high5}\end{bmatrix} = \begin{bmatrix}60\\ 12\\ 15\\ 10\\ 5005\end{bmatrix}  \tag{47}\]  
Figures 6-8 show that the red solid line represents the Robust Model Predictive Controller (RMPC), while the blue dashed line represents the MPC.The optimal control \(\mathbf{U}_{[h]}^{*}\) can be obtained through software, and the simulation control effect is shown by the red solid line in Figure 8.  
Figure 6: Wing span morphing ratio during the controller performance verification. Figure 7: Input variable values during the controller performance verification: (**a**) elevator angle, and (**b**) throttle setting. Figure 8: Flight response curves during the morphing process in the controller performance verification: (**a**) flight speed, (**b**) angle of attack, (**c**) pitch angle, (**d**) pitch rate, and (**e**) flight altitude. When solving the RMPC, the wingspan deformation rate \(\rho\) varies during this process. Therefore, the steady-state operating points of the parameter-varying system are determined based on Equations (9) and (10).