# Wireless Energy Harvesting Two-Way Relay Networks with Hardware Impairments
## 3 Ergodic Capacities Analysis
### The Optimum PS Design of AF Protocol  
Based on (16) and (17), we analyze the OPS ratio for the AF protocol starting from (16) and (17). With the notice of that \(Y_{1}\) and \(Y_{2}\) are both concave functions of \(\rho\), it is easy to find that \(R_{sum}^{\text{AF}}\) is a concave function. The OPS of AF protocol can be obtained by equating \(\frac{\partial R_{sum}^{\text{AF}}}{\partial\rho}=0\). However, it is difficult to directly calculate a closed form solution of the OPS ratio by solving \(\frac{\partial R_{sum}^{\text{AF}}}{\partial\rho}=0\) because of complex high-order polynomial function of \(\rho\) in the numerator and denominator of \(\frac{\partial R_{sum}^{\text{AF}}}{\partial\rho}\). Therefore, we turn to utilize an approximate optimal solution for AF protocol with the consideration of high SNR regimes.  
Using the fact that \(\log_{2}(1+x)\approx\log_{2}(x)\) when \(x\gg 1\), the instantaneous achievable rate of \(S_{i}\) can be simply approximated in high SNR regimes as  
\[R_{i}\approx\frac{1}{2}\log_{2}(\frac{\Xi_{1}\gamma_{1}\gamma_{2}}{\Xi_{2} \gamma_{\Sigma}\gamma_{i}+\eta\rho\gamma_{i}+\Xi_{3}V_{i}}) \tag{49}\]  
Since the convexity of \(\log_{2}(x)\) is the same with that of \(x\), by analyzing the convexity of \(\frac{\Xi_{1}\gamma_{1}\gamma_{2}}{\Xi_{2}\gamma_{\Sigma}\gamma_{i}+\eta\rho \gamma_{i}+\Xi_{3}V_{i}}\), it is easy to get that \(R_{i}\) is concave function. And, thus, \(R_{sum}^{\text{AF}}(\rho)=R_{1}+R_{2}\) is concave function.  
The first derivatives of \(R_{sum}^{\text{AF}}\) can be obtained as  
\[\frac{\partial R_{sum}^{\text{AF}}}{\partial\rho}=\frac{\partial R_{1}}{ \partial\rho}+\frac{\partial R_{2}}{\partial\rho}. \tag{50}\]The obtained \(\frac{\partial R_{i}}{\partial\rho}\) is expressed on the top of next page.  
\[\frac{\partial R_{i}}{\partial\rho}=\frac{1}{2\ln 2}\,\frac{(\eta\gamma_{ \Sigma}\gamma_{i}(1+\kappa^{2})\kappa_{2}^{2}+\eta\gamma_{i}-(1+\kappa_{1}^{2}) V_{i})\rho^{2}+2(1+\kappa^{2})V_{i}\rho-(1+\kappa^{2})V_{i}}{\eta\rho(1-\rho) \gamma_{1}\gamma_{2}[\eta(\kappa_{1}^{2}+\kappa_{1}^{2}\kappa^{2}+\kappa^{2}) \gamma_{\Sigma}\gamma_{i}\rho^{2}-(\eta\kappa^{2}(2+\kappa^{2})\gamma_{\Sigma} \gamma_{i}+\eta\gamma_{i}-(1+\kappa_{1}^{2})V_{i})\rho-(1+\kappa^{2})V_{i}]} \tag{51}\]  
By equating \(\frac{\partial R_{1}}{\partial\rho}+\frac{\partial R_{2}}{\partial\rho}\) to zero, we obtain that the OPS ratio that maximizes \(R_{sum}^{\rm AF}(\rho)\) must satisfy the following equation:  
\[Q_{1}\rho^{4}+Q_{2}\rho^{3}+Q_{3}\rho^{2}+Q_{4}\rho+Q_{5}=0 \tag{52}\]  
where \(Q_{n}=L_{n,1}-L_{n,2}\), \(n\in\{1,2,\cdots,5\}\). And \(L_{n,i}\), \(i\in\{1,2\}\), is expressed as follows  
\[L_{1,i}= q_{1}\gamma_{i}[q_{2}\gamma_{i}+\eta\gamma_{i}-\kappa_{1,+}^{2}V_{i}]\] \[L_{2,i}= -(q_{2}\gamma_{i}+\eta\gamma_{i}-\kappa_{1,+}^{2}V_{i})(q_{3} \gamma_{i}+\eta\gamma_{i}-\kappa_{1,+}^{2}V_{i})\] \[+2q_{1}\kappa_{+}^{2}V_{i}\] \[L_{3,i}= -(q_{2}\gamma_{i}+\eta\gamma_{i}-\kappa_{1,+}^{2}V_{i})\kappa_{+} ^{2}V_{i}-q_{1}\gamma_{i}\kappa_{+}^{2}V_{i} \tag{53}\] \[-2(q_{3}\gamma_{i}+\eta\gamma_{i}-\kappa_{1,+}^{2}V_{i})\kappa_{ +}^{2}V_{i}\] \[L_{4,i}= -2\kappa_{+}^{2}V_{i}V_{i}+(q_{3}\gamma_{i}+\eta\gamma_{i}-\kappa _{1,+}^{2}V_{i})\kappa_{+}^{2}V_{i}\] \[L_{5,i}= \kappa_{+}^{2}V_{i}V_{i}\]  
and \(q_{1}=\eta(\kappa_{1}^{2}+\kappa_{1}^{2}\kappa^{2}+\kappa^{2})\gamma_{\Sigma}\), \(q_{2}=\eta\kappa_{2}^{2}(1+\kappa^{2})\gamma_{\Sigma}\), \(q_{3}=\eta\kappa^{2}(2+\kappa^{2})\gamma_{\Sigma}\), \(\kappa_{1,+}^{2}=1+\kappa_{1}^{2}\), \(\kappa_{+}^{2}=1+\kappa^{2}\).  
The above function is a quartic polynomial on \(\rho\) and has at most four real roots. Since \(R_{sum}^{\rm AF}(\rho)\) is a concave function, at most one of these roots of \(\frac{\partial R_{sum}^{\rm AF}}{\partial\rho}=0\) is real and positive.