# Joint User Pairing, Channel Assignment and Power Allocation in NOMA based CR Systems
## 2 System Model and Problem Formulation
To protect the PRs from harmful interference, we have Equation (3) where \(I_{th}\) represents the interference threshold. The constraint in Equation (4) guarantees that the power allocation at the ST follows the power budget where \(P_{T}\) is the available power at the ST. The minimum rate requirement (\(R_{T}\)) of each user is ensured by Equations (5) and (6). The constraint in Equation (7) guarantees that each weak user pairs with one and only one strong user and is allocated one channel. It is also required that every strong user must pair with only one weak user and communication on a single channel, this demand is mathematically written as in Equation (8). Finally, Equation (9) makes sure that each channel accommodate only one user pair. **3. Proposed Solution**  
The problem in **P1** is complex, non-convex and is very hard to solve for optimal solution because of high inter-dependency and inseparable \(S_{n,i,c}\). To make the problem more tractable, we propose to allocated power in two steps. First, to distribute the available power in all user pairs and then distribute the power among the users in the pair. The power allocated to the user pair consisting of \(n\)th strong user and \(i\)th weak user at \(c\)th channel is denoted as \(Q_{n,i,c}\). Then, the fractions of \(Q_{n,i,c}\) allocated for the signal of strong user is denoted as \(\alpha_{n,i,c}\), and \((1-\alpha_{n,i,c})\) represents the fraction allocated to the weak user. Thus, the transmit powers are given by \(P_{n,i,c}=\alpha_{n,i,c}Q_{n,i,c}\) and \(S_{n,i,c}=(1-\alpha_{n,i,c})Q_{n,i,c}\). After this, the transformed problem is given as:  
**P2:**  
\[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]0 (10) s.t. \[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]1 \[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]2 (12) \[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]3 (13) \[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]4 (14) \[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]5 (15) \[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]6  
The problem in **P2** is still non-convex because of Equations (10) and (15). To convert the problem in convex form, we substitute \(\beta_{n,i,c}=\alpha_{n,i,c}Q_{n,i,c}\), which makes the objective a convex function in \(\beta_{n,i,c}\) and \(Q_{n,i,c}\) (a discussion on the convexity of **P2** and **P3** is given in Appendix A). In addition, to transform the problem into a standard minimization problem, we multiply the objective by \(-1\). The problem after transformation is:  
**P3:**  
\[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]7 (17) s.t. \[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]8 \[\max_{x_{u,i,c},P_{u,i,c}}S_{u,i,c}\]9 (19) \[\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}\]0 (20) \[\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}\]1  
\[\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}\]2 \[\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}\]3  
Although we have converted the objective of **P3** to a convex form, the problem is still non-convex because of the constraint in Equation (22). We take advantage of the fact that Equation (22) is equivalent to:  
\[\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}\]4then we can transform Equation (24) into a linear function as:  
\[\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}\]5  
Note that, if this technique were applied for transformation of Equation (15), it would result in a non-convex function because \(\alpha_{n,i,c}Q_{n,i,c}\) makes the function non-convex.