Power Allocation Algorithm for an Energy-Harvesting Wireless Transmission System Considering Energy Losses

For an energy-harvesting wireless transmission system, considering that a transmitter which can harvest energy from nature has two kinds of extra energy consumption, circuit consumption and storage losses, the optimization models are set up in this paper for the purpose of maximizing the average throughput of the system within a certain period of time for both a time-invariant channel and time-varying channel. Convex optimization methods such as the Lagrange multiplier method and the KKT (Karush–Kuhn–Tucker) condition are used to solve the optimization problem; then, an optimal offline power allocation algorithm which has a three-threshold structure is proposed. In the three-threshold algorithm, two thresholds can be achieved by using a linear search method while the third threshold is calculated according to the channel state information and energy losses; then, the offline power allocation is based on the three thresholds and energy arrivals. Furthermore, inspired by the optimal offline algorithm, a low-complexity online algorithm with adaptive thresholds is derived. Finally, the simulation results show that the offline power allocation algorithms proposed in this paper are better than other algorithms, the performance of the online algorithm proposed is close to the offline one, and these algorithms can help improve the average throughput of the system.


Introduction
With the development of wireless communication technology, environmental protection and energy consumption issues have attracted widespread attention.The technology of green development and energy saving has become the mainstream technology of wireless communication development [1,2].Energy harvesting is a method of resource regeneration in wireless communication, which can realize the efficient use of renewable resources.In a scenario that the system has energy-harvesting transmitters, energy harvesters can harvest energy from the natural environment (such as wind energy, solar energy, tidal energy, etc.).Since the amount of harvested energy is limited and has large randomness, it is important to decide how to allocate the energy to transmit data.Although some research has been undertaken into power allocation in energy harvesting systems, algorithms are usually proposed which fail to take the energy losses into account or only think about one kind of energy loss.It is worth researching power allocation when considering that several kinds of energy losses exist.

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.
The contents are as follows: Section 3 shows the establishment of the system model; Section 4 solves the optimization problem for the time-invariant channel and proposes a power allocation algorithm with a three-threshold structure; Section 5 presents the optimal power allocation strategy in view of the time-varying channel; Section 6 puts forward the online power allocation algorithm with low complexity and adaptive thresholds; Section 7 gives the simulation results and analysis; and Sections 8 and 9 are a discussion and a summary of this paper, respectively.

System Model
The model of a wireless transmission system with an energy harvesting transmitter is shown in Figure 1.Supposing that the data transmission time has N time slots, the length of each time slot is unit 1, the transmitter will harvest E i units of energy at the beginning of time slot i.The energy E i collected at each time slot is independent and obeys uniform distribution.The transmit power in time slot i is p i ; when p i > 0, the circuit consumption power is a mW, and the total power consumed is In (1), p i is defined as where l i (0 ≤ l i ≤ 1) is the actual transmission time, s i is the amount of energy stored in the battery, r i is the amount of energy extracted from the battery and al i is the consumption.

System Model
The model of a wireless transmission system with an energy harvesting transmitter is shown in Figure 1.Supposing that the data transmission time has N time slots, the length of each time slot is unit 1, the transmitter will harvest i E units of energy at the beginning of time slot i .The energy i E collected at each time slot is independent and obeys uniform distribution.The transmit power in time slot i is i p ; when 0 i p > , the circuit consumption power is a mW, and the total power consumed is , 0 0, 0 i i all i p a p P p In (1), i p is defined as , 1,..., where i l ( 0 1 i l ≤ ≤ ) is the actual transmission time, i s is the amount of energy stored in the battery, i r is the amount of energy extracted from the battery and i al is the consumption.
For the additive white Gaussian noise channel, the instantaneous transmission rate ( ) In (4), i h is the channel fading coefficient in time slot i .There are energy losses when the energy is stored in the battery, supposing that the storage efficiency is α (0 ≤ α ≤ 1).If the energy collected by the time slot is used up to transmit the data, there are no energy storage losses; if the collected energy is not used up at the current time slot, the remaining energy s i is stored in the battery, the amount of energy loss is (1 − α)s i , and only αs i units of energy can be used for future.The amount of energy in the battery in time slot i can be written as For the additive white Gaussian noise channel, the instantaneous transmission rate R(p i ) is In ( 4), h i is the channel fading coefficient in time slot i.
In this paper, the average throughput of the system is maximized by optimizing the transmit power of each time slot and the factors such as energy arrivals, channel states, circuit consumption and storage losses are considered comprehensively.

