# Altitude Optimization and Task Allocation of UAV-Assisted MEC Communication System
## 1 Introduction
However, the above research works adopt partial offloading approach to offload computational tasks to the UAV for computation. Since the computational capacity of user and UAV is limited, it is impractical to offload computational tasks to the UAV when the computational tasks are large. The work in [24] considered a UAV-enabled MEC system in which the UAV can act as an MEC server for computation or offload the tasks to base stations (BSs) for computation. It is worth noting that the LoS channel was adopted in [24], which ignored the effect of obstacle blockage in urban scenarios. Different from this paper, we use probabilistic channel that contain both LoS and non-LoS (NLoS) links, which makes our research more consistent with realistic scenarios. The flying altitude of the UAV is an important issue, which is the focus of UAV-assisted wireless communication networks. However, the above existing works assume that the UAV flies at a fixed altitude without considering the optimization of the flying altitude. The work in [25] mainly focused on optimizing flying altitude and the number of UAVs to minimize a total power consumption. The altitude optimization problem of UAV based ad-hoc network was considered through minimizing the average network outage probability in [26]. For mixed radio frequency and underwater optical communication system, the authors determined an optimal altitude of the UAV by minimizing the system outage probability in [27]. However, most of the existing works in UAV-assisted MEC system have not investigated closed-form solution for the optimal flying altitude of the UAV. In addition, the above works have made significant contributions in the field of UAV-assisted MEC communication, but UAV-assisted MEC in maritime communication has not yet received wide attention. In practice, UAV-assisted MEC maritime communication system investigated in our paper is meaningful. Firstly, the flexible mobility of UAV compensates the disadvantage of poor channel quality between ground MEC servers and users. Second, our research has certain potential to be applied in practical scenarios. For example, for maritime environments where network infrastructure is scarce and generated data are difficult to collect and monitor, using UAV as an MEC server can help maritime user process the generated compute-intensive data. Finally, we employ onshore BS and UAV to serve maritime user simultaneously, which can alleviate the computational burden of the network and further improve the computational performance of the system. In this paper, we consider a maritime communication system in which a UAV equipped with an MEC server is used to provide computing services to maritime user. To better fit the reality, we adopt probabilistic channel between user and UAV, which is composed of both LoS and NLoS links. In addition to offloading computational tasks to UAV, the user can also offload to onshore BS with high computational capability for computation. The main contributions of this paper are summarised as follows. * We propose a new UAV-assisted MEC framework in order to provide computing services for user with stringent latency requirement. In our proposed design, we formulate a task offloading problem for minimizing the total system delay to optimize the flying altitude of UAV and the task allocation ratio. * To effectively solve the optimization problem, we derive a semi closed-form expression for the optimal flying altitude of the UAV and a closed-form expression for the optimal task allocation ratio, respectively. * Simulation results demonstrate the accuracy of the analytical results and show that the optimal flying altitude depends on the horizontal distance between the UAV and the user. We also show the impacts of the transmit power, the bandwidth, and the CPU frequency on the optimal task allocation ratio. The rest of this paper is organized as follows. We present the system model and the problem formulation for a UAV-assisted MEC uplink maritime communication system in Section 2.