# Energy-Efficient Power Allocation in Non-Linear Energy Harvesting Multiple Relay Systems
## 3 Joint Optimization Algorithm for the Relay Transmit Power and PS Ratio
### Case 2  
When \(P_{RF}^{i}(t_{i})>P_{th}^{L}\) (i.e., \(s_{i}=L\)), we have \(P_{H}^{i}(t_{i})=P_{m}\), \(t_{\text{min}}=\min\biggl{(}0,1-\frac{P_{th}^{l+1}}{P_{5}h_{i}}\biggr{)}=0\) and \(t_{\text{max}}=1-\frac{P_{th}^{l}}{P_{5}h_{i}}\). Considering the constraints of (P4) and (P5), the optimization problem can be rewritten as three simplification scenarios:  
* Scenario I: When \(\frac{t_{i}P_{5}h_{i}}{(t_{i}+1)g_{i}}\geq P2\), we have \(t_{i}\geq t2\), and (P4) can be rewritten as \[ \begin{array}{ll}&\max_{P_{i},t_{i}}y_{1}(P_{i})=\frac{1}{2}\log_{2} \Bigl{(}1+\psi_{1}+\frac{P_{5}h_{i}}{\sigma^{2}}\Bigr{)}-x^{*}\cdot\bigl{(}P_{ i}+P_{Q}-P_{\text{m}}\bigr{)}\\ &s.t.P1\leq P_{i}\leq P2\\ &t_{\text{min}}\leq t_{i}\leq t_{\text{max}}\\ &t_{i}\geq t2\end{array} \] (15)  
There is a solution to Equation (15) if and only if \(t2\leq t_{\text{max}}\) is satisfied. The objective function is independent of \(t_{i}\), so we usually let \(t_{i}^{*}=t_{\text{max}}\). Due to \(\frac{\partial^{2}y_{1}}{\partial P_{1}^{2}}<0\), \(y_{1}(P_{i})\) is a convex function with respect to \(P_{i}\), and it can be solved by derivation. Let \(\frac{dy_{1}}{dP_{i}}=0\) and have \(P0=\frac{1}{x^{*}\cdot 2\ln 2}-\frac{(1+\psi_{i})\cdot\sigma^{2}}{g_{i}}\). The solution I can be expressed as  
\[\left\{ \begin{array}{ll}P_{i}^{l*}=[P0]_{P1}^{P2}\\ \rho_{i}^{l*}=1-t_{i}^{l*}=1-t_{\text{max}}\end{array} \right. \tag{16}\]  
where \(t2=\frac{P2\cdot g_{i}}{P_{5}h_{i}-P2\cdot g_{i}}\), \(P1=\max(0,\frac{(\gamma_{\text{min}}-\psi_{i})\cdot\sigma^{2}}{g_{i}})\), \(P2=\min\bigl{(}P_{\text{max}}-\varphi_{i},P_{m}-P_{Q}\bigr{)}\) and \([x]_{a}^{b}\) denotes \(\max(a,\min(x,b))\). * Scenario II: When \(\frac{t_{i}P_{5}h_{i}}{(t_{i}+1)g_{i}}\leq P2\), we have \(t_{i}\leq t_{2}\), and (P4) can be rewritten as \[ \begin{array}{ll}&\max_{P_{i},t_{i}}y_{1}(P_{i})=\frac{1}{2}\log_{2} \Bigl{(}1+\psi_{1}+\frac{P_{5}g_{i}}{\sigma^{2}}\Bigr{)}-x^{*}\cdot\bigl{(}P_{ i}+P_{Q}-P_{m}\bigr{)}\\ &s.t.P1\leq P_{i}\leq\frac{t_{i}P_{5}h_{i}}{(t_{i}+1)g_{i}}\\ &t_{\text{min}}\leq t_{i}\leq t_{\text{max}}\\ &t_{i}\leq t2\end{array} \] (17)There is a solution to Equation (17) if and only if \(t_{\min}\leq t2\) is satisfied. The objective function is related to \(t_{i}\), so we use the Lagrange multiplier method to convert a constrained problem to an unconstrained problem \(\underset{P_{i},t_{i}}{\max}L(P_{i},t_{i})=\frac{1}{2}\log_{2}\Big{(}1+\psi_{i}+ \frac{P_{i}Q_{i}}{e^{2}}\Big{)}-x^{*}\cdot\big{(}P_{i}+P_{Q}-P_{m}\big{)}+ \lambda_{i}\Big{(}\frac{t_{i}P_{i}b_{i}}{(t_{i}+1)g_{i}}-P_{i}\Big{)}\), where \(\lambda_{i}\) is the Lagrange multiplier. Since \(\frac{\partial^{2}L}{\partial P_{i}^{2}}<0\) and \(\frac{\partial^{2}L}{\partial t_{i}^{2}}<0\), we use the KKT condition for the solution. Solution II can be expressed as  
\[\left\{ \begin{array}{l}P_{i}^{II*}=[P0]P_{1}^{II*}\\ P_{i}^{II*}=1-t_{i}^{II*}=1-\min(t2,t_{\max})\end{array} \right. \tag{18}\]  
where \(t2=\frac{P_{2},g_{i}}{P_{3}h_{i}-P_{2},g_{i}}\), \(P0=\frac{1}{x^{*}\cdot 2\ln 2}-\frac{(1+\psi_{i})\cdot e^{2}}{g_{i}}\) and \(P1=\max(0,\frac{(\gamma_{\min}-\psi_{i})\cdot e^{2}}{g_{i}})\). * Scenario III: Considering the constraints of (P5), the optimization problem can be rewritten as \[ \begin{array}{l}\underset{P_{i},t_{i}}{\max}\,y_{2}(P_{i},t_{i})=\frac{1}{2 }\log_{2}\Big{(}1+\psi_{i}+\frac{t_{i}P_{i}b_{i}}{(t_{i}+1)\sigma^{2}}\Big{)} -x^{*}\cdot\big{(}P_{i}+P_{Q}-P_{m}\big{)}\\ s.t.\,\frac{t_{i}P_{3}h_{i}}{(t_{i}+1)g_{i}}\leq P_{i}\leq P2\\ t_{\min}\leq t_{i}\leq t_{\max}\\ t1\leq t_{i}\leq t2\end{array} \] (19) There is a solution to Equation (19) if and only if \(D=[t1,t2]\cap[t_{\min},t_{\max}]\
eq\varnothing\) is satisfied and we let \(D=[t_{a},t_{b}]\). First, because Equation (19) is a linear programming problem for \(P_{i}\) and \(\frac{\partial y_{2}}{\partial P_{i}}<0\), the optimal solution \(P_{i}^{*}=\frac{t_{i}^{*}P_{3}h_{i}}{(t_{i}+1)g_{i}}\) can be obtained according to monotonicity.