Optimal Offline Power Allocation for the Time-Invariant Channel
We first study the time-invariant channel scene where h i = h, i = 1, . . ., N and the energy arrivals are E i , i = 1, . . .N. The instantaneous transmission rate is (4); then, the optimization problem P1 can be described as max The condition in (6) means that the amount of energy in the battery is nonnegative, which reflects the energy causality.The condition in ( 7) means the power is nonnegative.
Observing this optimization problem, it can be found that R(p) is concave in p and all conditions are linear, so P1 is a convex optimization problem and the Lagrange multiplier method and KKT conditions can be used.The Lagrange function is where λ i , µ i , ν i , i , θ i , σ i , i = 1, . . .N are nonnegative Lagrange multipliers for the restrictive conditions.
Taking the derivatives with respect to s i , r i , l i , we can obtain

∂L ∂r
where . The remaining KKT conditions are Putting ( 10), ( 11) and (12) in order: 16) and ( 17) can be written as We first analyze (18).Since the system exhibits storage losses, the optimal solution cannot be achieved by using a conventional water-filling algorithm or the DWF (Directional Water-Filling) algorithm in [6].Reference [13] defines two thresholds according to (18): Obviously, p si > p ri , and the two thresholds have the following relationship: In [13], the authors have analyzed p ri ≤ p i * ≤ p si , which means that the optimal power should be between two thresholds.If p i is greater than p si , the part of the energy which exceeds p si should be stored in the battery, so p si is called the storage threshold; if p i is less than p ri , the system needs to retrieve energy from the battery, so p ri is called the retrieval threshold.According to Lemma 3 in [13], the threshold should be monotonically increasing and its value changes only when the battery is empty.
Combined with the analysis of [13] and the restrictions of this paper, the optimal power should satisfy the following conditions: Then, we analyze (19) and firstly propose a new optimization problem, P2: In ( 25), l i = 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 It is obvious that (26) is similar to (19), and the only difference is the parameter σ i which corresponds to the condition l i * ≤ 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 * ≤ 1 should satisfy the following: No matter what the situation is, the power allocation in the last time slot should be It can be found from the above discussion that power allocation mainly depends on p si , p ri and p o ; thus, Algorithm 1 next proposed is called the three-threshold algorithm: Algorithm 1. Optimal solution for the time-invariant channel 1) Calculate p o , initialize: 2) for i = ii:1:N do Linear search the largest p s,k and p r,k which can make p i , s i , r i , i = ii, . . ., N feasible in (23), (24) and the condition B i ≥ 0, i = ii, . . ., N should be satisfied; for j = ii : N if B j ≤ ε (ε is an arbitrarily small value) or j ≥ N − 1 for i = ii : j p i , s i , r i are decided by p s,k and p r,k ; end if end for end for 3) for i = 1 : N − 1 Compare the value of p o with p si and p ri , then adjust p i , s i , r i , l i and calculate B i ; end for 4)

Optimal Offline Power Allocation for Time-Varying Channel
Now we consider the time-varying channel scenario, and the instantaneous transmission rate is still (4), so the optimization problem P3 is max P3 is still a convex optimization problem, and so we can also use the Lagrange multiplier method and the KKT conditions:

