# Computational-Intelligence-Based Spectrum-Sharing Scheme for NOMA-Based Cognitive Radio Networks
## 2 System Model and Problem Formulation
### NOMA-Assisted Power Allocation Scheme
#### 2.1.2 Time Slot 2  
During time slot 2, the SR will transmit the superimposed signal \(x_{I}\) for all SUs and the user \(Q\), which can be expressed as \(x_{I}=\sum_{k=0}^{K}\sqrt{p_{k}x_{k}}\). For \(k=0\), the intended signal is for the primary network.  
For \(k=1,2,\ldots\)\(K\), the intended signal is for the secondary receivers.  
Based on the above assumption, i.e., \(|g_{0}|\leq|g_{1}|\leq\ldots\leq|g_{K}|\), we can set \(p_{0}\geq p_{1}\geq\ldots\geq p_{K}\geq 0\) such that, \(\sum_{k=0}^{K}p_{k}=P_{3}\). Applying the NOMA principle, we define the power allocation coefficient \(\lambda_{k}=\frac{|g_{0}|^{2}}{\sigma^{2}}\) which clearly means that \(0\leq\lambda_{0}\leq\lambda_{1}\leq\ldots\leq\lambda_{K}\). Each receiving node applies SIC to decode the weaker signals directly. It is assumed that if \(SU_{1}\) having the poorest channel condition towards \(Q\) can decode \(x_{0}\) successfully, then the remaining SUs can also decode \(x_{0}\). Mathematically, we can express this condition as \(R_{x_{0}\to 1}\geq\gamma_{0}\), where \(R_{x_{0}\to 1}\) denotes the achievable rate at \(SU_{1}\) to decode \(x_{0}\) and is given as:  
\[R_{x_{0}\to 1}=log_{2}\Bigg{(}1+\frac{\lambda_{1}p_{0}}{\lambda_{1}\sum_{l=1}^{K}P_ {l}+1}\Bigg{)} \tag{5}\]  
Finally, the achievable rate at each \(k^{th}\) SU to decode \(x_{k}\) can be expressed as [26]:  
\[R_{k}=log_{2}\Bigg{(}1+\frac{p_{k}|g_{k}|^{2}}{|g_{k}|^{2}\sum_{l=k+1}^{K}p_{ l}+\sigma^{2}}\Bigg{)}\]  
\[R_{k}=log_{2}\Bigg{(}1+\frac{\lambda_{k}p_{k}}{\lambda_{k}\sum_{l=k+1}^{K}p_{ l}+1}\Bigg{)} \tag{6}\]  
Again, for the successful decoding of \(x_{k}\) at each \(k^{th}\) SU, the above rate should satisfy  
\[R_{k}\geq\gamma_{k},\hskip 56.905512 ptk\in\Gamma \tag{7}\]As stated above, the proposed scheme guarantees the reliable transmission of primary signal using the MRC technique. Therefore, the achievable sum rate at the receiver \(Q\) can be obtained as [31]:  
\[R_{Q}=log_{2}\Bigg{(}1+\frac{P_{sel}|h_{sel}|^{2}}{\sigma^{2}}+\frac{\lambda_{0}p _{0}}{\lambda_{0}\sum_{k=1}^{K}p_{k}+1}\Bigg{)} \tag{8}\]  
In the above expression, the interference experienced from the PBS at \(Q\) is neglected in time slot 1 due to the absence of DL. For successful decoding of \(x_{0}\) at \(Q\), the above rate should satisfy \(R_{Q}\geq\gamma_{0}\). Correspondingly, the minimum transmit power \(P_{sel}\) at \(SU_{sel}\) can be expressed as:  
\[P_{sel}\geq\frac{\sigma^{2}}{|h_{sel}|^{2}}\Bigg{(}2^{\gamma_{0}}-1-\frac{ \lambda_{0}p_{0}}{\lambda_{0}\sum_{k=1}^{K}p_{k}+1}\Bigg{)} \tag{9}\]  
For a given transmit power \(P_{S}\), the remaining power of the system should satisfy  
\[P_{total}=P_{0}+P_{sel} \tag{10}\]  
It is important to note that two time slot transmission processes can significantly reduce system transmit power while meeting QoS requirements, especially when the PBS and \(Q\) are separated by a large physical distance. Summing up the whole discussion, our optimization problem takes the following mathematical form:  
\[\begin{split}&\max\limits_{p_{0},p_{1},\ldots,p_{K}}\sum\limits _{k=1}^{K}R_{k}\\ &\text{such that}\\ & C_{1}:\ R_{k}\geq\gamma_{k},k\in\Gamma\\ & C_{2}:\ R_{x_{0}\to 1}\geq\gamma_{0}\\ & C_{3}:\ p_{0}\geq p_{1}\geq\ldots\geq p_{K}\geq 0\\ &\ C_{4}:\ \sum\limits_{k=0}^{K}p_{k}=P_{S}\end{split} \tag{11}\]  
Thus, our objective is to maximize the sum rate of all SUs under transmit power and QoS constraints. \(C_{1}\) defines the rate threshold for successful decoding of \(x_{k}\) at the \(k^{th}\) SU, \(C_{2}\) defines the condition to ensure successful decoding of \(x_{0}\) at each SU, and \(C_{3}\) and \(C_{4}\) define the individual transmit power and system transmit power constraint, respectively.