## 3 Problem Formulation and the PSO-Based Power Allocation Scheme for SEE Maximization
Therefore, the rate of Message 1 at U1 can be expressed as  
\[R_{x_{1},Tu_{1}}\geq\phi_{1}, \tag{11b}\]3  
The rate of Message 1 at the eavesdropper is:  
\[R_{x_{1},Tu_{1}}\geq\phi_{1}, \tag{11b}\]4  
Accordingly, the secrecy rate of Message 1 is given by  
\[R_{x_{1},Tu_{1}}\geq\phi_{1}, \tag{11b}\]5  
In Phase 2, the transmitter sends Message 2 to the relay. Then, the rate of Message 2 at the relay is as follows:  
\[R_{x_{1},Tu_{1}}\geq\phi_{1}, \tag{11b}\]6  
In Phase 3, the relay forwards Message 2 to U2. Then, the rate of Message 2 at User 2 is  
\[R_{x_{1},Tu_{1}}\geq\phi_{1}, \tag{11b}\]7  
The achievable rate for Message 2 is defined by the rate observed at U2 and the relay, as follows:  
\[R_{x_{1},Tu_{1}}\geq\phi_{1}, \tag{11b}\]8  
The rate for Message 2 at the eavesdropper is given as follows:  
\[R_{x_{1},Tu_{1}}\geq\phi_{1}, \tag{11b}\]9  
Therefore, the secrecy rate of Message 2 is defined as:  
\[R_{u_{2},\min}\geq\phi_{2},\]0  
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  
\[R_{u_{2},\min}\geq\phi_{2},\]1Our 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:  
\[R_{u_{2},\min}\geq\phi_{2},\]2 (28a) s.t. \[R_{u_{2},\min}\geq\phi_{2},\]3 \[R_{u_{2},\min}\geq\phi_{2},\]4 (28c) \[R_{u_{2},\min}\geq\phi_{2},\]5 (28d) \[R_{u_{2},\min}\geq\phi_{2},\]6 (28e) \[R_{u_{2},\min}\geq\phi_{2},\]7 (28f) \[R_{u_{2},\min}\geq\phi_{2},\]8  
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:  
\[R_{u_{2},\min}\geq\phi_{2},\]9  
\[p_{1}+p_{2}+p_{3}\leq P_{T}^{\max},\]0  
\[p_{1}+p_{2}+p_{3}\leq P_{T}^{\max},\]1  
where \(\omega=\frac{3\xi}{h_{T_{u3}}}-P_{T}^{\max}\). Accordingly, the boundaries of each particle's position for the power allocation variables in the PSO algorithm are \(\left[p_{1\min\_OMA},P_{T}^{\max}\right]\), \(\left[p_{2\min\_OMA},P_{T}^{\max}\right]\) and \(\left[p_{r\min\_OMA},P_{R}^{\max}\right]\).