Performance Analysis of UAV Assisted Mobile Communications in THz Channel

The huge available bandwidth in Terahertz (THz) frequency band is recently contemplated to achieve high data rate wireless communications. Consequently, THz communications are attractive candidates to fulfill the continuous ever–increasing requirements of future wireless networks. Numerous beyond 5G applications are highly considered for those systems such as high capacity backhaul, enhanced hotspot booths as well as short–range device–to–device (D2D) communications. Wireless communications systems that deploy unmanned aerial vehicles (UAVs) promise to achieve cost–effective wireless connectivity for devices without any need to pay for infrastructure coverage. When compared to terrestrial communications, wireless systems with UAVs are generally faster and more flexible to deploy or reconfigure. In addition, systems deploying UAVs are likely to have much better communication channels due to their high mobility capabilities. Accordingly, the presence of short–range line–of–sight (LOS) links prevail. In this paper, we consider a single–cell cellular network with a UAV deployed as a decode-and-forward (DF) relay in the full-duplex (FD) mode in order to assist a base station (BS) and extend its coverage over THz channel. A joint power allocation and trajectory optimization scheme that minimizes the outage probability of the link between the BS and a mobile device (MD) is derived in the presence of the interference of the D2D devices that share the same THz frequency band. Furthermore, the optimum powers of the MD and the UAV that maximize the achievable rate at the BS are obtained. The performance of the proposed schemes is compared with the fixed power allocation schemes which distribute the power equally among users. Numerical results show that the outage probability and the achievable rate at the BS using the proposed schemes are remarkably superior compared to the fixed power allocation schemes.


I. INTRODUCTION
Over the last few years, data traffic over cellular networks has experienced a radical growth, mainly due to the explosion of smartphones, tablets, and laptops. This increase in data traffic on cellular networks has resulted in an ever-increasing need for offloading traffic for optimum performance of both voice and data services. The remarkable expansion of wireless data traffic has advocated the investigation of gap regions in the radio spectrum to meet the users' demands in the radio spectrum to satisfy users' escalating requirements and promise for the exploitation of high capacity and massive connectivity [1], [2].
Examining the spectrum below 6 GHz, it is found congested and in excessive use by existing mobile networks, WiFi, broadcasting and satellite communications. Further-more, for millimeter wave (mmWave) communication systems, they can only support data rates in the order of 10 Gbps within one meter, which is still two orders of magnitudes below the needed requirements [3]. Nevertheless, THz band communication is a key wireless technology to satisfy those objectives by solving the spectrum scarcity problems and capacity limitations of current wireless systems. With deploying communications systems in the THz band, terabit-per-second (Tbps) links are predicted to become a reality within the few upcoming years. Hence, on its turn, THz is capable of enabling numerous long-awaited applications in various aspects with its promising high throughput and low latency. It is noteworthy that THz band is also an auspicious candidate to offload traffic from cellular band and introduce better service for short-range communicat-ing nodes [4]. Consequently, the THz frequency band (0.1-10 THz) has recently received noticeable attention within the global community because of its capabilities to offer seemless data transfer, wide bandwidth that theoretically can reach up to some THz, potential capacity in terabit per second, latency in the order of microseconds and ultra-fast download capabilities. All these qualifications give this particular frequency range superiority in comparison to optical frequencies [5]. Additionally, the THz waves are more suitable candidates for uplink communication. In other words, they allow non-line-of-sight (NLOS) propagation and function as reliable substitutes in troublesome climate conditions such as dust, turbulence rain and fog. Moreover, the THz frequency band is not affected by surrounding noise caused by optical sources and it is not correlated with any safety limits or health problems [6]. Compared to wireless optical communications, THz communication systems are not sensitive to atmospheric effects in outdoor wireless communications. For indoor wireless communications, the THz frequency band can track the beam much easier than the optical frequency band [7]. In addition, with such an available bandwidth, THz communication systems are capable of offering much more bandwidth than traditional microwave communication systems since transmission rates in the widely utilized microwave frequency bands are restricted by the limited allocated spectra that is typically a few 100 MHz [8]. This definitely makes the THz frequency band more superior to the microwave band as well as more suitable for the ever-increasing data traffic in future wireless communications [7].
However, the excessive available bandwidth advantage of the THz band communications comes always at the expense of great propagation loss [9]. Generally, this substantial loss is arisen as the electromagnetic wave propagates through the medium as well as the absorption loss caused by the molecular absorption of the water vapor molecules in the atmosphere [10], [11]. Those highly demanding properties that characterize only THz frequency range are expected to revolutionize the telecommunications landscape and change the route through which people communicate, share and use information [12]- [14].
The use of flying platforms such as UAVs or drones is rapidly enlarging. Thanks to their flexibility and high mobility, UAVs are vital in numerous potential applications in wireless systems such as aerial base stations to enhance coverage, reliability, energy efficiency and capacity of wireless networks [15]- [18]. UAV relaying is one of those various UAV applications in which the UAV is deployed in the network to attain wireless connectivity between a couple of nodes in the case of no existing direct communication link between them. This particular application is considered an efficacious technique to increase throughput, improve reliability as well as to extend the BS coverage [10], [19]. The high mobility of the UAV relay can improve the communication performance by dynamically adjusting the UAV location that best suits the surroundings. Moreover, combining THz and low-altitude UAV is characterized by a higher chance of LOS with the ground user equipments (UEs), which in turn makes the deployment of UAVs to support THz communications a very auspicious solution [20]. In fact, deploying D2D communication in cellular networks allows mobile devices to communicate directly with each other under the control of the BS to cope with the tremendous pressure on cellular networks with limited spectrum resources. It is also worth mentioning that the deploying of THz band D2D communication makes the computing, uploading and downloading between two close UEs near-real time [21]. There are multiple research works from the literature that consider D2D communications in THz frequency band [22]- [24]. Although this can help in uploading the main cellular network, more complex interference is observed in D2D heterogeneous networks due to reusing the same resources. In fact, D2D communication has been intensely inspected and deeply studied in the RF as well as mmWave bands. In addition, there are various difficulties arisen when deploying it in THz band [25].

