Keywords

1 Introduction

The progressive shift towards decentralized generation in power distribution networks has made the problem of optimal Distributed Energy Resources (DER) operation increasingly constrained, due to the integration of flexible (deterministic) energy systems combined with the strong penetration of (uncontrollable and stochastic) Renewable Energy Sources (RES). This challenge can be met by using the Virtual Power Plant (VPP) concept, which is based on the idea of aggregating the capacity of many DER, (i.e. generation, storage, or demand) to create a single operating profile to increase flexibility through the definition of approaches to manage the uncertainty.

We develop a two-step optimization model to be employed in the Energy Management System (EMS) of a VPP. Our EMS decides the optimal planning of power flows for each timestamp that minimizes the cost. The planning decision model is composed by two steps: the first (day-ahead) step is designed to optimize the load demand shift and to estimate the cost, and models the prediction uncertainty using a robust (scenario-based) approach. The second step is an online greedy algorithm implemented within a simulator that uses the optimized shifts from the previous step to minimize the operational real cost, while fully covering the optimally shifted energy demand and avoiding the loss of energy produced by RES generators. We propose the following main contributions: (1) a robust optimization approach for planning power flows to minimize the VPP expected cost and to obtain optimized load shifts in presence of forecast uncertainty; (2) the development of a real case study to test the model; (3) an assessment of the quality of our solutions in terms of the Expected Value of Perfect Information (EVPI), i.e. by comparing the actually obtained costs with the optimal expected costs that would be possible assuming perfect information.

The rest of the paper is organized as follows. Section 2 discusses the main approaches proposed in the literature for modeling VPP and for handling uncertainties in energy management problems. Section 3 describes the proposed two-step optimization model for the EMS of a VPP. Section 4 presents how we applied our model to data in a real case study. Section 5 provides an analysis of results. Concluding remarks are in Sect. 6.

2 Related Work

The potential applications of the VPP concept has been recognized in recent literature. For example, [2] shows that the advance of DER in the commercial and regulatory structure of electricity markets in course of liberalization has created opportunities for decentralization of the role of traditional power utilities.

VPPs are one of the main components of intelligent electrical grids of the future, connecting and integrating several types of power sources (both renewable and non-renewable), storage and energy loads to operate as a unique power plant. The heart of a VPP is an EMS which coordinates the power flows coming from the generators, controllable loads and storages. In [12] an EMS for controlling a VPP is presented, with the objective to manage the power flows for minimizing the electricity generation costs, and avoiding the loss of energy produced by renewable energy sources. In general, the EMS can operate by minimizing the generation costs or by maximizing the profits. On the basis of actual energy prices and availability of DER, the EMS decides: (1) how much energy should be produced; (2) which generators should be used for the required energy; (3) whether the surplus energy should be stored or sold to the energy market.

Moreover, DER aggregation can effectively couple traditional peak electrical plants by supporting them with the flexible contribution of consumers to the overall efficiency of the electric system. From this perspective, the EMS of a VPP can develop Demand Side Management (DSM) mechanisms to modify temporal consumption patterns. DSM can provide a number of advantages to the energy system and focuses on utilizing power saving mechanisms, electricity tariffs, and government policies to decrease the demand peak and operational costs instead of enlarging the generation capacity. As an example, [13] proposed an Energy Management System for a renewable-based microgrid with online signals for consumers to promote behavior changes. The integration of renewable sources must be adequately addressed so as to manage uncertainty and to avoid affecting the operational reliability of a power system. Unit commitment (UC) is a critical decision process, which can be formalized as the problem of deciding the outputs of all the generators to minimize the system cost. The main principle in operating an electrical system is to cover the demand for electricity at all times and under different conditions depending on the season, weather and time, and by minimizing the operating cost. The deterministic formulation of this problem may not adequately account for the impact of uncertainty. For this reason, different approaches are used to manage UC under uncertainty [10]: (1) Stochastic UC, which is based on probabilistic scenarios. The basic idea is to find optimal decisions taking into account a large number of scenarios, each representing a possible realization of the uncertain factors. Stochastic UC is generally formulated as a two-stage problem [16] that determines the generation schedule to minimize the expected cost over all of the scenarios, while respecting their probabilities. The approach usually requires high computational cost for simulations. (2) Robust UC formulations, which optimize assuming a well-defined range for the uncertain quantities, instead of taking into account their probability distribution. The range of uncertainty is defined by the upper and lower bounds on the net load at each time period [15]. (3) Hybrid models have been proposed in recent years to combine the advantages and compensate the disadvantages [14]. The assessment of uncertainty in the modeling of distributed energy systems has received considerable attention in recent works that apply machine learning techniques for forecasting flexibility of VPP. Many studies have been done on the residential sector using support vector regression and neural networks [6, 9] and some methods present promising results however it seems unlikely they may be implemented in real life in particular in the industrial sector. We plan to improve these methods in our model for future works.

