# Piezoelectric Energy Harvesting Prediction and Efficient Management for Industrial Wireless Sensor
## 3 Prediction of the Harvestable Energy
### The Predictor of the Harvestable Energy from Vibrations  
It is considered a broader data history to increase the precision in estimating the power harvestable from vibrations. To avoid having to store a considerable number of data, the periodicity \(T\) observed in  
Figure 11: Exponentially Weighted Moving-Average (EWMA) predictor performance. (**a**) Real and estimated power over the whole measurement period; (**b**) Absolute error over the whole measurement period. (**c**) Zoom between the 6 th and 7 th day. (**d**) Zoom between the 15 th and the 16 th day. (**e**) Estimated power and absolute error during the 6 th day. (**f**) Estimated power and absolute error during the 15 th day.  
Figure 9 is considered to estimate the power at a given instant. The used data history is that shown in Figure 12, and the harvestable power at the current slot \(t\) is evaluated using several weights \((\alpha,\,\beta,\,\gamma)\) by the following equation:  
\[\hat{p}_{d}\left(t\right)\ =\ \sum_{i=1}^{N_{D}}\alpha_{i}.p_{d-i}(t)\ +\ \sum_{j=1}^{T} \Biggl{[}\sum_{i=1}^{N_{D}}\beta_{i,j}.p_{d-i}(t\ +\ j)\ +\ \sum_{i=0}^{N_{D}}\gamma_{i,j}.p_{d-i}(t\ -\ j)\Biggr{]} \tag{4}\]  
In this equation, \(N_{D}\) represents the previous number of days and \(T\) the periodicity over time \(\hat{p}_{d}\left(t\right)\) is the estimated power at time \(t\) of the day \(d\) and, \(p_{d-i}(t)\) represents the harvested power during the previous days in the same time slot. \(p_{d-i}(t+j)\) and, \(p_{d-i}(t-j)\) are, respectively, the harvested powers in previous days at the previous and subsequent time slots of the current moment \(t\). The previous time slots of the current day are also taken into consideration with the weight \(\alpha_{i}\). The goal is to reduce the RMSE compared to the value obtained with the EWMA algorithm; for this, the optimal weights \(\left(\alpha_{\text{opt}},\beta_{\text{opt}},\gamma_{\text{opt}}\right)\) for each estimate are determined.  
Using the algorithm defined by the Equation (4), with the value of \(T\) is set at 80, the performances of PHEV are shown in Figure 13.  
* Figure 13a compares the predicted power for the measurements recorded during the month. The result shows that the power estimated by the PHEV follows the power peaks of the real power.
* Figure 13b shows the evolution of the absolute prediction error during the month. The largest absolute error reached was 0.857 mW, unlike 1.02 mW obtained with the EWMA predictor. This error corresponded to a relative error of 21.2%, unlike 25.25% with the EWMA predictor.
* Figure 13d,e show that the power gaps between the real power and the predicted power were less pronounced with the PHEV than the EWMA algorithm.
* An analysis of the absolute prediction errors in the EWMA and PHEV algorithm was shown in Figure 13f, and it was obtained that the prediction error was lower in the case of PHEV. Based on these results, the RMSE obtained with PHEV was 19.52 mW compared to 28.63 mW with the EWMA algorithm. Performances of the two predictors on all the month's data are summarized in Table 4.  
Figure 12: Used data history to predict the harvestable power.  
Figure 13: PHEV performance compared to EWMA. (**a**) Real and estimated power over the whole measurement period; (**b**) Absolute error over the whole measurement period. (**c**) Comparison of real and PHEV predicted powers during the 10 th day. (**d**) Comparison of real and predicted powers (PHEV and EWMA) during the 6 th day. (**e**) Comparison of real and predicted powers (PHEV and EWMA) during the 15 th day. (**f**) Comparison of absolute prediction errors for the two algorithms (EWMA and PHEV).