II. RELATED WORK
In [17], the authors studied three typical application scenarios for mmWave-UAV communications, communication terminal, access point and backbone point. Numerous key enabling techniques for UAV communications are presented including beam tracking, multi-beam forming, FD relaying techniques as well as transmitter\receiver beam alignment. In [18], 3D beamforming for mmWave UAV communications with a phased uniform planar array is investigated. In their work, the authors proved that their approach is capable of achieving flexible beam coverage for all types of target area. Moreover, it was proven that the beamforming gain is mostly concentrated in the target coverage area. The authors in [26] employed a FD-UAV relay in order to increase the communications capacity of the mmWave networks. In their design, large antenna arrays are equipped at the source node (SN), the destination node (DN) and the FD-UAV relay in order to solve the problem of high pathloss of mmWave channels and help in mitigating the self-interference at the FD-relay. Accordingly, the authors formulate a problem for maximizing the achievable rate from the SN to the DN, where they target at jointly optimizing the UAV position, analog beam forming and power control.
It is noteworthy that the most significant attribute of THz communications exists in its capability to facilitate mobile communications at both the access level and the device level in D2D and drone-to-drone communications [27]. There are handful papers deploying UAV communication over the THz channel [28]- [30]. The authors in [28] analyzed the orientation and position estimation capabilities of the THz multiple input multiple output (MIMO)-orthogonal frequency division multiplexing (OFDM) link between two UAVs based on both the position and the orientation error bound. Their simulations concluded that millimeter-level positioning accuracy that is needed for distributed sensing is achievable in case the separation distance between the transmitter and receiver is sufficiency small. In addition, their simulations revealed that increasing the bandwidth beyond a specific point does not lead to any notable increase in positioning accuracy. The authors in [29] investigated the challenges in enabling high data rate and low latency infrastructure-less wireless UAVs networking in mmWave and THz-band communications. They mainly studied the effects of mobile uncertainties on mmWave and THz bands. From the above discussion, it is noted that researchers do not focus on evaluating the outage probability of the model that combines THz and D2D technologies with a mobile FD-UAV operating in the same frequency band. Then, the contributions of the paper are as follows: 1) The total outage probability of the communication link from MD to UAV and from UAV to BS is derived in THz channel in the presence of the UAV self-interference and the interference from D2D devices that utilize exactly the same frequency resources.
2) The joint power allocation and trajectory optimization scheme which minimizes the outage probability of the link between the BS and an MD is derived in the presence of the interference of the D2D devices. 3) In addition, the rate maximization optimization problem at the BS is derived and the optimum powers of the MD and the UAV that maximize the SINR at the BS are also obtained. It is worth mentioning that this work is an extension of our work published in [30], where the UAV position here is no longer fixed to make the best use of the UAV mobility and flexibility. In other words, a dynamic position of the UAV is now considered to generalize the model submitted in [30].

