## 5 Numerical Simulation  
To present a numerical example, the mentioned quadcopter model was chosen. Typical SDRE control technique was compared with its modified version. Considering a quadcopter (presented in Figure 1) as a vehicle with four independent drives and with an electric power system located at its center of gravity, it is important to define coordinate systems in order to determine the position. A model device has six degrees of freedom, where vertical movement in the global coordinate system and three Euler angles are controlled parameters. There is a need to assume a body fixed frame and a symmetrical structure of the model with the origin in the center of mass, where every drive is independently controlled and aerodynamic effects are negligible. The mathematical model is taken from [26]. As mentioned, this model needs to be described using [PERSON]'s angles: roll angle \(\phi\in\langle-\pi,\pi\rangle\), pitch angle \(\theta\in\langle-\frac{\pi}{2},\frac{\pi}{2}\rangle\), and yaw angle \(\psi\in\langle-\pi,\pi\rangle\). These angles are a sequence of three rotations  
\[ \begin{split}\mathbf{R}_{\mathbf{x}}(\phi)&= \left[\begin{array}{ccc}1&0&0\\ 0&\cos(\phi)&-\sin(\phi)\\ 0&\sin(\phi)&\cos(\phi)\end{array}\right],\mathbf{R}_{\mathbf{y}}(\theta)= \left[\begin{array}{ccc}\cos(\theta)&0&\sin(\theta)\\ 0&1&0\\ -\sin(\theta)&0&\cos(\theta)\end{array}\right],\\ \mathbf{R}_{\mathbf{z}}(\psi)&=\left[\begin{array}{ccc}\cos(\psi)&-\sin( \psi)&0\\ \sin(\psi)&\cos(\psi)&0\\ 0&0&1\end{array}\right].\end{split}  \tag{66}\]  
This leads to the rotation matrix \(\mathbf{R}\), which describes rotations of the local system in terms of the global system. \[\mathbf{R}_{\mathbf{z}\mathbf{x}}(\psi,\theta,\phi)=\mathbf{R}_{\mathbf{z}}( \psi)\mathbf{R}_{\mathbf{y}}(\theta)\mathbf{R}_{\mathbf{x}}(\phi) \tag{67}\]  
The representation of the actual model in the simulations requires us to determine differential equations that describe all relations in the model. The orientation of the vehicle is described by two vectors, \(\mathbf{r}^{T}=(x,y,z)\) and \(\mathbf{\Omega}^{T}=(\psi,\phi,\theta)\). The quadrotor's acceleration is described by the differential equation  
\[\ddot{\mathbf{r}}=-g \begin{bmatrix}0\\ 0\\ 1\end{bmatrix} +\mathbf{R}\frac{b}{m}\sum_{i=1}^{4}\omega_{i}^{2} \begin{bmatrix} 0\\ 1\end{bmatrix} , \tag{68}\]  
where:  
\(g\)--the gravitational acceleration;  
\(\mathbf{R}\)--the rotation matrix;  
Figure 1: Structure of a quadrotor aircraft. \(b\)--the thrust factor;  
\(\omega_{l}\)--the speed of rotor \(i=1,2,3,4\). The second differential equation is presented in  
\[\mathbf{I}\ddot{\Omega}=-\dot{\Omega}\times\mathbf{I}\dot{\Omega}-\sum_{i=1}^{4} J_{R}\left[\dot{\Omega}\times \begin{bmatrix}0\\ 0\\ 1\end{bmatrix} \right]\omega_{i}+\tau. \tag{69}\]  
Vector \(\boldsymbol{\tau}\) is defined as  
\[\tau= \begin{bmatrix}lb(\omega_{4}^{2}-\omega_{2}^{2})\\ lb(\omega_{3}^{2}-\omega_{2}^{2})\\ d(\omega_{2}^{2}+\omega_{4}^{2}-\omega_{1}^{2}-\omega_{3}^{2})\end{bmatrix} , \tag{70}\]  
where:  
\(l\)--the length the of quadrotor's arm;  
\(d\)--the drag factor. The quadrotor's model has four control inputs (vertical movement in the global coordinate system and three Euler angles). It is assumed that the input values, which represent forces, are directly proportional to the squared angular velocity of the motor. \[ \begin{cases}u_{1}=b(\omega_{1}^{2}+\omega_{2}^{2}+\omega_{3}^{2}+\omega_{4}^ {2})\\ u_{2}=b(\omega_{4}^{2}-\omega_{2}^{2})\\ u_{3}=b(\omega_{3}^{2}-\omega_{1}^{2})\\ u_{4}=d(\omega_{2}^{2}+\omega_{4}^{2}-\omega_{1}^{2}-\omega_{3}^{2}).\end{cases}  \tag{71}\]  
Let us create a new variable that describes relative motor speed  
\[\omega_{d}=\omega_{2}+\omega_{4}-\omega_{1}-\omega_{3}. \tag{72}\]  
Using Equations (68)-(72), a dynamic model is presented as a system of six equations  
\[