Secrecy Energy Efﬁciency Maximization in an Underlying Cognitive Radio–NOMA System with a Cooperative Relay and an Energy-Harvesting User

: Security is considered a critical issue in the deployment of 5G networks because of the vulnerability of information that can be intercepted by eavesdroppers in wireless transmission environments. Thus, physical layer security has emerged as an alternative for the secure enabling of 5G technologies and for tackling this security issue. In this paper, we study the secrecy energy efﬁciency (SEE) in a downlink underlying cognitive radio (CR)—non-orthogonal multiple access (NOMA) system with a cooperative relay. The system has an energy-harvesting (EH) user and an eavesdropper, where the transmitter provides direct communication with a close secondary user and a distant secondary user via the relay. Our objective is to maximize the SEE of the CR-NOMA system under the constraints of a minimum information rate for the secondary users, a minimum amount of energy harvested by the EH user, and maximum power availability at the transmitter and the relay that still prevents them from causing unacceptable interference with the primary user. The proposed solution to maximize the SEE is based on the low-computational—complexity particle swarm optimization (PSO) algorithm. For validation purposes, we compare the optimization outcomes obtained by the PSO algorithm with the optimal exhaustive search method. Furthermore, we compare the performance of our proposed CR-NOMA scheme with the conventional orthogonal multiple access (OMA) scheme.


Introduction
The rapid expansion of wireless networks has produced a massive increment in data traffic. The fundamental requirements for future networks such as 5G include massive connectivity of users and the Internet of Things (IoT), low latency, high energy efficiency, and higher data rates. Non-orthogonal multiple access (NOMA) has attracted extensive attention in the literature because it can provide superior energy efficiency, higher data rates, and low transmission latency [1,2]. NOMA is based on superposition coding at the transmitter and successive interference cancellation (SIC) at the receiver, where multiple users can simultaneously access the same frequency with different transmit power levels [3,4]. To further improve the coverage of the network, cooperative communications utilize a relay or a cooperative user to forward messages to the intended users who are very far away from the base station (BS) and who do not have a direct link because of obstacles or the shadowing effect.
Security represents one of the major problems in wireless networks because the signals transmitted can be intercepted in the shared wireless medium. Physical layer security (PLS) was introduced to complement traditional security techniques, and it exploits the nature of physical layer dynamics to provide a secure transmission [5]. Several studies in the literature have investigated the security in NOMA systems with the objectives of secrecy sum rate maximization [6][7][8] and secrecy energy efficiency (SEE) [3,9]. Zhang et al. [6] considered a single-input single-output NOMA system with a passive eavesdropper, where the objective was to maximize the secrecy sum rate (SSR) under the constraint of minimum data rate at the users. The authors compared their proposed solution with the orthogonal multiple access (OMA) method, obtaining a significant improvement of the SRR by using NOMA. A downlink simultaneous wireless information and power transfer (SWIPT) system with NOMA was proposed in [7]. The BS simultaneously served several information receivers and multiple EH receivers in which the EH receivers were considered potential eavesdroppers. The authors solved the SSR maximization problem under the constraints of minimum data rate required by the information receiver users and minimum harvested energy required by the EH receivers. Garcia et al. [8] proposed secrecy sum rate maximization in a cooperative NOMA system composed of two users and a relay. The paper highlights the importance in cooperative communications of improving the secrecy performance of the network, since simulation results showed that higher values for the secrecy sum rate were obtained by employing a cooperative relay compared to values obtained by the NOMA network without cooperative relaying. A cooperative system model with SWIPT was proposed in [10], where an EH user co-existed with a nearby user that applies SWIPT to harvest energy and work as a relay to help and guarantee a minimum data rate at the far user. The minimum transmit power problem was considered under the constraints of minimum signal to interference plus noise ratio (SINR) of the users and minimum harvested energy at the EH user. Mao et al. [11] considered an underlay cognitive multiple-input single-output NOMA system with SWIPT in which the secondary BS and the multiple secondary SWIPT users co-existed with several primary users via the underlay scheme. The minimum transmit power problem is investigated subject to the constraints of minimum SINR, minimum energy harvested to satisfy the power consumption at the users, and maximum interference power with the primary network.
Yao et al. [9] considered a downlink NOMA system composed of a BS and multiple legitime users under the presence of an eavesdropper. The Secrecy energy efficiency was maximized subject to the constraints of minimum data rate and maximum available power at the BS. A NOMA cognitive radio (CR) system with energy harvesting (EH) users was proposed by Wang et al. [3] in which the secondary users harvest energy in the first phase and transmit their uplink information with NOMA in the second phase under the presence of the eavesdropper. The authors proposed the secrecy energy efficiency (SEE) maximization problem under the constraints of minimum data rate, maximum interference power to the primary users (PUs) and maximum secrecy outage probability. However, none of the researchers studied SEE maximization in a downlink CR-NOMA system with cooperative relaying and an EH user. The importance of the EH user lies in powering the user terminal expected in 5G applications, such as those in the Internet of Things (IoT) [12]. In this paper, we consider the EH user to be a receiver that stores energy from RF signals.
With the above motivations, and because energy efficiency is a crucial factor for future wireless networks, we investigate a downlink CR-NOMA scheme to maximize the SEE with cooperative relaying, subject to quality of service (QoS) requirements. We propose a particle swarm optimization (PSO)-based algorithm to solve the optimization problem, which has advantages over the optimal exhaustive search method, such as low computational complexity and high accuracy. Moreover, in the literature, application of PSO in wireless communications networks has shown high performance in resolving optimization problems [8,13].
The main contributions of this paper are summarized as follows.
• Since we focus on enhancing the PLS (and to enable sustainable 5G networks), we propose maximizing the SEE of the CR-NOMA system with cooperative relaying and an EH user to prevent eavesdropper wiretaps by satisfying the following QoS requirements: minimum required energy at the EH user, a minimum data rate for secondary users, the maximum permissible transmission power at the relay, and a transmitter that avoids interference with the primary user.
• To reduce the computation complexity of the solution, we solve the SEE maximization problem with a PSO-based algorithm that provides high-accuracy outcomes and high convergence speed. In addition, we provide the mathematical boundaries for the variables of the proposed optimization problem. The simulation results show that the proposed PSO algorithm achieves outcomes very close to values obtained by the high computational-complexity exhaustive search method.

