## 2 Related Work  
There has been some research into wireless communication systems with energy-harvesting equipment. For a time-invariant channel, in [3], the optimal offline power allocation policies are proposed to minimize the transmission completion time under energy causality for two kinds of data arrival scenarios. In [4], the optimal power allocation policies are derived when the capacity of the battery is limited. In [5], for a sensor networks scenario, the problem of maximizing the throughput of the system is firstly studied, and then the problem of minimizing the average delay is solved. In addition, wireless transmission with a time-varying channel is also studied. In [6], directional water-filling algorithm is proposed to solve throughput maximization question and the proving of optimality is given. The authors next use stochastic dynamic programming to tackle the optimal online policy with causal channel information and propose a low-complexity near-optimal algorithm. In [7], structural results for the optimal energy allocation are obtained by using dynamic programming and optimization theory; then, the staircase water-filling algorithm is obtained based on the conventional water-filling algorithm when considering that the capacity of a battery has no limit. In [8], a geometric water-filling (GWF) algorithm is proposed in place of the conventional water-filling algorithm with a sum power constraint. Then, the recursively geometric water-filling (RGWF) algorithm is obtained by taking energy causality into account. All the energy collected in [3; 4; 5; 6; 7; 8] is used for transmission and other losses are ignored, which is too idealistic. In [9], the authors analyze the problem of optimizing system throughput in the case of imperfect batteries: the batteries will leak over time or the upper limit of the battery capacity decreases with time. In [10], for a time-invariant channel, taking the circuit consumption factor into account and considering both energy efficiency (EE) and spectrum efficiency (SE), the EE-SE two-phase algorithm is proposed to solve the problem of the optimization of throughput. In [11], circuit consumption is also considered for both time-invariant and time-varying channels, and the optimal solution is given to maximize the throughput. In [12], three questions are studied: throughput maximization, the minimization of energy consumption when data transmission is completed, and the minimization of data transmission completion time. Inspired by the offline optimal algorithm of the above problems, an online power allocation algorithm with low complexity is proposed. The losses of energy in the storage process are studied in [13], where the conditions of time-invariant and time-varying channels, infinite and limited battery capacity, single users and broadcast channels are discussed, respectively. Then, an optimal power allocation algorithm with a double-threshold structure is proposed. Besides the above-mentioned studies, there has also been some research into power allocation in other scenarios. For example, [14] develops distributed methods to efficiently use harvested energy in a sensor network while [15] considers power and server allocation in a multibeam satellite downlink. Some of the above references do not consider the additional energy losses and some consider only the single energy losses, while there would be more than one kind of energy loss problem in the actual scene. This paper aims to study the scenario where not only circuit consumption generated in the process of transmission but also the energy losses in the storage process are considered. These two factors are considered as restrictive conditions in the optimization problem for time-invariant and time-varying channels, respectively. We discuss the offline optimal power allocation strategies to solve the throughput maximization problems and then propose an online power allocation policy with low complexity.