## 3 Secrecy Rate Maximization  
Taking into account the four aforementioned scenarios, the system's average secrecy rate is written as  
\[R_{\text{sec}}(\gamma,\beta_{1},\beta_{2},z)=P(H_{1})(P_{d})R_{\text{sec}}^{1}+P (H_{1})(1-P_{d})R_{\text{sec}}^{3}+P(H_{0})(1-P_{f})R_{\text{sec}}^{4}. \tag{25}\]  
In this article, the \(R_{\text{sec}}\) function is aimed to be maximized over \(\gamma,\beta_{1},\beta_{2},z\). The following constraints are derived:  
\[ \begin{split}\text{C1}:R_{\text{s}_{1}}^{a}&\geq R _{1}^{+},\\ \text{C2}:R_{\text{s}_{1}}^{b}&\geq R_{2}^{+},\\ \text{C3}:R_{\text{s}_{3}}&\geq R_{1}^{+},\\ \text{C4}:R_{\text{s}_{4}}&\geq R_{2}^{+},\\ \text{C5}:\sum_{i=0}^{2}\beta_{i}\leq 1,\\ \text{C6}:0<\gamma\leq 1,\\ \text{C7}:\beta_{i}>0,\\ \text{C8}:0\leq z\leq 1,\\ \text{C9}:E_{\text{active}}^{1}+E_{\text{i}}-E_{\text{ss}}& \geq E_{\text{c}}^{1},\\ \text{C10}:E_{\text{active}}^{3}+E_{\text{i}}-E_{\text{ss}}& \geq E_{\text{c}}^{3},\\ \text{C11}:E_{\text{active}}^{4}+E_{\text{i}}-E_{\text{ss}}& \geq E_{\text{c}}^{1}.\end{split}  \tag{26}\]  
C1 represents the QoS of the BS, and a predefined throughput threshold \(R_{1}^{+}\) should be provided for the BS in the mutualism scenario. C2 represents the QoS of the HT, and a predefined throughput threshold \(R_{2}^{+}\) should be provided for the HT in the mutualism scenario. C3 represents the QoS of the BS, and a predefined throughput threshold \(R_{1}^{+}\) should be provided for the BS in the interference scenario. C4 represents the QoS of the HT, and a predefined throughput threshold \(R_{2}^{+}\) should be provided for the HT in the silent BS-active HT scenario. C5 indicates that in the spectrum sensing-based dynamic time allocation scheme, the sum of the time parameters cannot exceed \(T=1\,\text{s}\). C7 indicates that time parameters cannot be negative. In order for the system throughput not to be negative, the energy harvested by the HT should be greater than the energy consumed. Thus, this requirement imposed C9, C10, and C11 constraints. It is set as \(E_{\text{i}}\geq E_{\text{ss}}\) by the system user at the beginning of dynamic time allocation. Otherwise, spectrum sensing cannot be performed. Excluding the energy harvested after spectrum sensing, the energy that can be used is \(E_{\text{i}}-E_{\text{ss}}\). Based on the above analysis, the optimization Problem P1 of the spectrum sensing-based PLS for heterogeneous SRN is formulated as  
\[ \begin{split}(\mathbf{P1})&\max_{\gamma,\beta_{1}, \beta_{2},z}R_{\text{sec}}\\ &\text{s.t.}\ \ \text{C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11}\end{split}  \tag{27}\]  
**Lemma 1**. : _When \(R_{\text{sec}}^{1}=\left(R_{\text{s}_{1}}-R_{\text{ED}}^{1}\right)^{+}\), if \(R_{\text{sec}}\) is considered as a function of \(z\), then \(R_{\text{sec}}(z)\) is a concave function._  
Proof. : Please refer to Appendix A. The variation in the \(R_{\text{sec}}(z)\) function with respect to \(z\) for \(P_{\text{BS}}=17\) kW, \(\beta_{1}=0.39\), \(\beta_{2}=0.41\), \(\beta_{0}=0.2\), \(N=3\), \(P_{\text{j}}=100\) W is shown in Figure 5. There can be a single \(z\) value that maximizes the \(R_{\text{sec}}(z)\) function, which has a concave structure with respect to \(z\). In the case of \(z=1\), where the entire signal transmitted from the BS is backscattered by the HT, which helps the BS in transmitting information, the HT does not harvest energy from the BS's signal. In this scenario, HT works with impedance matching, but the maximum secrecy rate cannot be achieved. For the given simulation values, the maximum value of \(R_{\text{sec}}=18.53\) bps/Hz is reached at \(z=0.56\). Similarly to the steps carried out in Lemma 1, if the second derivative of the \(R_{\text{sec}}(\gamma)\) function with respect to \(\gamma\) is expressed, \(\frac{\partial^{2}R_{\text{sec}}(\gamma)}{\partial\gamma^{2}}\leq 0\) is obtained. Therefore, the \(R_{\text{sec}}(\gamma)\) function is an increasing function of \(\gamma\) for \(\forall\gamma\in(0,1]\), and for max. \(R_{\text{sec}}(\gamma)\), \(R_{\text{sec}}(\gamma=1)\) is set [11; 12; 23; 45].