∂L ∂r i
= Other KKT conditions are the same as in ( 10), ( 11) and (12).From (37) and (38), we can see that where V is the water level and can be written as For (41), we still use the definitions in [13]: In ( 42) and (43), V si and V ri are two water-level thresholds and the function of them is similar with those of p si and p ri .Obviously, Like the time-invariant channel, the optimal solution should satisfy s i information of the present moment and past moment, and so these thresholds need to be predicted.The prediction equations in [13] are In (52), f E (e) is the probability density function of e.In (53), f H (h) is the probability density function of h, f E,H (e, h) is the joint probability density function of e and h, and f E,H (e, H) = f E (e) • f H (h) because the two variables are independent of each other.
The disadvantage of this prediction method is that the calculated thresholds are fixed, which is not feasible for all time slots and α.Based on the solution of Equations ( 52) and ( 53), an adaptive-threshold algorithm is proposed in this paper.For the time-invariant channel, we first get p s from (52); then, the adaptive threshold should be In (54), two factors will affect the threshold: the storage efficiency α and time slot i. Obviously, the value of the threshold will increase when α becomes smaller or i becomes larger, and the strategy is reasonable because the transmitter should use more energy instead of storage when a time slot is close to the end or the storage efficiency α is small.In addition, p ri is calculated by ( 22), according to the analysis in the offline part; then, the online power allocation policy should be For the time-varying channel, we first get V s and then V ri is calculated by (44) and the online power allocation method is

Simulation Results and Analysis
The simulation tool is MATLAB 2014a in this paper (part of our MATLAB code is available in the Supplementary File).The system model is as shown in Figure 1 in part 3. The additive white Gaussian noise (AWGN) channel is adopted and we assume that the noise spectral density N 0 = 10 −19 W/Hz, the bandwidth is 1 MHz and the path loss h between the transmitter and the receiver is -100 dB for the time-invariant channel.For the time-varying channel, the h i obeys exponential distribution with E[h i ] = −100 dB.The energy arrival of each time slot is independent and obeys the uniform distribution.We consider 10 time slots, and the length of each of time slot is 1 second.B 0 = 0 and the capacity of the battery has no limit.The circuit consumption power is set to be 5 mW.
Figure 2 shows the performance changes of each algorithm as the storage efficiency of the battery is changed when the channel is time-invariant.The energy arrivals obey the uniform distribution of [5,15] mJ.The non-storage strategy means that the energy of the current slot is completely expended in the slot and the power allocation policy is as in ( 27) and (28).It can be seen from the figure that the algorithm proposed in this paper is obviously superior to the algorithm in [13] because compared with the algorithm in [13], the factor of circuit consumption is considered in our optimization process.The curve of the adaptive-threshold online algorithm proposed in this paper is close to the offline optimal strategy curve while the gap between the double-threshold offline algorithm in [13] and its corresponding fixed-threshold online algorithm is larger, which shows that the adaptive-threshold is more beneficial to improve the throughput.From Figure 2, it can be also found that under the low storage efficiency, the strategy of non-storage has a great advantage, and with the increasing of storage efficiency, the disadvantage of non-storage strategy is gradually reflected.

Simulation Results and Analysis
The simulation tool is MATLAB 2014a in this paper.The system model is as shown in Figure 1 in part 3. The additive white Gaussian noise (AWGN) channel is adopted and we assume that the noise spectral density  Figure 2 shows the performance changes of each algorithm as the storage efficiency of the battery is changed when the channel is time-invariant.The energy arrivals obey the uniform distribution of [5,15] mJ.The non-storage strategy means that the energy of the current slot is completely expended in the slot and the power allocation policy is as in ( 27) and (28).It can be seen from the figure that the algorithm proposed in this paper is obviously superior to the algorithm in [13] because compared with the algorithm in [13], the factor of circuit consumption is considered in our optimization process.