We propose an EMS composed of a two-step optimization model for a VPP. Our focus is on modeling renewable sources and load demand uncertainty in the first (day-ahead) step, by proposing a robust optimization with DSM to support DER aggregation by decreasing peak usage of traditional energy generators. The second step is an on-line, greedy, algorithm that receives the optimized demand shifts as input and manages power flows in the VPP and it is necessary to make the whole approach applicable in practice, but should not be considered a major contribution of this work.

3 Model Description

3.1 Robust Approach to Model Uncertainty

We propose a two-step optimization model for the VPP EMS that produces optimized demand shifts (\(S_{Load}\)) by assuming as input the predictions for the solar power (\(P_{fPV}\)) generation profile, for the demand load profile (\(P_{fLoad}\)), and a fixed percentage of allowed demand shift. We use a robust approach to model uncertainty, which stems from (1) prediction errors in the solar power profile; (2) uncontrollable deviations from the planned demand shifts. For each of these quantities, the range of uncertainty is specified via a lower and an upper bound (for each timestamp), which can be obtained for example by estimating confidence intervals. We use these bounds to define a limited number of scenarios to calculate the optimized demand shifts that minimizes the expectation of the daily operating costs.

Then we feed these optimized shifts as input to an online greedy heuristic, implemented within a simulator, that calculates for each timestamp the optimal flows for the diesel power (\(P_{CHP}\)), the power exchanged with the storage system (\(P_{Storage}\)) and the power exchanged with the external grid (\(P_{Grid}\)) to supply the optimally shifted load demand. Figure 1 shows the proposed EMS model.

Fig. 1.
figure 1

The two steps of the optimization model for the EMS

In the first step, our objective function minimizes the VPP estimated cost over all scenarios and the whole optimization period (one day):

$$\begin{aligned} min(z) = \frac{1}{|S|}\sum _{s \in S} \sum _{t \in T} c^{s}(t) \end{aligned}$$
(1)

The objective function will be described in more detail in Sect. 3.8. Where t is a timestamp, s is a scenario, and \(c^s(t)\) is the (decision-dependent) cost for a scenario/timestamp pair. T is a set representing the whole horizon, and S is the set of all considered scenarios. In detail, those are:

$$\begin{aligned} S = \{ s^{++}, s^{+-}, s^{-+}, s^{--} \} \end{aligned}$$
(2)

\(s^{++}\) is the scenario with the highest values of predicted \(P_{PV}(t)\) and \(P_{Load}(t)\) (i.e. \(P_{PV}(t)+\delta _{PV}(t)\) and \(P_{Load}(t)+\delta _{Load}(t)\), where \(\delta _{PV}(t)\) and \(\delta _{Load}(t)\) define the considered range of uncertainty and are part of the problem input). The other 3 scenarios are easily deducible.

3.2 Modeling of Uncertainties

The diffusion of PV systems, as green and free sources of energy, implies their consideration as basic component of recent VPP. As a side effect, it becomes necessary to consider ways of addressing their uncertainty so as not to compromise the reliability of the system. Also load demand, due to its significant volatility, should be considered as uncertain to avoid that the actual VPP behavior deviates too much from the optimal one.