III. SYSTEM AND CHANNEL MODEL
In this section, the system model and the channel model are provided.

A. SYSTEM MODEL
We consider an individual cell cellular network as shown in Fig. 1 that involves one MD, one UAV, one BS and M D2D device pairs that coexist and share the same frequency resources with the MD and the UAV. The direct link between the MD and the BS is not achievable due to high loss resulting from lengthy distances travelled or the presence of obstacles such as mountains, trees, sky-scrapers. With the help of a UAV employed between the MD and the BS to operate as a DF relay, the communication link between the MD and the BS is promoted and LOS is achieved between the MD and the UAV as well as between the UAV and the BS. The UAV is anticipated to operate in FD mode to increase the data rate. Therefore, the UAV is equipped with a couple of antennas (one transmit antenna and one receive antenna), meanwhile the other devices in the network are equipped with a single antenna.
The interference from the UAV-transmit antenna is remarkable and can not be neglected even with the deploying of modern self-interference cancellation techniques.  Without loss of generality, consider an MD is located at (D,0,0) in a Cartesian coordinate system, where D is the distance from the MD to the BS as shown in Fig.1. The BS is located at (0,0,H), where H is its height as indicated. The UAV's location at time t is assumed to be (x t ,y t ,z t ). Therefore, the distance from the MD to the UAV (i.e. D M,U ) and the distance from the UAV to the BS (i.e. D U,BS ) at time t can be calculated from Fig.2 and are given respectively by: Let M represents the number of D2D pairs. The transmit powers of the MD, the UAV, the i th D2D transmitter and the self-interference power at the UAV are denoted as: P M , P U , P d2di and P rr respectively. The communication channels between the nodes in the network are assumed to be THz channels. All the channels between the nodes are assumed to be known or perfectly estimated. The description of this channel is provided in the next subsection.

B. CHANNEL MODEL
In the following, we introduce the THz channel model that was developed using THz wave atmospheric transmission attenuation model as well as water vapour absorption. The LOS THz channel gain can be formulated as [31]- [33]: where P L(f, d) is the pathloss that frequency f suffers when traveling a distance d.
Particularly, P L(f, d) involves spreading loss L sl (f, d) and molecular absorption L mal (f, d) that must be highly considered in the THz band. The spreading loss L sl (f, d) is resulting from the expansion of the electromagnetic wave as it propagates through different mediums. However, the molecular absorption L mal (f, d) is a result of the collisions generated by atmospheric gas or water molecules. Extensive research on the effect of atmospheric attenuation was conducted in [31], [32]. The channel coefficient h follows zero-mean complex Gaussian distribution with variance that models free space path as well as molecular absorption gain. From [32] (Eqn. (2), (3) and (5)), the pathloss at frequency f after propagating a distance d is related to the variance of the THz channel and is expressed as: where σ 2 is the variance of the THz channel with zero mean and hence, h ∼ CN (0, σ 2 ). G T x and G Rx are the transmitter and the receiver antenna gains, c is the speed of light in free space and k(f ) is the frequency dependent medium absorption coefficient that is provided in [34].

