Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast...

13
Multi-period exibility forecast for low voltage prosumers Rui Pinto a, b , Ricardo J. Bessa a, * , Manuel A. Matos a, b a INESC Technology and Science (INESC TEC), Campus da FEUP, Rua Dr. Roberto Frias, 4200-465, Porto, Portugal b Faculty of Engineering, University of Porto, Rua Dr. Roberto Frias, 4200-465, Porto, Portugal article info Article history: Received 18 May 2017 Received in revised form 9 November 2017 Accepted 25 November 2017 Available online 28 November 2017 Keywords: Renewable energy Multi-temporal Flexibility Forecast Storage Uncertainty Prosumers abstract Near-future electric distribution grids operation will have to rely on demand-side exibility, both by implementation of demand response strategies and by taking advantage of the intelligent management of increasingly common small-scale energy storage. The Home energy management system (HEMS), installed at low voltage residential clients, will play a crucial role on the exibility provision to both system operators and market players like aggregators. Modeling and forecasting multi-period exibility from residential prosumers, such as battery storage and electric water heater, while complying with internal constraints (comfort levels, data privacy) and uncertainty is a complex task. This papers de- scribes a computational method that is capable of efciently learn and dene the feasibility exibility space from controllable resources connected to a HEMS. An Evolutionary Particle Swarm Optimization (EPSO) algorithm is adopted and reshaped to derive a set of feasible temporal trajectories for the resi- dential net-load, considering storage, exible appliances, and predened costumer preferences, as well as load and photovoltaic (PV) forecast uncertainty. A support vector data description (SVDD) algorithm is used to build models capable of classifying feasible and non-feasible HEMS operating trajectories upon request from an optimization/control algorithm operated by a DSO or market player. © 2017 Elsevier Ltd. All rights reserved. 1. Introduction 1.1. Motivation Distributed Renewable Energy Sources (DRES) have been experiencing a fast growing in medium voltage (MV) and low voltage (LV) grids as the solar power technology becomes more and more affordable [1,2]. Conventional electrical network in- frastructures were designed to accommodate unidirectional power ows coming from the large power plants to the more populating zones where most of the consumers exist. With the increasingly presence of DRES in LV and MV distribution grid, there is a para- digm change as the power ows start to reverse direction, partic- ularly during sunny days or windy periods. Consequently, technical difculties regarding the operation of distribution grid start to arise for Distribution Systems Operators (DSO), with bus voltage limits being violated or even line congestion events. Microgrids, composed with exible loads, small-scale storage and their intelligent management by means of an Home Energy Management System (HEMS) combined with smart meter capa- bilities, can bring exibility into the operation of distribution grids, taking advantage of increasingly more frequent types of exible loads such as the electric vehicle [3,4] and the presence of signi- cant levels of photovoltaic (PV) microgeneration [5]. The exible character that microgrids bring to the distribution grid operation can be used to provide ancillary services [6,7] at period of grid stressful operation. Optimizing the operation of these small-scale distribution grids is being seen as crucial to endow DSOs of means of accommodate current levels of DRES and allow for a deeper penetration of micro-generation in LV distribution grids in the short-term future. Controlling, modeling, optimizing schedules of microgrid exible assets has been topic of research for the last years [8,9] with some focus given to energy storage [10,11]. DSOs can also take advantage of the exible nature of microgrids during grid stressful operation periods, use it for voltage control features at MV/LV substations [12], for load frequency control [13], for power losses reduction, support unintentional microgrid oper- ation [14], and to create operational conditions that maximize DRES hosting capacity that might bring nancial benets for prosumers and have a positive impact on the decarbonization of the electric power system. Domestic small-scale storage, heat-pumps, thermostatically * Corresponding author. E-mail address: [email protected] (R.J. Bessa). Contents lists available at ScienceDirect Energy journal homepage: www.elsevier.com/locate/energy https://doi.org/10.1016/j.energy.2017.11.142 0360-5442/© 2017 Elsevier Ltd. All rights reserved. Energy 141 (2017) 2251e2263

Transcript of Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast...

Page 1: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

lable at ScienceDirect

Energy 141 (2017) 2251e2263

Contents lists avai

Energy

journal homepage: www.elsevier .com/locate/energy

Multi-period flexibility forecast for low voltage prosumers

Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos a, b

a INESC Technology and Science (INESC TEC), Campus da FEUP, Rua Dr. Roberto Frias, 4200-465, Porto, Portugalb Faculty of Engineering, University of Porto, Rua Dr. Roberto Frias, 4200-465, Porto, Portugal

a r t i c l e i n f o

Article history:Received 18 May 2017Received in revised form9 November 2017Accepted 25 November 2017Available online 28 November 2017

Keywords:Renewable energyMulti-temporalFlexibilityForecastStorageUncertaintyProsumers

* Corresponding author.E-mail address: [email protected] (R.J. Be

https://doi.org/10.1016/j.energy.2017.11.1420360-5442/© 2017 Elsevier Ltd. All rights reserved.

a b s t r a c t

Near-future electric distribution grids operation will have to rely on demand-side flexibility, both byimplementation of demand response strategies and by taking advantage of the intelligent managementof increasingly common small-scale energy storage. The Home energy management system (HEMS),installed at low voltage residential clients, will play a crucial role on the flexibility provision to bothsystem operators and market players like aggregators. Modeling and forecasting multi-period flexibilityfrom residential prosumers, such as battery storage and electric water heater, while complying withinternal constraints (comfort levels, data privacy) and uncertainty is a complex task. This papers de-scribes a computational method that is capable of efficiently learn and define the feasibility flexibilityspace from controllable resources connected to a HEMS. An Evolutionary Particle Swarm Optimization(EPSO) algorithm is adopted and reshaped to derive a set of feasible temporal trajectories for the resi-dential net-load, considering storage, flexible appliances, and predefined costumer preferences, as wellas load and photovoltaic (PV) forecast uncertainty. A support vector data description (SVDD) algorithm isused to build models capable of classifying feasible and non-feasible HEMS operating trajectories uponrequest from an optimization/control algorithm operated by a DSO or market player.

© 2017 Elsevier Ltd. All rights reserved.

1. Introduction

1.1. Motivation

Distributed Renewable Energy Sources (DRES) have beenexperiencing a fast growing in medium voltage (MV) and lowvoltage (LV) grids as the solar power technology becomes more andmore affordable [1,2]. Conventional electrical network in-frastructures were designed to accommodate unidirectional powerflows coming from the large power plants to the more populatingzones where most of the consumers exist. With the increasinglypresence of DRES in LV and MV distribution grid, there is a para-digm change as the power flows start to reverse direction, partic-ularly during sunny days or windy periods. Consequently, technicaldifficulties regarding the operation of distribution grid start to arisefor Distribution Systems Operators (DSO), with bus voltage limitsbeing violated or even line congestion events.

Microgrids, composed with flexible loads, small-scale storageand their intelligent management by means of an Home Energy

ssa).

Management System (HEMS) combined with smart meter capa-bilities, can bring flexibility into the operation of distribution grids,taking advantage of increasingly more frequent types of flexibleloads such as the electric vehicle [3,4] and the presence of signifi-cant levels of photovoltaic (PV) microgeneration [5]. The flexiblecharacter that microgrids bring to the distribution grid operationcan be used to provide ancillary services [6,7] at period of gridstressful operation. Optimizing the operation of these small-scaledistribution grids is being seen as crucial to endow DSOs ofmeans of accommodate current levels of DRES and allow for adeeper penetration of micro-generation in LV distribution grids inthe short-term future. Controlling, modeling, optimizing schedulesof microgrid flexible assets has been topic of research for the lastyears [8,9] with some focus given to energy storage [10,11].

DSOs can also take advantage of the flexible nature of microgridsduring grid stressful operation periods, use it for voltage controlfeatures at MV/LV substations [12], for load frequency control [13],for power losses reduction, support unintentional microgrid oper-ation [14], and to create operational conditions thatmaximize DREShosting capacity that might bring financial benefits for prosumersand have a positive impact on the decarbonization of the electricpower system.

Domestic small-scale storage, heat-pumps, thermostatically

Page 2: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

R. Pinto et al. / Energy 141 (2017) 2251e22632252

controlled loads (TCL), air-conditioners, and the electric vehicle willfor sure be more common in residential type buildings in the nearfuture, increasing the flexibility that can be provided within LVdistribution grids, either by means of demand response pro-grammes or flexibility aggregators participating in dedicated mar-ket sessions or even with single HEMS smart operation aiming atmaximizing customers profits [15,16] while supporting DSO inmeeting specific operational criteria [17,18]. The flexibility provi-sion from HEMS monitoring and control capabilities is a theme ofrelevant significance as a result of the added value that can bebrought to interested agents like DSOs and flexibility aggregators.Therefore, there is a need for developing flexibility models tocapture the following characteristics:

