# Resource Allocation of UAV-Assisted IoT Node Secure Communication System
## 4 Simulation Results and Numerical Analysis
From the simulation results, it can be observed that under the same \(P_{max}\), as the distance between \(EN\) and \(DN\) continues to increase, the corresponding maximum PSR will decrease. The values of three points mentioned in the scheme from near to far are 0.3375, 0.3346, and 0.2787, respectively. Considering height factors, as the flight height of the UAV increases, the stable value of the PSR increases, from low to high height, 0.3068, 0.3375, and 0.3557, respectively. Figure 6 shows the variation of the instantaneous secrecy rate over time slots. They all have the same trend as that of the transmit power, PSR. When the UAV is hovering over \(DN\), the channel quality of the main link and the transmission efficiency are the best. Additionally, the closer \(EN\) is to \(DN\), the smaller the optimal secrecy rate is. The transmit power has little effect on the optimal secrecy rate. Meanwhile, the baseline and the optimal scheme have limited numerical differences (4.747 bits/s/Hz and 4.292 bits/s/Hz, respectively, less than 0.5 bit/s/Hz) due to the existence of the PSR, which can be neglected in applications. Figure 7 shows the curve of the average secrecy rate in terms of the number of iterations. All schemes converge to terminate at a threshold, which validate that the subproblem approximates to the convex problem. Additionally, the proposed algorithm converges very fast when we vary the location and the magnitude of the power of \(ENs\). It is an efficient solution for UAV applications. Considering height factors, as the flight height of the UAV increases, the stable value of the average secrecy rate decreases, from low to high height, 3.640 bits/s/Hz, 3.489 bits/s/Hz, and 3.408 bits/s/Hz, respectively. Based on the aforementioned results, we will proceed to summarize and compare the performances of the baseline [10] and the values obtained through the proposed optimal method. The selected environmental conditions include the coordinates of \(ENs\) (5, 9), (15, 9), \(DN\) (10, 15), and \(P_{max}\) = 2 W, \(H\) = 5.0 m. A comparative analysis data table is presented in Table 2 below. The comparative analysis reveals that our proposed methodology excels in terms of optimal power allocation, the energy harvesting ratio for \(DN\) and \(ENs\). Furthermore, the instantaneous secrecy rate exhibits a close proximity. Our approach comprehensively considers various factors, including power, security, and transmission efficiency, leading to a superior overall performance, which demonstrates the superiority of our resource allocation schemes over the baseline scheme. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Indices** & **Baseline [10]** & **Proposed Optimal Method** \\ \hline Maximum transmit power W & 0.5984 & 0.6207 \\ Stable harvesting energy of \(DN\) (W) & \(1.176\times 10^{-5}\) & \(7.322\times 10^{-6}\) \\ Stable harvesting energy of \(EN1\), \(EN2\) (W) & \(3.171\times 10^{-6}\) & \(1.867\times 10^{-6}\) \\ Maximum \(DN\) and \(ENs\) receive energy ratio & 1.8547 & 1.9612 \\ Maximum instantaneous secrecy rate (bits/s/Hz) & 4.292 & 4.747 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance comparison. Figure 4: The harvesting energy versus the time slot. \(H\) = 5.0 m. The coordinates for \(EN1\), \(EN2\), and \(DN\) are (5, 9), (15, 9), and (10, 15), respectively. Figure 3: Optimized transmit power versus the time slot. \(H\) = 5.0 m.  
Figure 2: Trajectories of a UAV with a different location of \(ENs\). \(H\) = 5.0 m, \(P_{max}\) = 2 W. The coordinates of the UAV’s initial and final location are set as \(q_{i}\) = (0, 10) and \(q_{F}\) = (20, 10).