## 5 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 as \(\bar{h}_{T_{u_{1}}}\sim\mathcal{CN}\left(0,d_{Tu_{1}}^{-v}\right)\), \(\bar{h}_{T_{u_{3}}}\sim\mathcal{CN}\left(0,d_{Tu_{3}}^{-v}\right)\), \(\bar{h}_{TR}\sim\mathcal{CN}\left(0,d_{TR}^{-v}\right)\), \(\bar{h}_{TE}\sim\mathcal{CN}\left(0,d_{TE}^{-v}\right)\), \(\bar{g}_{Ru_{1}}\sim\mathcal{CN}\left(0,d_{Ru_{1}}^{-v}\right)\), \(\bar{g}_{Ru_{2}}\sim\mathcal{CN}\left(0,d_{Ru_{2}}^{-v}\right)\), \(\bar{g}_{RE}\sim\mathcal{CN}\left(0,d_{RE}^{-v}\right)\), \(\bar{h}_{Tp}\sim\mathcal{CN}\left(0,d_{Tp}^{-v}\right)\), and \(\bar{g}_{Rp}\sim\mathcal{CN}\left(0,d_{Rp}^{-v}\right)\), 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\), \(\sigma^{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_{T{{u_{1}}}}=30\), \(d_{T{R}}=50\), \(d_{T{p}}=60\), and \(d_{T{E}}=50\) in meters, respectively. The distances from the relay to User1, User2, the PU, and the eavesdropper are defined as \(d_{R{{u_{1}}}}=30\), \(d_{R{{u_{2}}}}=50\), \(d_{R{p}}=50\) and \(d_{R{E}}=30\) in meters, respectively. With respect to the maximum permissible interference power with the PU, [PERSON] 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 \(\big{|}f(g_{best})_{i-1}-f(g_{best})_{i}\big{|}\big{/}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.