# Modeling and Application of Dynamic Soaring by Unmanned Aerial Vehicle
## 2 Dynamic Soaring Application Model
### Flight Simulation Model  
This paper carried out the dynamic soaring test flight by the flight simulation program. This flight simulation model was built following the logic block diagram shown in Figure 5.  
Figure 4: The exponential wind field model. Figure 3: The glider Fox model. The core of the flight simulation model is the six degrees of freedom (6-DOF) equation. This equation links the force and moment acting on the UAV to the movement. The force part of the 6-DOF equation for the dynamic soaring is as same as Equation (4) in the energy harvesting mechanism model derivation, and the moment part is as follows:  
\[\left\{ \begin{array}{l}L=\dot{p}I_{x}-I_{xz}\big{(}\dot{r}+pq\big{)}-\big{(}I_{ y}-I_{z}\big{)}qr\\ M=\dot{q}I_{y}-I_{xz}\big{(}r^{2}-p^{2}\big{)}-(I_{z}-I_{x})rp\\ N=\dot{r}I_{z}-I_{xz}\big{(}\dot{p}-qr\big{)}-\big{(}I_{x}-I_{y}\big{)}pq\end{array} \right. \tag{9}\]  
where \([L,M,N]\) are the rolling, pitching, and yawing moments, respectively, and \(I\) is the rotational inertia. In this paper, Matlab and Simulink are used as the basic environment. For the control module, this paper used PID to realize the longitudinal and lateral control. The inputs for this system were desired height, desired yaw angle, actual height, and actual yaw angle. This control module eliminated deviation by conversing position and angle to the rudder. A simple gliding model is used to verify the simulation program. The initial status, final status, and trajectory are shown in Figure 6.  
Figure 5: The logic diagram of the dynamic soaring flight simulation model. From the results, the UAV glides about 50 m northward. The altitude decreases steadily and finally reaches zero. A detailed analysis of the motion and energy is shown in Figure 7.  
The results of the verification simulation show that the program this paper used is reliable. From the trajectory perspective, the results match the acknowledgment of gliding: the speed and altitude decrease slowly. Furthermore, the energy perspective gives a mechanism's certainty of program reliability. Because of the minor Euler angles or aerodynamic angles, the UAV takes three direction forces: Lift, drag, and gravity. The lift and gravity are parallel and normal to the drag. Hence, the gravity's work is offset by the lift at the beginning. Meanwhile, lift and drag are both influenced by airspeed. Thus, while the drag's work is causing a decrease in the airspeed, the drag and lift decrease. This chain reaction will cause a decreasing rate of potential energy rise and a decreasing rate of kinetic energy. For the total energy, it is related to the drag's work. Because the displacement is linear, the drag's work is linear, and the total energy change is linear. Lastly, the potential energy is zero, and the total energy is as same as the kinetic energy. Figure 8 shows the analysis results precisely; hence, the simulation program is verified. Figure 6: The results for the verification gliding case. Figure 7: The detailed results for the trajectory and airspeed. Because of the structure of the flight simulation model, a planned trajectory was needed. According to the research, the dynamic soaring trajectory can be divided into the closed-loop and open-loop trajectories. Normally, the flight mission for the UAV requires a certain flight distance. Hence, this paper chose the open-loop trajectory for the following analysis. Meanwhile, the typical dynamic soaring cycle can be divided into four phases: windward climb, high altitude turn, leeward descent, and lower altitude turn. The detailed parameters of the trajectory are shown in Figure 9 and Table 2.  
This paper gives a new method to solve the trajectory optimization time problem by giving two key control variables to longitudinal and lateral motion: the altitude and the \begin{table}
\begin{tabular}{c c c} \hline \hline
**Cycle Time** & **Altitude Range** & **Yaw Angle Range** \\ \hline
14 s & 0–15 m & \(-\)160 deg to 30 deg \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Trajectory conditions.