Formally, we assume that the error for our load demand forecast can be considered an independent random variable: this is reasonable hypothesis, provided that our predictor is good enough. This allows to define our uncertainty range based on confidence intervals. In particular, we assume that the errors follow roughly a Normal distribution \(N(0, \sigma ^2)\), and that the variance for each timestamp is such that the 95% confidence interval corresponds to 20% of the estimated load. Formally, we have that \(1.96 \sigma = 0.2 P_{Load}(t)\); in practice, this simply means that the \(\delta _{Load}\) parameters used to obtain our four scenarios is equal to \(0.2 P_{Load}(t)\) as in [8].

Methodologies for the estimation of hourly global solar radiation have been proposed by many researchers and in this work, we consider as a prediction the average hourly global solar radiation from [11] based on the period of recorded data (summer) in [7]. We then assume that the prediction errors in each timestamp can be modeled again as random variables. Specifically, we assume normally distributed variables with a variance such that the 95% confidence interval corresponds to 10% of the prediction value. In other words, our \(\delta _{PV}\) parameter for timestamp t is equal to \(0.1 P_{PV}(t)\).

The designs of the EMS with its objective function, the power balance constraints, and the dynamic model of the generation units are presented in the next subsections. All problems are modeled via Mixed Integer Programming (MILP) formulations. We first describe the (robust) step 1 and then (i.e. Sect. 3.9) we illustrate the online step of our EMS.

3.3 Modeling of Generator Units

We consider a Combined Heat and Power (CHP) dispatchable generator, with an associated fuel cost. Our approach should decide the amount \(P^{s}_{CHP}(t)\) of generated CHP power for each scenario \((s \in S)\) and for each timestamp \((t \in T)\). We assume bounds on \(P^{s}_{CHP}(t)\) given by the Electrical Capability based on real generation data [3, 7]. In our approach we treat CHP decisions in each timestamp as independent, because we assume that each timestamp is long enough to decide independently (from the previous timestamp) whether to switch on or off the generator. Therefore, we can model the generated CHP power with:

$$\begin{aligned} P^{min}_{CHP} \le P^{s}_{CHP}(t) \le P^{max}_{CHP} \ \ \ \ \forall t \in T \end{aligned}$$
(3)

3.4 Modeling of Storage Systems

The development of battery systems has increased over the last few years to cover the use of renewable energy sources when they are not available. Our model for the battery system is based on the level of energy stored at each timestamp t as a function of the amount of power charged or discharged from the unit.

\(P_{Storage}^{s}(t)\) is the power exchanged between the storage system and the VPP. We actually use two decision variables: \(P^{s}_{St_{In}}(t)\) if the batteries inject power into the VPP (with efficiency \(\eta _{d}\)) and \(P^{s}_{St_{Out}}(t)\) for the batteries in charging mode (with efficiency \(\eta _{c}\)). The initial battery states and the efficiency values are based on real generation data [3, 7]. We use a variable \(charge^{s}(t)\) to define for each timestamp the current state of the battery system:

$$\begin{aligned} charge^{s}(t) = charge^{s}(t-1) - \eta _{d}P^{s}_{St_{In}}(t) + \eta _{c}P^{s}_{St_{Out}}(t) \ \ \ \forall t \in T \end{aligned}$$
(4)

More accurate models for storage systems are present in recent literature. For example, [4] optimizes battery operation by modeling battery stress factors and analyzing battery degradation. However, in our work, it is sufficient to take into account the status of the charge for each timpestamp since we assume that each timestamp is long enough to avoid high stress and degradation level of the batteries.

3.5 External Grid

The variable \(P_{Grid}^{s}(t)\) represents the current power exchanged with the grid for each scenario and for each timestamp. Similarly, the total power is defined as the sum of two additional variables, namely \(P^{s}_{Grid_{In}}(t)\) if energy is bought from the Electricity Market and \(P^{s}_{Grid_{Out}}(t)\) if energy is sold to the Market. We assume bounds given by the net capacity from literature [3] based on real data for the maximum input/output net capacity.

$$\begin{aligned} P^{min}_{Grid_{In}} \le P^{s}_{Grid_{In}}(t) \le P^{max}_{Grid_{In}} \ \ \ \ \forall t \in T \end{aligned}$$
(5)
$$\begin{aligned} P^{min}_{Grid_{Out}} \le P^{s}_{Grid_{Out}}(t) \le P^{max}_{Grid_{Out}} \ \ \ \ \forall t \in T \end{aligned}$$
(6)

