1. Introduction
Energy harvesting (EH) is the process that enables the conversion of ambient energy present in the environment (e.g., solar, wind, thermal, or kinetic energy) into electrical energy for use in powering small, autonomous devices. This promising technology encourages the deployment of long-term wireless networks since conventional, battery-operated devices can be replaced by self-sustainable, autonomous ones that harvest the energy they need from their surrounding environment [
1]. The quest for perpetually communicating devices is challenged by the intermittent and random nature of ambient energy sources. For example, energy harvested from sunlight or wind experiences significant variations depending on the weather, the season, and the time of day. For this reason, part of the scavenged energy is usually stored in a component of limited capacity (typically, a supercapacitor or a battery) to further balance the amount of energy harvested at each moment with the energy consumption profile.
EH technology can be used to provide a virtually uninterrupted power supply to the nodes of a Wireless Sensor Network (WSN) [
2]. However, to cope with the uncertainty in the energy availability, EH nodes must implement an energy management policy to ensure long-term operations [
3]. This management policy determines when to activate/deactivate the sensing, transmitting, or receiving circuits of the device according to the amount of available energy; i.e., it tries to schedule sensing and communication tasks optimally from an energy point of view. Certainly, the design of optimal management policies requires the energy harvesting profile to be known in advance or, at least, that it can be accurately predicted [
4,
5].
In energy harvesting WSNs (EH-WSNs), accurate prediction of the near future energy availability (from a few minutes to a few hours) is particularly important to avoid short-term energy shortages at the sensor nodes [
6]. In this paper, we focus on one of the most common and effective ambient energy sources for EH-WSNs: sunlight. Solar radiation is dynamic, uncontrollable, and only partially predictable. The solar energy available to a device can fluctuate considerably even within a short period. There is a need, therefore, for efficient prediction methods that accurately forecast the expected solar energy intake in the near future so that energy expenditure can be effectively adapted to the dynamics of energy harvesting.
Different estimation techniques have been proposed in the last few years. Most of them use past energy patterns to predict future energy availability, thus requiring one to maintain several profiles of the energy harvested by the EH node for a number of prior days [
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16]. In this paper, we present a novel solar energy model, named the Solar Altitude Angle (SAA) model, that adopts a completely different approach. It is well known that solar irradiance on a cell surface mainly depends on the angle of incidence of the sunlight on it, that is, on the height of the sun above the horizon. Hence, the SAA model only uses the solar altitude angles at different times of day to predict future solar energy intake. Evaluation results using real datasets show that our proposal is able to provide accurate predictions at both short-term and medium-term forecasting horizons by only executing a few low complexity operations. In addition, since it does not maintain locally collected past energy measures, the SAA model has a very low memory overhead. Finally, it is important to highlight that our proposal is extremely simple to set up since, unlike most prediction schemes, it does not require the careful tuning of any configuration parameter to ensure accurate energy estimations. In fact, the SAA model can be used without requiring any particular configuration in different solar energy harvesters under varying weather conditions and locations. All these features make our proposal particularly suitable for hardware constrained devices (for example, sensor-like motes) that must work under severe resource restrictions such as limited battery and computing power, and/or scarce memory [
17].
The rest of the paper is organized as follows. Related work is reviewed in
Section 2. In this section, we also briefly describe Pro-Energy and UD-WCMA predictors, two of the most performant schemes.
Section 3 presents the SAA model, our novel solar energy model. In
Section 4, we evaluate the performance of the SAA model and compare it with that of Pro-Energy and UD-WCMA predictors in different scenarios. In
Section 5, we discuss some implementation issues. The main conclusions are laid out in
Section 6.
2. Related Work
Many different prediction models have been proposed in recent years. Most of them use energy observations in prior days to predict future energy availability: QL-SEP [
6], EWMA [
7], WCMA [
8], ASEA [
9], Pro-Energy [
10,
11], IPro-Energy [
12], SEPCS [
13], UD-WCMA [
14], LINE-P [
15], and Adaptive LINE-P [
16]. This class of models requires maintaining locally collected data about the energy harvested during a number of prior days. Subsequently, recently measured energy values are carefully combined with the energy harvesting patterns from previous days to predict future energy intake. For example, EWMA [
7] estimates the energy value at timeslot
n as a weighted average of the most recent energy value and the mean energy value at timeslot
n of the previous days. QL-SEP [
6] adjusts the EWMA estimation with the average increase/decrease ratio (either positive or negative) of the energy harvested in the previous timeslots. ASEA [
9] improves the EWMA model introducing an additional scaling factor that adjusts future energy expectations based on the variability of short-term weather conditions. WCMA [
8] also improves EWMA in scenarios with changing weather conditions. This model introduces a new weighting factor that quantifies how many current weather conditions have changed with respect to those in the previous days. UD-WCMA [
14] is a dynamic version of WCMA with adaptive weighting factors. Pro-Energy [
11] carefully combines the most recent energy value with the average energy harvested during the most similar previous days to the current one. We will provide a more detailed description of Pro-Energy and UD-WCMA in the following subsections. SEPCS [
13] and LINE-P [
15] employ complex linear prediction models that take into account both previous energy samples from the same day and energy samples from previous days. Finally, Adaptive LINE-P [
16] improves LINE-P with adaptive weighting parameters.
All of these techniques rely on one or several weighting factors that determine the relative importance between current and past measures when computing energy predictions. As expected, the configuration of these parameters is critical for accurate predictions. Moreover, there is no single set of parameter values that performs well enough for all weather conditions and/or energy harvesters. Generally, the weighting factors are tuned
a priori for a particular set of data, so most of these techniques cannot dynamically adapt to varying weather conditions. To the best of our knowledge, only UD-WCMA [
14] and Adaptive LINE-P [
16] predictors provide effective models able to dynamically adjust the weighting factors to current weather conditions.
There is also another class of models that use cloud cover forecasts to predict solar energy intake [
18,
19]. These methods are able to improve long-term predictions but can only be applied to scenarios in which external connectivity is available to obtain weather forecasts. In this paper, we focus on those schemes that only use locally collected energy measures to make predictions, as they are suitable for autonomous EH nodes with no online resources available. Among them, two of the most popular schemes are the Pro-Energy and UD-WCMA predictors. We briefly present both prediction methods in the following subsections.
2.1. Pro-Energy
This predictor divides each day into
N non-overlapping timeslots of equal duration. To make predictions, Pro-Energy maintains a pool of
D profiles, each one containing the energy harvested during each of the
N timeslots of a given past day. Subsequently, at timeslot
n of the current day C, the energy prediction for future timeslot
,
, is computed as follows:
where
is the energy predicted for timeslot
of the current day,
is the energy harvested during the last timeslot
n of the current day,
is the average energy harvested during timeslot
of the
P most similar profiles of the pool, and
is the correlation factor that determines the significance of the last measured energy value
when computing predictions for future timeslots:
with
a weighting factor,
, and
G the number of timeslots in the future that presumably show a strong correlation with the energy harvested during the current timeslot. Clearly, the weight associated with the last measured energy value progressively decreases as predictions go away in time.
To compute
, the similarity with the current day for each profile
of the pool must be computed. For a given profile
, this will be computed as the mean absolute error (MAE) over the previous
K timeslots:
where
is the energy harvested during timeslot
j of profile
. Subsequently, if we assume that
is the ordered set of profiles based on their similarity with the current day, the weighted average energy value is computed as
where
is the number of profiles combined, and
2.2. Dynamic Weather Condition Moving Average (D-WCMA)
D-WCMA predictions are based on a weighting factor that is dynamically configured to adapt to different weather conditions. This model needs to store the energy harvested in each of the
N timeslots of the
D previous days
. Subsequently, at timeslot
n of the current day C, D-WCMA computes the energy prediction for future timeslot
as follows:
where
is the adaptive weight of the last observation in the prediction for timeslot
, GAP
is a factor that scales the current energy variations with respect to those of the previous days over a time horizon of
K timeslots, and
is the average energy harvested during timeslot
in the previous
D days:
where
is the energy harvested during timeslot
of the preceding day
.
The weighting factor
estimates the predictability level of the energy intake during future timeslot
from the variations in the energy harvested during the previous days. It is dynamically configured as follows:
where
is the standard deviation of the energy harvested during timeslot
of the preceding days, whereas
is the standard deviation of the energy variations between timeslots
n and
on those days. Finally, the GAP factor is computed as a normalized weighted average of the ratio between the energy harvested in the current day and the average energy harvested in the previous days along the last
K timeslots:
2.3. Universal Dynamic WCMA (UD-WCMA)
For the purpose of improving robustness to weather variations, UD-WCMA replaces in the D-WCMA prediction scheme the last measured energy value,
, with a weighted linear combination of itself and the energy harvested during the future timeslot in the most similar previous day. Thus, the energy prediction for future timeslot
is computed as follows:
where
is the new weighting factor used in the prediction for timeslot
, and
is the energy harvested during timeslot
of day
,
being the day among the
D previous days with the more similar energy profile to the current day. The similarity between days is computed in the same way as in the Pro-Energy predictor. The weighting factor
is dynamically tuned as follows:
where
is the standard deviation of the variations in the energy harvested in the current day along the last
consecutive timeslots:
4. Evaluation
We evaluated the performance of Pro-Energy, UD-WCMA, and Solar Altitude Angle (SAA) predictors using an open-source in-house simulator [
22]. We employed real solar traces obtained from the National Renewable Energy Laboratory (NREL) at Oak Ridge, Tennessee [
23]. Each original trace contains one sample per minute of the radiant energy on the solar cell in a given day. From the raw irradiance values
I, the harvested power has been estimated as
, where
is the efficiency factor of the solar cell, and
A is the area of the cell surface. As in [
11], we considered
and
22
7
. In addition, we set the number of timeslots per day
N to 48, so we stored in each energy profile the average solar power harvested at each 30
interval.
Figure 4 depicts the average power harvested from sunrise to sunset for each day of the year 2018 and the power harvested at different times of several representative days for the given location. Note how solar power harvesting significantly varies from one day to another and at different times of the same day.
We evaluated the accuracy of the prediction methods for timeslot horizons (
h) from 1 to 4 (30
to 120
). We computed the predictions for each day of the year 2018 from sunrise to sunset and, afterward, the MAE and the Mean Absolute Deviation (MAD) for all of them:
where
and
are, respectively, the actual and the predicted solar energy harvested from timeslot
n to timeslot
:
4.1. Optimal Pro-Energy Configuration
We firstly evaluated the performance of the Pro-Energy predictor with multiple configuration settings. Note that, contrary to our proposal, the computational overhead introduced by this scheme (and, consequently, the accuracy of its predictions) depends on the setting of several parameters such as the number of energy profiles stored (
D), the number of past measures used to compute similarity between profiles (
K), and the number of profiles combined for predictions (
P). We configured this predictor with three different sets of parameters (overhead levels), as shown in
Table 1. Additionally, to compute the correlation factor
, we always used
(
h), while the weighting factor
was configured with values from 0 to 1 to find out the best value for each simulated scenario.
Figure 5 shows the MAE for both the short-term (30 and 60
) and medium-term (90 and 120
) predictions obtained with Pro-Energy (95% confidence intervals are shown in the graphs). As expected, prediction errors are greater as the prediction horizon moves away, and the most accurate predictions are achieved using the setting with the highest overhead. Note that the
parameter greatly impacts performance. The optimal weighting factor takes values from
for the 30
predictions with the low overhead settings to
for the 120
predictions with the high overhead settings. Not surprisingly, the relative significance of the last measured energy value (that is, the weighting factor
) must be diminished as the prediction horizon moves away.
4.2. Performance Comparison
We compared the performance of the SAA energy predictor with respect to the Pro-Energy and UD-WCMA schemes. To ensure a fair comparison, we configured Pro-Energy with the optimal
parameter in each scenario, as obtained in the previous section. For UD-WCMA, we set
and
as recommended in [
14]. Recall that our predictor does not require the tuning of any parameter at all.
Figure 6 shows the short-term prediction results obtained with the different estimation methods—in particular, their MAD—and the relative difference between the MAE obtained with each of the predictors and that obtained with Pro-Energy when configured with the high overhead settings (Pro-High), since this is the best performing alternative. Noticeably, and despite its apparent simplicity, the MAE obtained with the SAA model is
% and
% lower than that obtained with Pro-High at 30 and 60
prediction horizons, respectively. Moreover, even the simplified SAA model using the sine approximation (SAA-Sine) reduces the MAE obtained with Pro-High by
% and
% at 30 and 60
horizons, respectively. On the other hand, the UD-WCMA technique is able to slightly improve the predictions given by Pro-Energy with the low overhead settings (Pro-Low) only, but its estimations are much less accurate than those obtained with our proposal.
The results obtained for the medium-term predictions are shown in
Figure 7. Pro-High provides slightly more accurate estimations than the SAA technique only at the 120
prediction horizon. Moreover, even SAA-Sine still achieves more precise estimations than both UD-WCMA and Pro-Low. Consequently, our SAA model would be a very interesting choice for solar energy forecasting at both short- and medium-term prediction horizons.
5. Implementation
In this section, we will evince that our model presents clear advantages for implementation in hardware-constrained devices. Recall that the SAA predictor does not use energy harvesting patterns observed in the past to estimate future energy availability. Instead, it just requires the computation of the altitude angle of the sun at both the current time and the future prediction horizon. Fortunately, this is not an arduous task. As shown in
Section 3, the solar altitude angle can be computed using Equation (
14) from the declination, the hour, and the latitude angles. Note first that stationary nodes can be preloaded with the sine and cosine of their corresponding latitude angle. Furthermore, recall from Equation (
15) that the solar declination angle only depends on the day of year, so this angle can only take 365 different values that could be easily pre-calculated and stored in the nodes. In fact, the corresponding sines and cosines of the declination angles could be directly stored in the nodes. If this were not the case, the declination angle should be computed daily. In any case, a variable storing the current day of year is necessary and must be incremented (modulo-365) by one once a day.
To compute the declination angle (and its corresponding sine and cosine), we must perform some trigonometric functions. To estimate their complexity, we assume that they are approximated using a finite number of terms of their corresponding Taylor series. Thus, the sine and cosine functions for a given angle of
x can be calculated as follows:
The 7-th (8-th) degree Taylor polynomial provides a good estimation of the sine (cosine) function in the range
, so we assume that computing each sine (cosine) function involves performing 3 additions and 5 multiplications (4 additions and 5 multiplications). This is a worst case scenario since, for small angles, these functions can be accurately approximated with a Taylor polynomial of a lower degree. Subsequently, it easily follows from Equation (
15) that computing the declination angle requires a total of 5 additions and 7 multiplications and, since what we need to estimate the altitude angle is its sine and cosine, we have to perform 7 more additions and 10 more multiplications. The product of the sines (and cosines) of the latitude and the declination angles needed to compute the altitude angle also only has to be calculated once a day.
Contrastingly, the hour angle (and its cosine) and the altitude angle at the prediction horizon must be computed for each prediction. Note that the altitude angle at the current timeslot will have already been computed in the previous prediction (as the altitude angle at the prediction horizon), so it is unnecessary to calculate it again. The hour angle can be easily calculated using Equation (
16), so only one addition and one multiplication is required. The arcsine function needed to compute the altitude angle can be calculated as follows:
thus requiring the same number of operations as the sine function. Finally, only one extra multiplication and division must be performed to estimate the future energy intake (see Equation (
17)).
In the case of using the sine approximation expressed in Equation (
19), both sunrise and sunset times of the current day at the given location must be known beforehand. These times can be directly estimated from previous measures. For example, the sunrise time (
) can be estimated as the time corresponding to the first timeslot of the current day in which the amount of harvested solar energy is not null (or above a minimum threshold). Similarly, the current day length, that is, the interval from sunrise to sunset (
), can be approximated as the day length observed in the previous day, since day length only varies a few minutes per day. These times can be measured in any unit, even in the number of timeslots directly. Subsequently, to make a prediction, the sine of the relative angle corresponding to the future timeslot must be computed. Recall that the sine of the relative angle at the current timeslot will have already been computed in the previous prediction (as the sine value for the future timeslot). This angle includes the factor
, which only has to be calculated once a day. Therefore, each prediction only requires 4 additions, 7 multiplications, and 1 division.
The number of operations and memory overhead required for the different SAA implementations is shown in
Table 2. We assumed that integer and float numbers are stored as 16 and 32 bit values, respectively. All SAA variants require the last measured energy value to be stored. Additionally, the original SAA scheme also needs to store the current day of year, the sine and cosine values for the latitude angle, the solar altitude angle at the prediction horizon, and, if solar declination angles have been pre-calculated, their corresponding sines and cosines (730 values). In contrast, SAA-Sine requires the sunrise time of the current day, the current day length, and the sine of the relative angle at the future timeslot to be stored. In all cases, the operations involved in the prediction procedure have a low enough complexity so as to be implemented in low-power WSN nodes.
We performed an analogous analysis to obtain the number of operations per prediction and memory overhead for both Pro-Energy and UD-WCMA schemes. Recall that Pro-Energy needs to compute the similarity of the current day with each profile of the pool using Equation (
3) and the weighted average energy harvested during the future timeslot of the most similar profiles using Equations (
4) and (
5). UD-WCMA requires the computation of the similarity of the current day with stored profiles, as Pro-Energy does, as well as the corresponding weighting factors
and GAP using Equations (
8), (
10), and (
12), which involves the computation of several standard deviations (see Equations (
9) and (
13)). The computation of standard deviations requires one to perform several square roots. To avoid any possible bias in favor of our scheme, we assumed that the time complexity for computing a square root was equivalent to that of a multiplication. In addition, both schemes must also update their pool of profiles once a day. Although not considered when estimating the number of operations, recall that both Pro-Energy and UD-WCMA schemes must sort the stored energy profiles by their similarity with the current day, which requires some extra operations for each prediction. Regarding their memory needs, these schemes require the storage of the pool of energy profiles, each one containing the energy harvested during each of the timeslots of a given past day, and the energy harvested during the timeslots of the current day. In view of the results obtained, we can affirm that our proposal is able to provide more accurate predictions in most scenarios using considerably less memory and performing fewer operations.
6. Conclusions
This paper presents the SAA (Solar Altitude Angle) predictor, a novel energy prediction model for solar-powered devices. The new technique obtains accurate predictions of future solar energy availability based on the altitude angles of the sun at different times of day. We compared the performance of SAA with some popular techniques using real datasets. Evaluation results show that our proposal is able to provide the most accurate predictions in almost all of the evaluated scenarios by only executing a few low complexity operations and with the lowest memory overhead since, contrary to most state-of-the-art predictors, it does not use past EH patterns to estimate future energy intake.
It is also important to highlight that, unlike most prediction schemes that require the careful tuning of certain configuration parameters to ensure acceptable energy estimations, our energy model provides accurate predictions without requiring any particular configuration for each different scenario. This lack of required settings greatly simplifies the management and setup of the proposed technique in different solar energy harvesters under varying weather conditions and locations.
Further, the SAA predictor does not limit energy estimations to pre-defined instants of time. Although we have presented a new algorithm using equally distributed timeslots to ensure a fair comparison with currently available schemes, our energy model can be used to make predictions for any time of day. Thus, the SAA model can be readily employed in cases where arbitrary prediction horizons are necessary.