� Multi-period flexibility from behind-the-meter storage and TCLdue to the inter-temporal nature of state of charge (SoC) andwater temperature equations;

� LV net-load patterns driven by weather conditions (e.g., PVgeneration) that introduce high uncertainty in the forecastingtask [19].

This paper produces contributions that address these tworesearch challenges.

1.2. Related work and contributions

Different authors studied the economic and technical benefits offlexibility from energy storage technologies. The focus was mainlyin large-scale storage and renewable energy power plants, which,combined, create the virtual power plant (VPP) concept. Forinstance, in Ref. [20] the value of price arbitrage for energy storageis evaluated for different European electricity markets. The authorsfound that in fuel import-based markets, such as the UnitedKingdom, there are opportunities for investors to benefit fromenergy storage arbitrage and the presence of hydro power plantsdecrease the interest in storage investment. Gomes et al. proposeda two-stages stochastic optimization method for the joint coordi-nation of wind and PV systems considering energy storage in theday-ahead market and adopted a mixed-integer linear program-ming formulation [21]. Results show that, although the totalamount of traded energy is inferior when considering a joint co-ordination, the final profit is greater than when considering adisjoint operation. A comprehensive literature review about VPPscheduling can be found in Ref. [22].

The present paper differs from these works since it is focused inresidential prosumers with small-scale storage and PV generation,and flexible appliances combined through an HEMS. In thissegment, concerns like data protection and privacy, multi-periodflexibility representation and the need to have local computa-tional units are important challenges that are not fully covered bythe current literature.

A standard approach for modeling flexible distributed energyresources (DER) is to characterize their flexibility with a set ofspecific parameters. For instance, for planning the operation ofservices buildings with thermal energy storage on a yearly basis,Stinner et al. defined the maximum flexibility provision in eachhour considering three dimensions: temporal, power and energy[23]. However, in this work the flexibility was modeled andcalculated for planning purposes rather than a short-term timehorizon. For design process or for selecting set of buildings toparticipate in demand response schemes, De Coninck et al. pro-posed flexibility cost curves, which correspond to the amount ofenergy that can be shifted to or from a flexibility interval and theassociated cost [24]. Operational decision making is not covered bythis methodology.

Multi-period flexibility modeling and forecasting for short-termhorizons is a rather recent topic, with few relevant research worksdedicated to it.

Zhao et al. studied a geometric approach that is capable ofaggregating flexibility provided from TCL (represented as a “vir-tual” battery), and where the set of feasible power profiles of eachTCL has been demonstrated to be a polytope [25]. The aggregationof several sets is performed by means of the Minkowski sum of theindividual polytopes. The computational burden issue is tackled bythe authors by adopting several approximations regarding thecalculation of the Minkowski sums. Despite the merits of this work,domestic battery storage is not modeled and neither is the impactof net-load uncertainty, which are both relevant and challengingissues in this problem.

The “virtual” battery model was also explored by other authors,like Hughes et al. that proposed a first-order linear dynamicalmodel for flexibility provision from heating, ventilation, and airconditioning (HVAC) systems in frequency regulation services, andgeneralizes the method to many other types of loads [26]. The re-sults showed that the developed technique still has challenges toovercome in modeling small-scale systems. Another example isHao et al., which considered demand aggregation using batterymodels to model the set of feasible power profiles that a collectionof TCLs can provide to track frequency regulation signals [27]. TheTCLmodeling assumes a simplified continuous powermodel wherethe error related to this simplification decreases as the size andhomogeneity of the TCL aggregation increases.

Nosair et al. proposed a method to construct flexibility enve-lopes that describe the flexibility potential of the power system andits individual resources [28]. The proposed envelopes comprise allpossible intra-hourly deviation and variation of the modeled DRESconsidering that for a certain sub-hourly time there is maximumoutput variability. Using the 95% percentile of the probability dis-tribution of all the sub-hourly time steps the authors define anenvelope which comprises the majority of realizations of flexibilityrequirements for that intervals. HEMS are not considered in thisstudy, particularly the costumer's preferences regarding the oper-ation of their equipment, whichmakes themodeling problemmorecomplex and simultaneously more realistic. Moreover, the multi-period nature of flexibility is not modeled in the envelope.

A similar concept is also proposed by Nuytten et al. [29]. Theauthors presented a methodology to estimate the maximum andminimum curves regarding the operation of a combined heat andpower (CHP) plant combined with thermal storage. The differencebetween these two curves is indicated by the authors as being thetheoretical maximum flexibility that the system can provide. Thismethodology can only be used for modeling the maximum flexi-bility that the system is capable of providing for one specific timestep in the time horizon considered, if one assumes that no flexi-bility has already been provided in a later period. No multi-temporal formulation has been adopted in this work, whichmeans that a set of feasible power set-points regarding flexibilityprovision during more than one time step cannot be provided bythe proposed method. This flexibility representation was alsoadopted in the European Project IndustRE as flexgraphs [30].

Ulbig and Anderson [31] described a methodology to analyzethe available flexibility for each time-step from an ensemble ofdiverse units in a confined grid zone. This flexibility is modeled as aPower Node, which allows for detailed modeling of specific con-straints such as maximum ramp rates, power limits, as well asenergy storage operation ranges. The authors propose a visualrepresentation of the available flexibility during a specific timehorizon. Nevertheless, this visual representation and modelingapproach does not account for a multi-temporal formulation,meaning that the mentioned flexibility availability is only depicted

Page 3: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

R. Pinto et al. / Energy 141 (2017) 2251e2263 2253

for a single time step.Pan et al. proposed a method to calculate the feasible region of a

linear programming formulation for the operation of a districtheating system, considering the thermal inertia of buildings [32].The main objective was to have condensed and privacy preservingdata exchange between district heating and electricity controlcenters. The method can be generalized to estimate the flexibilityregion for multiple time periods and non-linear formulations, butshowed the following limitations: a) uncertainty is not included inthis work (is pointed out by the authors as future work); b) visualrepresentation of multi-period flexibility region with more thanthree time intervals is not possible.

A different representation for the flexibility is proposed inRef. [33]. Bremer and Sonnenschein propose two samplingmethods for defining the technically feasible flexibility set fromDER. The authors, for instance, propose a Monte Carlo samplingmethod that starts with a feasible operating schedule and then, ineach step, modifies it in at least one point in time with a randommutation factor. The methodology is used by the authors in a suc-ceeding workwhere the obtained trajectories are used as a learningsample for a support vector data description (SVDD) algorithm [34].Despite some similarities in the methodology with the work beingpresented in the present paper, this approach did not consider themodeling of costumers' preferences neither accounted for theforecast uncertainty.

Considering the reviewed state of-the-art, the main originalcontribution from the present paper is a novel trajectory generationalgorithm that is capable of modeling the multi-period flexibilityfrom HEMS, including information about base net-load (i.e.,inflexible load plus PV generation) forecast uncertainty representedby a set of short-term scenarios generated from probabilistic fore-casts taking into account the temporal interdependency of forecasterrors.

The main limitation of reviewed literature is that informationabout net-load forecast uncertainty is not included in the multi-period flexibility model, which, when included in DSO or aggre-gators optimization models, might lead to solutions with lowrobustness to uncertainty. In contrast to the methods described inRefs. [25e27,32,33] that proposed multi-period flexibility estima-tion but without forecast uncertainty characterization, in ourmethod the uncertainty in the PV and net-load profile is tackled bymeans of a novel trajectory-based evaluation procedure using theconvergence features of the EPSO (Evolutionary Particle SwarmOptimization [35]) algorithm that have been adapted to this work.

Compared to [23,24], the proposed method is for operational (orshort-term decision-making) and extends flexibility estimation tomultiple time intervals (i.e., set of flexibility trajectories), whichrepresents an added value compared to the works described inRefs. [28e31].

Similarly to [32,33], the modeling strategy allows the interestedparts to not have to model the equipment within the HEMS, whichreduces the computational complexity and effort of problems suchas multi-period OPF and maintains data privacy. In a second stage,the flexibility trajectory set is used as input in a SVDD model that iscapable of delimiting the feasible flexibility set of the respectiveHEMS. The potential interested parts, DSOs or demand/flexibilityaggregators, only need to receive a reduced number of flexibilitytrajectories, called support vectors, which by means of a specificfunction to be embedded in their optimization tools allows them toidentify unknown HEMS flexibility trajectories as being feasible ornot.

1.3. Structure of the paper

The remaining of this paper is organized as follows: section 2

introduces the concept of multi-temporal flexibility adopted inthis work; in section 3 the developed methodology is detailed,presenting the structure of the flexibility set generation algorithm,and the approach to encode and distribute the generated infor-mation to interested parts; section 4 presents the results regardingthe performance of the proposed method; finally, in section 5 themain conclusions are presented.

