Uavnoma: A UAV-NOMA Network Model under Non-Ideal Conditions

Uavnoma is a set of Python functions and a front-end script for modeling, studying, and analyzing the communication system composed by an unmanned aerial vehicle (UAV) and two ground users. We assume that the UAV acts as an aerial base station to serve the users according to non-orthogonal multiple access (NOMA) principles. For more practical insights, residual hardware impairments (RHI) and imperfect successive interference cancellation (ipSIC) are considered. More specifically, uavnoma allows the modelers to study and visualize the system performance in terms of achievable rate and outage probability. Additionally, the package produces figures and tables showcasing results from the specified performance metrics


INTRODUCTION
The massive adherence of society to wireless communication technologies has enabled significant technological development in recent years, generating new scenarios and new challenges.Based on this, different network structures are needed to meet the heterogeneous requirements of the applications foreseen for the next generation of mobile communication.These different network infrastructures will impose stringent requirements to system designers, such as reliable communications, massive connectivity, low latency, low energy consumption, seamless connectivity, and high spectral efficiency.To achieve these heterogeneous requisites, numerous strategies and transmission technologies have been proposed.In this context, it is necessary to explore and understand the principles of the techniques and tools expected for beyond fifthgeneration (B5G) networks, so that new solutions can be proposed.This work provides a package to auxiliary the study and formulation of system models related to two potential tools for B5G: non-orthogonal multiple access (NOMA) and unmanned aerial vehicles (UAV).
Since the design of appropriate multiple access techniques is crucial for supporting the massive number of devices foreseen for future networks, the NOMA technique is investigated in this work.NOMA is a crucial multiple access technique for supporting the massive number of devices foreseen for future networks, due to promising gains when compared to the orthogonal counterpart [1,2].The main idea of NOMA is to perform superposition coding (SC) at the transmitter and successive interference cancellation (SIC) at the receiver.Then, the users share the same resource block of time/ frequency with distinct power levels.
In turn, the demand for UAV in communication networks has increased in the last few years [3].UAVs working as aerial base stations (BSs) have also been identified as enablers of future-generation wireless networks due to the ability to perform complex tasks in diverse scenarios and flexible configurations.Due to these features, UAVs can significantly improve the connectivity and coverage range of communication networks.By combining the intrinsic features of NOMA and UAV, it is possible to achieve enormous gains for the overall network in terms of coverage, latency, fairness, capacity, spectral efficiency, and energy efficiency [4].
In the investigated scenario, a UAV acts as a BS which employs NOMA to communicate with two ground users.In order to provide practical insights, this work presents the uavnoma package, a Python simulation model of a downlink UAV-NOMA network with two users under the effect of the residual hardware impairments (RHI) and imperfect successive interference cancellation (ipSIC) on the network.In addition, Rician fading is taken into account to model the line-of-sight (LoS) component to the Air-to-Ground (A2G) communication link between the UAV and ground users.
In summary, the uavnoma package provides a set of functions to generate the simulation parameters and to calculate the performance of the UAV-NOMA framework.The package also provides a front-end script to run simulations.The functions provided by uavnoma allow the user to: • Study the UAV-NOMA network and use it as a basis for implementing other technologies.
• Modify the parameters and analyze the system's performance, considering the error propagation due to the RHI and the ipSIC in terms of outage probability and achievable rate.• Visualize simulation output and produce tables and figures to evaluate the performance of the system.
These utilities were developed to study the modeling and performance of UAVNOMA networks under non-ideal conditions.The remainder of this paper is organized as follows.The Section "Theoretical background" describes the system model under consideration.In the next Section, "Implementation and architecture", the architecture and organization of the package are presented.A usage example is discussed in Section "Usage Example", while the package's quality assurances are described in Section "Quality control".Section "Availability" provides information about the package's availability for different architectures, as well as its dependencies.Finally, the Section "Reuse potential" describes the potential extensions of the package.