•
We solve the SEE maximization problem for a CR orthogonal multiple access (CR-OMA) scheme to compare it with our proposed CR-NOMA scheme. Similar to the CR-NOMA system, we also optimize the power allocation variables of each OMA user. Simulation results show that our proposed scheme based on NOMA outperforms the OMA scheme, where an improvement in the SEE of around 40% to more than 100% is achieved by NOMA compared with OMA .
The rest of this paper is organized as follows. The CR-NOMA network model with an EH user is described in Section 2. In Section 3, the SEE maximization problem in the CR-NOMA network is formulated, and the PSO-based power allocation scheme for SEE maximization is described. The comparison approach of SEE maximization in the CR-OMA scheme is studied in Section 4. Simulation results of the cooperative CR-NOMA network with an EH user are presented in Section 5. Finally, the conclusion is presented in Section 6. Table 1 lists the main abbreviations used throughout the paper.

Network Model
We study a downlink underlying CR-NOMA system consisting of one secondary transmitter, one cooperative relay, two secondary users, one EH user, one primary user and one eavesdropper. The cooperative relay operates in half-duplex mode and implements the decode-and-forward (DF) protocol. Figure 1 illustrates the system model; the nearby secondary user is U1, and we assume there is no direct link between the transmitter and the distant secondary user, U2, because of path obstruction. User 3 (denoted as U3) is the EH user and the primary user is denoted as PU. The system model involves two phases. In Phase 1, the transmitter serves the secondary users and sends a superimposed signal, x, composed of Message 1, Message 2, and Message 3 corresponding to the close, distant and EH users' messages, respectively. Then, U1 and the relay receive the messages. In Phase 2, the relay retransmits Message 2 to U2 and U1. In the following, we provide a detailed description of the two phases.
Concerning Phase 1, let x 1 , x 2 ∈ C denote the messages for U1 and U2, with transmit powers of p 1 and p 2 respectively. According to the NOMA concept, the transmission power level for the user with the lower channel gain should be higher than the transmission power level of the user with the higher channel gain. Therefore, we consider p 2 > p 1 . The energy signal intended for the EH user, x 3 , can be a signal known to both secondary users prior to information transmission. At the secondary transmitter, x 3 is sent with a transmit power of p 3 . Then, the transmit signal is defined as The channels from the transmitter to User 1, User 3, the relay, and the eavesdropper are denoted ash Tu 1 ,h Tu3 ,h TR andh TE , respectively. The channels from the relay to User 1, User 2, and the eavesdropper are denoted asg Ru 1 ,g Ru 2 , andg RE , respectively. We assume that the variance in the noise of the users, the relay, and the eavesdropper is the same, and we define them as We also assume that U1 and U2 can cancel the interference from known symbol x 3 . In Phase 1, since the relay decodes Message 2 (considering Message 1 as interference), the rate of Message 2 at the relay is given by where h TR = h TR 2 .
At the eavesdropper, the rate of Message 1 is: where h TE = h TE 2 .
The energy harvested by User 3 in Phase 1 can be expressed as where h Tu3 = h Tu3 2 , τ ∈ (0, 1), τ = 1 2 is the transmission time fraction for Phase 1. In Phase 2, the relay retransmits Message 2. User 1 and the eavesdropper use maximum-ratio combining, and the rate of Message 2 at U1 is given as follows: where h Tu 1 = h , and p r denotes the transmit power of Message 2 at the relay. The rate of Message 2 at the eavesdropper is given as follows: where g RE = |g RE | 2 . Under NOMA, User 1 performs successive interference cancellation to remove the interference of Message 2, and decodes Message 1. Then, the rate of Message 1 at U1 is defined as follows: Therefore, the secrecy rate of Message 1 is given by where The rate of Message 2 at U2 is as follows: . The achievable rate of Message 2 is defined by the rate observed at U1, the relay, and User 2 as follows: Consequently, the secrecy rate of Message 2 is defined as: The power at the transmitter and the relay should remain at a controllable level to avoid interference with the primary user, and these power constraints are specified in Section 3.

