# Piezoelectric Energy Harvesting Prediction and Efficient Management for Industrial Wireless Sensor
## 3 Prediction of the Harvestable Energy  
### Previous Linear Energy Prediction  
Numerous studies have been proposed to predict harvestable energy from ambient sources [26; 48; 49]. One of the most popular algorithms is based on an EWMA filter [50]. The method involves dividing the database into time slots. The idea is that the harvestable energy at the time slot \(t\) of a day \(d\) is similar to the energy harvestable at the previous time intervals of the same day and at the same slot of time at the previous day \(d-1\). Thus, the power estimated at time \(t\) is defined as follows:  
\[\hat{p}_{d}\ (t)=\alpha\cdot p_{d}(t-1)\ +\ (1-\alpha)\cdot p_{d-1}(t) \tag{2}\]  
where \(\hat{p}_{n}\ (t)\) represents the power estimated at the time slot \(t\) of the current day. \(p_{d}(t-1)\) is the power harvested during the previous time slot of the same day. \(p_{d-1}(t)\) is the power harvested at the same time interval during the previous day. Finally, \(\alpha\ (0\leq\alpha\leq 1)\) is the weight of the filter. Using data from the sun for nine days, in [26], an optimal value of \(\alpha\) of 0.5 was obtained. This value was the one with the lowest prediction error. In [48], using data from the sun over a year, the value of \(\alpha\) leading  
Figure 8: Harvestable power harvested over the first four days. Figure 9: Harvestable power on different days of the month: Highlighting the periodicity. (**a**) Measurement over the month; (**b**) Zoom between the second and the fourth day. to a minimum error was 0.28. The time slot was set at 30 min in these previous works, each day comprising 48-time slots. Note that the time slot is a function of the process to be controlled. In this work, the initial vibration sampling, time slots of one minute, and the vibration data recorded throughout the month were used. The optimal weight was then determined by looking for the Mean Square Error (MSE) minimum. The Sum of the Mean Square Errors (SMSE) between the measured and the estimated power is defined as:  
\[\text{SMSE}(\alpha)\ =\ \sum_{d=1}^{n_{d}}\sum_{t=1}^{T}(p_{d}(t)\ -\ \hat{p}_{d}(t))^{2} \tag{3}\]  
where \(n_{d}\) is the number of days considered for the analysis, and \(T\) corresponding to the number of the sample made over a day (\(T=1440\)). \(p_{d}(t)\) is the measured power, and \(\hat{p}_{d}(t)\) is the estimated power calculated as in Equation (2). The value of \(\alpha\) which minimizes the SMSE can be obtained by equating the derivative of \(\text{SMSE}(\alpha)\) to zero and then solving for \(\alpha\). Using data recorded over a month, the sum of the squared errors' according to \(\alpha\), is shown in Figure 10. This high value of \(\alpha\) shows that the correlation is low between the harvestable power over two consecutive days. This result is consistent with the shift in periodicity observed in Figure 10.  
Maintaining \(\alpha\) at its optimal value, the EWMA predictor's performances are shown in Figure 11. The performances over the whole measurement period (one month) are shown in Figure 11a,b, respectively, about the comparison between the experimental power and the predicted power and about the absolute error. * In Figure 11b, a prediction error of up to 1.02 mW was obtained; such a difference can be prejudicial for the definition of the specifications of the autonomous IWS. Around the 383 rd hour, a prediction error of 1017 uJ was also observed. The overall analysis from the results of Figure 11b gives a relative error of 25.25% and a Root Mean Square Error (RMSE) of 28.63%. * In Figure 11c,d, there was a comparison between the actual power and the estimated power around the times when the most significant errors occurred. The results showed that the predicted power follows the same trend as the real power when it is monotonic. * Figure 11e,f showed a larger zoom around the most significant errors to better visualize the previous aspect. These latest results show that the EWMA method fails when the power fluctuates a lot.