THEORETICAL BACKGROUND
Scenario Let us consider a downlink UAV-aided NOMA network, as illustrated in Figure 1.In this scenario, a UAV is deployed as an aerial base station that communicates with M = 2 users with different channel conditions.We consider that each node is equipped with a single antenna and both UAV and users operate in the half-duplex mode.Furthermore, we assume that users subscribe to different traffic services that require a minimum data rate to be provided acceptably.
We assume that the UAV continuously flies with a constant velocity in a circular trajectory of radius r 1 and altitude H, and the users are randomly positioned in a region of radius r 2 .Based on three-dimensional Cartesian coordinates, the location of the UAV (x,y,z) and of the m-th user (x m ,y m ,0), with m ∈ {1, 2}, can be represented respectively by (r 1 cosθ u , r 1 sinθ u , h) and (r 2 cosθ m , r 2 sinθ m , 0).The variables θ u and θ m are defined as the azimuth angle of the UAV and of the m-th user along their respective circles.The Euclidian distance between the UAV and the m-th user can be obtained by .
Channel Model Since the LoS path typically exists in our scenario, Rician fading is considered, and the channels between the UAV and the users are assumed to follow a Rician distribution.
A Rician fading channel is described using two parameters: 1) Rician factor (K), and, 2) the total power of the direct path and the scattered paths, P LoS = µ 2 + 2σ 2 , where µ denotes the mean and σ denotes the standard deviation.Considering a given K and P LoS , the µ and σ can be calculated, respectively, as follows , 1 and .

