# Wireless Energy Harvesting Two-Way Relay Networks with Hardware Impairments
## 3 Ergodic Capacities Analysis
### Capacity of AF Relaying  
For the AF protocol, the total ergodic capacity can be given by  
\[C_{e}^{\rm AF}=\mathbb{E}\{C(Y_{1})\}+\mathbb{E}\{C(Y_{2})\} \tag{33}\]  
The CDFs of \(Y_{1}\) and \(Y_{2}\) is presented as following Theorem 3.  
**Theorem 3**.: _With the define of \(X=\gamma_{1}\) and \(Y=\gamma_{2}\). \(F_{Y_{i}}(t)\) is obtained as_  
\[F_{Y_{i}}(t)=1-A_{i}e^{-\frac{tA_{i}\eta\rho}{(\Xi_{1}-t\Xi_{2})}}\sqrt{\frac {\beta_{i}}{\chi_{i}}}K_{1}(\sqrt{\beta_{i}\chi_{i}}),\,\,\,t<\frac{\[PERSON]_{1}}{ \[PERSON]_{2}} \tag{34}\]  
_where_  
\[\begin{split}\beta_{i}&=\frac{4A_{i}\Xi_{3}V_{i}t}{ \[PERSON]_{1}-t\[PERSON]_{2}}\\ \chi_{i}&=A_{i}+\frac{t\[PERSON]_{2}A_{i}}{\[PERSON]_{1}-t\[PERSON]_{ 2}}.\end{split} \tag{35}\]  
_and \(K_{1}(\cdot)\) is the first-order modified Bessel function of the second kind [28]._  
Proof.: The CDF of \(Y_{1}\) for the AF protocol is derived as follows.  
\[\begin{split} F_{Y_{1}}(t)&=\mathbf{Pr}\left\{Y_{1 }<t\right\}\\ &=\mathbf{Pr}\left\{\frac{\Xi_{1}\gamma_{1}\gamma_{2}}{\Xi_{2} \gamma_{1}(\gamma_{1}+\gamma_{2})+\eta\rho\gamma_{1}+\[PERSON]_{3}V_{1}}<t\right\}\\ &=\mathbf{Pr}\left\{\Xi_{1}XY<t(\Xi_{2}X(X+Y)+\eta\rho X+\Xi_{3} V_{1})\right\}\\ &=\mathbf{Pr}\left\{(\Xi_{1}\!-\!t\Xi_{2})XY<t(\Xi_{2}X^{2}\!+ \!\eta\rho X\!+\!\Xi_{3}V_{1})\right\}\end{split} \tag{36}\]  
Case II: If \(\rho^{+}\geq\rho^{\rm DF}_{\rm min}\)  
\[R^{\rm DF}_{sum}(\rho) =\begin{cases}C\left(\dfrac{\eta\rho\gamma_{2}\gamma_{\Sigma}}{ \kappa^{2}\eta\rho\gamma_{2}\gamma_{\Sigma}+V_{2}}\right)+C\left(\dfrac{\eta \rho\gamma_{1}\gamma_{\Sigma}}{\kappa^{2}\eta\rho\gamma_{1}\gamma_{\Sigma}+V_{ 1}}\right)\\ \hskip 14.226378 pt,0\leq\rho\leq\rho^{\rm DF}_{\rm min}\\ \hskip 14.226378 ptC\left(\dfrac{(1-\rho)\gamma_{n}}{(\kappa^{2}-\rho\kappa^{2} _{1})\gamma_{n}+1}\right)+C\left(\dfrac{\eta\rho\gamma_{n}\gamma_{\Sigma}}{ \kappa^{2}\eta\rho\gamma_{n}\gamma_{\Sigma}+V_{n}}\right)\\ \hskip 14.226378 pt,\rho^{\rm DF}_{\rm min}\leq\rho\leq\rho^{+}\\ \hskip 14.226378 ptR_{\rm MA}=C\left(\dfrac{(1-\rho)\gamma_{\Sigma}}{(\kappa^{2} -\rho\kappa^{2}_{1})\gamma_{\Sigma}+1}\right),\rho^{+}\leq\rho\leq\rho^{\rm DF }_{\rm max}\end{cases} \tag{44}\]  
where \(\rho^{+}\) is the intersection of \(I_{\rm sg}(\rho)\) and \(R_{\rm MA}(\rho)\), which can be obtained by solving the following Kubischen Polynons  
\[\begin{split} B^{+}_{1}\rho^{3}+B^{+}_{2}\rho^{2}+B^{+}_{3}\rho+B^ {+}_{4}=0\\ B^{+}_{1}=& x^{2}_{1}(1+\kappa^{2}_{1})\eta\gamma^{2} _{n}\gamma^{2}_{\Sigma}\\ B^{+}_{2}=&-\eta\gamma_{n}\gamma_{\Sigma}[\gamma_{n} \kappa^{2}_{1}+\kappa^{2}_{1}(1+\kappa^{2})\gamma_{n}\gamma_{\Sigma}\\ &+(1+\kappa^{2}_{1})(1+\kappa^{2})(\gamma_{n}-\kappa^{2}\gamma_{n})] \\ B^{+}_{3}=&(1+\kappa^{2})\eta\gamma_{n}\gamma_{\Sigma}(1+(1+ \kappa^{2})(\gamma_{n}-\kappa^{2}\gamma_{n}))\\ &+(1+\kappa^{2}(1+\kappa^{2}_{1}))V_{n}\gamma_{n}\\ B^{+}_{4}=&-(1+\kappa^{2})^{2}V_{n}\gamma_{n}\end{split} \tag{45}\]  
and \(\rho^{*}\) is the intersection of the first segment of \(I(\rho)\) and \(R_{\rm MA}(\rho)\), which can be obtained by solving Kubischen Polynons as follows  
\[\begin{split} B^{*}_{1}\rho^{3}+B^{*}_{2}\rho^{2}+B^{*}_{3}\rho+B^ {*}_{4}=0\\ B^{*}_{1}=&\eta^{2}\gamma^{3}_{\Sigma}\gamma_{1} \gamma_{2}(\kappa^{2}\kappa^{2}_{2}-\kappa^{2}_{1}(1+\kappa^{2}))\\ B^{*}_{2}=&\eta^{2}\gamma^{2}_{\Sigma}\gamma_{1} \gamma_{2}((1+2\kappa^{2})+\kappa^{2}(1+\kappa^{2})\gamma_{\Sigma})\\ &+\eta\gamma^{2}_{\Sigma}\kappa^{2}_{2}(\gamma_{2}V_{1}+\gamma_{1} V_{2})\\ B^{*}_{3}=&\eta\gamma_{\Sigma}(\gamma_{2}V_{1}+ \gamma_{1}V_{2})+\gamma_{\Sigma}V_{1}V_{2}\\ B^{*}_{4}=&-\gamma_{\Sigma}V_{1}V_{2}\end{split} \tag{46}\]  
Proof.: The proof is given in the Appendix D.  
From the two cases of the achievable sum rates expressed in (43) and (44), we analyze the OPS ratio \(\rho^{o}\) by case studies.