Problem Formulation and the PSO-Based Power Allocation Scheme for SEE Maximization
The objective is to maximize the SEE, subject to the constraints of a minimum required rate at each secondary user, minimum energy harvested by U3, and maximum available power at the relay and transmitter based on the maximum permissible interference with the primary user. The SEE is defined as the ratio of secrecy sum rate maximization to total power consumption [3,5,14]. The optimization problem can be modeled as follows: where p cT and p cR are circuit power consumption, ξ is the minimum required energy harvested by U3, and φ 1 and φ 2 are the minimum required data rates for U1 and U2, respectively. P max T and P max R are the maximum power permitted at the transmitter and relay, respectively, to avoid interference with the primary user. To guarantee that the power level from the transmitter and the relay will not interfere with the primary user, the maximum transmission power at the transmitter and at the relay, respectively, are constrained as indicated in (12) and (13): where I max is the power level of the maximum permissible interference with the primary user, P T is the maximum available power at the BS, and h T p is the channel coefficient from the secondary transmitter to the primary user; and: where g Rp is the channel coefficient from the relay to the primary user, and P R is the maximum available power at the relay. To solve problem (11), we propose a low-complexity algorithm based on PSO [15]. First, we define the boundaries of the variables p 1 , p 2 , p 3 and p r based on the constraints in problem (11). Then, the minimum transmit power for Message 1 is calculated based on (11b) and (11f), the minimum transmit power of Message 2 at the transmitter is calculated based on (11c) and (11f), the minimum transmit power intended for the EH user is calculated based on (11f), and the minimum transmit power of the relay is calculated based on (11c), as follows: g Ru 1 , and α = 2ξ The overall algorithm of the proposed scheme using PSO is described in Algorithm 1. Let It max , S, w, c 1 , and c 2 , respectively, denote the maximum number of iterations, the total number of particles, the inertia weight parameter, and the acceleration coefficients. Each particle's position represents a vector of four elements (p 1 , p 2 , p 3 , p r ) for which the boundaries are p 1 min , P max T , p 2 min , P max T , p 3 min , P max T and p r min , P max R , respectively. Let x n , v n , and p n best define the position, velocity, and local best position of particle n, respectively.
In addition, the global best position of all particles is defined by g best . We use a penalty function to deal with the constraints, where we define fitness function f (x n ) = f (p 1 , p 2 , p 3 , p r ) based on the objective function of problem (11), as follows: where ρ is the penalty value, g i is the i-th constraint of problem (11), and δ (g i ) = 0 if g i is satisfied and δ (g i ) = 1 otherwise. Note that if all the constraints are satisfied (feasible point), f (x n ) is the objective function (11a) without penalty.

