In this section, the simulation results are presented and discussed. First, the case study and the parameters of the system are explained. The proposed method for data-driven interval prediction is then applied on the available data set. Finally, the simulation results for optimal day-ahead scheduling are discussed to show the effectiveness of the proposed algorithm.
All the simulations have been done in Python (Python Software Foundation, Fredericksburg, VA, USA) on an Intel(R) Core i7-7500U CPU @2.70 GHz computer (Intel Corporation, Santa Clara, CA, USA) with an installed memory of 16 GB. In order to implement the point forecast, the models from scikit-learn (Oakland, CA, USA) and Keras (Cambridge, MA, USA) are used. The optimization framework has been modeled in PYOMO (Oakland, CA, USA) [
39], while GUROBI 9.0.2 (Gurobi Optimization, Beaverton, OR, USA) [
40] is used as the solver.
4.1. Case Study
The proposed algorithm is evaluated on the data set available for an industrial MES in Germany. As shown in
Figure 2, this industrial site includes a natural gas CHP system, two natural gas boilers, a local PV installation, an EES device to store electricity, and a TES device to store the generated heat. The parameters of each unit are summarized in
Table 1. The local electrical consumption, thermal consumption, and PV energy generation were measured by a local measurement system. The data available are from 8 March 2019 to 17 March 2020 with a 15 min resolution, while the measurements for October 2019 and November 2019 are missing. Therefore, the data are available for 315 days in total. The quality of the local measurements were checked in advance. Missing values were replaced by linear interpolation, except the mentioned two months, which have been excluded from further analysis. The installed capacity of the PV system was upgraded in September 2019. Therefore, all the data are normalized regarding the capacity of PV at the moment of measurement.
The German day-ahead electricity prices were downloaded from the platform of the European Network of Transmission System Operators (ENTSO-E) [
41]. In order to include taxation in the electricity price, the price for buying electricity from the grid at each time is assumed to be twice as high as the reported price by ENTSO-E at that time step. Moreover, the day-ahead price for selling electricity is assumed to be half of the price of buying electricity at that time step. Moreover, in order to analyse the real-time cost, the imbalance electricity price delta was downloaded via [
42]. It is assumed that the real-time prices of buying and selling electricity are equal to each other. The price of natural gas is set to 0.4 €/m
3 (equal to 0.034 €/kWh) [
43]. The electricity demand, the thermal demand, and the prices for energy carriers are shown in
Figure 3 for 27 September 2019, which was randomly selected from our data set.
4.2. PV Uncertainty Representation
The first step to represent the uncertainty of PV energy generation is to obtain a point forecast. All the models proposed in
Section 2.1 were applied on the available data set for PV generation, and the best model was selected based on the accuracy and the computational time. It should be mentioned that the PV data set is zero-inflated, which means that certain time periods are excluded (from 7 in the evening to 7 in the morning, since the PV production is (almost) zero). In order to obtain a good generalization performance, a 10-fold cross validation was used. Moreover, the data set was divided by 80% and 20% for the training set and the validation set, respectively. In order to obtain the optimal hyper-parameters of each model, Grid Search was used to find the best performance (except for persistence method). The maximum lag for SMA and LASSO was set between two days ago and two weeks ago. It was determined that the best performance was obtained at 10 days ago (
) for both methods. The FFNN also showed the best performance, with two hidden layers, each including 100 neurons, while the sigmoid function was selected as the activation function. Moreover, the best hyper-parameters of SVR are obtained with radial basis function (RBF) as the kernel function.
In
Table 2, the results of different evaluation metrics are presented for all the point forecast models (the optimal hyper-parameter(s) of each model is(are) used). As shown, the LASSO performance is the best for all metrics, while SVR has the worst. The other models (persistence, SMA, and FFNN) perform similarly. More complicated models, such as FFNN and SVR, are not able to outperform LASSO because of the small size of the data set to train complicated models. Normally, these methods, especially the FFNN, require more data to be trained. Moreover, in the last column of
Table 2, the computational time of each prediction model is shown. Since the persistence model only takes the last day values as the predicted energy production, it can be done very fast, while the FFNN takes the most time to provide the prediction values. To conclude, since LASSO outperforms the other models, it was selected as the day-ahead point forecaster.
The next step was to calculate the quantiles of the forecast to build the predicted interval for day-ahead PV energy generation. A non-parametric approach based on historical quantiles of the error is proposed in
Section 2.2. The quantile function of the errors are described by 99 quantiles with a probability value from 0.01 to 0.99 with a step of 0.01. According to the proposed method, only the historical errors from one day ago to the optimal (maximum) lag are considered (see Equation (
10)), which turns out to be
. Moreover, the forecast errors for the last 10 days at the same time step as well as the errors from 1 h before and 1 h after the previous days are considered to calculate the targeted time step quantiles of error.
Two probabilistic forecast benchmark methods are also implemented to be compared with the performance of the proposed method. In the first benchmark, the quantiles for each time step are calculated based on the historical errors from previous days, i.e., the seasonal behavior of the PV system is ignored. The second benchmark is based on building quantiles around the point forecast (the method used in most of the literature).
To evaluate the performance of the probabilistic forecast, the calibration diagram is used. It compares the similarity of predicted distribution (
y-axis) with the distribution of the original data set (
x-axis). A reliable probabilistic forecast should be well-calibrated, i.e., close to the diagonal.
Figure 4 shows the average calibration diagram of the proposed methods versus two benchmark methods for all time horizons, over all days available in the data set. The solid black line represents the ideal case. The greater the similarity to the diagonal, the more reliable the method is.
As shown in
Figure 4, the proposed method and the quantiles benchmark method perform quite similarly, while the proposed method is closer to the diagonal and is in the lead. On the other hand, the second benchmark, which is based on building distribution around the point forecast, has an uncalibrated reliability diagram. This means that the second benchmark is not able to provide a reliable result, and the predicted distribution is far from the original data. To quantify the above comparison, the maximum deviation and the mean absolute error with regard to the ideal case are calculated for each probabilistic method. The maximum deviation is 0.02%, 0.05%, and 0.3% for the proposed method, the first benchmark method, and the second benchmark method, respectively. Moreover, the proposed method ends up with a 0.01% mean absolute error, while the first and the second benchmark methods result in 0.02% and 0.12% of the mean absolute error. As a result, the proposed method, which is a combination of LASSO and quantile function based on historical errors, outperforms the two benchmarks. After obtaining the quantiles, the predicted interval can be obtained for any uncertainty level.
Figure 5 illustrates the predicted interval for four different uncertainty levels (10%, 20%, 30%, and 40%) for PV generation together with real measurements and point forecast for the randomly selected day (27 September 2019). For instance, the interval for the 10% uncertainty is calculated based on the 45th and 55th quantiles.
4.3. Interval Optimization
The simulation results regarding the optimal day-ahead scheduling of the proposed MES are discussed in this section. In order to address the uncertainty of PV generation, interval optimization is proposed. In this part, by varying the uncertainty level for PV generation, the sensitivity of the operation cost of the system as well as the behavior of all the units are analyzed.
According to the formulation in
Section 3, the interval optimization is applied to the proposed case study. Four different uncertainty levels are taken into account to represent the uncertainty of PV: 10%, 20%, 30%, and 40%. By solving the optimization model, the intervals for average daily operation cost are obtained and shown in
Table 3, where
and
are the day-ahead scheduling cost interval.
and
are the real-time cost interval to compensate the representation of PV uncertainty. The values in
Table 3 are reported in average of 315 days available in the data set. The 0% is simulated when only day-ahead point forecast values are used to estimate PV energy generation.
As shown in
Table 3, by increasing the level of uncertainty, not only does the width (
) of day-ahead cost interval increase, but the width of the total operational cost (day-ahead and real-time) increases as well. Moreover, it can be seen that the interval optimization solution is sensitive to the PV uncertainty level, although the deviations are small. When the PV uncertainty level is changed from 10% to 40%, the lower bound and upper bound of the day-ahead cost would change by
and
, respectively. It can be concluded that the main part of the total cost (
) belongs to the day-ahead cost, and the real-time compensation costs are small compared to the day-ahead costs (
and
with a 10% uncertainty level). These cost intervals provide ideas for the energy management system of the MES regarding the uncertainty level of PV generation.
In order to analyze the effect of uncertainty on the behavior of the units and on the input energy carriers (electricity and gas), the average daily optimal values of these parameters are shown in
Table 4 for two uncertainty levels (10% and 30%). As can be seen, the amount of purchased electricity and sold electricity are sensitive to the level of PV uncertainty, while the behavior of CHP and boilers do not change over different levels of uncertainty. Therefore, the gas consumption is approximately constant for these two levels of uncertainty. This behavior can be explained by the prices for electricity and gas as well as the limited capacity of TES.
As formulated in Equation (
29), the main objective of the proposed optimization is to minimize the operational cost of the MES. However, another factor that could be considered in MESs with local energy generation resources is self-reliance (see [
44] for more information).
Table 5 shows the values of the self-consumption (the ratio between the self-consumed local electricity generation and the total local electricity generation) and self-sufficiency (the ratio between the load supplied by local electricity generation and the total load) of the system for two uncertainty levels. As can be seen in
Table 5, there are not many changes in self-consumption by switching from one uncertainty level to another. The reason is that the optimization, in order to minimize the cost, is more sensitive to the price of electricity, while maximizing self-consumption is beyond the scope of this paper. Moreover, in the daily average, there is more PV production in the lower bound analysis. Therefore, self-sufficiency is higher in lower bound analysis for both uncertain levels shown in
Table 5.
Moreover, in order to analyze the behavior of different units under PV uncertainty, their optimal operation under 30% uncertainty level over the representative day are shown in
Figure 6,
Figure 7 and
Figure 8. It should be mentioned that, in these figures, the dashed lines belong to the upper bound (shown by
+) analysis of the day-ahead objective function, while the solid lines represent the lower bound (shown by
−) analysis of the day-ahead objective function.
Figure 6 shows the optimal electricity interaction with the main grid. In day-ahead optimization, the injected energy is zero, while the real-time injected energy is shown in
Figure 6a. As can be seen, the lower bound and the upper bound of real-time injection follow the day-ahead PV uncertainty. Due to the error in forecasting PV generation, there is more PV energy generation in the afternoon in real time. The bounds of the real-time purchased energy (
Figure 6b) also depend on the uncertainty of the PV energy system. However, as shown in
Figure 6b, the bounds for day-ahead purchased electricity do not only depend on PV uncertainty but also are affected by electricity price. The difference between lower and upper bounds of this parameter can be seen early in the morning when the electricity price is low. As the uncertainty of the PV system has an influence on the interaction of energy with the grid, the EES behavior is also affected by this issue (see
Figure 8a).
The behavior of boilers and the thermal part of CHP is shown in
Figure 7. These two units should supply the thermal demand of the site. As can be seen, CHP behavior is affected by PV uncertainty during the day. These changes also have an influence on the behavior of the two boilers and the TES (see
Figure 8b). Since, in lower bound analysis, there is more PV generation compared to the upper bound analysis during the day, the CHP unit generates less energy (both thermal and electrical) during the day (also less energy stored in the TES in
Figure 8b). However, in the evening, the CHP generates more energy in the lower bound analysis to supply the demand. Therefore, the uncertainty of the PV system shifts the generation of the CHP and boilers. However, the total generation of these units are constant in the lower and upper bounds analysis during one day.