## 3 Problem Formulations
### Sensing-Based Spectrum Sharing under Perfect Sensing Conditions  
In perfect sensing conditions, where the satellite user can correctly detect the terrestrial network state without a false alarm in the variable short sensing time \(\tau\), and we have \(P_{d}=1\), \(P_{f}=0\) and \(\tau=0\). Thus, Equation (19) can be simplified to Equation (20),  
\[ \begin{split} C=\max_{\left\{P_{s}^{(i)},P_{s}^{(b)}\right\}}E \left\{C_{ii}\right\}P\left(\mathcal{H}_{i}\right)+E\left\{C_{bb}\right\}P \left(\mathcal{H}_{b}\right),\\ s.t.\left\{\begin{array}{c}E\left\{P_{s}^{(i)}\right\}P\left( \mathcal{H}_{i}\right)+E\left\{P_{s}^{(b)}\right\}P\left(\mathcal{H}_{b} \right)\leq P_{av},\\ E\left\{P_{s}^{(b)}G_{t}\left(\theta^{\prime}\right)G_{BS}L_{sp}h_{sp}\right\} \leq I_{av}.\end{array}\right.\end{split}  \tag{20}\]  
Obviously, the objective function and constraints are not related to the sensing time \(\tau\). Moreover, the objective function is a concave function with respect to the power \(P_{s}^{(i)}\) and \(P_{s}^{(b)}\). The Lagrangian duality method is adopted to solve Equation (20) since the duality gap is zero [31]. The Lagrangian function of Equation (20) can be formulated as  
\[ \begin{split} L(P_{s}^{(i)},P_{s}^{(b)},\lambda,\mu)=E\{C_{ii} \}P(\mathcal{H}_{i})+E\{C_{bb}\}P(\mathcal{H}_{b})-\lambda\{E\{P_{s}^{(i)}\}P (\mathcal{H}_{i})+E\{P_{s}^{(b)}\}P(\mathcal{H}_{b})-P_{av}\}\\ -\mu\{E\{P_{s}^{(b)}G_{t}(\theta^{\prime})G_{BS}L_{sp}h_{sp}\}-I_{av}\}, \end{split}  \tag{21}\]  
where \(\lambda\) and \(\mu\) are the non-negative Lagrangian multipliers. In addition, the Lagrangian dual function is defined as:  
\[g\left(\lambda,\mu\right)=\max_{\left\{0\leq P_{s}^{(b)},0\leq P_{s}^{(i)} \right\}}L\left(P_{s}^{(i)},P_{s}^{(b)},\lambda,\mu\right). \tag{22}\]  
The dual function Equation (22) serves as an upper bound on the optimal value of Equation (20). Then, the dual problem can be defined as:  
\[\min_{\lambda,\mu}g(\lambda,\mu). \tag{23}\]  
Similar to [36], Equation (23) can be decomposed into multiple parallel subdual functions as follows:  
\[ \begin{split} Subproblem1\left(SP1\right):\max_{P_{s}^{(i)} \geq 0}E\{C_{ii}\}-\lambda E\{P_{s}^{(i)}\},\end{split}  \tag{24}\]\[Subproblem2\left(SP2\right):\max_{P_{s}^{\left(b\right)}\geq 0}E\{C_{bb}\}- \lambda E\{P_{s}^{\left(b\right)}\}-\mu E\{P_{s}^{\left(b\right)}G_{t}(\theta^{ \prime})G_{BS}L_{sp}h_{sp}\}+\mu I_{av}. \tag{25}\]  
According to the Karush-Kuhn-Tucker (KKT) conditions, the optimal transmission powers for sensing-based opportunistic channel access scheme can be formulated as:  
\[P_{s}^{\left(i\right)}=\left(\frac{N_{0}B}{\lambda\ln 2}-\frac{N_{0}}{G_{t} \left(\theta\right)G_{r}\left(\varphi\right)L_{ss}h_{ss}}\right)^{+}, \tag{26}\]  
\[P_{s}^{\left(b\right)}=\left(\frac{B}{\ln 2\left[\lambda+\mu G_{t}\left( \theta^{\prime}\right)G_{BS}L_{sp}h_{sp}\right]}-\frac{N_{0}}{G_{t}\left( \theta\right)G_{r}\left(\varphi\right)L_{ss}h_{ss}}\right)^{+}, \tag{27}\]  
where \(\left(x\right)^{+}\) means the maximum between 0 and \(x\). Suppose that \(h_{ss}^{\prime}=G_{t}\left(\theta\right)G_{r}\left(\varphi\right)L_{ss}h_{ss}\) and \(h_{sp}^{\prime}=G_{t}\left(\theta^{\prime}\right)G_{BS}L_{sp}h_{sp}\), and they represent the channel gain of cognitive link and interference link considering the impact of the antenna patterns and propagation issues, respectively. It is obvious that transmitter power is proportional to the \(B\) and \(h_{ss}^{\prime}\) for all states. Conversely, if the terrestrial network is monitored to be busy, the cognitive satellite user obtains higher transmission power when \(h_{sp}^{\prime}\) is lower, since the more severe fading of the interference link is, the less influence of the satellite users on the terrestrial network. Now, we can evaluate Equation (23) via the solutions of Equations (26) and (27) for the fixed \(\lambda\) and \(\mu\), and minimize the dual function \(g\left(\lambda,\mu\right)\) by updating \(\lambda\) and \(\mu\) through Algorithm 1, which uses the subgradient method at each iteration.