# MRAS Using Lyapunov Theory with Sliding Modes for a Fixed-Wing MAV
## 2 Fixed-Wing MAV Mathematical Model  
The complete mathematical model of the fixed-wing MAV considers an inertial fixed frame \(\mathcal{I}=\{x_{\mathcal{I}},y_{\mathcal{I}},z_{\mathcal{I}}\}\), and the body frame fixed attached to the center of gravity of the fixed-wing MAV given by \(\mathcal{B}=\{x_{\mathcal{B}},y_{\mathcal{B}},z_{\mathcal{B}}\}\).  
The \(\mathcal{W}=\{x_{\mathcal{W}},y_{\mathcal{W}},z_{\mathcal{W}}\}\) represents the wind frame, and it is considered during the cruise of the fixed-wing MAV [21]. In this work, the Newton-Euler formulation is applied to obtain the equations of motion for the fixed-wing MAV and is given by the following mathematical model [22].  
\[\xi = \mathbf{V} \tag{1}\] \[m\dot{\mathbf{V}} = \mathbf{RF}+mge_{3}\] (2) \[\dot{\boldsymbol{\eta}} = \Phi(\eta)\Omega\] (3) \[\mathbf{I}\dot{\Omega} = -\Omega\times\mathbf{I}\Omega+\Gamma \tag{4}\]  
with \(\xi=(x,y,z)^{T}\in\mathbb{R}^{3}\) like the position coordinates relative to the inertial frame, the rotation coordinates is given by \(\boldsymbol{\eta}=(\phi,\theta,\psi)^{T}\in\mathbb{R}^{3}\). The orientation of the rigid body is represented by an orthogonal rotation matrix \(\mathbf{R}\in SO(3):\mathcal{B}\rightarrow\mathcal{I}\), which can be parameterized by the Euler angles \(\phi\), \(\theta\) and \(\psi\) which represent the roll, pitch, and yaw, respectively.  
The translational velocity in \(\mathcal{B}\) is defined by \(\boldsymbol{\
u}=(u,v,w)^{T}\in\mathbb{R}^{3}\), and the angular velocity in \(\mathcal{B}\) is represented with \(\Omega=\left(p,q,r\right)^{T}\in\mathbb{R}^{3}\), the translational velocity is defined with \(\mathbf{V}=\left(\dot{x},\dot{y},\dot{z}\right)^{T}\in\mathbb{R}^{3}\) in \(\mathcal{I}\). The total forces and moments acting on the vehicle \(\mathbf{F}\in\mathbb{R}^{3}\) and \(\Gamma\in\mathbb{R}^{3}\), respectively. The third vector of the canonical basis of \(\mathbb{R}^{3}\) is represented with \(e_{3}\) in the \(z\)- axis, \(m\in\mathbb{R}\) is the mass of the fixed-wing MAV, the matrix, which represents or contains the inertial moments is \(\mathbf{I}\in\mathbb{R}^{3\times 3}\). The \(\Phi(\eta)\) is the Euler matrix and describes the relation between \(\boldsymbol{\eta}\) and \(\Omega\).  
\[\Phi(\eta)=\left(\begin{array}{ccc}1&\sin\phi\tan\theta&\cos\phi\tan\theta \\ 0&\cos\phi&-\sin\phi\\ 0&\sin\phi\sec\theta&\cos\phi\sec\theta\end{array}\right)\]  
Finally, the matrix \(\mathbf{E}:\mathcal{B}\rightarrow\mathcal{W}\) describes the transformation of a vector from the body frame to the wind frame, and this matrix is essential to develop the aerodynamic analysis. The winding frame is given by  
\[\mathbf{E}=\left(\begin{array}{ccc}c_{\alpha}c_{\beta}&s_{\beta}&s_{\alpha} c_{\beta}\\ -c_{\alpha}s_{\beta}&c_{\beta}&-s_{\alpha}s_{\beta}\\ -s_{\alpha}&0&c_{\alpha}\end{array}\right)\]  
with \(\alpha\) is the angle of attack and \(\beta\) is the side slip angle [21].  
To design the MRAS using Lyapunov theory with sliding modes, the model of Equations (1)-(4) omitted any flexible structure of the fixed-wing MAV. This is considered a rigid body. Also, the curvature of the earth is not considered because it is assumed that the fixed-wing MAV will only fly short distances. Then, the mathematical model of the pure angle motion in pitch is necessary to achieve the desired altitude.  
The same concept of pure motion is considered for the yaw and roll angles. Thus, the objective is to obtain an adaptive controller for the Euler angles of the fixed-wing MAV and achieve the desired altitude and the desired angles despite the unknown perturbations due to the wind gusts. As previously explained, we have uncoupled the mathematical model of the fixed-wing MAV in three aerodynamic models: longitudinal dynamic and directional-lateral dynamic.