Proposed offline algorithm
Offline algorithm in [13] Proposed online algorithm Non-storage strategy Online algorithm in [13] Figure 2. Throughput for the time-invariant channel with energy arrivals obeying the uniform distribution of [5,15] mJ.
Figure 3 shows the performance of each algorithm when the energy arrivals obey the uniform distribution of [5,20] mJ and the channel is time-invariant.It can be found that the overall change trend of each algorithm is similar to Figure 2.However, because of the increasing average value of energy arrivals, the overall throughput is obviously improved and the gap between the various algorithms gets larger.It is worth noting that with the improvement of storage efficiency, the double-threshold algorithm curve in [13] is closer to the curve of the offline algorithm proposed in this paper.This is due to the improvements of the mean of the energy arrivals and the storage efficiency; the energy used in the transmission increases, while the circuit consumption is constant, which makes the influence of circuit consumption smaller.
optimal strategy curve while the gap between the double-threshold offline algorithm in [13] and its corresponding fixed-threshold online algorithm is larger, which shows that the adaptive-threshold is more beneficial to improve the throughput.From Figure 2, it can be also found that under the low storage efficiency, the strategy of non-storage has a great advantage, and with the increasing of storage efficiency, the disadvantage of non-storage strategy is gradually reflected.Figure 3 shows the performance of each algorithm when the energy arrivals obey the uniform distribution of [5,20] mJ and the channel is time-invariant.It can be found that the overall change trend of each algorithm is similar to Figure 2.However, because of the increasing average value of energy arrivals, the overall throughput is obviously improved and the gap between the various algorithms gets larger.It is worth noting that with the improvement of storage efficiency, the doublethreshold algorithm curve in [13] is closer to the curve of the offline algorithm proposed in this paper.This is due to the improvements of the mean of the energy arrivals and the storage efficiency; the energy used in the transmission increases, while the circuit consumption is constant, which makes the influence of circuit consumption smaller.

Proposed offline algorithm
Offline algorithm in [13] Proposed online algorithm Non-storage strategy Online algorithm in [13] Figure 3. Throughput for the time-invariant channel with energy arrivals obeying the uniform distribution of [5,20] As shown in Figures 4 and 5, the performance of each algorithm varies with the change of storage efficiency under the time-varying channel when the energy arrivals obey the uniform distribution of [5,15] mJ and [5,20] mJ, respectively.As can be seen from the pictures, the algorithm proposed in this paper is still superior to the algorithm in [13].However, the performance of the strategy of non-storage is not ideal, because the channel state is changing all the time and the strategy of non-storage may still transmit data when the channel is in a very poor state.As with the time-invariant channel scene, the adaptive-threshold online algorithm curve proposed in this paper is close to the curve of the offline algorithm.When the mean of energy arrival gets larger and the storage efficiency increases, the influence of circuit consumption decreases, and so the performance of the double-threshold algorithm in [13] will be closer to the algorithm in this paper.As shown in Figure 4 and Figure 5, the performance of each algorithm varies with the change of storage efficiency under the time-varying channel when the energy arrivals obey the uniform distribution of [5,15] mJ and [5,20] mJ, respectively.As can be seen from the pictures, the algorithm proposed in this paper is still superior to the algorithm in [13].However, the performance of the strategy of non-storage is not ideal, because the channel state is changing all the time and the strategy of non-storage may still transmit data when the channel is in a very poor state.As with the time-    As shown in Figure 4 and Figure 5, the performance of each algorithm varies with the change of storage efficiency under the time-varying channel when the energy arrivals obey the uniform distribution of [5,15] mJ and [5,20] mJ, respectively.As can be seen from the pictures, the algorithm proposed in this paper is still superior to the algorithm in [13].However, the performance of the strategy of non-storage is not ideal, because the channel state is changing all the time and the strategy of non-storage may still transmit data when the channel is in a very poor state.As with the time-  By changing the h, we get three curves in Figure 6.It can be seen that the channel state plays a vital role and the performance of the proposed offline algorithm increases more obviously when the channel state improves.Figure 7 shows the performance of each algorithm when the storage efficiency is 60% and the channel is time-invariant.The performance of the online algorithm in [13] is the worst, while the proposed offline algorithm in this paper is still the best.
invariant channel scene, the adaptive-threshold online algorithm curve proposed in this paper is close to the curve of the offline algorithm.When the mean of energy arrival gets larger and the storage efficiency increases, the influence of circuit consumption decreases, and so the performance of the double-threshold algorithm in [13] will be closer to the algorithm in this paper.By changing the h , we get three curves in Figure 6.It can be seen that the channel state plays a vital role and the performance of the proposed offline algorithm increases more obviously when the channel state improves.Figure 7 shows the performance of each algorithm when the storage efficiency is 60% and the channel is time-invariant.The performance of the online algorithm in [13] is the worst, while the proposed offline algorithm in this paper is still the best.Offline algorithm in [13] Proposed online algorithm Non-storage strategy Online algorithm in [13] Figure 6.Throughput of the proposed offline algorithm for the time-invariant channel with energy arrivals obeying the uniform distribution of [5,15] mJ.
to the curve of the offline algorithm.When the mean of energy arrival gets larger and the storage efficiency increases, the influence of circuit consumption decreases, and so the performance of the double-threshold algorithm in [13] will be closer to the algorithm in this paper.By changing the h , we get three curves in Figure 6.It can be seen that the channel state plays a vital role and the performance of the proposed offline algorithm increases more obviously when the channel state improves.Figure 7 shows the performance of each algorithm when the storage efficiency is 60% and the channel is time-invariant.The performance of the online algorithm in [13] is the worst, while the proposed offline algorithm in this paper is still the best.

