# Identification of High-Order Nonlinear Coupled Systems Using a Data-Driven Approach
## 2 Mathematical Tools
### Mathematical Model of a Quadcopter  
A quadcopter or quadrotor is a type of unmanned aerial vehicle (UAV) that has four rotors mounted on a rigid frame. The rotors can generate both lift and torque, which are used to control the position and orientation of the quadrotor. The mathematical model of a quadrotor can be derived using [PERSON] and Euler's laws and applying basic principles of physics. This derivation gives the equations that govern the motion of a quadrotor, both concerning the body frame and the inertial frame.  
The configuration space of a quadcopter is defined by six variables: \(x\), \(y\), \(z\), \(\phi\), \(\theta\), and \(\psi\), where \((x,y,z)\) are the coordinates of the center of mass in an inertial frame, and \((\phi,\theta,\psi)\) are the Euler angles that represent the orientation of the body frame with respect to the inertial frame. The actuation space of a quadrotor is defined by four variables: \(u_{1}\), \(u_{2}\), \(u_{3}\), and \(u_{4}\), where \(u_{i}\) is the angular velocity of the i-th rotor. The schematics of this aircraft are given in Figure 1. In aeronautics, the convention of measuring elevation or altitude through the negative part of the Z-axis is often a matter of mathematical and geometric consistency. The convention is motivated by the right-hand coordinate system commonly used in aviation and engineering: the X-axis points forward (along the longitudinal axis of the aircraft), the Y-axis points to the right (along the lateral axis), and the Z-axis points downward (along the vertical axis) [24].  
The dynamics of a quadcopter can be expressed as [25; 26; 27; 28]:  
\[\dot{x}=f(x,u), \tag{5}\]  
where \(x=[x_{1}\dots\ x_{12}]^{T}\), \(u=[u_{1}\ \dots\ u_{4}]^{T}\), and  
\[\dot{x}_{1} = x_{7}, \tag{6}\] \[\dot{x}_{2} = x_{8},\] (7) \[\dot{x}_{3} = x_{9},\] (8) \[\dot{x}_{4} = x_{12},\] (9) \[\dot{x}_{5} = x_{11},\] (10) \[\dot{x}_{6} = x_{10},\] (11) \[\dot{x}_{7} = \frac{\beta_{1}}{m}(\sin(x_{4})\sin(x_{6})+\cos(x_{4})\cos(x_{6}) \sin(x_{5})),\] (12) \[\dot{x}_{8} = -\frac{\beta_{1}}{m}(\cos(x_{4})\sin(x_{6})-\cos(x_{6})\sin(x_{4} )\sin(x_{5})),\] (13) \[\dot{x}_{9} = \frac{\beta_{1}}{m}(\cos(x_{5})\cos(x_{6}))+9.81,\] (14) \[\dot{x}_{10} = \frac{1}{I_{xx}}\big{(}\beta_{2}+(I_{yy}-I_{zz})x_{11}x_{12}\big{)},\] (15) \[\dot{x}_{11} = \frac{1}{I_{yy}}(\beta_{3}+(I_{zz}-I_{xx})x_{10}x_{12}),\] (16) \[\dot{x}_{12} = \frac{1}{I_{zz}}\big{(}\beta_{4}+(I_{xx}-I_{yy})x_{10}x_{11}\big{)}, \tag{17}\]  
with \(\beta_{1}\) as the force responsible for throttle movement, \(\beta_{2}\) as the torque responsible for roll movement, \(\beta_{3}\) as the torque responsible for pitch movement, and \(\beta_{4}\) as the torque responsible for yaw movement, given by  
\[\beta_{1} = b(u_{1}^{2}+u_{2}^{2}+u_{3}^{2}+u_{4}^{2}), \tag{18}\] \[\beta_{2} = b(u_{4}^{2}+u_{3}^{2}-u_{1}^{2}-u_{2}^{2}),\] (19) \[\beta_{3} = b(u_{2}^{2}+u_{3}^{2}-u_{1}^{2}-u_{4}^{2}),\] (20) \[\beta_{4} = d(u_{1}^{2}+u_{3}^{2}-u_{2}^{2}-u_{4}^{2}),\text{ and}\] (21) \[\Omega = u_{1}-u_{2}+u_{3}-u_{4}. \tag{22}\]Notice that \(u_{1}\), \(u_{2}\), \(u_{3}\), and \(u_{4}\) are the frequencies of rotors 1, 2, 3 and 4, respectively, i.e., they are the implicit control inputs and they are given in rad/s. The variables \(x_{1}\), \(x_{2}\), and \(x_{3}\) represent the linear displacements along the earth fixed axes \(X_{e}\), \(Y_{e}\), and \(Z_{e}\), respectively, and they are in meters. On the other hand, the variables \(x_{4}\), \(x_{5}\), and \(x_{6}\) describe the angular displacements around the body axes \(Z_{b}\), \(Y_{b}\), and \(X_{b}\), respectively, and they are in radians. The remaining state variables describe the linear and angular velocities, and they can be easily deduced from (5)-(22).