# Dynamic Divide Grouping Non-Orthogonal Multiple Access in Terrestrial-Satellite Integrated Network
## 5 Joint Resource Allocation Optimization Scheme
### Power Control Factor Optimization
Similarly, the intra-group power allocation of the satellite will satisfy that  
\[\log_{2}\left(1+\frac{\rho^{(1)}_{S,i,J}P_{S,i,J}H^{(1)}_{S,i,J}}{\rho^{(2)}_ {S,J}P_{S,J}H^{(2)}_{S,J}+I_{B}+r_{S,i,J}N_{0}}\right)\geq\frac{1}{2}\log_{2} \left(1+\frac{P_{S,i,J}H^{(1)}_{S,i,J}}{P_{S,J}H^{(2)}_{S,i,J}+I_{B}+r_{S,J}N_{ 0}}\right), \tag{33}\]  
\[\log_{2}\left(1+\frac{\rho^{(2)}_{S,i,J}P_{S,J}H^{(2)}_{S,i,J}}{I_{B}+\sigma^ {2}}\right)\geq\frac{1}{2}\log_{2}\left(1+\frac{P_{S,i,J}H^{(2)}_{S,i,J}}{I_{ B}+\sigma^{2}}\right). \tag{34}\]  
Due to \(\rho^{(1)}_{S,i,J}+\rho^{(2)}_{S,i,J}=1\), we have  
\[\frac{1+\frac{P_{S,i,J}H^{(2)}_{S,i,J}}{I_{B}+r_{S,i,J}N_{0}}}{1+\frac{P_{S,i, J}H^{(2)}_{S,i,J}}{I_{B}+r_{S,i,J}N_{0}}+\sqrt{1+\frac{P_{S,i,J}H^{(1)}_{S,i,J}}{I_{B}+ \sigma^{2}}}{I_{B}+r_{S,i,J}N_{0}}+1}\leq\rho^{(1)}_{S,J}\leq\frac{\sqrt{1+ \frac{P_{S,i  
update the approximation parameters \((\theta_{S,I,J},\beta_{S,I,J})\), then use the updated parameters for the next iteration until the results converge, as stated in the SCA approach above. In each iteration, we solve the subproblem (41) by means of the Lagrangian dual method. The Lagrangian function is  
\[ \begin{split} L\bigg{(}r_{S,I,J},P^{-}_{S,I,J},\lambda,\mu\bigg{)} =\sum\limits_{I=1}^{K_{s}/2}\frac{r_{S,I,J}}{In2}\bigg{[}\left(\theta^{(1)}_{ S,J,I}In\gamma^{(1)}_{S,J,I}+\beta^{(1)}_{S,J,J}\right)+\left(\theta^{(2)}_{S,J,I} In\gamma^{(2)}_{S,J,I}+\beta^{(2)}_{S,J,J}\right)\bigg{]}\\ +\lambda\left(r_{S,b}-\sum\limits_{j=1}^{K_{s}/2}r_{S,I,J}\right) +\mu\bigg{(}P_{\max}-e^{\widetilde{n}_{S,I,J}}\bigg{)}\end{split} . \tag{42}\]  
where \(\lambda,\mu\) the Lagrange multiplier for the constraint condition, the dual problem can be expressed as  
\[ \begin{split}\min\limits_{\lambda,\mu}&\max L\bigg{(}r _{S,I,J},P^{-}_{S,I,J},\lambda,\mu\bigg{)},\\ s.t& C1-C3.\end{split}  \tag{43}\]  
Based on the standard KKT condition [46], by deriving \(r_{S,I,J}\) and \(P^{-}_{S,I,J}\), we can obtain the optimal power allocation scheme of the subproblem in the form of \(\lambda\) and \(\mu\)  
\[P_{S,I,J}[t+1]=e^{P_{S,I,J}[t+1]}\!\!=\!\!\left[\frac{\theta^{(1)}_{S,I,J}+ \theta^{(2)}_{S,I,J}}{\mu In2+\frac{\theta^{(1)}_{S,I,J}(t)^{(1)}_{S,I,J}[t]}{ \rho^{(2)}_{S,J,I}H^{(2)}_{S,J,I}t^{F^{-}_{S,J}[t]}+I_{B}+r_{S,J,I}[t]N_{0}}} \right]^{+}, \tag{44}\]  
\[r_{S,I,J}[t+1]=\left[\frac{\lambda In2-\frac{\theta^{(1)}_{S,I,J}(t^{(1)}_{S, I,J}t^{(1)}_{[PERSON]}t^{F^{-}_{[PERSON]}[t]})}{\rho^{(2)}_{S,J,I}t^{F^{-}_{S,J}[t]}+I_{B}+r _{S,J,J}[t]N_{0}}-\frac{\theta^{(2)}_{[PERSON]}(t^{(2)}_{[PERSON]}t^{F^{-}_{[PERSON]}[t]} )}{I_{B}+r_{[PERSON]}[t]N_{0}}}{N_{0}e^{P_{S,I,J}[t]}(\theta^{(1)}_{S,J,I}\rho^{(1) }_{S,J,I}H^{(1)}_{S,J,I})+\theta^{(2)}_{S,J,I}\rho^{(2)}_{S,J,I}H^{(2)}_{S,J,I} \right)}\end{split}\right]^{+}, \tag{45}\]  
where \([x]^{+}=\max(0,x)\). As \(L(r_{S,I,J},P^{-}_{S,I,J},\lambda,\mu)\) in (42) is not differentiable, the Lagrange multiplier \(\lambda\) and \(\mu\) can be obtained by using the subgradient method iteratively as follows:  
\[\mu[t_{\delta}+1]=\big{[}\mu[t_{\delta}]-\delta_{\mu}(P_{\max}-P_{S,I,J}) \big{]}^{+}, \tag{46}\]  
\[\lambda[t_{\delta}+1]=\left[\lambda[t_{\delta}]-\delta_{\lambda}(r_{S,b}- \sum\limits_{j=1}^{K_{s}/2}r_{S,I,J})\right]^{+}, \tag{47}\]  
where \(\delta_{\lambda}\) and \(\delta_{\mu}\) are the step size of \(\lambda\) and \(\mu\) in each iteration. The satellite beam channel allocation scheme is summarized as Algorithm 1. In the outer loop, we update the approximation parameters \(\theta_{S,I,J}\) and \(\beta_{S,J,J}\), and transform the original optimization problem into a solvable convex problem by logarithmic approximation. In the inter loop, we solve the transformed subproblem using the Lagrangian dual method. By updating the approximation parameters iteratively, we can finally obtain the optimal solution of original problem in (41).