A. SINR EVALUATIONS
The received signal at the UAV can be expressed as interference signal from D2D transmitting devices where P M is the transmitting power of the MD, h M,U is the channel gain from the MD to the UAV, X M is the transmitting signal of the MD and has unit energy, γ r is the UAV self-interference factor, P rr is the self-interference power of the UAV, h rr is the self-interference channel experienced at the UAV, X U is the transmitting signal of the UAV and has unit energy,P d2di is the transmitting power of the i th D2D device, h d2di,U is the channel gain sensed at the UAV from the transmitting device of the i th D2D pair, X d2di is the transmitting signal of the D2D transmitting device of the i th D2D pair and has unit energy, n U denotes the additive white Gaussian noise (AWGN) at the UAV which has zero mean and variance N o . The received signal at the BS can be written as: where P U is the transmitting power of the UAV, h U,BS is the channel gain from the UAV to the BS, h d2di,BS is the channel gain sensed at the BS from the transmitting device of the i th D2D pair and n BS denotes the AWGN at the BS. Assuming all D2D devices have the same transmitting power P d2d , then from (5) and (6), the signal to-interferencenoise-ratio (SINR) at the UAV and the SINR at the BS are given respectively as: The received signal of the i th D2D receiving device is expressed as: interference signal from other D2D transmitters is the channel gain from the MD to the i th D2D receiving device, h U,d2di is the channel gain from the UAV to the i th D2D receiving device and n d2di denotes the noise at the i th D2D receiving device which has Gaussian distribution (AWGN) with zero mean and variance N o .
Therefore, from (9), the SINR of the i th D2D receiving device is given by:

B. OUTAGE PROBABILITY EXPRESSION
The outage probability of the communication link between the MD and the BS is previously derived in detail in our previous work [30] and expressed as: where In the following, the optimum powers of the MD and the UAV that minimize the outage probability given in (11) will be derived. Moreover, the optimum trajectory of the UAV that minimizes the outage probability is also obtained.

V. JOINT POWER ALLOCATION-TRAJECTORY OPTIMIZATION SCHEME
In this section, the joint trajectory optimization and optimum power allocation of MD and UAV to minimize the outage probability is derived. This joint optimization problem is formulated as: where P max is the system budget power dedicated for the communication link between the MD and the BS. To solve the optimization problem presented in (15), we decouple it into trajectory optimization and power allocation sub-problems. The two sub-problems are solved individually in an iterative manner. Then, the joint power allocation-trajectory optimization algorithm is presented.

A. POWER OPTIMIZATION
The objective is to minimize the outage probability expression given in (11) by optimizing the transmit powers P M and P U given a fixed trajectory for the UAV. Thus, problem (15) can be formulated as: The QoS is guaranteed when γ d2d = T . Therefore, from (10), the power of the i th D2D device that guarantee the QoS at the i th D2D is expressed as: (17) or equivalently: ||h d2di,U || 2 (µ 1 P M + µ 2 (P max − P M ) + µ 3 N o ) + AXY P M + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AZ where Then, by substituting (17) in (11) and by letting the power of the UAV P U = P max − P M from (16b), the outage probability of the link from the MD to the BS is given by: where I is given by (19) at the top of this page and A is given as: To minimize the outage probability given in (21), the exponential term must be maximized. The maximization of the second exponential term is performed by minimizing the power of the exponential, that is minimizing I with respect to P M . To obtain the power P M that minimizes I, ∂I ∂P M is obtained and equated to zero. After mathematical manipulation, P M is obtained as the solution of the following quadratic equation: where The solution of this quadratic equation is expressed as: From (16b), P * U is given as: where only positive power values are considered as constrained in (16c).