2. HEMS multi-period flexibility: the concept

Multi-period flexibility from HEMS can be defined as the abilityto change the expected (baseline) net-load profile for a specificperiod of time (e.g., 24 h period), by jointly considering informationabout flexible/inflexible load, PV generation, hot water demand,water temperature inside the electric water heater and the state ofcharge (SoC) of domestic battery storage.

The visual representation of the multi-period flexibility enve-lope is not as straightforward as one might assume. Actually, whendealing with problems that aim at defining the feasible flexibilityset for more than three time steps ahead, the visual representationof such domain becomes impossible. There is a difference betweenthe visual representation of the power limits in each time step thatcharacterize the maximum flexibility band (like the flexibility en-velope in Refs. [28,29]) and the actual visual representation of thefeasible flexibility set considering different temporal activations offlexible resources.

For the sake of clarity, let one assume that in the followingexample the flexibility provision can only be provided by a singledomestic battery storagewith 3.2 kWh of electrical energy capacity,maximum charge and discharge power of 1.5 kW, an initial SoC of0.64 kWh (20%) and a minimum allowed SoC of 15% capacity,0.48 kWh. In this example the battery efficiency is neglected. Theupward and downward hourly limits of the flexibility band for thisbattery, considering the stated conditions, are depicted in Fig. 1.This would represent the flexibility envelope or flexgraph fromRefs. [28,29]).

The outer limits of the flexibility domain represented in Fig. 1are defined by the previously mentioned upward and downwardflexibility limits. The search domain defined in Fig. 1 relates towhatis commonly referred to as the flexibility power band. As the initialSoC is 0.64 kWh, the upward flexibility limit for the first consideredoperating time is equal to the maximum battery charging power, aswith that the resulting SoC will be 2.14 kWh, considering hourlytime steps and neglecting the battery's efficiency. Analyzing thedefined downward flexibility limits, namely the limit for the firsttime step considered, as the minimum allowed SoC is 15% of thestorage capacity, 0.48 kWh, the maximum discharge power ad-missible is just 0.16 kW for a hourly time step. From the secondoperation time step considered onwards, both the upward anddownward flexibility provision power limits correspond to themaximum charge and discharge rates, respectively. This occursbecause there is always a possible flexibility trajectory that remainsfeasible while representing a choice of maximum charging or dis-charging power in any of the remaining time steps considered.

With that said, it is important to stress that, as previously stated,there is an important difference between the flexibility power bandlimits definition and the limits for the feasible flexibility provisionenvelope being tackled in this study. An example of that fact is thetrajectory being depicted also in Fig. 1 representing a possibleflexibility offer expressed in kW [0.0, �0.5, 0.0]. Although the po-wer set-points composing this trajectory are all within the limits ofthe defined flexibility power band, analyzing the SoC response tosuch trajectory (in kWh) [0.64, 0.14, 0.14] one can verify that thetrajectory becomes infeasible from the second time step onwards asthe minimum SoC constraint (SoC > ¼ 0.48 kWh) is not being

Page 4: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

Fig. 1. Hourly limits for flexibility search space.

R. Pinto et al. / Energy 141 (2017) 2251e22632254

complied.The representation for the flexibility space that is adopted in this

paper is through a set of technically feasible net-load trajectories,which represent alternative paths to the expected (baseline) net-load profile (trajectory). In other words, these trajectories aresamples taken from the multi-dimensional space forming thefeasible flexibility set.

Concluding, the concept of multi-temporal flexibility provisionrelates with the potential that a certain HEMS has of reshaping itsexpected net-load profile for a determined number of inter-temporal related periods, while complying with technical andphysical internal constraints. The main focus of this study refers tothe delimiting of the flexibility set that encompasses all thepossible multi-temporal net-load profile variations that can beperformed by the HEMS control functions. The next section de-scribes the methodology that generates this set of temporal flexi-bility trajectories.

3. Methodology for modeling the feasible flexibility set

3.1. General framework

The methodology developed in this work extends the previouswork reported in Ref. [36] in which the feasible flexibility set isestimated using semi-randomly generated feasible trajectories andthen feeding a SVDD algorithm with those trajectories. In thatprevious version of the algorithm, random sampling routines werebeing used to generate a sufficient number of feasible trajectories.In this new version, the construction of feasible trajectories no

longer depends on a random sampling routine but instead an EPSOalgorithm is being used to search for feasible trajectories. The use ofthe EPSO algorithm also enables the inclusion of information aboutbase net-load uncertainty forecast (i.e., inflexible load plus PVgeneration) by means of solution evaluation for a set of differentuncertainty scenarios, which greatly increases the complexity andcomputational effort. Accordingly, a feasible solution will be onethat complies with all the constraints for a predefined probabilitythreshold from all the possible HEMS base net-load scenariosconsidered, instead of using simply a point (or deterministic)forecast information like in the previous algorithm version.

The final set of feasible trajectories resulting from the EPSOsearch procedure are aggregated to create a learning dataset for theSVDD algorithm. The SVDD is an one-class support vector machinealgorithm that is commonly used in novelty detection, where adetermined set of samples is provided to the functionwhich in turnbuilds a model by detecting the soft boundary of that set [37].Inspired by the methodology proposed in Ref. [38] for the encodingof search spaces for virtual power plants application, the SVDD isused in this work for classifying new flexibility trajectories asbelonging to that set or not. Or in other words, to check if a po-tential net-load profile is technically feasible or not.

Fig. 2 depicts the main stages of the proposed methodology inthe form of a block-diagram. The first step is the generation ofshort-term scenarios for the forecast uncertainty, corresponding toa discrete multi-temporal representation of uncertainty, which isdescribed in Section 3.2. Then, there are three main boxes repre-senting: the trajectory construction process; the learning of thefeasible domain process; and the validation of the multi-period

Page 5: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

T rajectory C onstruc on ProcessEPSO

algorithm: Feasible

Trajectories Genera on

Mul Scenario

Customer’s Preferences Valida on

L earning F lexible Domain Process

Set of F easible T rajectories

SV DDSupport Vector

Data Descrip on

Support Vectors

Valida on of required mul -period flexibility

provision

Flexibility Needs

Flexibility check

HEMS

DSOFlexibility aggregator HEMS

DSOFlexibility aggregator

Fig. 2. Block-diagram of the flexibility set search algorithm.

R. Pinto et al. / Energy 141 (2017) 2251e2263 2255

flexibility. The first stage concerns to the use of the EPSO algorithmto generate feasible trajectories that comply with the defined cus-tomer's preferences (see Section 3.4). These customer's preferencesare embedded into the proposed algorithm and are responsible ofmodeling the desire of minimizing the wasting of energy comingfrom PV generation, which means that the battery's storage ca-pacity must be used at its most to accommodate the energy surplusfrom PV generation. Another considered customer preference is thedefinition of the water temperature range inside the EWH tank,which must never surpass the defined minimum and maximumtemperatures during the period of time in study. The formulation ofthe optimization problem is discussed in Section 3.3.

In the second stage, Section 3.5, the constructed feasible tra-jectories are used as input for the SVDD function which will resultin the model construction and identification of the support vectorsthat define the boundaries of the feasibility domain. Finally, in thevalidation of multi-period flexibility stage, the interested agent(DSO or flexibility aggregator) can take advantage of the feasibledomain knowledge coming from the information embedded in theprovided support vector and define the optimal multi-periodflexibility trajectory that is aligned with its operational needswhile being viable to be provided by the HEMS/aggregation ofHEMS.

3.2. Representation of forecast uncertainty

The proposed method to generate flexibility trajectories forHEMS uses as input a sample of temporal scenarios without anyassumption of the parametric model of its joint distribution. Eachscenario can be interpreted as a sample taken from the joint

probability distribution. This representation is called random vec-tors in statistics [39], path forecasts in econometrics [40] andweather ensembles in atmospheric sciences [41].

Mathematically, a set ofM temporal scenarios for a time horizonof length T can be defined as follows:

YM ¼

26664y1tþ1jt y1tþ2jt / y1tþT jty2tþ1jt y2tþ2jt / y2tþT jt/ / / /

ymtþ1jt ymtþ2jt / ymtþT jt

37775 (1)

where each row (y½m�) of YM contains one scenario member.Collectively, the scenario set should exhibit the correct temporaldependence-structure structure between the marginal probabilitydistributions or probabilistic forecasts (see Ref. [42] for moredetails).

These scenarios can be empirical, analytical, physical or gener-ated in a stochastic model. Yet, it is important to underline that theproposed method is independent from the scenario generatingprocess and can be applied even if this process is unknown orknown only in the form of a simulation model.