Algorithm 1:
The proposed PSO algorithm to solve SEE problem (11).
Data: It max , S, w, c 1 , c 2 and variables {x n }. Initialize the positions of particles randomly x n = {p 1 , p 2 , p 3 , p r }, and evaluate f (x n ). Find the index of the best particle: g best = arg max 1≤n≤N f (x n ).
Define the initial local best position: p n best = x n , ∀n. Define the initial velocity of the particles: v n = 0, ∀n. for i = 1 : 1 : It max do for each particle n = 1, . . . , S do Calculate random numbers: r n 1 , r n 2 ∼ U (0, 1). The velocity of the particle is updated as: v n ← wv n + c 1 r n 1 p n best − x n + c 2 r n 2 (g best − x n ). Update particle's position: x n ← x n + v n . Limit x n in their respective boundaries and get f (x n ). Evaluate the local best position: if f (x n ) > f p n best then p n best ← x n end Evaluate the global best position: if f (x n ) > f (g best ) then g best ← x n end end end Result: Set f (g best ) as the maximum SSE of problem (11).
Under the presence of more users, the proposed system model can be utilized by applying a user grouping scheme. For instance, a user grouping for a downlink NOMA system is proposed in [16]. In the paper, the authors considered a grouping scheme where two users are selected for each group (strong user and weak user), and the different groups use orthogonal resources by avoiding interference between groups. In [17], the authors proposed a NOMA-TDMA scheme by considering an uplink industrial IoT scenario composed of several sensors and one sink. The first step is to sort the channel gains and divide the total time into several time slots. Then, an optimization problem is formulated to allocate the power with NOMA and define the duration of the time slots, where the system allows a maximum of two users in each group, and the different groups are assigned different time slots. Based on the previous studies on many users, therefore we can group the users according to their channel gains, where each time slot is assigned to each group. In this case, there is no interference between users in different groups, and an extension of the proposed scheme can be applied to allocate the power to maximize the SEE with NOMA in each group. However, it is noteworthy that the proposed scheme considers that there is no direct link to the secondary user 2 because of path obstruction so that a cooperative relay is needed to consider. In the case of a user grouping scheme, there exist some groups where the distant secondary user has poor channel conditions. In that case, our proposed scheme based on a cooperative relay can be utilized efficiently.
In the case of multiple relays, the development of a relay selection algorithm is needed, where a simple solution is an exhaustive search among the possible relays. That is to say, we can perform the power allocation while considering each relay and choose the relay that achieves the highest SEE. However, an efficient solution with multiple relays needs a joint optimization of the power variables and relay selection, which may be topics for future research. On the other hand, the case of multiple eavesdroppers can be addressed by considering just the eavesdropper with the highest SINR to compute the secrecy rate with small modifications in (2) and (5), following the approach proposed in [18].