B. TRAJECTORY OPTIMIZATION
In this subsection, we minimize the total outage probability expression presented in (11) by optimizing the trajectory of the UAV given equal power allocation for the MD and the UAV. In other words, P M =P U = Pmax 2 . According to (17), the minimum power of any D2D transmitting device when P M = P U = Pmax 2 is denoted as P d2deq and is given as: Consequently, problem (15) can be expressed as: Since problem (29) is non-convex with x,y and z, to solve such a problem, we decouple it into N − 1 sub-problems. Accordingly, we minimize the outage probability in different time slots serially. The sub-problem for a given time slot t can be expressed as: From (11), P t out can be expressed as: Substituting by D M,U and D U,BS expressed in (1) and (2) in (31), the total outage probability can be expressed as: Since f (x, y, x) is monotonically increasing, minimizing P out is equivalent to minimizing f (x, y, z) [35]. Thus, problem (15) can be rewritten as: Since problem (35) is convex and it satisfies slater's condition [36], the gap between the optimal value of problem (35) and that of its dual problem is zero. Consequently, this problem can be solved by getting the solution of the dual problem [36]. Let λ be the Lagrangian multiplier that corresponds to the moving distance constraint given in (35b). Therefore, the Lagrangian of problem (35) is: and the dual objective is: Thus, the dual problem of (35) can be expressed as: Since g(λ) is not differenciable, sub-gradient method is deployed to pick dual problem (38). In fact, the sub-gradient method is implemented to find the feasible solution in the chosen sub-gradient direction. By letting λ w represents the w th iteration, it is proven that the sub-gradient of the dual function g(λ) at λ w is expressed as: where (x w t , y w t , z w t ) minimizes the Lagrangian L(x t , x t , x t , λ w ) [37]. q w is selected as the sub-gradient. Moreover, the step size is selected as: where a > 0 and b ≥ 0. Consequently, λ is updated in each iteration according to the following rule: where the notation [X] + means max(X, 0). In fact, λ represents the price factor for the moving distance constraint. Furthermore, it surely increases in case the moving distance constraint is contradicted. Hence, the sub-gradient method tells that λ increases if d t,t−1 > v and decreases otherwise. The iteration process comes to an end when |g(λ w+1 ) − g(λ w )| < ϵ 2 is satisfied, where ϵ 2 is the error tolerance for the trajectory optimization algorithm.
Referring to Karush-Kuhn-Tucker conditions, the optimal trajectory is obtained by getting ∆f (x t , y t , z t ) = 0. Then, the obtained trajectory is substituted into (41) in order to calculate λ w+1 . In each iteration, the optimum trajectory J opt t = (x opt t ,y opt t , z opt t ) is obtained numerically, where it is within the moving ability of the UAV in time slot t − 1. After that, the UAV moves to J opt t in time slot t − 1. Algorithm 1 summarizes the procedure for solving the trajectory design sub-problem.

Algorithm 1: Trajectory Optimization Algorithm.
Input:The transmit power P. Output:The trajectory J. for t = 2 : N do Use Karush-Kuhn-conditions to obtain the optimal trajectory (x t w , y t w , z t w ). Update λ according to (41); w = w + 1;

C. JOINT POWER ALLOCATION-TRAJECTORY OPTIMIZATION ALGORITHM
Let: P where P (k) t,out is the total outage probability in the k th iteration. Then, the joint power allocation and trajectory optimization problem is summarized in Algorithm 2, where ϵ 1 is the predetermined error tolerance for the joint power allocation trajectory optimization algorithm. Both Algorithm 1 and Algorithm 2 are considered as convex quadratic optimization (CQO) problems, where both interior-point algorithms are based on potential reduction approach (ϵ) with iteration bound O(n log n ϵ ) in the worst case [38].

Algorithm 2: Joint Trajectory Optimization and Power Allocation Algorithm
Given the trajectory of the UAV, solve the power allocation sub-problem (16). Given the power allocation, solve the trajectory optimization problem (29). k = k + 1;