Empirical scenarios can be constructed with analog-basedmethods like the analog ensemble approach [43], which searchesthe historical forecast data for situations when the forecast wasmost similar (or analogous) to the current forecast. For each ofthose analogous forecasts, the corresponding observation iscollected. An analytical solution to construct these scenarios is theepi-spline basis functions, which approximates the stochasticprocess for renewable energy and controls the degree to whichextreme errors are captured [44]. A well-know physical approachconsists in ensemble predictions systems that are designed tomodel three sources of weather uncertainty: initial conditions,physical approximation and boundary conditions [41].

In this paper, a stochastic simulation method, based on theGaussian copula proposed in Refs. [42,45] for wind and solar en-ergy, was adopted. The method work as follows:

� Probabilistic forecasts (marginal distribution functions) for solarpower are generated with a combination of feature engineeringand gradient boosting trees and using a grid of weather fore-casts [46]. Exponential functions are used for the distribution'stails as described in Ref. [47]. For load time series, probabilisticforecasts are generated with conditional kernel density esti-mation [48].

� Scenarios (or random vectors) are generated by plug-in anexponential covariance matrix into a Gaussian copula and usingthe inverse of the forecasted cumulative distribution function.The details of the scenario generation method can be found inAppendix A.

3.3. Problem formulation

In this work, flexibility from domestic EWH and battery storageis included in the flexibility model. However, the methodology canbe easily generalized to other flexible resources at the domesticand network level. The problem formulation has two decisionvariables and two state variables. The decision variables are thepower flow in the domestic electric battery's inverter, Pbat , and theoperating point of the EWH, Pewh. The two state variables refer tothe battery SoC and the water temperature inside the EWH tank.The constraints used in this problem formulation are presentednext.

Page 6: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

R. Pinto et al. / Energy 141 (2017) 2251e22632256

trajh ¼ Pbath þ Pewhh (2)

Pbatmin < ¼ Pbath < ¼ Pbatmax (3)

Pewhh ¼�

0; for off statusPewhnom; for on status

(4)

SoCini þXHh¼1

Pbath < ¼ SoCmax (5)

SoCini þXHh¼1

Pbath > ¼ SoCmin (6)

qmin < ¼ qh < ¼ qmax (7)

The trajectories representing the flexibility that can be providedby the HEMS are limited to the battery's charging and dischargingpowers (Pmax

bat and Pminbat ) and the EWHnominal power (Pnomewh), (3) and

(4) respectively.Regarding the maximum charging power, in this study a dy-

namic model is adopted where the maximum charging power de-pends on the SoC of the battery, which is a typical behavior for Li-ion batteries. This is explained by the two most common chargingstages that occur when charging a lithium-ion battery, constantcurrent and constant voltage [49]. During constant currentcharging stage the battery is basically connected to a current-limited power supply until reaching around 70e80% of its energycapacity. For superior SoC the battery enters the constant voltagestage where the charger acts as a voltage limited power supply andthe charging current gradually decreases as the SoC approximatesfull capacity.

The modeling used in this work is presented in Fig. 3 where themaximum charging power starts to decrease for SoC superior to80% and a minimum charging power of 20% nominal power isassumed. The inclusion of this non-linear behavior of batterystorage also highlights the added value of the proposed methodsince it is not constrained by first-order linear models like inRef. [26].

State of charge limits are enforced by equations (5) and (6), with

Fig. 3. Battery charging model.

the maximum allowed SoC being the total energy capacity of thebattery and the minimum allowed SoC being limited to a certainpercentage of total capacity, e.g. 15%. There is an allowed watertemperature range inside the EWH tank that is being representedby equation (7). Equation (8) represents the water temperaturevariation along the time horizon, which depends on the expectedvolume of hot water usage and the decision variable regarding theoperating status of the EWH, Pewh. The physically-based loadmodeladopted for the EWH modeling is aligned with the one used inRef. [50].

qh ¼ qh�1 þDtC

�� aðqh�1 � qhouseÞ � cpvhðqdes � qiniÞ þ Pewhh�

(8)

In (8), Dt is the time step [h], C is the thermal capacity [kWh/�C]set to 0.117, a is the thermal admittance [kWh/�C] set to �9:42�4,qhouse is the house indoor temperature set to 20 �C, cp is the waterspecific heat [kWh/(ltr.�C)], vh is the hot water consumption at timeh, qdes is the desired temperature for water consumption set to38 �C, and qinl is the inlet water temperature set to 17 �C.

In line with Fig. 2, there is a need to validate the costumerspreferences. Thus, the SoC state variable must be updated takinginto account the PV generation surplus, which must be accommo-dated by the battery, accounting for battery storage capacity andmaximum charging power limitations. Accordingly, for each timestep of the operation horizon considered, the SoC variable isupdated by summing up the PV generation surplus, PVsur , whichconsequently increases the SoC, and subtracting the EWH possiblepower in those time steps. The combination between the PV gen-eration surplus to be accommodated, the decision variableregarding the charging (or not) of the battery, and the decisionvariable representing the EWH operating status must respect themaximum charging power, by verifying (9).

Pbath þ PVsurh � Pewhh < ¼ Pbatmax; ch (9)

Additionally, (5) must give place to (10) to account for the PVgeneration surplus. The maximum and physically possible amountof PV surplus energy that the battery can absorbwithout being usedfor flexibility provision must still be assured when defining thefeasible trajectories for flexibility provision.

SoCini þXHh¼1

Pbath þ PVsurh � Pewhh < ¼ SoCmax (10)

There is a maximum amount of PV generation surplus that thebattery is capable of accommodating, which is related to its storagecapacity and it can vary along the time horizon depending on theprecedent operation decisions. The maximum energy that thebattery can accommodate results from the difference between themaximum and minimum SoC limits. To assess whether this speci-fication is being respected or not along all the time steps consid-ered, an auxiliary variable was created, capacity. Its initial value isset to the previously referredmaximum energy that the battery canaccommodate. The created auxiliary variable tracks down thesupposed PV surplus energy accommodation capacity for each timestep.

capacityh ¼ capacityh�1 ��PVsur

h � Pewhh�

(11)

capacityh ¼ capacityh�1 þ Pbatmax (12)

In each time step where there is a PV generation surplus, itsvalue is updated by subtracting its current value by the PV surplusto be accommodated in that time step (11), limited to the battery

Page 7: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

R. Pinto et al. / Energy 141 (2017) 2251e2263 2257

charging power. On the other hand, in each time stepwhere there isno PV generation surplus, its value is updated by increasing thecapacity to absorb by the discharging power limit of the battery(12). A trajectory is classified non-feasible if is limiting the theo-retical maximum capacity of the storage unit to accommodate PVsurplus. If a certain trajectory respects all the problem constraintsbesides the one regarding the accommodation of PV, that trajectoryis modified to cope with that requirement.

Pbath ¼ capacityh ��PVsur

h � Pewhh�

(13)

Accordingly, the decision variable regarding the operation of theelectric battery will be modified to be equal to the remaining bat-tery capacity after accommodating the PV surplus (13). Part of thePV surplus might be consumed by the operation of the EWH whileproviding flexibility, which is accounted in (11) and (13).

Fig. 4 illustrates the evolution of the state variable regarding thebattery SoC after this evaluation procedure takes place.

Fig. 4 represents, at the top, one of the 100 possible base net-load scenarios. As previously mentioned, to meet the costumer'spreferences, the battery SoC must be updated whenever the PVgeneration exceeds the load levels (represented by negative net-load values). One consequence of this costumer preferencemodeling is that, in moments of PV surplus, the battery cannot

Fig. 4. HEMS base net-load scenario (top); So

present downward flexibility (only possible with battery dis-charging) since the battery must be used to accommodate the en-ergy PV surplus through the charging mode (although HEMSdownward flexibility might be presented depending on the oper-ation of the EWH). An example of this effect can be observed inFig. 4. The initial SoC variation depicted in the bottom chart showsthat the SoC either stays unchanged or increases during the iden-tified PV surplus moments. At the bottom, the resulting SoC vari-ation along the considered time horizon can be compared to theoriginal variation. As it can be seen from the figure analysis, thefinal SoC starts to differ from the initial SoC variation at themomentwhen the first net-load negative value occurs. The shape differencerepresents the PV generation surplus deducted the powerconsumed by the EWH in the flexibility provision.

3.4. EPSO implementation for the trajectory searching process

The fundamental ideas behind the EPSO algorithm are thepopulation based evolutionary programming concept where eachcombination of generated solution, X, and respective strategic pa-rameters, weights - w, is called particle. There are five main steps inthe general scheme of EPSO, namely:

C variation due to PV surplus (bottom).

Page 8: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

R. Pinto et al. / Energy 141 (2017) 2251e22632258

