# 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
}(P_{i},t_{i})=\frac{1}{2}\log_{2}\Bigl{(}1+\psi_{i}+\frac{P_{S}h _{i}}{\sigma^{2}}\Bigr{)}-x^{*}\cdot\left(P_{i}+P_{Q}-a_{l}\cdot(1-t_{i})P_{S}h _{i}-b_{l}\right)+\lambda_{i}\)\(\left(\frac{t_{i}P_{S}h_{i}}{(t_{i}+1)g_{i}}-P_{i}\right)\), where \(\lambda_{i}\) is the Lagrange multiplier, since \(\frac{\partial^{2}t_{i}}{\partial P_{i}^{2}}<0\) and \(\frac{\partial^{2}t_{i}}{\partial t_{i}^{2}}<0\), the optimal solution can be obtained by the KKT condition as follows  
\[\left\{ \begin{array}{l}P_{i}^{III*}=\max(P1,\frac{t_{i}^{III*}P_{S}h_{i}}{(t_{ i}^{III*}+1)g_{i}})\\ \rho_{i}^{III*}=1-t_{i}^{III*}=1-[t_{0}^{0}]_{t_{\min}}^{\min(t2,t4,t_{\max})} \end{array} \right. \tag{26}\]  
where \(t0\) is the real root of the univariate cubic equation \(a\cdot(t0)^{3}+b\cdot(t0)^{2}+c\cdot t0+d=0\), \(a=x^{*}\cdot 2\ln 2\cdot a_{l}g_{i}\cdot\left(P_{S}h_{i}+(1+\psi_{i})\cdot\sigma^{2}\right)\), \(b=x^{*}\cdot 2\ln 2\cdot a_{l}g_{i}\cdot\left(2P_{S}h_{i}+3(1+\psi_{i})\cdot\sigma^{2}\right)\), \(c=x^{*}\cdot 2\ln 2\cdot(a_{l}g_{i}+1)\cdot\left(P_{S}h_{i}+(1+\psi_{i})\cdot\sigma^{2} \right)+4x^{*}\ln 2\cdot a_{l}g_{i}\cdot(1+\psi_{i})\cdot\sigma^{2}-g_{i}\), \(d=x^{*}\cdot 2\ln 2\cdot(a_{l}g_{i}+1)\cdot(1+\psi_{i})\cdot\sigma^{2}-g_{i}\), \(t2\) and \(P1\) are the same as in Scenario I and \(t4\) is the same as in Scenario II. In order to solve this univariate cubic equation, we use [PERSON]'s formula. We let \(t0=Y-\frac{b}{6}\) and change it into a standard univariate cubic equation \(Y^{3}+pY+q=0\)where \(p=\frac{c}{a}-\frac{b^{2}}{3a^{2}}\) and \(q=\frac{d}{a}-\frac{bc}{3a^{2}}+\frac{2b^{3}}{27a^{3}}\). The discriminant is \(\Delta=\left(\frac{a}{2}\right)^{2}+\left(\frac{p}{3}\right)^{3}\) and can be divided into three cases: when \(\Delta>0\), there is a real root \(Y_{1}=u+v\); when \(\Delta=0\), there are two real roots \(Y_{1}=u+v\) and \(Y_{2}=w\!\cdot\!u+w^{2}\) and when \(\Delta<0\), there are three real roots \(Y_{1}=u+v\), \(Y_{2}=w\cdot u+w^{2}\cdot v\) and \(Y_{3}=w^{2}\cdot u+w\cdot v\), where \(u=\sqrt[3]{-\frac{q}{2}-\sqrt{\Delta}}\), \(v=\sqrt[3]{-\frac{q}{2}+\sqrt{\Delta}}\) and \(w=\frac{-1+\sqrt{3}i}{2}\). * Scenario IV: 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}\!\left(1+\psi_{1}+\frac{t_{i}P_{S}h_{i}}{(t_{i}+1)\sigma^{2}}\right)-x^{* }\cdot\left(P_{i}+P_{Q}-a_{1}\cdot(1-t_{i})P_{S}h_{i}-b_{1}\right)\\ s.t.\frac{t_{i}P_{S}h_{i}}{(t_{i}+1)\delta_{i}}\leq P_{i}\leq\min(a_{i}\cdot(1-t _{i})P_{S}h_{i}+b_{i}-P_{Q},P_{\max}-\varphi_{i})\\ t_{\min}\leq t_{i}\leq t_{\max}\\ t1\leq t_{i}\leq\min(t2,t4)\end{array} \] (27) There is a solution to Equation (27) if and only if \(D=[t1,\min(t2,t4)]\cap[t_{\min},t_{\max}]\
eq\varnothing\) is satisfied and we let \(D=[t_{a},t_{b}]\). Solved as in Equation (19), solution IV can be expressed as \[\left\{ \begin{array}{l}P_{i}^{IV*}=\frac{t_{i}^{IV*}P_{S}h_{i}}{(t_{i}^{IV*} +1)\delta_{i}}\\ \rho_{i}^{IV*}=1-t_{i}^{IV*}=1-\underset{t_{i}^{IV*}\in\{t_{a}t_{b},[t0_{i}^{I _{b}}\}}{\operatorname{argmax}}y_{2}(t_{i}^{*})\end{array} \right.\] (28) where \(y_{2}(t_{i})=\frac{1}{2}\log_{2}\!\left(1+\psi_{1}+\frac{t_{i}P_{S}h_{i}}{(t_ {i}+1)\sigma^{2}}\right)-x^{*}\cdot\left(\frac{t_{i}P_{S}h_{i}}{(t_{i}+1) \delta_{i}}+P_{Q}-a_{1}\cdot(1-t_{i})P_{S}h_{i}-b_{1}\right)\), \(t1=\frac{(\gamma_{\min}-\psi_{i})\cdot\sigma^{2}}{P_{S}h_{i}-(\gamma_{\min}- \psi_{i})\cdot\sigma^{2}}\) and \(t0\), \(t2\) and \(t4\) are the same as in Scenario III. The power allocation algorithm in this paper consists of an outer loop algorithm and an inner loop algorithm. Since only single-relay power is assumed to be allocated and other relay power allocations are known in the solution, a fixed-point iteration algorithm is needed to obtain joint power optimization for all relays (i.e., an outer loop algorithm based on a fixed-point iteration, given by Algorithm 1).