# Design of a Morphing Aircraft Based on Model Predictive Control
## 4 Numerical Simulation
### Controller Performance Verification
To prevent the system from deviating beyond the controllable range and avoid overly tight or overly relaxed constraints leading to unsolvability or instability, constraints are selected near the equilibrium points to ensure that RMPC can always find a suitable control input under all possible wingspan variations.Taking \(\xi_{b}=0\) as an example, the system's state and input constraints are chosen as follows:  
\[\left[ \begin{array}{c}35\\ 9.0\\ 9.0\\ -0.6\\ 4995\end{array} \right]\leq\left[ \begin{array}{c}v_{c}\\ \alpha_{c}\\ \theta_{c}\\ q_{c}\\ h_{c}\end{array} \right]\leq\left[ \begin{array}{c}45\\ 9.7\\ 9.7\\ 0.6\\ 5005\end{array} \right],\left[ \begin{array}{c}-16.0\\ 53.7\end{array} \right]\leq\left[ \begin{array}{c}\delta_{e}\\ \delta_{t}\end{array} \right]\leq\left[ \begin{array}{c}-15.0\\ 56.2\end{array} \right] \tag{49}\]  
The boundary constraints of the disturbance force and disturbance moment are \(\mid w_{F}\mid\leq 100\)N and \(\mid w_{M}\mid\leq 100\)N/(m). Under these disturbance constraints, the resulting terminal state set is as follows:  
\[\mathbf{\Omega}=\{(v,\alpha,\theta,q,h)|x^{i}_{\min,\Omega}\leq x^{i}\leq x^{i }_{\max,\Omega}\} \tag{50}\]  
\[\left\{ \begin{array}{l}x^{i}_{\min,Omega}=[39.7,9.4,9.4,-0.1,4999.7]^{T}\\ x^{i}_{\max,\Omega}=[40.2,9.5,9.5,0.1,5001]^{T}\end{array} \right. \tag{51}\]  
Taking the prediction horizon as \(N=10\), with a weighting coefficient of \(\delta=3\), and a sampling time of \(T_{s}=1\) s, the control effect is shown by the blue dashed line in Figure 8.  
To test the robustness of the controller, a verification experiment is set, where the rate of deformation of the aircraft was reduced and the disturbance amplitude was increased. The wingspan deformation rate still changes from 0 to 1, and the deformation time period of the aircraft was extended from the original 10-40 s to 10-50 s. Periodic disturbances were introduced simultaneously with the wingspan deformation, with a disturbance period of 6.28 s and peak values of the disturbance force and disturbance moment increased from 100 to 120. The simulation results are shown in the figure below. Figures 9-11 show that the red solid line represents the Robust Model Predictive Controller (RMPC), while the blue dashed line represents the MPC. Figure 9: Verification experiment for the wingspan morphing ratio during the controller performance verification. Figure 11: _Cont._  
Figure 10: Verification experiment for the input variable values during the controller performance verification: (**a**) elevator angle, and (**b**) throttle setting. The true results show that when the wingspan is low and system disturbances are considered, the Model Predictive Controller (MPC) can effectively adjust during the deformation process of the variable-wingspan aircraft. It adjusts the control inputs in time to achieve stable flight. However, as the wingspan increases, the flight speed and altitude deviate from the initial state to some extent, and there are oscillations in the attitude angle. This indicates that the designed MPC has good control performance when system disturbances are not considered but has poor disturbance rejection capability. By observing the robust model predictive controller, and comparing the control performance under different deformation rates and disturbance amplitudes, it can be found that when the wingspan deformation rate is relatively small and subject to composite disturbances, the robust predictive control exhibits good control performance. It can quickly implement regulatory control, with system states fluctuating within a small range, ensuring the stable flight of the morphing aircraft. As the wingspan deformation rate increases, the impact of disturbances on the system reaches its peak. However, under the action of the robust controller, the disturbances are effectively suppressed, allowing the morphing aircraft to respond quickly to various commands and achieve stable flight. This demonstrates that the designed MPC is able to achieve stable flight.