� Replication: where each particle is replicated;� Mutation: where each particle has its weights, w, mutated;� Reproduction: where an offspring is generated from eachmutated particle according to the movement rule;

� Evaluation:where each particle in the population has its fitnessevaluated;

� Selection: where, by means of stochastic tournament, the bestparticles survive to form the next generation.

For a given particle Xi, the new resulting particle, Xnewi , results

from:

Xnewi ¼ Xi þ Vnew

i (14)

Vnewi ¼ w�

i0Vi þw�i1ðbi � XiÞ þw�

i2

�b�g � Xi

�(15)

This movement rule has the terms of inertia, memory andcooperation. The weights are subjected to mutation:

w�ik ¼ wi1 þ tNð0;1Þ (16)

where N(0, 1) is a random variable with Gaussian distribution with0 mean and variance 1. Additionally, the global best bg comesrandomly disturbed:

b�g ¼ bg þ t0Nð0;1Þ (17)

In (16) and (17) the t and t0are learning parameters.

Using the EPSO method, the developed algorithm incorporatesin each particle information regarding the decision variables, Pbatand Pewh. Accordingly, each particle in this reshaped EPSO algo-rithm becomes a two-dimension object representing the two de-cision variables. The final fitness value of each particle, whichrepresents the trajectory feasibility verification, is the result of thecombined fitness evaluation of the two dimensions of each particle.During the fitness evaluation process the state variables areupdated for the time steps considered. In the end, each feasibletrajectory, traj, will result from the sum, for each time step, of thetwo dimensions of each of the selected particles, according to (2).Problem constraint enumerated in the previous section must becomplied.

In each iteration of the algorithm, as part of the EPSO fitnessevaluation process, the state variables must be assessed regardingthe generated particles. Accordingly, the battery SoC and the watertemperature of the EWH are computed based on the values of theprevious time steps for the entire time horizon considered. As thedeveloped EPSO algorithm considers a two-dimensional formula-tion, this state variable assessment procedure includes two inde-pendent functions. The trajectory feasibility relies on the fulfillmentof (6), (9), and (7). For each time step where (6), (9), and (7) are notrespected, a penalty term is added in the penalty verificationfunction of the particle being evaluated (18).

Penaltyk ¼ Pensocmax þ Pensocmin þ Pentempwater(18)

In line with the information presented in Fig. 2, the feasibletrajectories generation process that takes place in the developedEPSO algorithm is not completewithout the customer's preferencesvalidation. In this study, besides the assurance that the watertemperature inside the EWH tank remains within the pre-established temperature range (7), one must assure that the mainpropose of the battery use prior to the HEMS flexibility offeringremains being the accommodation of the PV generation surplus(11) and (12).

The validation of this customer requirement is accomplished by

a scenario based approach that allows the EPSO resulting feasibleflexibility set (trajectories) to incorporate the forecast uncertaintyregarding the base net-load of the HEMS. Hence, a set of short-termscenarios are used to represent forecast uncertainty of base loadand PV generation in this methodology. This probabilistic infor-mation is included in the constraints of the optimization problem,resulting in a chance-constrained optimization problem [51] that issolved with EPSO. Let 2 be the indicator function on the fulfillmentof constraint (18), as represented by (19).

2 ¼�1; if Penaltyk ¼ 00; if Penaltyk >0 (19)

The indicator function 2 can be seen as a binary indicator thatgets value 1 if the penalty verification function in (18) equals 0 (i.e.,no constraints violation), and has the value 0 if the penalty verifi-cation function results in a value grater that 0 representing con-straints violation. In other words, if the constraints are violated inone interval of the net-load scenario, 2 gets value 0 independentlyfrom the violation or not of the constraints in other intervals, whichis guaranteed by (18). The EPSO fitness function comes from thesum of the indicator function for all the considered base net-loadscenarios (20). Accordingly, and as defined in (21), for a trajectoryto be considered robustly feasible it must comply with a scenariopercentage threshold t, e.g., the number of base net-load scenariosin which the trajectory remains feasible must be greater than adetermined percentage of the total number of scenarios.

Fituncertk ¼XNscens¼1

2s (20)

Fituncertk > t*Nscen (21)

The trajectory fitness evaluation can be carried out according to(18) for the different conditions that each of the considered basenet-load scenario represents. Consequently, one can classify acertain trajectory as being or not robustly feasible by checking (20).

In each EPSO iteration, the ever encountered best global particle(i.e., the one with better fitness evaluation) needs to be updated. Asreferred, the fitness function used in this problem formulation onlypenalizes solutions that do not comply with the defined con-straints. This means that there is no optimal solution in thissearching process for which the EPSO algorithm is being used. Eachparticle that is feasible for all the considered scenarios will have thesame fitness value. Therefore, the best global particle, bg , is selectedbased on the relative position of all the so far identified feasibletrajectories. The aim here is that bg , which is used as reference inthe movement rule, is chosen to increase the diversity of thefeasible trajectories set. Accordingly, this selection procedureevaluates the relative position of all the elements in the set offeasible trajectories, looking for the one with the greatest distancerelative to all the others.

Distance ¼XTt¼1

�Pbat;t � Pmeanbat;t

�þ�Pewh;t � Pmean

ewh;t

� (22)

Thus, for each dimension and for all the time steps considered,the absolute distance between the particle position and the meanposition of the feasible set is computed. The final distance comesfrom the accumulated distance along the time horizon considered,following (22).

3.5. Surrogate model for the HEMS flexibility

The final EPSO algorithm output will be a large set of feasible

Page 9: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

R. Pinto et al. / Energy 141 (2017) 2251e2263 2259

temporal trajectories, which represent the feasible flexibilitydomain. The originated trajectories are to be used as a learning setof a SVDD function. The one-class support vector machine functionavailable in the Scikit-Learn Python Library [37] was used. Thislearning dataset must have sufficient diversity among the builttrajectories so that the resulting model is capable of efficientlydelimit and learn the feasibility domain boundary.

The trained SVDD model identifies the necessary support vec-tors (domain boundary representative trajectories) that describethe high-dimension sphere representing the feasible domain andthe respective coefficients. The support vectors together with therespective coefficients compose the data that is transmitted to theinterested agents in order to quantify the HEMS flexibility potential.From the entire set of feasible trajectories that feed the SVDDfunction, some are selected by it regarding the significance thatthey have on delimiting the feasible domain. During this identifi-cation process, support vectors coefficients are also computed,which imposes more or less significance on certain support vectors.This means that some support vectors are more decisive on thedelimiting of the feasible domain, which implies that the respectivecoefficients have a greater value. Applying (23) the SVDD model iscapable of classifying new flexibility trajectories as feasible or not.

R2ðxÞ ¼ 1� 2Xi

bikðxi; xÞ þXi;j

bibjk�xi; xj

�(23)