3.6 Demand Side Management

The DSM of our VPP model aims to modify the temporal consumption patterns, leaving the total amount of required daily energy constant. The degree of modification is modeled by shifts that are optimized by the first step of our EMS. The shifted load is given by:

$$\begin{aligned} \tilde{P}_{Load}(t) = S_{Load}(t)+P_{Load}(t) \ \ \ \ \forall t \in T \end{aligned}$$
(7)

where \(S_{Load}(t)\) represents the amount of shifted demand, and \(P_{Load}(t)\) is the originally planned load for timestamp t (part of the model input). The amount of shifted demand is bounded by two quantities \(S^{min}_{Load}(t)\) and \(S^{max}_{Load}(t)\). By properly adjusting the two bounds, we can ensure that the consumption can reduce/increase in each time step by (e.g.) a maximum of 10% of the original expected load.

We assume that the total energy consumption on the whole optimization horizon is constant. More specifically, we assume that the consumption stays unchanged also over multiple sub-periods of the horizon: this a possible way to state that demand shifts can make only local alterations of the demand load. Formally, let \(T_n\) be the set of timestamps for the n-th sub-period, then we can formulate the constraint:

$$\begin{aligned} \sum _{t \in T_{n}}S_{Load}(t) = 0 \end{aligned}$$
(8)

Deciding the value of the \(S^{max}_{Load}(t)\) variables is the main goal of our day-ahead optimization step.

3.7 Power Balance

In general, ensuring power balance imposes that the total power generation must equal the load demand, \(P^s_{Load}(t)\), in all timestamps and for all scenarios.

In this work, the load demand that must be satisfied is the optimally shifted demand of (day-ahead) step of our model. At any point in time, the overall shifted load is covered by an energy mix considering the generation from the internal sources, the storage system, and power bought from the energy market. Energy sold to the grid and routed to the battery system should be subtracted from the power balance. Overall, we have:

$$\begin{aligned} \tilde{P}^s_{Load}(t) = P^{s}_{CHP}(t) + P^{s}_{PV}(t) + P^{s}_{Grid_{In}}(t) - P^{s}_{Grid_{Out}}(t) + P^{s}_{St_{In}}(t) - P^{s}_{St_{Out}}(t) \end{aligned}$$
(9)

3.8 Objective Function

The objective of our EMS is to minimize the operational costs z of the VPP in a time horizon (T). The objective function formulated as:

(10)

where \(c_{Grid}(t)\) is the hourly price of electricity on the Market and we assumed the same price for \(c_{Grid_{I}}\), \(c_{Grid_{O}}\) and \(c_{Grid_{S}}\). \(c_{CHP}\) is the diesel price, assumed to be constant for each timestamp.

3.9 Online Step

The online step of our model is designed to obtain the real optimal values for the power flow variables, assuming that the shifts have been planned using the first day-ahead step of the model. The on-line greedy algorithm is a restricted version of our MILP model, obtained by: (1) Fixing all the \(S_{Load}(t)\) to the value assigned by the step 1; (2) Considering a single scenario, corresponding to the actual realization of the uncertain quantities. (3) Each timestamp is optimized one at time. The MILP model is:

$$\begin{aligned} P^{min}_{CHP} \le P_{CHP}(t) \le P^{max}_{CHP} \ \ \ \ \forall t \in T \end{aligned}$$
(11)
$$\begin{aligned} charge(t) = charge(t-1) - \eta _{d}P_{St_{In}}(t) + \eta _{c}P_{St_{Out}}(t) \ \ \ \forall t \in T \end{aligned}$$
(12)
$$\begin{aligned} P^{min}_{Grid_{In}} \le P_{Grid_{In}}(t) \le P^{max}_{Grid_{In}} \ \ \ \ \forall t \in T \end{aligned}$$
(13)
$$\begin{aligned} P^{min}_{Grid_{Out}} \le P_{Grid_{Out}}(t) \le P^{max}_{Grid_{Out}} \ \ \ \ \forall t \in T \end{aligned}$$
(14)
$$\begin{aligned} \tilde{P}_{Load}(t) = P_{CHP}(t) + P_{PV}(t) + P_{Grid_{In}}(t) - P_{Grid_{Out}}(t) + P_{St_{In}}(t) - P_{St_{Out}}(t) \end{aligned}$$
(15)
$$\begin{aligned} z = \sum _{t \in T} c_{Grid_{I}}(t)P_{Grid_{In}}(t) + c_{CHP}P_{CHP}(t) + c_{Grid_S}(t)P_{St_{Out}}(t) - c_{Grid_{O}}(t)P_{Grid_{Out}}(t) \end{aligned}$$
(16)