VI. ACHIEVABLE RATE MAXIMIZATION OPTIMIZATION PROBLEM
In this section, the objective is to obtain the transmit powers P M and P U that maximize the achievable data rate.
Let R M,U and R U,BS be the achievable data rates at the UAV (DF-relay) and the BS, respectively, where: where W is the available bandwidth in THz band, γ U and γ BS are given in (7) and (8), respectively. The data rate from source to destination using DF-FD relaying is given by min(R M,U , R U,BS ) [39]. Then, the optimization problem can be formulated as: In order to satisfy the minimum required SINR at any D2D receiving device represented in (44d), γ d2d should be at least equal to T . Then, by substituting the minimum P d2d expressed in (18) in (7) and (8), γ U and γ BS can be expressed as: where Now, problem (44) can be reduced to: where P Mmax and P Umax are the maximum values of P M and P U , respectively. Because the function log 2 (.) is monotonically increasing and since γ U and γ BS are directly proportional to R M,U and R U,BS respectively, this optimization problem can be reformulated as: From (48a), it is obvious that the achieved end-to-end SINR of the system depends on the minimum value of the two hops namely γ U and γ BS . In order to maximize the end-to-end SINR, the transmit powers of the MD, P M and the UAV, P U should be adaptively adjusted to guarantee that γ U = γ BS . Hence, by equating (45a) and (45b), the following holds: (49) Let: where P U is substituted by P max − P M as constrained in (48c).
Parameter Description Value Therefore, the optimization problem in (48) can be expressed as: From (51), the optimum MD power that maximizes the achieved rate from MD to BS is given as: where only the positive power value is accepted. The optimum MD power that maximizes the rate from the MD to the BS can be expressed as: Then, the optimum power of the UAV can be calculated as P * U = P max − P * M . From (53), it is noted that P * M and consequently P * U are constants in the two extreme cases: P * M > P Mmax and P * M < P max − P Umax . The more general case is P max − P Umax ≤ P * M ≤ P Mmax which depends on the distances between the MD and the UAV, D M,U and the distance from the UAV to the BS, D U,BS .

VII. NUMERICAL RESULTS
In this section, the joint power allocation and trajectory optimization scheme that minimize the total outage probability at the BS as well as the rate maximization optimization problem are evaluated. The performance of the schemes is compared to the fixed power and trajectory scheme that blindly divides the system power budget between the MD and the BS equally and assumes a fixed position of the UAV. The simulations are performed at 1 THz, which is one of the transmission windows at THz frequency range presented in [40]. The values of the simulation parameters are summarized in Table  1.

A. PROPOSED JOINT POWER ALLOCATION AND TRAJECTORY OPTIMIZATION SCHEME
In this subsection, the proposed power allocation with trajectory optimization scheme is evaluated to obtain the optimum powers and optimum trajectory that minimize the outage probability expressed in (11). Two schemes are included for comparison purpose. The first scheme is the fixed powers and trajectory scheme; we call it "Scheme 1". The second one is the optimum power allocation with fixed trajectory; we call it "Scheme 2". Fig.3 shows the outage probability for the proposed joint power allocation and trajectory optimization versus the system power budget P max . The figure shows that the outage probability decreases with increasing P max . Moreover, the proposed joint power allocation trajectory optimization scheme achieves the lowest outage probability. This is due to the adaptability of the proposed scheme that assigns powers according to the instance UAV position and assigns the optimized trajectory according to the powers of the MD and the UAV. The figure also shows that the proposed joint power allocation and trajectory optimization scheme outperforms Scheme 2. This is because Scheme 2 optimizes only the powers of the MD and the UAV without adapting the UAV position accordingly. It is also shown that the proposed scheme outperforms Scheme 1. This is because the UAV has a fixed position and the system power budget is blindly divided equally between the MD and the UAV.  This is due to the higher pathloss that the propagating signal encounters at a longer travelling distance which is one of the challenges of THz communications. This problem can be solved using MIMO system which increases the transmit power significantly. Furthermore, the lowest outage probability is achieved by the proposed joint power allocation and trajectory scheme followed by Scheme 2 and then Scheme 1. Fig. 5 shows the outage probability for the same three schemes versus the BS height H. As before, the lowest outage probability is achieved by the joint power allocation and trajectory optimization scheme. It is noticed that the outage probability for the proposed scheme decreases whenever H increases till H ≈ 22.5m which is equal to the height of the UAV. This height corresponds to a shorter distance between the UAV and the BS, D U,BS . When H increases forward, D U,BS increases, which leads to an increase in the outage probability due to an increase in the distance between the UAV and the BS.