This classification is based on the comparison of the radius ofthe high dimension sphere and the radius in the high dimensiondomain that the trajectory being classified represents. The formulathat calculates the correspondent trajectory (and sphere's) radius isexpressed in equation (23), where R2 is the square of the radiusbeing calculated, xi and xj are support vectors, bi and bj are therespective coefficients, k refers to the kernel type used by the SVDDfunction, and x is the trajectory being evaluated. More detailedinformation regarding this methodology can be consulted inRefs. [38] and [34]. The information in equation (23) can be inte-grated in anymeta-heuristic optimization framework (like EPSO) tooptimize the availability flexibility according to the end-user goals[52].

To be classified as feasible, a trajectory must represent a radiusin the high dimension domain that is equal or inferior to the radiusof the sphere representing the feasibility boundary. Fig. 5 illustratesthe SVDD classification procedure where the sphere representingthe feasible flexibility space is defined by the identified supportvectors. Trajectories whose projection falls within the flexibilityspace delimited by the sphere (in other others, trajectories that leadto radius smaller than the sphere's radius) are considered feasible.On the other hand, trajectories leading to radius greater that thesphere's radius are considered unfeasible, which in Fig. 5 are rep-resented by the triangle-shaped symbols outside the domaindefined by the sphere.

The discrete nature of the EWH operation brings some chal-lenges when defining the HEMS flexibility set, namely due to dis-continuities that can be introduced by it. These discontinuities canbe learnt by the SVDD algorithm, which might lead to misguidingtrajectory classification. In order to clearly illustrate this effect, letone consider a EWH and a electric battery as flexible assets inside aHEMS. If at a certain time step the battery, for reasons of its oper-ating strategy, does not have flexibility provision capability, theonly flexibility that the HEMS can provide comes from the EWHdiscrete operation. Thus, the SVDD function will learn that for thereferred time step the HEMS can provide upward flexibility by theamount equal to the nominal power of the EWH. The resultingtrajectory classification model will then consider as feasible flexi-bility provision values between 0 kWand the EWH nominal power,

instead of a discrete representation. Nevertheless, these operationconditions are not frequent and this modeling glitch can beneglected when the battery has enough SoC margin to adjust itspower output.

According to the methodology introduced by this work, in orderto define its flexibility potential the HEMS only needs to provide tothe interested parts the computed support vectors and therespective coefficients, following (23), where xi and xj are thesupport vectors and bi and bj the respective coefficients. Accord-ingly, no information regarding customer's demand patterns orinstalled equipment (like battery specifications) need to berevealed. This surrogate model for the HEMS flexibility complieswith recent concerns regarding costumer's data privacy arisingwith the smart meter deployment [53e55].

4. Numerical results

The performance assessment of the developed methodologywas based on two main analyzes: the generation of feasible tra-jectories and the classification accuracy of SVDD models.

4.1. Generation of feasible flexibility trajectories

As detailed in Section 3, a trajectory will be classified as feasiblewhen complying with the considered constraints for at least a pre-defined minimum percentage of base net-load scenarios. Theconstraints refer to battery's SoC limits, EWH water temperatureand the use of the battery during PV surplus periods. The EPSOalgorithm is used to generate the set of feasible trajectories that willfeed the SVDD function responsible to construct a model capable ofidentifying new trajectories as feasible or not.

For the base net-load forecast uncertainty of the HEMS, 100short-term scenarios were used. In this study, for a certain trajec-tory to be considered feasible, it must comply with the problemconstraints for at least 90 scenarios, which represents a probabilityof 90%. The time horizon corresponds to a 24 h window with a15 min resolution, leading to 96 time steps.

The EPSO algorithm was configured with a 30 particle popula-tion size, a maximum number of iterations of 5000, a feasible tra-jectories target of 1000, communication factors of 0.15 for bothdimensions of the particles, maximum and minimum mutationrates of 0.50 and 0.05, respectively, and a learning parameter, t, of 5.The mutation rate is dynamic throughout the process, beginningwith the maximum value and decreasing until the minimum valueas the number of iterations increase.

For helping in the convergence of the algorithm, an initialpopulation is used, instead of using random values. This initialpopulation fills the initial particles with decision values that respectthe limits for the respective decision variables, Pbat and Pewh.Additionally, using one of the scenarios of HEMS net load profile,the PV energy surplus periods were identified and used to zero thedecision variable Pbat , so it approximates some of these initialparticles to the costumer's preference constraint of not dischargingthe battery during those periods and use it to accommodate thereferred PV energy surplus.

The HEMS modeled in this study has as flexible assets a do-mestic battery and an EWH unit. The battery considered has3.2 kWh capacity, maximum charging and discharging power of1.5 kW and an efficiency of 92.5%. The initial SoC was set to 60% ofthe maximum capacity and the minimum SoC level was defined as15% of the maximum capacity. Regarding the EWH, it has a nominalpower of 0.5 kW, maximum and minimum water temperatures of80 �C and 45 �C, respectively, and an initial water temperature of60 �C.

Page 10: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

Fig. 5. SVDD flexibility space concept.

R. Pinto et al. / Energy 141 (2017) 2251e22632260

Fig. 6 depicts the 100 HEMS base net-load scenarios used in thisstudy (top-left corner) and also a set of 100 feasible flexibility tra-jectories generated by the EPSO algorithm (bottom-left corner).

The net-load profile scenarios analysis (Fig. 6 top-left corner)lets one identify the period of day of typical superior PV generationas the one that brings more uncertainty regarding the HEMS net-load. It is during this period that the HEMS net-load can presentnegative values, which relate to the costumer's preferenceconstraint of using the battery to minimize, as far as it is physicalpossible to the battery, the injection of PV energy in the grid. Theimpact of this constraint in the set of feasible trajectories con-structed can be observed in the bottom charts depicted in Fig. 6.The period between 07:30 and 13:00 has been zoomed in forimproved clarity (right hand side charts of Fig. 6).

From 08:00 to 12:30 most of the net-load scenarios represent apower injection in the LV distribution grid, which imposes that thebattery should not be used to provide downward flexibility. Theright hand side bottom chart shows the flexibility trajectories forthat period. As one can observe, most of the trajectories areproviding 0 kW or 0.5 kW, the latter referring to the EWH nominalpower. Values greater that 0.5 kW can occur if the respective tra-jectory has room to provide upward flexibility, while accommo-dating the PV energy surplus. Negative values are very uncommonand only can occur if when evaluating a certain particle for the use

of the battery costumer preference the EWHpower related decisionvariable counterbalances the negative net-load trajectories in sometime steps. If that occurs, the battery can be used freely during suchtime steps to provide flexibility.

Regarding the increase in the diversity of the solutions gener-ated when comparing the current version of the algorithmwith thepreliminary one that used semi-random routines for the trajectoryconstruction [36], an analysis was performed using the principlecomponent analysis method, which applies an orthogonal trans-formation to convert a set of variables (with a set of observations)into a set of values of linearly uncorrelated variables (principalcomponents). Basically, the aim is to verify which version of thealgorithm produces a 1000 set of feasible trajectories that needsmore components to explain a certain percentage of the variance ofthe respective produced set. Results show that the newest algo-rithm version presented in this work needs 5 components toexplain 50% of the variance and 16 components to explain 80%,while, for the same conditions, the older version needs only 2 and5, respectively. This proves that the set of feasible trajectoriesproduced by the newest version of the algorithm is more diverse,which leads to a better representation of the feasible search spacewhen using the computed trajectories as input to build the SVDDmodel.

The final set of 1000 feasible trajectories generated by the EPSO

Page 11: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

Fig. 6. HEMS net-load trajectories (top); Flexibility provision trajectories (bottom).

R. Pinto et al. / Energy 141 (2017) 2251e2263 2261

routine needed around 25 min to be constructed in a desktopcomputer with an Intel Core i7-2600 CPU running at 3.40 GHz andwith 8.00 GB of installed RAM. The algorithm was developed onPython programming language.

4.2. Classification accuracy of SVDD-based model

The other analysis carried out regarding the performance of thealgorithm refers to the assessment of the SVDD classification ac-curacy of the multi-period trajectories. With that objective, twodifferent sets of trajectories were used: one set composed byfeasible trajectories and a second set of unfeasible trajectories. Thepurpose of using these two sets relates to the necessity of

Table 1Model efficiency comparison for feasible and non-feasible trajectories sets.

Feasible Trajectories Set Non-Feasible Trajectories Set

# correct # incorrect error (%) # correct # incorrect error (%)

g ¼ 0.05 and nu ¼ 0.01rbf 4964 48 0.96 32 11350 99.72poly 4960 52 1.04 3929 7453 65.48sigm 4961 51 1.02 3867 7515 66.03g ¼ 0.05 and nu ¼ 0.1rbf 4511 501 10.0 496 10886 95.64poly 4510 502 10.02 9013 2369 20.81sigm 4510 502 10.02 9027 2355 20.69g ¼ 0.05 and nu ¼ 0.15poly 4258 754 15.04 9632 1750 15.38sigm 4261 751 14.98 9624 1758 15.45g ¼ 0.05 and nu ¼ 0.20poly 4010 1002 19.99 9928 1454 12.77sigm 4011 1001 19.97 9943 1439 12.64g ¼ 0.005 and nu ¼ 0.15poly 4005 905 18.10 9779 1603 14.08sigm 4262 750 14.96 9626 1756 15.43

evaluating the classification process not only for the correct clas-sification of feasible trajectories but also for correctly identifyingunfeasible trajectories.

Regarding the SVDD function, hyper-parameters had to bedefined before the construction of the classification models. Thesehyper-parameters are the kernel type and coefficient (g), which willinfluence the quality of the classification performance. For thisproblem, it was found that the most suitable type of kernel was theSigmoid, being presented in Table 1 the performance results for thatkernel type together with the results from models using the radialbasis function and the polynomial kernels. Additionally, it was foundthat the fine tuning of the nu parameter can have a strong influenceon the quality of the constructed SVDD model, which can be con-sulted in Table 1. For better model performance, the input trajec-tories were normalized for values between 0 and 1, regarding theminimum and maximum values from the EPSO feasible trajectoriesset. The time period used for this analysis ranged between 09:00 and13:00 with 15 min time steps, resulting in a 16 time steps problem.

The nu parameter is a model configuration parameter and itrefers to an upper bound on the fraction of training errors and alower bound of the fraction of support vectors. Based on the resultsdisplayed in Table 1 one can verify that increasing the value of thenu parameter decreases the error on the classification of unfeasibletrajectories, while increasing the error on classifying feasible ones.Therefore, there is a trade-off on defining the best parametrizationfor the SVDD models.

It was found that the configuration with g ¼ 0:05 and nu ¼ 0.15produces themost balanced classificationmodel, resulting in errorsfor classifying feasible and non-feasible trajectories of 14.98% and15.45%, respectively. In the last iteration of the proposed approach,as depicted in Fig. 2, the flexibility trajectories selected by the DSOor flexibility aggregator still have to be validated locally by theHEMS. In the case of a non-feasible flexibility trajectory selection,the HEMS is responsible of indicating the most similar feasible

Page 12: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

R. Pinto et al. / Energy 141 (2017) 2251e22632262

trajectory that it can provide as flexibility to the interested agent.

5. Conclusions

This paper proposed a novel concept, called multi-period flexi-bility forecast for LV prosumers (behind-the-meter flexibility),which combines small-scale DER flexibility (e.g., storage, EWH) andforecast uncertainty for PV and net-load time series. This newfunction can be embedded in an HEMS and explored in the contextof smart grid and microgrid technology. The flexibility potentialalso accounts for comfort constraint regarding the temperature ofthe water in the EWH tank and a costumer-defined mode ofoperation of the electric battery.

In a first stage, an EPSO-based generation mechanism is pro-posed to create a set of feasible flexibility trajectories that arerobust to net-load forecast uncertainty. Then, in a second phase, itexplores a support vector data description function as a “black-box”model to communicate the flexibility set to different types of users,like DSO and flexibility aggregators. Nevertheless, the discreterepresentation with the flexibility trajectories set can be also in-tegrated in management functions of DSO and market players.

The modified EPSO algorithm used for searching feasible flexi-bility trajectories showed a high diversity in producing feasiblesolutions and, consequently, improved the efficiency of the createdSVDD models that are responsible of learning the HEMS feasibleflexibility set boundaries. More than that, the forecast uncertaintyregarding the HEMS net-load profile is fully considered bymeans offitness evaluation of the computed solutions for various base net-load short-term scenarios which was one of the major gaps iden-tified in the state of the art. Consequently, the proposed method-ology can be used to control the robustness of the flexibilitytrajectories set in a probabilistic fashion (i.e., chance-constrainedoptimization).

It is crucial that the flexibility set, which can be transmitted tothe interested stakeholders, clearly incorporates the physical andoperating constraints of the DER and also the desired strategicmodes of operation defined by the HEMS end-user. The trajectoriesresulting from the developed EPSO-based algorithm respect theproblem constraints regarding DER power limits, state-of-charge ofthe battery and the temperature of the water inside the EWH tank.Additionally, the constraint related to the customer's preferencesabout the use of the battery during PV surplus periods is alsorespected by the generated flexibility trajectories.

Additionally, the performance of the SVDD model was assessedfor the classification of feasible and non-feasible flexibility trajec-tories. Several configurations regarding the different hyper-parameters of the SVDD algorithm were analyzed. The configura-tion found to be more balanced regarding the trajectory classifi-cation procedure, with sigmoid kernel, g ¼ 0:05, and n ¼ 0:15,resulted in a misclassification error of around 15%. These errorswere computed for a 16 time steps problem formulation. As thetotal number of time steps of the problem decreases, the errors alsotend to decrease. The SVDD parameters showed a significantimpact on the model classification performance, imposing a trade-off between misclassification of feasible and non-feasibletrajectories.

The final outcome of this work is a forecast methodology withbenefits for two groups of stakeholders: a) integrated in DSOoperational planning tools to explore local flexibility potentialwithin LV distribution grids in a time efficient fashion whilecomplying with costumer privacy concerns; b) used by a prosumersflexibility aggregator to efficiently assess the true flexibility provi-sion capacity that can be provided by the assets belonging to itsportfolio.