Energy Efficiency Maximization in the Baseline CR-OMA Scheme with Cooperative Relaying and an EH User
In this section, we describe the baseline scheme for the energy efficiency maximization problem in OMA with cooperative relaying and an EH user. In OMA, the messages are sent to each user in different time slots. Accordingly, the transmission of each message from the transmitter to its respective secondary user in the OMA scheme involves three phases, which are detailed as follows.
In Phase 1, the transmitter sends message x 1 to U1. Therefore, the rate of Message 1 at U1 can be expressed as ).
The rate of Message 1 at the eavesdropper is: Accordingly, the secrecy rate of Message 1 is given by In Phase 2, the transmitter sends Message 2 to the relay. Then, the rate of Message 2 at the relay is as follows: In Phase 3, the relay forwards Message 2 to U2. Then, the rate of Message 2 at User 2 is The achievable rate for Message 2 is defined by the rate observed at U2 and the relay, as follows: R u 2 ,min _OMA = min(R x 2 ,TR_OMA , R x 2 ,Ru 2_OMA ).
The rate for Message 2 at the eavesdropper is given as follows: Therefore, the secrecy rate of Message 2 is defined as: To improve the OMA scheme, the transmitter does not send an energy signal to User 3, because it involves an extra period of time to send that signal; instead, we assume that User 3 stores the energy that comes to U1 from the transmitter during Phase 1 plus the energy that comes from the transmitter to the relay during Phase 2. In that way, it is possible to take advantage of the energy used by the transmitter when it sends the messages of secondary users. Accordingly, the energy stored by User 3 is given by Our goal is to maximize the secrecy energy efficiency, to guarantee the QoS requirement of the minimum rate at each secondary user, minimum requered energy and to guarantee maximum permitted power at the relay and transmitter. Accordingly, the problem can be formulated as follows: where p cT1 , p cT2 and p cR1 are circuit power consumption during the phase 1, phase 2 and phase 3 at the transmitter and at the relay, respectively, Similar to the proposed solution to P1, secrecy energy efficiency maximization problem P2 for CR-OMA is solved by using the PSO algorithm. Therefore, we need to establish the boundaries for power allocation variables p 1 , p 2 , and p r to be optimized. In this sense, the minimum transmit power, p 1 min _OMA , is calculated based on constraints (28b) and (28g), with p 2 min _OMA calculated based on (28c) and (28g), and with p r min _OMA calculated based on constraint (28c), as follows: where ω = 3ξ h Tu3 − P max T . Accordingly, the boundaries of each particle's position for the power allocation variables in the PSO algorithm are p 1 min _OMA , P max T , p 2 min _OMA , P max T and p r min _OMA , P max R .

