# Advanced Cooperative Formation Control in Variable-Sweep Wing UAVs via the MADDPG-VSC Algorithm
## 2 Dynamics Analysis of the Variable-Sweep Wing UAV
### Multi-Rigid-Body Dynamic Model  
To simulate the complex dynamic behavior of the L-30A variable-sweep wing UAV during flight, a multi-rigid-body dynamics model based on the Newton-Euler equations is employed. This model accurately captures changes in the center of mass and aerodynamic characteristics caused by variations in sweep angles. Given the significant changes in the center of mass and inertia characteristics of the UAV's fuselage and wings during flight, the mass distribution across each rigid body is assumed to be uniform, and the UAV's geometric shape is considered symmetrical along the longitudinal axis. These assumptions provide the foundation for deriving the dynamic equations. In contrast to simplified models, this multi-rigid-body model dynamically adjusts to real-time variations in mass and inertia, enhancing control accuracy and stability across different flight conditions. Utilizing this approach, the dynamic relationships of the multi-rigid-body system are established, as illustrated in Figure 1.  
Figure 1: Schematic of dynamic relationships in a variable-sweep wing UAV. The center of mass for each rigid body is defined, with \(O_{i}\) representing the center of mass, and \(I_{i}\) representing the position vector from the origin \(O_{b}\) of the fuselage coordinate system to \(O_{i}\). The centers of mass for the left and right wings are denoted as \(O_{1}\) and \(O_{2}\), respectively, as shown in Figure 2. The relative velocity of \(O_{i}\) is given by  
\[\mathbf{v}(\mathbf{p}_{O_{i}})\ =\ \frac{dt_{i}}{dt}=\mathbf{v}_{i}-\mathbf{v}_{0}\quad(i=1,2) \tag{1}\]  
This equation describes the relative velocity of the wing's center of mass with respect to the fuselage. \(\mathbf{v}_{i}\) is the velocity of the wing, and \(\mathbf{v}_{0}\) is the velocity of the fuselage. Multi-rigid-body dynamics equation  
The dynamics of each rigid body are defined. For each rigid body \(i\), including the fuselage and two wings, the force equation is given by  
\[\mathbf{F}_{i}=m_{i}\frac{dv_{i}}{dt}\quad(i=0,1,2) \tag{2}\]  
This equation describes the acceleration of the rigid body under the applied force. \(\mathbf{F}_{i}\) represents the resultant force acting on the rigid body, \(m_{i}\) is the mass of the rigid body, and \(dv_{i}/dt\) is the acceleration of the rigid body. Total force and dynamic equilibrium of the system  
By integrating the equations of motion for the centers of mass of both the fuselage and wings, the total dynamic equation for the system can be obtained, describing the overall dynamic behavior of the system during the morphing process, as follows:  
\[\mathbf{F}_{\text{aero}}+\mathbf{G}+\mathbf{T}+\mathbf{F}_{s}=(m_{0}+m_{1}+m_{2})\frac{dv_{0}} {dt} \tag{3}\]  
This equation combines all forces acting on the system, including aerodynamic force \(\mathbf{F}_{\text{aero}}\), gravity \(\mathbf{G}\), thrust \(\mathbf{T}\), and additional forces \(\mathbf{F}_{s}\) generated by wing deformation, to calculate the system's acceleration \(dv_{0}/dt\). Calculation of additional force  
Figure 2: Diagram of the variable-sweep wing UAV and mass centers. (**a**) Structural diagram of the L-30A variable-sweep wing UAV. (**b**) Schematic of mass centers and position vectors. The additional force \(\mathbf{F}_{s}\) generated during the wing deformation process reflects the impact of structural changes on the aerodynamic and inertial forces. The expression for \(\mathbf{F}_{s}\) is given by  
\[\mathbf{F}_{s}=\sum_{i=1}^{2}\mathbf{F}_{s_{i}}=\sum_{i=1}^{2}-m_{i}\frac{d\mathbf{v}\left( \mathbf{p}_{O_{i}}\right)}{dt} \tag{4}\]  
(5) Simplification of forces and moment  
To simplify the dynamic analysis, it is assumed that the centers of mass lie within the plane of the fuselage coordinate system with longitudinal symmetry, and that the dynamics are primarily influenced by longitudinal components.