Discussion
In this paper, convex optimization approaches such as the Lagrange multiplier method and the KKT (Karush-Kuhn-Tucker) condition are used to solve the problem we proposed.Then, we discuss and analyze the form of the optimal solution and find that the power allocation depends on three thresholds.Two of the thresholds can be calculated by a liner search while the third is decided by a channel statement.We next summarize the offline algorithms for both time-invariant and time-varying channels.Furthermore, inspired by offline algorithms, the online algorithm is proposed.The offline algorithm can adaptively adjust thresholds when the time and channel statements have changes.In addition, not only does the online algorithm have low complexity, but also the performance of the online algorithm is close to that of the offline one.Due to limited time and energy, we assume that the capacity of the battery is infinite and the maximum transmit power has no limit which will affect the optimization.These factors will be taken into account in future research work.The adaptive-thresholds

bandwidth is 1
MHz and the path loss h between the transmitter and the receiver is -100 dB for the time-invariant channel.For the time-varying channel, the i h obeys exponential distribution with [ ] 100 dBi E h = −.The energy arrival of each time slot is independent and obeys the uniform distribution.We consider 10 time slots, and the length of each of time slot is 1 second.0 =0 B and the capacity of the battery has no limit.The circuit consumption power is set to be 5 mW.

Figure 2 .
Figure 2. Throughput for the time-invariant channel with energy arrivals obeying the uniform distribution of[5,15] mJ.

Figure 3 .
Figure 3. Throughput for the time-invariant channel with energy arrivals obeying the uniform distribution of [5, 20] mJ.

Figure 4 .
Figure 4. Throughput for the time-varying channel with energy arrivals obeying the uniform distribution of[5,15] mJ.

Figure 5 .
Figure 5. Throughput for the time-varying channel with energy arrivals obeying the uniform distribution of [5, 20] mJ.

Figure 4 .
Figure 4. Throughput for the time-varying channel with energy arrivals obeying the uniform distribution of[5,15] mJ.

Figure 4 .
Figure 4. Throughput for the time-varying channel with energy arrivals obeying the uniform distribution of[5,15] mJ.

Figure 5 .
Figure 5. Throughput for the time-varying channel with energy arrivals obeying the uniform distribution of [5, 20] mJ.

Figure 5 .
Figure 5. Throughput for the time-varying channel with energy arrivals obeying the uniform distribution of [5, 20] mJ.

Figure 6 .
Figure 6.Throughput of the proposed offline algorithm for the time-invariant channel with energy arrivals obeying the uniform distribution of[5,15] mJ.

Figure 7 .
Figure 7. Throughput for the time-invariant channel with 60% storage efficiency.

Figure 6 .
Figure 6.Throughput of the proposed offline algorithm for the time-invariant channel with energy arrivals obeying the uniform distribution of[5,15] mJ.

Figure 7 .
Figure 7. Throughput for the time-invariant channel with 60% storage efficiency.

Figure 7 .
Figure 7. Throughput for the time-invariant channel with 60% storage efficiency.