4 Case Study

The model is implemented and tested using real data and our case study is based on a Public DatasetFootnote 1. From this dataset we assume electric load demand and photovoltaic production forecasts, upper and lower limits for generating units and the initial status of storage units.

4.1 Dataset Description

The dataset presents 100 individual profiles of load demand with a time step of 5 min resolution from 00:00 to 23:00. We consider aggregated profiles with timestamp of 1 h and we use them as forecasted load. We can see, after aggregation, that most of the electrical consumption occurs in certain parts of the day by presenting consumption peaks, as expected. This lead to the need of demand side mechanisms to reduce these peaks.

The photovoltaic production is based on the same dataset with profiles for different size of PV units but for the same sun irradiance (i.e. the same shape but different amplitude due to the different size of the PV panels used). We use also in this case the PV production as forecasted production. Most of the aggregated photovoltaic forecast production occurs around midday, with a consequent need of balancing this source of energy to cover periods of high request of energy in the VPP. In Fig. 2 we show forecasted values of load demand, optimized demand shifts and PV production in the case with maximum allowed shifts of 10%.

Fig. 2.
figure 2

Scenarios for load demand (left) and for PV production (right) with 10% of allowed shift

The demand electricity hourly prices have been obtained based on data from the italian national energy market management corporationFootnote 2 (GME) in €/MWh. The diesel price is taken from the Italian Ministry of Economic DevelopmentFootnote 3 and is assumed as a constant for all the time horizon (one day in our model) as assumed in literature [1] and from [7].

4.2 Model Comparison

For performing the experiments, we need to obtain realizations for the uncertainties related to both loads and PV generation. Since we have assumed normally distributed prediction errors, we do this by randomly sampling error values according to the distribution parameters. Specifically, we consider a sample of 100 realizations (enough for the Central Limit Theorem [5] to ensure that sample average values will follow approximately a Normal distribution).

For each realization, we obtain a solution and a cost value by solving our two-step approach (robust optimization + on-line algorithm) using Gurobi as a MILP solver. We evaluate the quality of the approach by comparing the costs with those that could be obtained assuming perfect information. This allows us to estimate the Expected Value of Perfect Information (EVPI).

In particular, we consider two different models that make use of perfect information: the first is named Day-ahead Oracle, and the second the Day-after Oracle. The Day-ahead Oracle is identical to the robust model, except that only one scenario is considered and this corresponds to an actual realization of the uncertain variables. The cost obtained from this model represents the best achievable result for the whole problem, assuming that no uncertainty is present.

The Day-after Oracle is designed to obtain the best possible values for the power flow variables, assuming that the shifts have been planned using the robust optimization approach. The oracle replaces the on-line greedy algorithm with a restricted version of our MILP model, obtained by: (1) Fixing all the \(S_{Load}(t)\) to the value assigned by the robust approach; (2) Considering a single scenario, corresponding to the actual realization of the uncertain quantities. The main difference w.r.t. the greedy algorithm is that all timestamps are optimized simultaneously, rather than one at a time.

It is interesting to investigate the estimated costs of the robust optimization step, and evaluate how accurately it predicts the actual costs from the on-line approach, or the costs of the two oracles.

We refer to the day-ahead oracles as DA, to the day-after oracle as DF, and to the two steps of our model as RS1 (Robust Step 1) and OS2 (Online Step 2).

5 Results and Discussions