Future work will focus on improving the efficiency of the

classification procedure by the SVDD model and also on investi-gating new approaches to transmit to the interested agents theHEMS flexibility set, e.g. use virtual batteries derived from theflexibility trajectories set.

Acknowledgements

The research leading to this work is being carried out as a part ofthe InteGrid project (Demonstration of INTElligent grid technolo-gies for renewables INTEgration and INTEractive consumer partic-ipation enabling INTEroperable market solutions andINTErconnected stakeholders), which received funding from theEuropean Union's Horizon 2020 Framework Programme forResearch and Innovation under grant agreement No. 731218.

The work of Rui Pinto was also supported in part by Fundaç~aopara a Ciencia e a Tecnologia (FCT) under PhD Grant SFRH/BD/117428/2016.

A. Gaussian copula method

The Gaussian copula method [39,42] generates M temporalscenarios of solar power forecasts. First, the variable

Ztþkjt ¼ F�1ðbF tþkjtðytþkÞÞ is calculated, where ytþk is the observed

value for lead time t þ k, bF tþk the forecasted probability distribu-

tion function and F�1 the inverse of the Gaussian cumulative dis-tribution function. This random variable Ztþkjt is Gaussiandistributed with zero mean and unit standard deviation. Then, thescenarios are generated with the following process:

1. Generate M random vectors Z½m� from a multivariate Gaussiandistribution (i.e., Gaussian copula) with zero mean and covari-ance matrix SZ. The size of this random vector is between t þ 1and t þ T where T is the maximum lead time or time horizon.

2. Transform Z½m� with the following equation to obtain a randomvector in the same scale of y (note that Z was a Gaussianvariable).

y½m� ¼ bF�1�F�Z½m�

��(24)

where bF�1is the vector of inverse forecasted distribution function

for lead times between t þ 1 and t þ T , F is the distribution func-tion of a standard normal randomvariable and y½m� is them-th solarpower scenario.

The dependency structure between the lead-times is modeledwith a Gaussian copula that uses an exponential covariance matrixgiven by:

cov�Ztþk1 ; Ztþk2

� ¼ exp� jk1 � k2j

n

�(25)

where Ztþk1 is the Gaussian random variable for lead time t þ k1and where n is the range parameter controlling the strength of thecorrelation of random variables among the set of lead times. Theparameter n is determined by trial-error experiences using the p-variogram score as a performance metric [56].

References

[1] Hasheminamin M, Agelidis VG, Heidari A. Impact study of high PV penetrationin low and medium-voltage networks when considering residential and in-dustrial load profile. In: Proceedings of 2013 International conference onrenewable energy research and applications, ICRERA 2013. IEEE; 2013.p. 347e52.

[2] Taylor M, Ralon P, Ilas A. The power to change: solar and wind cost reduction

Page 13: Multi-period flexibility forecast for low voltage prosumers · Multi-period flexibility forecast for low voltage prosumers Rui Pinto a, b, Ricardo J. Bessa a, *, Manuel A. Matos

R. Pinto et al. / Energy 141 (2017) 2251e2263 2263

potential to 2025. Tech. rep. International Renewable Energy Agency (IRENA);June 2016.

[3] Alipour M, Mohammadi-Ivatloo B, Moradi-Dalvand M, Zare K. Stochasticscheduling of aggregators of plug-in electric vehicles for participation in en-ergy and ancillary service markets. Energy 2017;118:1168e79.

[4] Anand M, Golshannavaz S, Ongsakul W, Rajapakse A. Incorporating short-term topological variations in optimal energy management of MGs consid-ering ancillary services by electric vehicles. Energy 2016;112:241e53.

[5] Clastres C, Pham TH, Wurtz F, Bacha S. Ancillary services and optimalhousehold energy management with photovoltaic production. Energy2010;35(1):55e64.

[6] Biegel B, Westenholz M, Hansen LH, Stoustrup J, Andersen P, Harbo S. Inte-gration of flexible consumers in the ancillary service markets. Energy2014;67:479e89.

[7] Majzoobi A, Khodaei A. Application of microgrids in providing ancillary ser-vices to the utility grid. Energy 2017;123:555e63.

[8] Liang H, Zhuang W. Stochastic modeling and optimization in a microgrid: asurvey. Energies 2014;7(4):2027e50.

[9] Kim B., Bae S., Kim H., Optimal energy scheduling and transaction mechanismfor multiple microgrids, Energies 10(4).

[10] Milanes-Montero M.-I., Barrero-Gonzalez F., Pando-Acedo J., Gonzalez-Romera E., Romero-Cadaval E., Moreno-Munoz A., Active, reactive and har-monic control for distributed energy micro-storage systems in smart com-munities homes, Energies 10(4).

[11] Meneses de Quevedo P., Contreras J., Optimal placement of energy storage andwind power under uncertainty, Energies 9(7).

[12] Tuominen J, Repo S, Kulmala A. Comparison of the low voltage distributionnetwork voltage control schemes. In: 2014 IEEE PES innovative smart gridtechnologies conference Europe (ISGT-Europe), Istanbul; 2014.

