# Joint User Pairing, Channel Assignment and Power Allocation in NOMA based CR Systems
## 2 System Model and Problem Formulation  
We consider a cooperative NOMA CR system where a secondary transmitter (ST) communicates with \(W\) number of secondary receivers (SRs) in the presence of primary receivers (PRs), as shown in Figure 1. The available spectrum is divided into \(W/2\) channels and each channel is shared by two NOMA users. (The hardware complexity and delay due to SIC increase with the number of users per channel. Thus, the proposed system model considers two users per channel [30].) Without loss of generality, we consider the \(W\) users are sorted in descending order of their channel gains and divided into two sets of equal size. The set containing first \(\dfrac{W}{2}\) users with larger values of channel gains is called the set of strong users and is represented as \(\mathcal{A}\). Similarly, the users in the second set are called weak users because they have weak channel conditions compared to the nodes in the set of strong users; the set of weak user is denoted as \(\mathcal{B}\). On each channel, a strong user is paired with a weak user. Then, on reception the strong user employs SIC to decode its signal without any interference from the weak user, whereas the weak user faces interference because of the strong users signal. The gains of the \(c\)th channel from ST to \(n\)th strong user and \(i\)th weak user are represented as \(|h_{n,c}|^{2}\) and \(|\overline{h_{i,c}}|^{2}\), respectively. The channel gain from ST to the PRs at the \(c\)th channel is denoted as \(|f_{c}|\). To facilitate the mathematical formulation of the problem, a binary variable \(x_{n,i,c}\) is introduced such that:  
\[x_{n,i,c}= \begin{cases}1,&\text{when $n$th strong user is paired with $i$th weak user and are allocated $c$th channel,}\\ &\forall n\in\mathcal{A},i\in\mathcal{B}\\ 0,&\text{otherwise,}\end{cases} \]  
We aim to maximize the sum rate of the NOMA system subject to the interference temperature of the primary network, QoS guarantee of each user, limited battery power at the BS and sufficient gap in the received powers for SIC. The problem can be mathematically written as:  
Figure 1: Considered system model. **P1:**  
\[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\] (1) s.t. \[\sum_{n=1}^{W/2}\sum_{i=1}^{W/2}x_{n,i,c}(S_{n,i,c}|h_{n,c}|^{2}-P_ {n,i,c}|h_{n,c}|^{2})\geq\psi,\forall c,n\in\mathcal{A},i\in\mathcal{B}, \tag{2}\] \[\sum_{n=1}^{W/2}\sum_{i=1}^{W/2}x_{n,i,c}(P_{n,i,c}+S_{n,i,c})|f_{ c}|^{2}\leq I_{th},\forall c,n\in\mathcal{A},i\in\mathcal{B},\] (3) \[\sum_{n=1}^{W/2}\sum_{i=1}^{W/2}\sum_{c=1}^{W/2}x_{n,i,c}(P_{n,i,c }+S_{n,i,c})\leq P_{T},\forall n\in\mathcal{A},i\in\mathcal{B},\] (4) \[\sum_{i=1}^{W/2}\sum_{c=1}^{W/2}x_{n,i,c}\log_{2}\left(1+\frac{P_ {n,i,c}|h_{n,c}|^{2}}{\sigma^{2}}\right)\geq R_{T},\forall n,n\in\mathcal{A},i \in\mathcal{B},\] (5) \[\sum_{n=1}^{W/2}\sum_{c=1}^{W/2}x_{n,i,c}\log_{2}\left(1+\frac{S_ {n,i,c}|\overline{h_{i,c}}|^{2}}{P_{n,i,c}|\overline{h_{i,c}}|^{2}+\sigma^{2} }\right)\geq R_{T},\forall i,n\in\mathcal{A},i\in\mathcal{B},\] (6) \[\sum_{n=1}^{W/2}\sum_{c=1}^{W/2}x_{n,i,c}=1,\forall i,n\in \mathcal{A},i\in\mathcal{B},\] (7) \[\sum_{i=1}^{W/2}\sum_{i=1}^{W/2}x_{n,i,c}=1,\forall n,n\in \mathcal{A},i\in\mathcal{B},\] (8) \[\sum_{n=1}^{W/2}\sum_{i=1}^{W/2}x_{n,i,c}=1,\forall c,n\in \mathcal{A},i\in\mathcal{B}. \tag{9}\]  
The objective of the problem is given in Equation (1) where \(\sigma^{2}\) denotes the variance of additive white Gaussian noise (AWGN), \(P_{n,i,c}\) is the power allocated for the signal of \(n\)th strong user paired with \(i\)th weak user at \(c\)th channel and \(S_{n,i,c}\) represents the power of the \(i\)th weak user paired with \(n\)th strong user at the \(c\)th channel. The first term in the objective represents the rate of the strong user and the second term is the rate of the weak user paired with the corresponding strong user. For SIC, a sufficient gap in the received powers of the signals of the strong user and weak user is required and is ensured by Equation (2).