## 2 Dynamic Modeling
### Governing Equations  
The force equation, including disturbance caused by drag force and wind force, in the \(x\), \(y\), and \(z\) direction of the earth frame is formed as below:  
\[m\left[ \begin{array}{c}\ddot{x}\\ \ddot{y}\\ \ddot{z}\end{array} \right]_{E}={}^{E}\mathbf{R}^{\mathbf{g}}\left[ \begin{array} []{c}0\\ 0\\ u\end{array} \right]_{B}-\left[ \begin{array}{c}\delta_{x}\dot{x}\\ \delta_{y}\dot{y}\\ \delta_{z}\dot{z}\end{array} \right]_{E}+\left[ \begin{array}{c}f_{xx}\\ f_{xy}\\ f_{yz}\\ f_{xz}\end{array} \right]_{E}+\left[ \begin{array}{c}0\\ 0\\ mg\end{array} \right]_{E} \tag{1}\]  
where \(\delta_{x}\), \(\delta_{y}\) and \(\delta_{z}\) denote the drag coefficients; \(f_{xx}\), \(f_{xy}\) and \(f_{yz}\) denote disturbances caused by wind. \(u\) is the composition of forces of the four propellers; that is \(u=-f_{1}-f_{2}-f_{3}-f_{4}\). \({}^{E}\mathbf{R}^{B}\) is the body 3-2-1 rotation transformation matrix that transfers vectors expressed in body-fixed frame to the one expressed in the earth frame. The definition of \({}^{E}\mathbf{R}^{B}\) is as follows:  
\[{}^{E}\mathbf{R}^{B}=\left[ \begin{array}{cccc}\cos\psi&-\sin\psi&0\\ \sin\psi&\cos\psi&0\\ 0&0&1\end{array} \right]\left[ \begin{array}{cccc}\cos\theta&0&\sin\theta\\ 0&1&0\\ -\sin\theta&0&\cos\theta\end{array} \right]\left[ \begin{array}{cccc}1&0&0\\ 0&\cos\phi&-\sin\phi\\ 0&\sin\phi&\cos\phi\end{array} \right]\]  
With the rotation transformation matrix, the control input, \(u\), which is acting in the \(z\) direction of the body-fixed frame of the quad-rotor, could be transformed into the vector expressed in the earth frame. Therefore, Equation (1) could be written the vector form as indicated below:  
\[\mathbf{a}_{B}=\frac{1}{m}\mathbf{F}_{E}+\mathbf{g}+\mathbf{f}_{t} \tag{2}\]  
Figure 1: Quad-rotor dimension assumption. Figure 2: Definitions of the Quadrotor: (**a**) thrust directions; (**b**) spin direction of the propellers. where \(\mathbf{F}_{E}={}^{E}\mathbf{R}^{\beta}\Big{[} \begin{array}{cccc}0&0&u\end{array}  \Big{]}^{T}\), \(\mathbf{g}=\Big{[} \begin{array}{cccc}0&0&g\end{array} \Big{]}^{T}\), \(\mathbf{f}_{t}=\mathbf{D}_{t}+\mathbf{d}_{t}\), \(\mathbf{D}_{t}=-\Big{[} \begin{array}{cc}\delta_{x}\dot{x}&\delta_{y}\dot{y} &\delta_{z}\dot{z}\end{array} \Big{]}^{T}\) and \(\mathbf{d}_{t}=\Big{[} \begin{array}{cc}f_{ux}&f_{uy}&f_{uz}\end{array}  \Big{]}^{T}\). In moment equation, the derivative of angular velocity of the quadrotor is defined as \(\dot{\mathbf{\omega}}_{B}\in\mathbb{R}^{3\times 1}\), the moment of inertia of the quadrotor is defined as \(\mathbf{J}\in\mathbb{R}^{3\times 3}\), the torque generated from the propellers is defined as \(\boldsymbol{\tau}_{\eta}\in\mathbb{R}^{3\times 1}\), the wind disturbance is defined as \(\mathbf{d}_{\eta}\in\mathbb{R}^{3\times 1}\), the gyroscope effects and the rest terms is defined as \(\mathbf{P}\). The governing equations are summarized below:  
\[\dot{\mathbf{\omega}}_{B}=\mathbf{J}^{-1}\Big{(}\boldsymbol{\tau}_{\eta}- \mathbf{P}+\mathbf{f}_{\eta}\Big{)} \tag{3}\]  
where:  
\[\left\{ \begin{array}{l}\mathbf{P}=\boldsymbol{\omega}_{B}\times\mathbf{I}_{ B}\boldsymbol{\omega}_{B}+\mathbf{r}_{ct}\times m_{p}\mathbf{a}_{o}\\ \quad+\sum\limits_{i=1}^{4}\Big{[}\mathbf{r}_{ci}\times m_{p}\big{(} \boldsymbol{\omega}_{B}\times(\boldsymbol{\omega}_{B}\times\mathbf{r}_{ci}) \big{)}+\boldsymbol{\omega}_{B}\times\mathbf{I}_{p}\Big{(}\boldsymbol{\omega} _{B}+\boldsymbol{\omega}_{pi}\Big{)}\Big{]}\\ \boldsymbol{\tau}_{\eta}=\left[\begin{array}{c}(f_{2}+f_{3}-f_{1}-f_{4})l_{ u}\\ (f_{1}+f_{2}-f_{3}-f_{4})l_{l}\\ (f_{2}-f_{1}+f_{4}-f_{3})\mu\end{array}\right]\mathbf{r}_{ct}=\sum\limits_{ i=1}^{4}\mathbf{r}_{ci},\ \mathbf{f}_{\eta}=\mathbf{D}_{\eta}+\mathbf{d}_{\eta}\\ \mathbf{D}_{\eta}=-\Big{[}\begin{array}{cc}\delta_{x}\dot{\phi}&\delta_{y} \dot{\theta}&\delta_{z}\dot{\psi}\end{array}\Big{]}^{T},\ \mathbf{d}_{\eta}=\Big{[}\begin{array}{cc}f_{ uv\phi}&f_{ uv\theta}&f_{ uv\psi}\end{array}\Big{]}^{T}\end{array} \right.