## 5 Simulation and Analysis
The simulation results of UAV avoidance under the moving threat are given in Figure 8. In the figure, the red triangle represents the moving threat, and the black triangle represents the UAV. The numbers on each triangle represent the position of the UAV and the threat at that moment. From the simulation, it can be seen that the \"2\" moment is the closest moment when the UAV might encounter with the moving threat, and they are likely to collide with each other if there is not any evasive action taken by the UAV. The method proposed in this paper works like this:  
When any movement conflicts within the preplanned flight path aredetected, the detection system of the UAV would immediately turn to estimate the moving threat specifically, and determine where the conflicts might occur; then, a safe flight path is estimated in advance that would not cause flight conflicts, so it can continue to fly according to the estimated flight path. According to the measurement \begin{table}
\begin{tabular}{c c c c c c} \hline
**Angles of Relative Motion** & **0\({}^{\circ}\)** & **30\({}^{\circ}\)** & **60\({}^{\circ}\)** & **90\({}^{\circ}\)** & **120\({}^{\circ}\)** & **150\({}^{\circ}\)** \\ \hline The minimum relative distance (km) & 1.120 & 0.881 & 0.465 & 0.652 & 1.894 & 1.872 \\ \hline \end{tabular}
\end{table} 
Table 1: Relative minimum distances between the UAV and the moving threat at different angles. Figure 7: The avoidance trajectory for the UAV from the moving threat at different angles. from its own sensors and the estimated flight path and real-time altitude, the UAV modifies its flight state constantly so as to achieve the aim of conflict avoidance. This is exactly what is shown in Figure 8. The UAV has re-planned the new conflict-avoiding path before the \"2\" moment. Furthermore, our method was compared with Kalman fusion, which is a standard test to track apreplanned path. Figure 9 is are salt of the comparison at the same path point. Owing to the error accumulation of the inertial navigation system, drift was produced during the simulation, but our method performs better because the control strategy at every next time step is considered in creating the path planning strategy for the exact current time step. In order to verify the performance of the proposed method, we compared it with the artificial potential field (APF) [29], ant colony optimization (ACO) [30], and artificial neural network (ANN) [31], which are very popular in UAV path planning applications. Figure 10 shows the error covariance changes over time of these methods. To get a better idea of the changes, the traces of the covariance matrices were represented in a log-value coordinate form. It can be seen that the method proposed in this paper outperforms the other three. Figure 8: The simulation of flight trajectory between the UAV and the threat. Figure 9: The comparison of the proposed method in this paper with Kalman fusion. For a 40-s simulation, the Kalman fusion method produces a drift of about 0.67 m, while our method brings about a drift of 0.23 m—the better performance is because the control strategy at every next time step is considered in creating the current path planning strategy. To make a quantified comparison, Table 2 describes the corresponding quantified results of these methods. The processing time is computed by the internal counter of the simulation PC. As can be seen in the table, the APF method can create the shortest path but needs the longest processing time. In addition, owing to the iterative process during the planning, the ACO and ANN methods require more time. It can be seen from Table 1 that the method proposed in this paper can program a shorter path compared with the ACO and the ANN method. Furthermore, what is important is that this method has an extraordinarily shorter processing time.