[13] Zhou L, Li Y, Wang B, Wang Z, Hu X. Provision of supplementary load fre-quency control via aggregation of air conditioning loads. Energies 2015;8(12):14098e117.

[14] Gouveia J, Gouveia C, Rodrigues J, Bessa R, Madureira A, Pinto R, et al.Microgrid energy balance management for emergency operation. In: Proc. ofthe IEEE PowerTech 2017, Manchester, UK; 2017.

[15] Shakeri M, Shayestegan M, Abunima H, Reza SS, Akhtaruzzaman M,Alamoud A, et al. An intelligent system architecture in home energy man-agement systems (HEMS) for efficient demand response in smart grid. EnergyBuild 2017;138:154e64.

[16] Rajalingam S, Malathi V. HEM algorithm based smart controller for homepower management system. Energy Build 2016;131:184e92.

[17] Snape JR, Ardestani BM, Boait P. Accommodating renewable generationthrough an aggregator-focused method for inducing demand side responsefrom electricity consumers. IET Renew Power Gener 2013;7(6):689e99.

[18] Gkatzikis L, Koutsopoulos I, Salonidis T. The role of aggregators in smart griddemand response markets. IEEE J Sel Areas Commun 2013;31(7):1247e57.

[19] Qiu X, Ren Y, Suganthan PN, Amaratunga GA. Empirical mode decompositionbased ensemble deep learning for load demand time series forecasting. ApplSoft Comput 2017;54:246e55.

[20] Zafirakis D, Chalvatzis KJ, Baiocchi G, Daskalakis G. The value of arbitrage forenergy storage: evidence from european electricity markets. Appl Energy2016;184:971e86.

[21] Gomes I, Pousinho H, Melício R, Mendes V. Stochastic coordination of jointwind and photovoltaic systems with energy storage in day-ahead market.Energy 2017;124:310e20.

[22] Nosratabadi SM, Hooshmand R-A, Gholipour E. A comprehensive review onmicrogrid and virtual power plant concepts employed for distributed energyresources scheduling in power systems. Renew Sustain Energy Rev 2017;67:341e63.

[23] Stinner S, Huchtemann K, Müller D. Quantifying the operational flexibility ofbuilding energy systems with thermal energy storages. Appl Energy2016;181:140e54.

[24] Coninck RD, Helsen L. Quantification of flexibility in buildings by cost curves emethodology and application. Appl Energy 2016;162:653e65.

[25] Zhao L, Zhang W, Hao H, Kalsi K. A geometric approach to aggregate flexibilitymodeling of thermostatically controlled loads. IEEE Trans Power Syst2017;32(6):4721e31.

[26] Hughes JT, Domínguez-García AD, Poolla K. Identification of virtual batterymodels for flexible loads. IEEE Trans Power Syst 2016;31(6):4660e9.

[27] Hao H, Sanandaji BM, Poolla K, Vincent TL. Aggregate flexibility of thermo-statically controlled loads. IEEE Trans Power Syst 2015;30(1):189e98.

[28] Nosair H, Bouffard F. Flexibility envelopes for power system operationalplanning. IEEE Trans Sustain Energy 2015;6(3):800e9.

[29] Nuytten T, Claessens B, Paredis K, Van Bael J, Six D. Flexibility of a combinedheat and power system with thermal energy storage for district heating. ApplEnergy 2013;104:583e91.

[30] Delnooz A, Geysen D, Six D, Verbeeck J, Virag A. Adapted methodology foroptimal valorization of flexible industrial electricity demand. June 2016. Tech.Rep. Deliverable 3.2, EU Project IndustRE.

[31] Ulbig A, Andersson G. Analyzing operational flexibility of electric powersystems. Int J Electr Power & Energy Syst 2015;72:155e64.

[32] Pan Z, Guo Q, Sun H. Feasible region method based integrated heat andelectricity dispatch considering building thermal inertia. Appl Energy2017;192:395e407.

[33] Bremer J, Sonnenschein M. Sampling the search space of energy resources forself-organized, agent-based planning of active power provision. In: 27th In-ternational conference on environmental informatics for environmentalprotection, sustainable development and risk management (EnviroInfo 2013),Hamburg; 2013. p. 214e22.

[34] Sonnenschein M, Lünsdorf O, Bremer J, Tr€oschel M. Decentralized control ofunits in smart grids for the support of renewable energy supply. EnvironImpact Assess Rev 2015;52:40e52.

[35] Miranda V, Fonseca N. EPSO-evolutionary particle swarm optimization, a newalgorithm with applications in power systems. In: IEEE/PES Transmission anddistribution conference and exhibition, vol. 2. IEEE; 2002. p. 745e50.

[36] Pinto R, Matos MA, Bessa RJ, Gouveia J, Gouveia C. Multi-period modeling ofbehind-the-meter flexibility. In: Proc. of the IEEE PowerTech 2017, Man-chester, UK; 2017.

[37] Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B, Grisel O, et al.Scikit-learn: machine learning in Python. J Mach Learn Res 2012;12(Oct):2825e30. arXiv:1201.0490.

[38] Bremer J, Rapp B, Sonnenschein M. Encoding distributed search spaces forvirtual power plants. In: 2011 IEEE symposium on computational intelligenceapplications in smart grid (CIASG). IEEE; 2011. p. 9e16.

[39] Cario MC, Nelson BL. Modeling and generating random vectors with arbitrarymarginal distributions and correlation matrix. Tech. rep. Evanston, Illinois:Department of Industrial Engineering and Management Sciences, North-western University; 1997.

[40] Jord�a O, Marcellino M. Path forecast evaluation. J Appl Econ 2010;25(4):635e62.

[41] Bessa R, M€ohrlen C, Fundel V, Siefert M, Browell J, Gaidi SHE, et al. Towardsimproved understanding of the applicability of uncertainty forecasts in theelectric power industry. Energies 2017;10(9):1402.

[42] Pinson P, Madsen H, Nielsen HA, Papaefthymiou G, Kl€ockl B. From probabi-listic forecasts to statistical scenarios of short-term wind power production.Wind Energy 2009;12(1):51e62.

[43] Eckel FA, Monache LD. A hybrid NWP-analog ensemble. Mon Weather Rev2016;144(3):897e911. https://doi.org/10.1175/MWR-D-15-0096.1.

[44] Staid A, Watson J-P, Wets RJ-B, Woodruff DL. Generating short-term proba-bilistic wind power scenarios via nonparametric forecast error density esti-mators. Wind Energy 2017;20(12):1911e25.

[45] Golestaneh F, Gooia HB, Pinson P. Generation and evaluation of space-timetrajectories of photovoltaic power. Appl Energy 2016;176:80e91.

[46] Andrade J, Bessa R. Improving renewable energy forecasting with a grid ofnumerical weather predictions. IEEE Trans Sustain Energy 2017;8(4):1571e80.

[47] Matos M, Bessa RJ, Gonçalves C, Cavalcante L, Miranda V, Machado N, et al.Setting the maximum import net transfer capacity under extreme RES inte-gration scenarios. In: 2016 International conference on probabilistic methodsapplied to power systems (PMAPS). Beijing, China: IEEE; 2016.

[48] Reis M, Garcia A, Bessa R. A scalable load forecasting system for low voltagegrids. In: Proc. of the IEEE PowerTech 2017, Manchester, UK; 2017.

[49] Battery University. Charging Lithium-Ion Batteries. Battery University; 2015.http://batteryuniversity.com/learn/article/charging_lithium_ion_batteries.

[50] Heleno M, Matos MA, Lopes JAP. Availability and flexibility of loads for theprovision of reserve. IEEE Trans Smart Grid 2015;6(2):667e74.

[51] Charnes A, Cooper WW. Chance-constrained programming. Manag Sci1959;6(1):73e9.

[52] Bremer J, Sonnenschein M. Communications in computer and informationscience. In: Ch. Constraint-Handling with support vector decoders, vol. 449.Berlin, Heidelberg: Springer; 2014. p. 228e44.

[53] Farquharson J, Wang A, Howard J. Smart grid cyber security and substationnetwork security. In: 2012 IEEE PES innovative smart grid technologies, ISGT2012. IEEE; 2012. p. 1e5.

[54] Yan Y, Qian Y, Sharif H. A secure data aggregation and dispatch scheme forhome area networks in smart grid. In: GLOBECOM - IEEE global telecommu-nications conference. IEEE; 2011. p. 1e6.

[55] Deng P, Yang L. A secure and privacy-preserving communication scheme foradvanced metering infrastructure. In: 2012 IEEE PES innovative smart gridtechnologies, ISGT 2012. IEEE; 2012. p. 1e5.

[56] Scheuerer M, Hamill T. Variogram-based proper scoring rules for probabilisticforecasts of multivariate quantities. Mon Weather Rev 2015;143(4):1321e34.