B. RATE MAXIMIZATION SCHEME
In this subsection, the rate maximization scheme introduced is evaluated. Fig.6 shows the optimum powers P M and P U that maximize the achievable rate at the BS versus the horizontal distance x o between the BS and the UAV. When x o is zero, which means that the UAV is exactly above the BS, the MD is assigned the maximum MD power value P Mmax and P U is assigned a lower power; which is the remaining power budget P max − P Mmax . These power values are retained until x o ≈ 30 m. When x o > 30 m, P M gradually decreases since the link between the MD and the UAV gets better. However, P U increases since the link between the UAV and the BS gets worse. Similarly, whenever the UAV is exactly above the MD (i.e. x o = 70 m), the maximum UAV power value P Umax is assigned to P U since it suffers from very high fading and distortion due to the long distance travelled. It can be mentioned that at x o = 70 m, there is no need to invest a lot of power in the link between the MD and the UAV. This is because of the optimum power allocation scheme that adapts with the given scenario instead of assigning fixed powers to the MD and the UAV. It is worth mentioning that the summation of P M and P U at any given scenario is P max . Fig. 7 shows the achieved rate for different BS heights H. It is noted that increasing the BS height results in increasing the rate achieved. From the system model represented in Fig.1, increasing the BS height H above zero shortens the distance between the BS and the UAV. This in return leads to decreasing the distance between the UAV and the BS denoted as D U,BS . Because the travelled distance is inversely proportional to the achieved rate, the rate increases whenever H decreases. In addition, it is clear that the rate achieved is maximum whenever the UAV is placed in the middle between the MD and the BS (ex: xo D = 0.5). This is because at this certain UAV placement scenario, the achievable rates values at the UAV and the BS are very close. Fig. 8 shows the achieved rate obtained using the derived optimum power allocation scheme compared with the achievable rate obtained using fixed power allocation scheme versus the normalized distance x o /D. The figure plotted for different values of the SINR thresholds T of the D2D devices. The figure shows that the proposed optimum power allocation scheme outperforms the fixed power allocation scheme for all values of T . The figure also shows that, as T increases, the achieved rate decreases. This is because increasing T leads to an increase in the assigned power for the D2D device P d2d which in turn increases the interference caused by D2D devices at the UAV and the BS receiving antennas. Consequently, higher rate is achieved at small values of T . Fig. 9 shows the achieved rate versus xo D at different distances between the MD and the BS D at BS height H = 15 m and minimum SINR threshold of D2D T = 10 −3 . As expected, whenever the distance between the MD and the BS increases, the achieved rates decreases drastically due to the substantial path loss the signal experiences. Consequently, the rate decreases whenever the distance between the MD and the BS increases due to the inverse proportionality between them. Fig.10 shows the outage probability when using the optimum powers allocation that minimize the achievable outage probability as presented in Algorithm 1 as well as the achieved outage probability when utilizing the powers allocation that maximize the achievable rate, at a fixed trajectory. It is noted that the outage probability achieved due to the optimum powers that minimize the outage probability (Algorithm 1) is better than that achieved when using the optimum powers that maximize the achievable rate.

VIII. CONCLUSIONS
In this paper, a joint power allocation and trajectory optimization scheme that minimizes the outage probability of the link between the MD and the BS in THz channel is proposed. Moreover, a rate maximization scheme is proposed in order to extend the coverage of the BS, where the optimum powers of the MD and the BS that maximize the achievable rate at the BS are obtained. The UAV is deployed as a DF-FD relay in order to extend the coverage of the BS. Numerical results show that the total outage probability achieved by the joint power allocation and trajectory optimization scheme is much better than the total outage probability achieved in the case of fixed power and trajectory scheme. Moreover, the achieved proposed rate maximization scheme that optimizes the MD and UAV transmitted powers is found superior to that fixed power allocation scheme achieved rate that assigns equal fixed powers to the MD and the UAV. For future work, MIMO system could be implemented and antenna arrays are utilized to increase the transmit powers effectively and achieve a higher directivity in our proposed UAV-relaying system.