2( 1)
The channel coefficients h m from the UAV to the m-th user, modeled as complex Gaussian variables, are expressed as where g m denotes the deterministic LoS channel component modeled by complex Gaussian random variables, g m ∼ CN(µ, 2σ  x Ps Ps a a = + to all users by superposition coding (SC), where P is the average transmit power of the UAV, s 1 is the message of the primary user, α 1 denotes the power allocation factor for the primary user message, s 2 is the message of the secondary user, and α 2 denotes the power allocation factor for the secondary user message, with α 1 + α 2 ≤ 1 and α 1 , α 2 > 0. In real deployments, due to many impairments, the network can experience residual hardware degradation.
In the receiver, the users employ the SIC technique.The SIC technique consists in decoding the strongest signal component first, which will be the signal of the primary user due to the power factor (α 1 ) allocated by the UAV.By contrast, the remaining signals are treated as interference.Specifically, the primary user tries to decode its message by treating the secondary user's message as noise.The more realistic signal-to-interference-plusnoise ratios (SINRs) at the primary user when we consider non-ideal conditions, such as RHI, can be expressed as where ρ = P/λ 2 denotes the signal-to-noise ratio (SNR) at the UAV, and κ (0 ≤ κ ≤ 1) denotes the error propagation factor that models the impact of RHI.When κ = 0, perfect SIC is assumed.On the other hand, κ = 1 is the worst case, corresponding to a fully failed hardware scenario.When SIC is employed by the secondary user, the process occurs successively until the secondary user decodes its respective message.First, the secondary user tries to decode the primary user's message by treating its message as noise and then removes the message from his observation successively.It is worth noting that perfect SIC is difficult to happen in practice.Then, as a result of the ipSIC at the users, a minimal error in the first detection will cause large errors due to the recursive characteristics of the process.Based on the above, the more realistic SINR at the secondary user when we consider non-ideal conditions, such as RHI and ipSIC, can be expressed as where ϵ (0 ≤ ϵ ≤ 1) denotes the error propagation factor that models the impact of ipSIC.When ϵ = 0, perfect SIC is assumed, while ϵ = 1 reflects the worst-case scenario.Under this consideration, the instantaneous data rate achieved by the primary user can be written as ( ) The achievable rate by the secondary user can be expressed as ( ) By definition, the outage event can occur when the rate provided to any user is not enough to decode their data flow or the data flow of the weaker users.Based on this, we investigate the outage probability of received messages to characterize the link-level performance for the users in UAV-NOMA networks with non-ideal conditions, such as the effect of RHI and ipSIC, as described below.
The outage probability achieved by the primary user and secondary user can be expressed, respectively, as [ ] and [ ] where r denotes the target rate.
In turn, substituting (5) and ( 7) into (9), the outage probability of the primary user can now be expressed as ( ) Substituting ( 6) and ( 8) into (10), the outage probability of the secondary user can be rewritten as ( )

IMPLEMENTATION AND ARCHITECTURE
The uavnoma package is implemented in Python, containing a front-end script and functions to model the UAV-NOMA system under non-ideal conditions.The script provides a command-line user interface, accepting model parameters, running the simulation, and displaying results using plots and a table, optionally exporting them to a CSV file.The functions are shown in Figure 2.
• Design the initial parameters.
• Calculate the position of the UAV and users.
• Model the fading based on Rician Distribution.
• Generate the channel gain between UAV and users.
• Analyze system performance using as metrics the instantaneous achievable rate and outage probability.
The included front-end script allows anyone to experiment with the model without a deep knowledge of Python.The package provides the capability to exploit the main characteristics of the transmission model in which the UAV is used as an aerial base station.In the system, data is forwarded to users using the NOMA technique.To simulate a more realistic scenario, the effects of hardware impairments and imperfect SIC are assumed.In addition, it allows us to explore new scenarios, such as cooperative communication, fullduplex communication, and propose methodologies to improve system performance, such as energy allocation policies, trajectory optimization, energy harvesting, decoding order, and channel estimation.As shown in Figure 2. the package is organized in three modules, two of them containing library functions (generate_values.pyand performance_metrics. py), and another representing the front-end script (command_line.py).The library functions allow the user to programmatically configure and run the UAV-NOMA system model.Besides allowing users to run simulations from the command-line, the front-end script is fully commented, also acting as a tutorial on how to use the library functions.
Specifically, the generate_values.pymodule has functions to generate data related to the position of the users and the UAV, fading distribution, and channel coefficient gain.More specifically, the function group is described as follows: generate_channel: this function calculates the specific distance between the users and the UAV, the small-scale fading, large-scale fading, and finally, it generates the channel coefficients.The channel gains are sorted to identify the primary user and secondary user.
The second module, performance_metrics.py, extracts information about channel coefficients and uses it to calculate performance metrics.Specifically, the module is composed of the following functions: calculate_instantaneous_rate_primary: this function calculates the achievable rate of the primary user.It calculates the SINR experienced by the primary user and based on the result, generates the achievable rate under non-ideal conditions of RHI.calculate_instantaneous_rate_secondary: following the NOMA principles, this function returns the achievable rate of the secondary user under non-ideal conditions of RHI and ipSIC.average_rate: this function provides the average achievable rate of the system.outage_probability: from the obtained data about the user's rate, this function returns the system outage probability, the outage probability of the primary user, and the outage probability of the secondary user.
The command_line.pymodule contains the front-end script, which automates the analysis and presentation of the data obtained by the two library modules.The main function is called when the script is invoked with the uavnoma command.The validate function provides a verification of the user-specified parameters.Users can manipulate the behavior of the system by modifying the script's parameters.The script uses the library functions to perform a simulation and is able to produce plots and tables as shown in Figures 3-5, as well as output results to a CSV file.The type of generated output is also controlled via the script's parameters, as discussed in the next section.

USAGE EXAMPLE
An example simulation was executed with the parameters shown in Table 1, according to the following command: $ uavnoma --seed 123 -s 50000 -p 2 -f 15 -l 2.2 -r 2 -ur 15 -uh 20 -t1 0.5 -t2 0.5 -hi 0.05 -si 0.05 -p1 0.8 -p2 0.2 --snr-min 10 --snr-max 60 The uavnoma command outputs the results displayed in Figure 3 to the terminal, generating the plots shown in Figures 4 and 5. To evaluate the impact of the outage probability, Figure 4 shows the outage probability performance of the primary and secondary users.From this figure, one can observe that for intermediate SNR values, the secondary user achieves more outage probability values.This effect is the result of the accumulation of inter-user interference during the successive decoding process on each user.Since the secondary user fails to decode and remove the primary user's signal from their data, then interfering components will accumulate successively throughout the communication process.Thus, the level of interference experienced by the stronger user will be higher, which directly impacts his performance.In order to present more insights.
Figure 5 shows the achievable rate of the primary and secondary users.As expected, the rate curves corroborate the results obtained based on the outage probability figure.For high SNR values, the rate achieved by the secondary user becomes better than that of the   Table 1 Simulations parameters for the results shown in Figures 3-5.
Figure 5 Plot of achievable rate provided by the front-end script when using the parameters shown in Table 1.

Figure 1
Figure 1 System model: simplified representation of UAV-NOMA transmission.
random_position_uav: this function provides a UAV position based on a 3D Cartesian plane due to the mobility and height of the UAV.random_position_users: this function generates the position of the users based on a 2D Cartesian plane.fading_rician: this function generates the parameters to model the fading based on Rician distribution to model the fading considering LoS effects.

Figure 2
Figure 2 Structure of the uavnoma package.The package is organized into two main components, library functions and a front-end script.The library functions component is composed of two modules: generate_values.pyand performance_metrics.py.The front-end script component is composed of only one module: command_line.py.

Figure 3
Figure 3Table provided by the front-end script when using the parameters shown in Table1.

Figure 4
Figure 4Plot of outage probability provided by the front-end script when using the parameters shown in Table1. 2