# 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 3  
When \(P_{RF}^{i}(t_{i})\in\Big{[}P_{thr}^{l},P_{thr}^{l+1}\Big{]},l=1,2,\ldots,L-1\) (i.e., \(s_{i}=l\)), we have \(P_{H}^{i}(t_{i})=a_{l}\cdot(1-t_{i})P_{s}h_{i}+b_{l}\), \(t_{\min}=1-\frac{P_{thr}^{l+1}}{P_{s}h_{i}}\) and \(t_{\max}=1-\frac{P_{thr}^{l}}{P_{s}h_{i}}\). Considering the constraints of (P4) and (P5), the optimization problem can be rewritten as four simplification scenarios:  
* Scenario I: When \(a_{l}\cdot(1-t_{i})P_{s}h_{i}+b_{l}-P_{Q}\leq\frac{t_{i}P_{3}h_{i}}{(t_{i}+1)g_ {i}}\) and \(a_{l}\cdot(1-t_{i})P_{s}h_{i}+b_{l}-P_{Q}\leq P_{\max}-\varphi_{i}\), (P4) can be rewritten as \[ \begin{array}{l}\underset{P_{i},t_{i}}{\max}\,y_{1}(P_{i},t_{i})=\frac{1}{2} \log_{2}\Big{(}1+\psi_{i}+\frac{P_{3}h_{i}}{\sigma^{2}}\Big{)}-x^{*}\cdot(P_{i}+ P_{Q}-a_{l}\cdot(1-t_{i})P_{s}h_{i}-b_{l})\\ s.t.P1\leq P_{i}\leq a_{l}\cdot(1-t_{i})P_{s}h_{i}+b_{l}-P_{Q}\\ t_{\min}\leq t_{i}\leq t_{\max}\\ t_{i}\geq\max(t2,t3)\end{array} \] (21)There is a solution to Equation (21) if and only if \(\max(t2,t3)\leq t_{\max}\) is satisfied. First, because Equation (21) is a linear programming problem for \(t_{i}\) and \(\frac{\partial t_{1}}{\partial t_{i}}<0\), \(t_{i}^{*}=\max(t2,t3,t_{\min})\) can be obtained according to monotonicity. Then, since \(\frac{\partial^{2}t_{i}}{\partial t_{i}^{2}}<0\), \(y_{1}(P_{i})\) is a convex function with respect to \(P_{i}\), and it can be solved by derivation. Solution I can be expressed as  
\[\left\{ \begin{array}{l}P_{i}^{1*}=\left[P0\right]_{P1}^{a_{i}\cdot(1-t_{i}^{ *})P_{S}h_{i}+b_{l}-P_{Q}}\\ \rho_{i}^{1*}=1-t_{i}^{1*}=1-\max(t2,t3,t_{\min})\end{array} \right. \tag{22}\]  
where \(t2=\frac{-b+\sqrt{b^{2}-4 ac}}{2a}\) is the positive root of the quadratic equation \(a\cdot t_{i}^{2}+b\cdot t_{i}+c=0\), \(a=a_{l}g_{i}P_{S}h_{i}>0\), \(b=P_{S}h_{i}-\left(b_{l}-P_{Q}\right)g_{i}\), \(c=-(a_{l}P_{S}h_{i}+b_{l}-P_{Q})g_{i}\), \(t3=\frac{a_{l}P_{S}h_{i}+b_{l}-P_{Q}-\left(P_{\max}-q_{i}\right)}{a_{l}P_{S}h _{i}}\), \(P0=\frac{1}{x^{*}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 II: When \(P_{\max}-\varphi_{i}\leq a_{l}\cdot(1-t_{i})P_{S}h_{i}+b_{l}-P_{Q}\) and \(P_{\max}-\varphi_{i}\leq\frac{t_{i}P_{S}h_{i}}{(t_{i}+1)g_{i}}\), P4 can be rewritten as \[\max_{ \begin{subarray}{c}P_{i},t_{i}\\ s.t.P1\leq P_{i}\leq P_{\max}-\varphi_{i}\\ t_{\min}\leq t_{i}\leq t_{\max}\\ t4\leq t_{i}\leq t3\end{subarray} }\] (23) There is a solution to Equation (23) if and only if \(D=[t4,t3]\cap\left\{t_{\min},t_{\max}\right\}\
eq\varnothing\) is satisfied and we let \(D=[t_{a},t_{b}]\). Solved as in Equation (21), solution II can be expressed as  
\[\left\{ \begin{array}{l}P_{i}^{II*}=\left[P0\right]_{P1}^{P_{\max}-\varphi_{ i}}\\ \rho_{i}^{II*}=1-t_{i}^{II*}=1-t_{a}\end{array} \right. \tag{24}\]  
where \(P0\), \(P1\) and \(t3\) are the same as in Scenario I: \(t4=\frac{(P_{\max}-\varphi_{i})\cdot g_{i}}{P_{S}h_{i}-(P_{\max}-\varphi_{i}) \cdot g_{i}}\). * Scenario III: When \(\frac{t_{i}P_{S}h_{i}}{(t_{i}+1)g_{i}}\leq a_{l}\cdot(1-t_{i})P_{S}h_{i}+b_{l} -P_{Q}\) and \(\frac{t_{i}P_{S}h_{i}}{(t_{i}+1)g_{i}}\leq P_{\max}-\varphi_{i}\), P4 can be rewritten as \[\max_{ \begin{subarray}{c}P_{i},t_{i}\\ s.t.P1\leq P_{i}\leq\frac{t_{i}P_{S}h_{i}}{(t_{i}+1)g_{i}}\end{subarray} }\] (25) \[t_{\min}\leq t_{i}\leq t_{\max}\] \[t_{i}\leq\min(t2,t4)\]  
There is a solution to Equation (25) if and only if \(t_{\min}\leq\min(t2,t4)\) is satisfied. Using the Lagrange multiplier method to convert a constrained problem to an unconstrained problem \(\max_{ \begin{subarray}{c}P_{i},t_{i}\\ \end{subarray}