## 4 Optimal Offline Power Allocation for the Time-Invariant Channel
Combined with the analysis of [13] and the restrictions of this paper, the optimal power should satisfy the following conditions:  
\[\frac{\partial L}{\partial r_{i}}=\frac{h}{1+{hp_{i}}^{*}}-\sum\limits_{j=i}^ {N}\lambda_{j}+\mu_{i}+_{i}=0\;\;\;i=1,\ldots,N \tag{11}\]0  
\[\frac{\partial L}{\partial r_{i}}=\frac{h}{1+{hp_{i}}^{*}}-\sum\limits_{j=i}^ {N}\lambda_{j}+\mu_{i}+_{i}=0\;\;\;i=1,\ldots,N \tag{11}\]1  
Then, we analyze (19) and firstly propose a new optimization problem, P2:  
\[\frac{\partial L}{\partial r_{i}}=\frac{h}{1+{hp_{i}}^{*}}-\sum\limits_{j=i}^ {N}\lambda_{j}+\mu_{i}+_{i}=0\;\;\;i=1,\ldots,N \tag{11}\]2  
In (25), \(l_{i}=\frac{{E_{i}}}{{p_{i}}+a}\), P2 aims to maximize the throughput in time slot \(i\) with \({E_{i}}\) units of energy, and the length of time slot \(i\) has no limit. Taking the derivative of (25), we can obtain  
\[\frac{\partial L}{\partial r_{i}}=\frac{h}{1+{hp_{i}}^{*}}-\sum\limits_{j=i}^ {N}\lambda_{j}+\mu_{i}+_{i}=0\;\;\;i=1,\ldots,N \tag{11}\]3  
It is obvious that (26) is similar to (19), and the only difference is the parameter \(\sigma_{i}\) which corresponds to the condition \({l_{i}}^{*}\leq 1\). Supposing that \(p_{o}\) is the optimal solution of P2, if the circuit consumption \(a\) and the channel fading coefficient \(h\) are determined, \(p_{o}\) is determined. It has been analyzed in [12] that the optimal power allocation for P2 adding the condition \({l_{i}}^{*}\leq 1\) should satisfy the following:  
\[\frac{\partial L}{\partial r_{i}}=\frac{h}{1+{hp_{i}}^{*}}-\sum\limits_{j=i}^ {N}\lambda_{j}+\mu_{i}+_{i}=0\;\;\;i=1,\ldots,N \tag{11}\]4  
\[\frac{\partial L}{\partial r_{i}}=\frac{h}{1+{hp_{i}}^{*}}-\sum\limits_{j=i}^ {N}\lambda_{j}+\mu_{i}+_{i}=0\;\;\;i=1,\ldots,N \tag{11}\]5According to the above analysis, in our optimization problem, \({p_{i}}^{*}\) and \({l_{i}}^{*}\) should satisfy the following:  
\[\frac{\partial L}{\partial r_{i}}=\frac{h}{1+{hp_{i}}^{*}}-\sum\limits_{j=i}^ {N}\lambda_{j}+\mu_{i}+_{i}=0\;\;\;i=1,\ldots,N \tag{11}\]6  
\[\frac{\partial L}{\partial r_{i}}=\frac{h}{1+{hp_{i}}^{*}}-\sum\limits_{j=i}^ {N}\lambda_{j}+\mu_{i}+_{i}=0\;\;\;i=1,\ldots,N \tag{11}\]7  
In addition, the last time slot should use up all the energy harvested and that remaining in the battery. Comprehensively considering the above analyses, finally, \({p_{i}}^{*}\) and \({l_{i}}^{*}\) should satisfy the following situations:  
(1) When \(pee>p_{si}\), then \({p_{i}}^{*}={p_{o}},i=1,\ldots,N\). We first set \({l_{i}}^{*}=1\), if \({E_{i}}-a>p_{o}\), \({s_{i}}^{*}={E_{i}}-a-{p_{o}},{r_{i}}^{*}=0,{l_{i}}^{*}=1\); if \({p_{ri}}\leq{E_{i}}-a\leq p_{o}\), \({l_{i}}^{*}=\frac{{E_{i}}}{{p_{o}}+a},{s_{i}}^{*}=0,{r_{i}}^{*}=0\); if \({E_{i}}-a<p_{ri}\), \({s_{i}}^{*}=0,{r_{i}}^{*}=\min({B_{i}},{p_{ri}}-({E_{i}}-a)),{l_{i}}^{*}=\frac{ {E_{i}}+{r_{i}}^{*}}{{p_{o}}+a}\). (2) When \(p_{ri}\leq p_{o}\leq p_{si}\), assume that \({l_{i}}^{*}=1\). If \({E_{i}}-a>p_{si},{s_{i}}^{*}={E_{i}}-a-p_{si},{r_{i}}^{*}=0,{l_{i}}^{*}=1\); if \({p_{ri}}\leq{E_{i}}-a\leq p_{si}\), \({p_{i}}^{*}=\max({p_{o}},{E_{i}}-a)\), \({s_{i}}^{*}=0,{r_{i}}^{*}=0\), \({l_{i}}^{*}=\frac{{E_{i}}}{{p_{i}}^{*}+a}\); if \({E_{i}}-a<p_{ri}\), \({p_{i}}^{*}=p_{o}\), \({s_{i}}^{*}=0,{r_{i}}^{*}={p_{ri}}-({E_{i}}-a)\), \({l_{i}}^{*}=\frac{{E_{i}}+{r_{i}}^{*}}{{p_{i}}^{*}+a}\). (3) When \(p_{o}<p_{ri}\), we can obtain \({p_{i}}^{*}\) from (23) and \({l_{i}}^{*}=1,i=1,\ldots,N\).