Simulation Results
In this section, we numerically evaluate the performance of our proposed PSO-based algorithm in the CR-NOMA network with cooperative relaying and an EH user, as illustrated in Figure 1, in comparison with the CR-OMA approach and with the baseline exhaustive search (ES) method.
In the simulations, the channels are modeled ash where d ij is the distance between device i and j, and the path loss exponent is defined by v. We evaluated the proposed algorithm with the following parameters: v = 4, σ 2 = −60 dBm, w = 0.7, and c 1 = c 2 = 1.494. The simulations were carried out on a computer with 16 GB of RAM and an Intel Core i7-6700K CPU by using Matlab.
The distance from the transmitter to the EH user is set as d Tu 3 = 10 meters. This distance needs to be small since the RF signal is attenuated as the distance increases and there exists a minimum energy harvesting requirement. In addition, it is common to find in the literature distances of 10 m or less for an EH user. For instance, we can refer to [11], where the authors used a distance of four meters from the secondary BS to the secondary EH users.
On the hard, depending on the scenario, the distances of the secondary users can be small. For example, picocells consider a maximum range of 200 m [19]. In the literature, common distances assumed to NOMA users are in the range of 10 to 80 m [2,6,20]. In addition, the objective of the proposed optimization problem is to maximize the SEE of the secondary network, which has relatively small distances since the transmission power is constrained with a maximum permissible interference with the primary users. In this paper, therefore we consider the distances from the secondary transmitter to User 1, the relay, the PU, and the eavesdropper as d Tu 1 = 30, d TR = 50, d T p = 60, and d TE = 50 in meters, respectively. The distances from the relay to User1, User2, the PU, and the eavesdropper are defined as d Ru 1 = 30, d Ru 2 = 50, d Rp = 50 and d RE = 30 in meters, respectively.
With respect to the maximum permissible interference power with the PU, Tuan et al. [21] studied the effects of the maximum permissible interference power in a range from −30 dBm to −90 dBm. In addition, the trade-off between the interference power and throughput of the cognitive network was investigated in [22], where the authors considered a range from −10 dBm to −40 dBm for the maximum permissible interference power. It is noteworthy that as we increase the maximum interference power value, we obtain a wider feasible domain of the problem. Then, to analyze the worst scenario, we select I max = −60 dBm.
To define the number of particles in the proposed PSO-based algorithm, we analyze the relative change of the objective function, i.e., SEE, for several numbers of particles, S. The relative change can be defined as f (g best ) i−1 − f (g best ) i f (g best ) i−1 , where f (g best ) i−1 is the fitness function of the global best particle at iteration i − 1 and f (g best ) i is the fitness function of the global best particle at the current iteration i. We present in Figure 2 the relative change of the SEE when the number of particles are equal to 25, 20 and 15, respectively. The values of the minimum rates at the secondary users are φ 1 = φ 2 = 1(bit/s/Hz), the minimum energy harvested by the EH user is ξ = −18 dBm, and the transmit power at both the transmitter and the relay is P T = P R = 30 dBm. In addition, Table 2 shows the comparison of a different number of particles when the number of iterations was selected to satisfy a tolerance of 10 −4 in the relative change of the SEE. The absolute error is evaluated by taking into account the SEE obtained by exhaustive search. We can observe that the absolute error is very small for all the cases with a small value in the computational time. The case with S = 10 archives the lowest computational time, however, the small number of particles in PSO can lead to a local optimal solution, which should be avoided. Therefore, in the paper, we had selected S = 20 particles to be used in the rest of the simulations.   Figure 3 shows the convergence behavior of the proposed algorithm given in Algorithm 1 for an average of several channel realizations. The value of the minimum rates at the secondary users are φ 1 = φ 2 = 0.5, 1, 1.5 (bits/s/Hz), the minimum energy harvested by the EH user is ξ = −18 dBm and the maximum available transmission power at the transmitter and the relay is P T = P R = 30 dBm. We can see that the SEE is enhanced as the iteration index is increased, and its convergence reaches a stable value from iteration index 50. However, from Table 2, we observe that we need at least 90 iterations to achieve a tolerance of 10 −4 . Then, we consider It max = 70 for further simulations, which is a trade-off between accuracy and computational time. We also observed that the SEE increases when decreasing the minimum data rate requirement of the secondary users. The reason for this is that the transmitter and the relay should deliver low transmission power to satisfy the low required rate of the secondary users. Consequently, the eavesdropper hardly trap the messages transmitted from the transmitter and the relay.
Note that if a lower computational time is needed, we can reduce the number of particles and iterations with a consequent reduction in the accuracy of the solution. For instance, at 40 iterations, the tolerance value is around 0.03 with an absolute error of around 0.0008 in the case of S = 20 and φ 1 = φ 2 = 1(bits/s/Hz).  In this paper, we analyze the computational cost based on the number of equations that the PSO-based algorithm needs to compute in each iteration, where a detailed study of the operations involved in each equation is omitted since it includes simple operations that just uses real values and do not have matrix operations. In addition, it is assumed that the secondary transmitter has high computational capabilities.
The computational cost for a complete iteration of the proposed PSO-based algorithm depends on the evaluation of the objective function and constraints in the problem (11), and the computations needed to update the velocity and position of the particles. First, from the problem (11), the algorithm needs to evaluate the expressions of the rates and the energy harvested for the current particle position, which requires the evaluation of 10 equations involving just real numbers. To estimate the objective function and constraints, it is also necessary to evaluate 8 equations and one additional equation for obtaining the fitness function in (18). Second, for each particle, we require to calculate two random numbers and evaluate 8 equations for the velocity update and position update since we have four variables. Third, we limit the position of the particle and find the local and best positions by computing six equations. Then, for each particle n, we need to execute around 35 equations. Since the algorithm repeats the process for a total of It max iterations, the total number of equations to be evaluated is 35 × S × It max , which can be mathematically expressed as the computational complexity of O (S × It max ).
In the case of the exhaustive search method, the complexity depends on the range of the variables which is based on numerical precision. Let us define ζ as the steps used for the power variables, then the total possible values for the variable p 1 are Υ p 1 = P max T − p 1 min + ζ ζ , where the same procedure is applied to the other variables to obtain Υ p 2 , Υ p 3 and Υ p r . Then, for the ES method, we need to evaluate the objective function and constraints a total number of Υ p 1 × Υ p 2 × Υ p 3 × Υ p r times. We can observe that the proposed PSO-based scheme permits a huge reduction in the computational complexity compared with the exhaustive search. For instance, in the case of φ 1 = φ 2 = 1(bits/s/Hz) and ξ = −18 dBm with a step of ζ = 1, the computational time of ES is around 72,4492 (s), which increases exponentially by reducing the value of ζ, i.e., with more numerical precision. By contrast, the PSO-based algorithm achieves a computational time of 18.92 (ms) with a number of particles equal to 20 and 90 iterations as we can see in Table 2. Figure 4 shows a comparison of SEE performance between our proposal using NOMA and the conventional OMA scheme in accordance with the SEE objective function versus the minimum data rate at the secondary users when the minimum energy harvested by the EH user is ξ = −15 dBm, when the maximum available transmission power at the transmitter and the relay is P T = P R = 30 dBm. From Figure 4, we can see that the NOMA scheme significantly outperforms the traditional OMA. This is because, under NOMA, the location of both users is exploited to simultaneously transmit to User 1 and User 2, in which the power allocated for the distant user is higher, compared to the power allocated for the closer user. This strategy is complemented with SIC in which the closer user first decodes the message of the distant user, where the SINR is high since it has the higher power, and it then subtracts that contribution to easily decode its own message (the message for the closer user). For the distant user, the interference from the message of the closer user is low, since the power allocated to this message is not high. On the other hand, the OMA scheme does not use SIC and the transmitter needs different periods of time to send each message to each intended user. Then, the transmission under the NOMA scheme is completed in two phases, as shown in Figure 1, while the transmission under OMA is completed in three phases. Therefore, because NOMA uses the resources more efficiently, it achieves better performance than the OMA scheme.
Moreover, we can see that the result obtained by our proposed PSO-based method achieves performance very close to that obtained by the exhaustive search method, but with lower complexity. The reason is that the PSO-based method iteratively updates the global and local particles' positions to search for the optimal solution, instead of systematically evaluating all possibilities to find its optimal solution, as the exhaustive search method does.  Figures 5 and 6 show that the proposed CR-NOMA scheme outperforms the baseline OMA scheme, and this finding confirms the outcomes obtained in the simulation results seen in Figure 3. From Figure 5, we can see that the SEE decreases when increasing the minimum required harvested energy at User 3. This is because the transmitter needs to send more power to satisfy the requirement of the EH user, and this fact requires p 3 to increase, which is inversely proportional to the maximization of the objective function (11a). Moreover, as the values of the data rate requirement increase, the SEE performance decreases, since more power must be delivered by the transmitter and the relay in order to satisfy the data rate requirements, which makes it easier for the eavesdropper to catch the messages. Figure 6 shows a comparison of SEE performance between our proposal using NOMA versus the minimum energy harvested by User 3 when the minimum data rates at the secondary users are φ 1 = φ 2 = 0.5, 1, 1.5 (bit/s/Hz), when the maximum available transmission power at the transmitter and the relay is P T = P R = 30 dBm. From Figure 6, we verify that the performance under NOMA is superior to OMA, and we can see that when the values of energy harvested and for data rate requirements increase, the values of the SEE start to decay.  . SSE performance comparison between CR-NOMA and CR-OMA according to the minimum harvested energy at User 3 with three different values for the data rate requirements at secondary User 1 (φ 1 ) and secondary User 2 (φ 2 ).

Conclusions
This paper proposes a low-complexity PSO-based algorithm to maximize the SEE in a cooperative relay CR-NOMA network with an EH user. The power allocation variables for each user are optimized to achieve SEE maximization under the following constraints: a minimum data rate for secondary users, a minimum level of harvested energy for the EH user, and the maximum permitted transmission power at both the secondary transmitter and the relay (based on a threshold for interference with the primary user). To validate the outcomes of the proposed solution, we compared the performance of our proposed PSO-based algorithm with the exhaustive search method. We confirmed that PSO achieves near-optimal performance compared to that obtained by the high computational-complexity exhaustive search method. Moreover, we studied SEE maximization in a cooperative relaying CR-OMA network with an EH user and compared it with our proposed scheme using the NOMA transmission strategy. The experimental results confirm the advantage of the proposed NOMA method compared to the OMA scheme, where an improvement in the SEE of around 40% to more than 100% is achieved by NOMA compared with OMA in the scenario varying the minimum energy harvested at user 3.