# Resource Allocation of UAV-Assisted IoT Node Secure Communication System
## 4 Simulation Results and Numerical Analysis  
In this paper, we adopt the information transmission model in [10] and set it as the baseline scheme. We compare it with our optimized scheme. In our study, we employed the SDP3 solver from CVX MATLAB and made 592 calls to CVX within the algorithm. The experimental setup involved the utilization of an Intel 64 Family 6 Model 142 Stepping 10 GenuineIntel 1401 MHz processor. The convergence time of the algorithm, under these hardware conditions, was observed to be approximately 269.02 s. The simulation parameters are given in Table 1.  
Figure 2 illustrates the optimal UAV's trajectory with the proposed algorithm considering conjoint optimization of different \(ENs\) at the same time. We obtain the different UAV trajectories for different \(EN\) positions compared with the fixed trajectory. The UAV flies to \(DN\) with maximum speed, then it hovers close to \(DN\) to facilitate the transmission of information and energy. Finally, the UAV flies to \(q_{F}\) with the fastest possible speed. In Figure 2, the peak coordinate of the green trajectory is (10, 16.75), the red one is (10, 16.43), the blue one is (11.03, 17.06), while the peak coordinate of the purple trajectory is (8.977, 17.05). These observations suggest that as \(ENs\) are positioned either closer or farther away, or deviate to the left or right of \(DN\), the flight trajectory exhibits similar trends in response. Figure 3 shows the UAV's transmit power over time slots. The optimized power first increases when the UAV is close to \(DN\), and then it remains constant while the UAV hovers at a certain position. The value of the baseline in the middle constant part is 0.5984 W, which is smaller than the optimized scheme of 0.6207 W. Finally, it decreases to zero when the UAV flies away from \(DN\). The optimized power decreases with decreasing \(P_{max}\). The closer \(ENs\) are to \(DN\), the higher the optimized power will be. Compared with the separated receiver mode, we sacrifice some power to obtain the desired secrecy rate due to a PS mode. In a separated receiver mode, the energy received by each antenna does not need to be split. However, in an in vivo case, the separated receiver mode is difficult to implement. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Values [10]** \\ \hline Mission time \(T\) & 20 s \\ Time slots \(N\) & 40 \\ Maximum transmit power \(P_{\max}\) & 2 W \\ Average transmission power \(\bar{P}\) & 0.5 W \\ Noise power \(\delta^{2}\) & \(-\)50 dBm \\ Channel power gain \(\bar{\beta}\) & \(-\)30 dBm \\ Power conversion efficiency factor \(\eta\) & 0.5 \\ Collecting energy threshold \(E_{\min}\) & 70 \(\mu\)W \\ Information coding threshold \(E_{sct}\) & 50 \(\mu\)W \\ Maximum speed of UAV \(V_{\max}\) & 5 m/s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameter. Figure 4 shows the energy collected by \(DN\) and \(ENs\) over time slots. The energy collection increases gradually as the UAV approaches \(DN\), and it remains unchanged when the UAV hovers over \(DN\). After flying away from \(DN\), the harvesting energy gradually decreases to zero. Similarly, the harvesting energy is higher than the baseline solution because the optimization of the PSR is not considered in [10]. Compared with the harvesting energy ratio of \(DN\) and \(ENs\), the value of the baseline is 1.8547, which is smaller than the optimized scheme of 1.9612. This indicates that the destination node receives more energy in the proposed method. Figure 5 shows the variation of the PSR with time. When the PSR is low, the IoT device is mainly used as energy nodes; otherwise, it is mainly used as information nodes. When the UAV is far away from \(DN\), the PSR is low to let energy nodes collect energy. If not, the PSR rises to let the \(DN\) node decode information. In order to meet the energy harvesting threshold requirement, the PSR increases with decreasing \(P_{max}\). However, the PSR decreases when \(ENs\) are located close to \(DN\) to reach the information decoding threshold.