# Altitude Optimization and Task Allocation of UAV-Assisted MEC Communication System
## 4 Numerical Results  
In this section, numerical results are given to verify the accuracy of the theoretical results. We set the distance between the projection of the UAV on the ground and the user is \(r=50\) m, environmental parameters are \(a=9.61\), \(b=0.16\)[36]. The channel gain at the reference distance of 1m is \(\beta_{0}=-30\) dB, the distance between the user and the BS is \(d_{\rm 52G}=25\) m. The bandwidth allocated by the user to offload tasks to the UAV and the BS are \(B_{\rm UAV}=B_{\rm BS}=1\) MHz, the beamwidth of UAV's directional antenna is \(\omega=100^{\circ}\). The CPU frequency allocated for computation on the UAV and the BS are \(f_{\rm UAV}=1\) GHz, \(f_{\rm BS}=10\) GHz. The other simulation parameters are shown in Table 2. In Table 1, \(\eta_{\rm LoS}=1\) and \(\eta_{\rm NLoS}=20\) are the parameters determined by the environment [29; 36], and we choose the frequency band of 2.4 GHz as the carrier frequency due to the extensive use in UAV products and related work [37; 38]. By iterating (15), the optimal flying altitude \(H^{opt}\) can be obtained as 57 meters, and then substitute the iterative \(H^{opt}\) into (18), the optimal task allocation ratio \(\alpha^{opt}\) can be obtained as 0.62. Figure 2 shows the total system delay versus the task allocation ratio and flying altitude of the UAV. We can see that the total system delay decreases and then increases as the task allocation ratio and flying altitude of the UAV increase, i.e., there exists an optimal flying altitude and optimal task allocation ratio that can minimize the total system delay, which is consistent with our analyses in Section 3. Figure 3 shows the minimum system delay, \(H^{opt}\), and \(\alpha^{opt}\) versus \(P\). It can be seen that as \(P\) increases, \(\alpha^{opt}\) gradually decreases and the minimum total delay of the system also decreases. It is because the computing capability of UAV is weaker than that of BS, \begin{table}
\begin{tabular}{c c} \hline \hline
**Description** & **Value** \\ \hline LoS link extra path loss & \(\eta_{\rm LoS}=1\) \\ NLoS link extra path loss & \(\eta_{\rm NLoS}=20\) \\ Carrier frequency & \(f_{c}=2.4\) GHz \\ Small-scale fading component & \(\tilde{\gamma}_{52G}=0.7\) \\ Noise power spectral density & \(N_{0}=5\times 10^{-15}\) W/Hz \\ Total computing task & \(L=5\times 10^{5}\) bit \\ Cycle for one bit & \(C=100\) cycle/bit \\ Speed of light & \(c=3.0\times 10^{8}\) m/s \\ Transmit power of the user & \(P=1\) W \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation parameters. and when user's transmit power increases, the user offloads more tasks to BS, and then the task allocation ratio of the user offloading tasks to UAV \(\alpha\) decreases accordingly. We also see that with the increase of \(P\), \(H^{opt}\) remains unchanged. This is because the optimal flying altitude of the UAV is irrelevant to \(P\). By comparing the results obtained based on (15) and (18) with the results obtained by one-dimensional search, we can observe that the two are basically identical. Figure 3: Minimum system delay, optimal flying altitude, and optimal task allocation ratio versus transmit power of the user. (**a**) Minimum system delay, (**b**) optimal flying altitude and optimal task allocation ratio. Figure 2: Total system delay versus task allocation ratio and flying altitude. Figures 4 and 5 depict the minimum system delay, \(H^{opt}\), and \(\alpha^{opt}\) versus \(B_{\text{UAV}}\) and \(B_{\text{BS}}\), respectively. Comparing Figures 4 and 5, it can be observed that the minimum total delay of the system decreases with the increase of both \(B_{\text{UAV}}\) and \(B_{\text{BS}}\), \(\alpha^{opt}\) increases in Figure 4 but decreases in Figure 5. It is because when \(B_{\text{UAV}}\) increases, the user offloads more computing tasks to the UAV, and the task allocation ratio of offloading to UAV \(\alpha\) increases.