The optimal costs from the on-line approach and the costs of the two oracles are shown together in Table 1 for comparison. The inspected variable is the objective function i.e. total daily VPP cost. The comparison is shown also in terms of percentage difference to show the differences among costs by inserting uncertainty and perfect information of inputs. It is possible to notice that the percentage difference between the DA and the DF is relatively small (from 3.79 to 6.99) by changing the percentage of allowed consumption shift. This allows to deduce that the optimized shifts in the DA (i.e. by assuming that no uncertainty is present) are similar to the optimized shifts after the introduction of input uncertainty. By comparing the two oracle models with the online step of our model, it can be observed that the optimal costs of OS2 significantly deviate from the optimal oracle costs. From this results we can deduce that our OS2 reduces the quality of the solution by 30% compared to DA (i.e. the best achievable result for the problem, assuming that no uncertainty is present).

Table 1. Costs and % difference among the three costs with allowed shift of 10%

We investigated also the parameters of \(\mu \) and \(\sigma \) over the 100 tested samples and we obtained that for the two oracle models the standard deviations are in the order of \(10^{-5}\) and in the OS2 the data are slightly more scattered (i.e. in order of \(10^{-1}\)) but on average they all have a good stability.

To estimate how accurately the robust optimization step predicts the actual costs from the on-line approach, we compare in Table 2 the expected optimal cost from RS1 (see Fig. 1) and the optimal real cost given by OS2. We compare (over the 100 realizations) by changing the allowed percentage of shift from 2% to 20%. In the OS2 costs we can see, as expected, an improvement trend by augmenting the percentage of shift (i.e. by relaxing the constraint) and we do not have a significant deviation from the optimal solution of RS1.

Table 2. Difference between expected and real costs of the two steps of our model

We assume that every hour the EMS will compute the energy that will be produced/sold/bought by each of the VPP components, as the result of the optimization problem so, in addition to producing the minimum (optimal) daily cost for VPP, our model also generates the optimal energy flows for each timpestamp. In Fig. 3 we show the optimal flows produced by, respectively, the OS2 (left), the DA (center) and the DF (right) in the same realization (over the 100 possible ones) and always in the case of 10% of allowed shift. The following considerations are deducible from the simulation results: in the DA we can see that, by having perfect information, it is possible to acquire energy from the grid in advance (i.e. when the cost is lower) for example in timestamp from 01:00 to 04:00 and to sell energy to the grid in period of highest price on the market or when more energy is available from renewable sources; renewable resources are always 100% exploited, because they are convenient in term of costs; around midday the EMS buys (or sells less) energy from (to) the grid rather than using the CHP because it is cheaper; CHP production is thus reduced (and absent in oracle models) during off-peak hours and is fully restored during on-peak hours to cover the load demand; the storage constraints are more strict (i.e. charge of storage for each timpestamp) and for this reason the storage is less used also during peak-periods. In the online step, the exchange of energy with the storage system is never used because, due to the greedy heuristic and the assumption of equal prices, is better to sell energy to the grid rather than to store it for future hours.

Fig. 3.
figure 3

Optimal energy flows in the VPP for OS2 (left), DA (center) and DF (right) in the same input realization

6 Conclusion

This work proposes a VPP EMS, a two-step optimization model, that decides the minimum cost energy balance at each point in time considering electrical load, PV production, electricity costs, upper and lower limits for generating units and storage units. The first step models the prediction uncertainty using a robust approach defining scenarios to optimize the load demand shift and to estimate the cost. The second step is an online optimization algorithm implemented within a simulator that uses the optimal shifts produced by the previous step to minimize, for each timestamp, the real cost while fully covering the optimally shifted energy demand. A case study is used to illustrate that the first robust step of our model produces good optimized shifts that do not significantly deviate (in term of costs) from the model with no uncertainty. We compare results conducted over 100 input realizations and we can observe that we have a loss of result quality in the second step developed with a greedy heuristic. We plan to improve this second online step by developing a multi-stage step able to react to unexpected event and by testing our model on real data of a large industrial plant. We plan to apply machine learning techniques to perform the whole range of predictions involved in the activities of a VPP in the industrial sector.