Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
METHOD OF OPERATING A POWER DISTRIBUTION SYSTEM
Document Type and Number:
WIPO Patent Application WO/2023/180418
Kind Code:
A1
Abstract:
Method of operating an electrical power distribution system (1), said power distribution system (1) comprising: - at least one electrical power generator (3, 5) with uncontrollable variable supply; - at least one electrical power consuming resource (13) with controllable demand and subject to at least one state constraint, said electrical power consuming resource (13) with controllable demand being arranged to be controlled by an internal controller (17); - a system controller (15) adapted to send requests to said internal controller (17) to request variation in said controllable demand; - an electrical power distribution network (9) arranged to transmit electrical power from said at least one electrical power generator (3, 5) to said at least one electrical power consuming resource (13) with controllable demand. A virtual battery model (19) of the electrical power consuming resource (13) with controllable demand is created, and is used to generate a set of feasible power consumption requests that the electrical power consuming resource (13) with controllable demand can fulfil on the basis of the virtual battery model (19)

Inventors:
SCHARNHORST PAUL (CH)
JONES COLIN (CH)
SCHUBNEL BAPTISTE (CH)
CARRILLO RANGEL RAFAEL EDUARDO (CH)
ALET PIERRE-JEAN (CH)
Application Number:
PCT/EP2023/057413
Publication Date:
September 28, 2023
Filing Date:
March 23, 2023
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
CSEM CT SUISSE DELECTRONIQUE MICROTECHNIQUE SA RECH DEVELOPPEMENT (CH)
International Classes:
H02J3/14; H02J3/38
Foreign References:
US20180287382A12018-10-04
US20180287382A12018-10-04
Other References:
D. BERTSIMASD. B. BROWN: "Constructing Uncertainty Sets for Robust Linear Optimization", OPERATIONS RESEARCH, vol. 57, no. 6, 2009, pages 1483 - 1495, Retrieved from the Internet
D. BERTSIMASD. B. BROWN: "Constructing uncertainty sets for robust linear optimization", OPERATIONS RESEARCH, vol. 57, no. 6, December 2009 (2009-12-01), pages 1483 - 1495
S. URYASEV: "Conditional value-at-risk: optimization algorithms and applications", PROCEEDINGS OF THE IEEE/IAFE/INFORMS 2000 CONFERENCE ON COMPUTATIONAL INTELLIGENCE FOR FINANCIAL ENGINEERING (CIFER, 2000, pages 49 - 57, XP010379601, DOI: 10.1109/CIFER.2000.844598
DELBAEN: "Coherent risk measures on general probability spaces", ADVANCES IN FINANCE AND STOCHASTICS (ESSAYS IN HONOUR OF DIETER SONDERMANN, vol. 35, 2002
R. D'HULST: "Demand response flexibility and flexibility potential of residential smart appliances: Experiences from large pilot test in Belgium", APPLIED ENERGY, vol. 155, 2015, pages 79 - 90, XP055283437, DOI: 10.1016/j.apenergy.2015.05.101
J. GASSERH. CAIS. KARAGIANNOPOULOSP. HEERG. HUG: "Predictive energy management of residential buildings while self-reporting flexibility envelope", APPLIED ENERGY, vol. 288, April 2021 (2021-04-01), pages 116653
Attorney, Agent or Firm:
E-PATENT S.A. (CH)
Download PDF:
Claims:
Claims

1. Method of operating an electrical power distribution system (1), said power distribution system (1) comprising:

- at least one electrical power generator (3, 5) with uncontrollable variable supply;

- at least one electrical power consuming resource (13) with controllable demand and subject to at least one state constraint, said electrical power consuming resource (13) with controllable demand being arranged to be controlled by an internal controller (17);

- a system controller (15) adapted to send requests to said internal controller (17) to request variation in said controllable demand;

- an electrical power distribution network (9) arranged to transmit electrical power from said at least one electrical power generator (3, 5) to said at least one electrical power consuming resource (13) with controllable demand; said method comprising steps of:

- determining a virtual battery model (19) of said at least one electrical power consuming resource (13) with controllable demand,

- determining a set of feasible power consumption requests that said at least one electrical power consuming resource (13) with controllable demand can fulfil, on the basis of said virtual battery model (19) in function of the current state of said electrical power consuming resource (13) with controllable demand and external conditions; and

- sending requests from said system controller (15) to said internal controller (17) of said electrical power consuming resource (13) with variable demand to increase or decrease its power consumption on the basis of power available on said electrical power distribution network (9) and said set of feasible power consumption requests, wherein said virtual battery model (19) comprises:

- a first block (19a) which receives a current state of said electrical power consuming resource (13) with controllable demand, and current external conditions, said first block (19a) determining a state change of said electrical power consuming resource (13) with controllable demand due to nominal behaviour of said internal controller (17), said first block (19a) being active only when said system controller (15) does not request said electrical power consuming resource (13) with controllable demand to consume more or less power,;

- a second block (19b) which receives said current request, current external conditions and a prediction of said external conditions at a time in the future, said second block (19b) being active only when said system controller (15) requests that said electrical power consuming resource (13) with controllable demand consume more or less power, said second block (19b) outputting a state change of said electrical power consuming resource (13) with controllable demand due to predicted changes in external conditions;

- a third block (19c) which receives the current request and determines a state change of said electrical power consuming resource (13) with controllable demand incurred by said current request, said state changes being combined such that said virtual battery model (19) outputs a predicted state of said electrical power consuming resource (13) with controllable demand at said time in the future on the basis of a current state of said electrical power consuming resource (13) with controllable demand, of said current external conditions, of said prediction of said external conditions at said time in the future, and of said current request 2. Method according to the preceding claim, wherein said step of determining a set of feasible power consumption requests is carried out by a flexibility forecasting system (21) on the basis of:

- the current state of said electrical power consuming resource (13) with controllable demand;

- current external conditions;

- predictions of external conditions at at least one time in the future;

- a confidence level of the ability that said electrical power consuming resource (13) with controllable demand can fulfil a request;

- uncertainty in said set of feasible power consumption requests; said flexibility forecasting system (21) outputting a maximum and minimum power consumption request that can be fulfilled at said at least one time in the future.

3. Method according to the preceding claim, wherein said uncertainty in said set of feasible power consumption requests exploits a coherent risk measure such as the Conditional Value at Risk. 4. Method according to any preceding claim, wherein said virtual battery model (19) comprises parameters determined by the steps of:

- operating said electrical power consuming resource (13) with controllable demand under nominal conditions while collecting measurements relating to said electrical power consuming resource (13) with controllable demand and of corresponding external conditions;

- generating a first set of state values on the basis of said measurements and said external conditions;

- operating said electrical power consuming resource (13) with controllable demand during periods in which increased power consumption is requested and during periods in which decreased power consumption is requested while collecting measurements relating to said electrical power consuming resource (13) with controllable demand and of corresponding external conditions;

- generating a second set of state values on the basis of said measurements and said external conditions obtained during periods in which increased power consumption is requested and during periods in which decreased power consumption is requested; and

- determining said parameters on the basis of said first and second set of state values and said corresponding external conditions. 5. Method according to any preceding claim, wherein said virtual battery model (19) is expressed as wherein : is the predicted state of said electrical power consuming resource (13) with controllable demand at a time t + 1 in the future; is the state of said electrical power consuming resource (13) with controllable demand at time t; p+ is a parameter that determines a linear state change of said electrical power consuming resource (13) with controllable demand due to positive relative power consumption requests; rt is a relative power consumption request at time t; is a positive relative power consumption request at time t; p~ is a parameter that determines a linear state change of said electrical power consuming resource (13) with controllable demand due to negative relative power consumption requests is a negative relative power consumption request at time t; pf is a parameter that determines how fast the state of said electrical power consuming resource (13) with controllable demand returns to its nominal value if no request is received; f(et) is a function of a vector of measurements of external conditions et at time t; has a value of 1 if a request r at time t is zero, and has a value of 0 otherwise; f(et+1) is a function of a vector of predictions of external conditions et+1 at future time t + 1.

6. Method according to the preceding claim, wherein said set of feasible power consumption requests is: wherein: p+ is a parameter that determines a linear state change of said electrical power consuming resource (13) with controllable demand due to positive relative power consumption requests; p- is a parameter that determines a linear state change of said electrical power consuming resource (13) with controllable demand due to negative relative power consumption requests; k is the number of discrete time steps of operation of said electrical power consuming resource (13) with controllable demand; r is a relative power consumption request trajectory; is the collection of alternating positive and negative parts of a relative consumption request trajectory up to request Z; s0 is the state of the electrical power consuming resource at the current time; c(l) is the predicted state at time I without requests; al(p+,p-) is the vector of coefficients of the state change due to requests up to time Z; is the vector of negative distances of the predicted state I without requests to a lower and upper state bound; is the vector of positive and negative coefficients of the state change due to requests up to time Z; 7. Computer program product comprising instructions which, when the program is executed by a computer, cause the computer to carry out the method steps of the method of any preceding claim.

Description:
Description

METHOD OF OPERATING A POWER DISTRIBUTION SYSTEM

Technical field

[0001] The present invention relates to power distribution systems comprising at least one uncontrollable and intermittent power source such as a solar or wind generation system, and to the mitigation of the problems related thereto.

State of the Art

[0002] As wind and solar power generation becomes a larger proportion of the energy mixture in power grids, the problems related to the intermittency of the power produced thereby become greater, in order that the power generated and fed into the power grid balances the energy consumed.

[0003] The traditional method to carry out grid balancing is to balance the supply side of the equation with relatively fast-acting and controllable power sources such as hydroelectric and combined-cycle gas generation. As a result, when wind and/or solar production is lower, these controllable power sources are ramped up to make up the shortfall, and as wind and/or solar production rises, they are ramped down. However, as the proportion of the energy mix produced by intermittent, uncontrollable energy sources increases, this supply-side strategy is no longer sufficiently responsive, and requires more and more gas generation standing idle or working at low power and low efficiency levels in order to provide the required buffer of generation capacity.

[0004] Various strategies have been proposed to counter this by manipulating the demand side of the equation. In essence, certain electrical power consuming resources have a degree of flexibility in their operation, due to acceptable variations in output. For instance, a building with a heat-pump operated heating and/or cooling (hereinafter “HVAC”) system has a certain thermal inertia in the building itself, and an acceptable temperature range for the occupants (e.g. 19-24°C), thermal storage tanks which can contain a larger or smaller quantity of energy, and so on, which permits consumption of more or less power when needed, compared to the consumption at a nominal setpoint.

[0005] Other examples of electrical power consuming resources which also present a degree of flexibility are electric vehicle charging stations, domestic battery arrays, drainage pumps, pumps for water supply reservoirs, pumped storage systems and so on. In essence, any such resource which has flexibility in its operation, due to for instance a permissible variation in temperature, water level, state of charge or similar, can be used for electrical power demand management by absorbing more or less power as required, within acceptable limits.

[0006] In order to encourage the operator of the electrical power consuming resource to carry out demand management, the grid operator can vary the price of electricity depending on whether there is too much or too little generation occurring, with the operator adjusting the power consumed on the basis of these signals in response to these incentives. However, this approach presents drawbacks in relying upon the consumer to voluntarily follow the incentives presented. Since it can take time for the price signal to be computed, transmitted and acted upon (if at all), this approach is still relatively slow and insufficiently flexible. Load flexibility forecasting can also be used to help balance a power grid, and an example of this is disclosed in document US2018/0287382.

[0007] The aim of the present invention is thus to propose a method of operating a power distribution system which at least partially overcomes the drawbacks of the prior art.

Disclosure of the Invention

[0008] More precisely, the invention relates to a method of operating an electrical power distribution system, said power distribution system comprising:

[0009] - at least one electrical power generator with uncontrollable variable supply, such as a wind turbine, photovoltaic cell system or similar;

[0010] - at least one electrical power consuming resource with controllable demand and subject to at least one state constraint, said electrical power consuming resource with controllable demand being arranged to be controlled by an internal controller. Such an electrical power consuming resource may for instance be a building provided with a heating and/or cooling system using electrical power, a pump for drainage or for filling a reservoir, a battery array, an electric vehicle charging system, or similar, and the state constraint may be for instance a particular temperature range within a building or a thermal storage tank, a water level range for a pump, a state of charge range for a battery system or similar;

[0011] - a system controller adapted to send requests to said internal controller to request variation in said controllable demand, i.e. to request that the resource consume more or less power than it otherwise would in the absence of such requests;

[0012] - an electrical power distribution network arranged to transmit electrical power from said at least one electrical power generator to said at least one electrical power consuming resource with controllable demand.

[0013] This method comprises steps of:

[0014] - determining a virtual battery model of said at least one electrical power consuming resource with controllable demand, thereby modelling it as if it were a battery storing energy in analogy to the resource’s ability to use more or less power than it would by default while still remaining within an acceptable state;

[0015] - determining a set of feasible power consumption requests that said electrical power consuming resource with controllable demand can fulfil within said state constraint (i.e. requests which will not cause the resource to exceed or undershoot predetermined functional limits, such as a comfortable temperature range in a building, a water level on the input or output side in the case of a pump, a maximum or minimum state of charge of a battery system, etc.) on the basis of said virtual battery model in function of the current state of the electrical power consuming resource with controllable demand and external conditions; and

[0016] - sending requests from said system controller to said electrical power consuming resource with controllable demand to increase or decrease its power consumption on the basis of power available on said electrical power distribution network and said set of feasible power consumption requests.

[0017] Said virtual battery model comprises:

[0018] - a first block which receives a current state of said electrical power consuming resource with controllable demand (e.g. the internal temperature in the case of a building, water levels in the case of a pump, a state of charge in the case of a battery array or similar), and current external conditions (e.g. which influence the normal consumption of power by the resource, such as temperature and insolation in the case of a building, water flows in the case of a pump etc.), said first block being active when said system controller does not request the resource to consumer more or less power than it otherwise would (i.e. sends a null request) and determining a state change of said electrical power consuming resource with controllable demand due to nominal behaviour of said internal controller (i.e. how the internal controller will affect the state of the resource when operating normally) ;

[0019] - a second block which receives said current request from said system controller to consume more or less power, current external conditions and a prediction of said external conditions at a time in the future (typically 15 minutes or 1 hour in the future), said second block outputting a state change of said electrical power consuming resource with controllable demand due to predicted changes in external conditions (i.e. how the internal controller will affect the state of the resource on the basis of future predicted changes in the external conditions and in function of the current request). The second block is active only when said system controller requests that said electrical power consuming resource with controllable demand consume more or less power, i.e. when the request is non-null;

[0020] - a third block which receives the current request and determines a state change of said electrical power consuming resource with controllable demand incurred by said current request,

[0021] said state changes being combined such that said virtual battery model outputs a predicted state at said time in the future on the basis of a current state, of said current external conditions, of said prediction of said external conditions at said time in the future, and of said current request.

[0022] As a result, the system controller obtains from the virtual battery model sets of feasible requests for the resource to consume more or less power than it would do with no such request being sent (i.e. its default operation), enabling the operator to be able to send feasible requests to the electrical power consuming resource with controllable demand in order to balance power on the electrical power distribution network by influencing the demand this resource in a way that does not cause it to enter an unacceptable state outside its state constraint. Since this can be influenced directly by the system controller, the response of the resource(s) in question can be very rapid, enabling rapid realtime balancing of the electrical power distribution network.

[0023] Advantageously, step of determining a set of feasible power consumption requests is carried out by a flexibility forecasting system on the basis of:

- the current state of said electrical power consuming resource;

- current external conditions;

- predictions of external conditions at times in the future,

- a confidence level of the ability that said electrical power consuming resource with controllable demand can fulfil a request;

- uncertainty in said set of feasible power consumption requests, e.g. by exploiting a coherent risk measure such as the Conditional Value at Risk;

[0024] said flexibility forecasting system outputting a maximum and minimum power consumption request that can be fulfilled.

[0025] Advantageously, said virtual battery model comprises parameters determined by the steps of:

- operating said electrical power consuming resource with controllable demand under nominal conditions while collecting measurements relating to said electrical power consuming resource with controllable demand and of corresponding external conditions;

- generating a first set of state values on the basis of said measurements and said external conditions, which hence reflect how the internal controller influences the state of the resource under default conditions without being requested to consume more or less power;

- operating said electrical power consuming resource with controllable demand during periods in which increased power consumption is requested and during periods in which decreased power consumption is requested while collecting measurements relating to said electrical power consuming resource with controllable demand and of corresponding external conditions;

- generating a second set of state values on the basis of said measurements and said external conditions obtained during periods in which increased power consumption is requested and during periods in which decreased power consumption is requested, which reflect how the internal controller affects the resource when asked to consume more or less power than it otherwise would if left to its own devices; and

- determining said parameters on the basis of said first and second set of state values and said corresponding external conditions.

[0026] Advantageously, said virtual battery model is expressed as

[0027] wherein : is the predicted state of said electrical power consuming resource with controllable demand at a time t + 1 in the future; is the state of said electrical power consuming resource with controllable demand at time t; p + is a parameter that determines a linear state change of said electrical power consuming resource with controllable demand due to positive relative power consumption requests; r t is a relative power consumption request at time t, i.e. that the electrical power consuming resource with controllable demand is requested to consume more or less power than it otherwise would; is the positive part of the relative power consumption request at time t, such that = max (r t , 0), i.e. that the electrical power consuming resource with controllable demand is requested to consume more power than it otherwise would; p- is a parameter that determines a linear state change of said electrical power consuming resource with controllable demand due to negative relative power consumption requests r t _ is the negative part of the relative power consumption request at time t, such that r t _ = min (r t , 0), i.e. that the electrical power consuming resource with controllable demand is requested to consume less power than it otherwise would; p f is a parameter that determines how fast the state of said electrical power consuming resource with controllable demand returns to its nominal value if no request is received; f(e t ) is a function of a vector of measurements of external conditions e t at time t; has a value of 1 if a request r at time t is zero, and has a value of 0 otherwise; f(e t+1 ) is a function of a vector of predictions of external conditions e t+1 at future time t + 1.

[0028] Advantageously, said set of feasible power consumption requests is:

[0029] with

[0030] wherein: p + is a parameter that determines a linear state change of said electrical power consuming resource due to positive relative power consumption requests; p- is a parameter that determines a linear state change of said electrical power consuming resource due to negative relative power consumption requests; k is the number of discrete time steps of operation of said electrical power consuming resource; r is a relative power consumption request trajectory, i.e. that the electrical power consuming resource with controllable demand is requested to consume more or less power than it otherwise would under control of its internal controller alone; is the collection of alternating positive and negative parts of a relative consumption request trajectory up to request Z; s 0 is the state of the electrical power consuming resource at the current time; c(l) is the predicted state at time I without requests; α l (p + ,p-) is the vector of coefficients of the state change due to requests up to time l; is the vector of negative distances of the predicted state I without requests to a lower and upper state bound; is the vector of positive and negative coefficients of the state change due to requests up to time l;

[0031] The invention finally relates to a computer program product comprising instructions which, when the program is executed by a computer, cause the computer to carry out the method steps of the method as defined above.

Brief description of the figures

[0032] Further details of the invention will become apparent upon reading the following description, in reference to the appended drawings in which:

- Figure 1 is a schematic representation of an electrical power distribution system;

- Figure 2 is a schematic representation of a virtual battery model as used in the invention;

- Figure 3 is a schematic representation of a flexibility forecasting system as used in the invention;

- Figure 4 is a flow diagram of the general principle of a first phase of training the virtual battery model;

- Figure 5 is a flow diagram of the general principle of a second phase of training the virtual battery model;

- Figure 6 illustrates plots of flexibility envelopes for day 3 of test data, in which the true flexibility envelope is on the left, the top row represents flexibility envelope predictions for different values of j, and the bottom row represents the difference of the predicted envelopes to the true envelope; and - Figure 7 illustrates predicted vs truly available timesteps in the flexibility envelopes for different values of j on day 3 of the test data, the bottom right showing the average percentage of infeasible prediction vs mean absolute prediction error for different values of j over 10 days.

Embodiments of the invention

[0033] Figure 1 illustrates schematically an electrical power distribution system 1, comprising a number of electrical power generators 3, 5, 7, of which at least one has an uncontrollable variable supply. As illustrated, these are at least one wind turbine 3 and at least one photovoltaic (PV) array 5. Furthermore, the system 1 comprises a conventional power generator 7, in order to provide a base load. The total power production capacity hence varies as the sum of the nominal generating capacity of the electrical power generators 3, 5, 7 at any given time, with the proviso that the generation of the PV array 5 is zero at night, and that of the wind turbines 3 is zero when the windspeed is out of the usable range. As a result, the conventional generation capacity must be able to cover the entire electrical demand when it is dark and windless or too windy.

[0034] Each of the electrical power generators 3, 5, 7 feeds the produced electricity into an electrical power distribution network 9, which supplies a number of electrical power consuming resources 11 , 13 illustrated here as houses, at least one of which (indicated with reference sign 13 and referred to simply as "resource 13” in the foregoing in the interests of brevity) having controllable demand under the command of a system controller 15, which can be a physical controller or a virtual controller, e.g. based on software, cloud computing or similar. System controller 15 communicates with the internal controller 17 of resource 13, in order to control the behaviour of resource 13, namely its power consumption. The resource 13 may be controlled either in an on-off manner, implying pulse-width modulation to increase or decrease consumption averaged over time, or may be able to consumer power at different rates.

[0035] In the following the description, the concrete example of a building provided with an HVAC system with controllable demand is used as the electrical power consuming resource 13. However, as mentioned above, the exact same principle applies to other electrical power consuming resources with controllable demand are possible, such as water pumps (e.g. for draining, filling reservoirs for drinking water or pumped storage), electric vehicle charging stations, domestic battery arrays, or any other electrical power consuming resource which has at least a certain degree of controllable flexibility in its power consumption.

[0036] The electrical power distribution system 1 may comprise any number of such electrical power consuming resources 13 with controllable demand.

[0037] The key to the present invention is that the variable demand of the at least one resource 13 is commanded directly under the command of the system controller 15, which is itself controlled by the system operator on the basis of the power currently being produced by the electrical power generators 3, 5, 7. This direct control enables the power consumption of the at least one resource 13 to be varied very rapidly, without the lags associated with demand incentivization via a variable pricing mechanism.

[0038] In brief, each resource 13 is modelled analogously to a battery (i.e. a virtual battery model 19) to determine the range of power it can draw at any given time while still remaining within operational constraints (e.g. a comfortable interior temperature range for a building, a state of charge range for a battery, a level of water range for a pump and so on). This range can be expressed either as a maximum or minimum power level, or as a flexibility envelope, which provides availability time predictions of power levels changes from a given baseline, depending on the time of the day.

[0039] Furthermore, the use of a virtual battery model 19 enables empirical determination of the model rather than requiring an a priori model. This reduces computational burden and does not require knowledge of the details of each resource 13 with controllable demand, but does imply a training period in order to determine the model.

[0040] Another aspect of the invention is the incorporation of uncertainty quantification into the method, with risk measures being used to formulate robust uncertainty sets which take the risk preferences of the operator of the electrical power consuming resource 13 in question.

[0041] At a basic level, the method of the invention comprises steps of:

[0042] - determining the virtual battery model 19 of the at least one resource 13,

[0043] - determining a set of feasible power consumption requests on the basis of said virtual battery model 19 in function of the current state of the resource 13 and the external conditions (e.g. temperature, insolation etc. in the case of a building provided with an HVAC system); and

[0044] - sending requests to the resource 13 to increase or decrease its power consumption on the basis of power available on the power distribution network and whether the requests comply with the set of feasible power consumption requests.

[0045] The generalities of the virtual battery model 19 model and the determination steps will be described first, and then the entire, rigorous methodology will be explained in detail.

[0046] Virtual battery model 19: generalities

[0047] Figure 2 illustrates the general construction of the virtual battery model 19, and its three blocks.

[0048] First block 19a takes the current state s t of the resource 13 at time t, the current request r t (if any), and the current external conditions e t (e.g. temperature, irradiance etc.) to compute the state change due to nominal controller behavior. This is motivated by the intuition that the state is driven toward a nominal value in request-free periods. This nominal value is dependent on the behavior of the internal controller 17, which in turn is influenced by the external conditions like temperature or irradiance. This model does not require a specific internal controller 17 structure, but works for a variety of controllers.

[0049] Second block 19b takes r t and e t , as well as a one-step prediction of the external conditions e t+1 at timestep t + 1 to capture the state change due to changes in external conditions. [0050] Third block 19c receives the request r t and determines the state change incurred by this request. When the resource 13 receives requests, the sign of the requests determines the direction of the change. This can be envisioned as charging or discharging the virtual battery with thermal energy.

[0051] The virtual battery model 19 hence predicts the new state s t+1 at timestep t + 1 from inputs as discussed above.

[0052] The different blocks 19a, 19b, 19c of the model can be learnt from data directly. For first and second blocks 19a, 19b, a (possibly nonlinear) model of the nominal state is learned from data of periods without requests, i.e. with the resource 13 operating normally, under the control of its internal controller 17 alone and subject to external conditions, as illustrated in the flow diagram of figure 4. An additional parameter in block 1 and the parameters in block 3 are learned from data of periods with requests for increased or decreased consumption, as illustrated in the block diagram of figure 5, and as will be explained further below.

[0053] Having forecasts for the external conditions, the state change can be predicted for different requests. If the predicted states do not violate the state constraints for a given request sequence, this sequence is classified as fulfillable, otherwise it is classified as not fulfillable. All request trajectories of a fixed length that are classified as fulfillable are collected in the set of feasible requests, as determined by a flexibility forecasting system as illustrated in figure 3. This set of feasible requests helps to distinguish between fulfillable and unfulfillable requests, and for a given request trajectory it can be determined whether it lies in the set or not.

[0054] To consider additional disturbances and uncertainty, a notion of conservativeness is encoded in the parameters of the third block 19c through the use of risk measures. A general approach to quantifying uncertainty with risk measures is presented in D. Bertsimas, D. B. Brown, "Constructing Uncertainty Sets for Robust Linear Optimization," Operations Research, 2009, 57(6): 1483-1495, https://doi.org/10.1287/opre.1080.0646 but with a focus on financial applications. [0055] This approach allows different confidence levels a for the ability to fulfill flexibility requests to be defined, which may also serve as a free parameter for the user to trade-off possible incentives for promising flexibility and penalties for not being able to provide this flexibility. This uncertainty quantification is again fully data-driven, requiring the same data as for the parameter identification of the third block 19c.

[0056] Flexibility can be reported to a higher-level Demand Response management system implemented in system controller 15 or elsewhere, by giving the maximum p max and minimum p min available power for certain time intervals for the one or more resources 13, together with a confidence of those availabilities. In this way, an aggregation at the higher level is facilitated. A schematic of the prediction of the minimum and maximum available power levels P min , p max for a time interval of N steps, starting from state s t with confidence level a and predictions of the external conditions e t , ... , e t+N , is given in flexibility forecasting system illustrated in Figure 3.

[0057] It should be noted that both the virtual battery model 19 and flexibility forecasting system 21 are typically implemented in software.

[0058] Detailed methodology

[0059] In the foregoing description, the at least one electrical power consuming resource 13 with controllable demand is a building with a HVAC system. The skilled person knows how to adapt the principles described below to other types of resource 13 such as, but not limited to, those mentioned above.

[0060] Special notation used below: The indicator function of the set {0} is denoted by X, so and the request trajectory [r 0 ,...,r k-1 ] as r 0:k-1 or simply r if the context is clear. The N-dimensional probability simplex is given by 0 and 1 denote a vector of appropriate size of zeros or ones, respectively, and the Kronecker product is denoted as k is the length of the particular request trajectory, i.e. the number of time steps (which are typically 15 minutes or 1 hour each step but other lengths of time are possible) being considered for a particular sequence of requests.

[0061] Model formulation

[0062] It is assumed that the state of a building 13 at time t, in terms of its thermal capacity, can be described by a scalar s t , bounded by s min and s max (without loss of generality, s min = 0 and s max = 1). The state bounds depend on the thermal bounds which are related to comfort constraints in the building 13 which is the resource 13 in the present example, meaning that s t = 0 indicates that no energy can be extracted from the virtual battery model 19 of the building 13 without violating comfort constraints, and s t = 1 indicates that no extra energy can be inserted into the virtual battery model of the building 13. In other words, if s t = 0, the temperature of the building 13 cannot be allowed to decrease further in the context of electrical heating, or to increase further in the context of electrical cooling, and if s t = 1 , the temperature of the building 13 cannot be allowed to rise further in the context of electrical heating, or to decrease further in the case of electrical cooling, without exceeding comfort constraints (e.g. a lower bound of 19°C and an upper bound of 24°C, though these boundaries can be set as required). More generally, storing/extracting energy in the virtual battery model 19 represents increasing/decreasing the amount of power consumed by the building or other resource 13.

[0063] The following assumption is made for the internal controller 17:

[0064] Assumption 1 : The internal controller 17 is able to keep the state s t in (0, 1) for all t in nominal operation. When receiving flexibility requests, the internal controller 17 follows them as close as possible, without violating the state bounds (i.e. comfort constraints).

[0065] For now, the state s t is abstract, but a meaningful definition is introduced below.

[0066] The desired behaviour of the virtual battery model is as follows:

1. Under nominal operation, the state is dependent on the internal controller 17 behavior, which is in turn mostly dependent on the external conditions 2. In normal operation or after a sequence of requests, the controller drives the state towards its nominal value. This behavior is not present when receiving requests from the system controller 15.

3. When receiving requests from the system controller 15, the state of the building 13 (i.e. its internal temperature) should change in direction of the request, but with possibly differing speed due to the buildings’ equipment. An additional state change is incurred by a change in external conditions.

[0067] For modeling the state evolution in dependence of relative consumption requests r t (i.e. increasing or decreasing the planned consumption by r t at time t), we define the following model.

[0068] Definition 1 (Virtual Battery Model 19). Let denote a relative consumption request at time t with respect to a baseline, and let be the positive and negative part of the request. With the external influences given by and a function to approximate the nominal state in a request-free evolution, we model the state evolution as

[0069] depending on the parameters p + , p~ and p f . This model encompasses all three model blocks of figure 2.

[0070] Note that the approximated state s t given by the virtual battery model is no longer bounded between 0 and 1. Furthermore, s t taking a value smaller than 0 or larger than 1 corresponds to a situation where the true state saturates at its boundaries and the internal controller 17 is not able to fulfill the relative consumption request from the system controller 15. Therefore, the state is associated with being in [0,1] with feasible requests, and with infeasible requests, as will be explained below.

[0071] The training of the virtual battery model is a two-step approach. Firstly, a nonlinear model f(e t ) is learned from data obtained during the nominal operation of the buildings’ controller, without any requests being received from the system controller 15, as illustrated in figure 4. Then the coefficients p + ,p- and P f can be identified respectively from request periods, in which an increased or decreased consumption is requested by the system controller 15, and the recovery periods in which no request is received from the system controller 15 and the internal controller 17 operates under its own internal algorithm, as illustrated in figure 5.

[0072] For the learning approach, the following formulation is leveraged, which describes the dependence of the predicted state s k on the starting state s 0 and the applied request trajectory r 0:k-1 , denoting the vector of binary variables by - k is again the number of time steps considered in this particular sequence.

[0073] Lemma 1 : For a given state s 0 and a request trajectory r, the state s k determined by the battery model evolution in [Equation 1] is given by:

[Equation 2]

[0074] with

[0075] Utilizing a linear model and regarding unmodeled nonlinear dynamics or disturbances as uncertainty introducing quantities is used by prior art approaches in robust learning-based and set-membership based model predictive control. Contrary to prior art approaches, in the present approach, unmodeled dynamics and disturbances are embedded in the parameter uncertainty for p + and p~, as explained below. Flexibility envelopes are also considered with respect to an uncertainty set computed from the parameter samples, by using risk measures.

[0076] Parameter identification

[0077] For uncertainty quantification, request sequences are considered, which are of the form r 0:k-1 , either strictly positive (i.e. r i > 0, i = 0, ..., k - 1) (when the resource 13 is requested to consumer more power than it would otherwise) or strictly negative respectively (i.e. r i < 0, i = 0, ..., k - 1) (when the resource 13 is requested to consume less power than it would otherwise), for generating parameter samples of p + or p-. r 0:k-1 is assumed to be followed by a request free period, and denote the corresponding state trajectory by s 0:k . We either have that the requests are fulfillable, i.e. 0 < s i < 1, i = 0, ...,k which we denote by setting an index I = k, or not fulfillable at a certain point I, with I = argminq s.t. s q = 0 or s q = 1. Assuming a state evolution as given by the battery model, we have [Equation 3]

[0078] Therefore, a parameter sample takes the form

[0079] To identify candidates for p f , state sequences s 0.k are considered that occur after a request period, so that r 0:k-1 = 0 and r k ≠ 0. Furthermore, only data is used from the recovery periods that fulfill |s t - f(e t )| > δ for some threshold , for identifying p f . This ensures to capture the internal controller 17 based recovery period and not small perturbations due to model mismatch.

[0080] As in the identification of p + and p-, we can determine an index I, where we either have that |S i - f(e i )l > δ, i = 0, ..., k + 1 (thus I = k + 1) or 1 = argmin q s.t. Using the request-free evolution of the battery model (i.e. without requests from the system controller 15 to consume more or less power), the following minimization problem can be formulated, whose solutions give samples of the p f parameter: [Equation 4]

[0081] In the following, we will assume to have sample sets for the parameters p + ,p~, denoted by P + ,P- with |P + | = n 1 , |P _ | = n 2 . Furthermore, it can be assumed that sample sets are ordered, so The parameter p f is assumed to be fixed after identifying possible candidates, e.g. through taking the maximum or average over the collected samples. This choice is deliberate, because treating p f as stochastic and following through with the approach outlined below introduces combinatorial issues and nonlinearities in the uncertainty set computation, while having a minimal impact on the flexibility envelope computation, due to its influence in the recovery periods only.

[0082] The set of feasible requests: set formulation [0083] Using the result of Lemma 1 above, the set of feasible request trajectories of length k, starting from a state s 0 , can be formulated as: [Equation 5]

[0084] This set is of interest for identifying specific feasible request trajectories for the flexibility envelope characterization.

[0085] For ease of notation, [Equation 2] can be written in the two following ways: [Equation 6] [Equation 7]

[0086] where [Equation 8]

[0087] groups all the nonrequest parts (i.e. the terms which do not directly depend on requests from the system controller 15 to consume more or less power) and [Equation 9]

[Equation 10]

[0088] group the request parts either depending on the parameters p + ,p-, or the request trajectory indicated by . The set of feasible requests can then alternatively be written as

[0089]

[0090] Uncertainty characterisation

[0091] Considering a fixed request trajectory r, its feasibility depends only on the parameters p + ,p-, as indicated by [Equation 12], and therefore on the choice of the . By combining all possible p + ,p- from the identified sets P 1 ,P 2 we construct a sample set for each denoted by In the following, a single set from the intersection in [Equation 13] is considered and therefore the index I is dropped. We write the set of samples as and the data matrix as A = [a 1 , ..., a N ]. On the nature of the samples, the following assumption is made:

[0092] Assumption 2. The unknown a is a random variable on a finite probability space with |Ω | = N,F = 2 Ω and support

[0093] wherein:

Ω is the sample space of the finite probability space.

F is the event space of the finite probability space. is the probability function of the probability space.

[0094] On the one hand, having as a random variable on a finite probability space is restrictive, since the true sample space Ω might be larger or even continuous. On the other hand, since data is the only knowledge we have about a, this assumption is aligned with the data-driven approach, and useful in practice (see D. Bertsimas and D. B. Brown, “Constructing uncertainty sets for robust linear optimization,” Operations Research, vol. 57, no. 6, pp. 1483- 1495, Dec. 2009 and assumption 3 below).

[0095] Robustness via Conditional Value at Risk

[0096] Having laid the foundations for representing uncertainty in the set of feasible trajectories, a specific risk measure is now exploited, the Conditional Value at Risk (CVaR), as a way to specify how the uncertainty is dealt with. Specifically, user preferences are taken into account, to trade off conservativeness and the size of the feasible set. For this, results from Bertsimas and Brown (op cit) are relied upon.

[0097] In the foregoing, the main concepts for the specific approach outlined here are presented, and reference is made to S. Uryasev, “Conditional value-at-risk: optimization algorithms and applications,” in Proceedings of the IEEE/IAFE/INFORMS 2000 Conference on Computational Intelligence for Financial Engineering (CIFEr) (Cat. No.00TH8520), 2000, pp. 49-57, and F. Delbaen, “Coherent risk measures on general probability spaces,” Advances in Finance and Stochastics (Essays in honour of Dieter Sondermann), vol. 35, 01 2002. [0098] Definition 2 (Conditional Value at Risk). Let (Ω,T, IP) be a finite probability space with and let X be a linear space of random variables on Ω . The conditional value at risk for X ∈ X with probability level a is defined as [Equation 14]

[0099] with Q its generating family, given by

[00100] An intuition about the meaning of CVaR can be drawn from its continuous probability space definition for atomless distributions (this intuition is inexact in the finite case, but nevertheless helpful). If we consider a constraint , then C gives the expected constraint violation in the α-% worst cases. This motivates the use of the risk-aversion constraint Note that this constraint implies both constraint satisfaction in expectation (note that choosing α = 1 corresponds directly to constraint satisfaction in expectation) and constraint satisfaction with probability ≥ 1 - α.

[00101] Risk aversion constraints are applied to the individual constraints in [Equation 13] and utilize the reformulation with robust uncertainty sets presented in Theorem 3.1 of Bertsimas and Brown (op cit). This is possible since CVaR is a coherent risk measure (i.e. it fulfills the properties of monotonicity, translation invariance, convexity, and positive homogeneity).

[00102] Theorem 1. For as in Assumption 2, we have [Equation 15]

[00103] with and the family of generating measures for CVaR α .

[00104] Note that Theorem 1 is not limited to CVaR, but holds for general coherent risk measures. It provides a closed form description of the set of request trajectories that fulfill the risk aversion constraint, by taking those that robustly fulfill constraints with respect to the uncertainty set U. For the feasibility of a given r, this implies checking constraint satisfaction for all α ∈ U and for all uncertainty sets corresponding to the k + 1 different constraints.

[00105] From Definition 2, the uncertainty set construction can directly be observed as in Theorem 1 for CVaR α , namely with the data matrix A. In the case of uniform probabilities of the samples and α chosen as for some j ∈ {1, ..., N}, the uncertainty set is the convex hull of all j-point averages of the samples in These are the uncertainty sets that are focused on in the following, for two reasons: Firstly, a weighting of the samples is not considered, which makes the choice of uniform probabilities natural. Secondly, for N large enough, the choice of a as offers a fine discretization, while also providing a straightforward way of computing the uncertainty set. The advantage of computability therefore outweighs the limitation of choice through the discretization.

[00106] Application

[00107] The virtual battery model 19 with uncertainty quantification is now used to show how feasibility of fixed request trajectories can be tested. This has direct application in the computation of flexibility envelopes, which is demonstrated in a simulation example.

[00108] Feasibility of Request Trajectories

[00109] To test whether a request trajectory r is classified as feasible, an uncertainty set U is built for a given and the fulfilment of the constraints in [Equation 13] is checked (i.e. if r fulfils all said constraints, the request is feasible, but if not, it is infeasible). However, characterizing the convex hull of all ;-point averages is not straightforward, and constructing and testing all combinations is combinatorially infeasible already for moderate values of J and N. To alleviate this issue, we make the following observation. Due to the linearity of the α l (p + ,p-) from [Equation 6] in p + ,p-, we can consider the j-point averages of the (p + ,p-) pairs in P + x P- , instead of their induced a samples, and whether the request is within the set of feasible requests of [Equation 11] is checked because of the equivalence of [Equation 6] and [Equation 7], We denote this set of ;-point averages by [00110] To test the containment of r in we only need to consider the tuples in leading to the minimum and maximum values in [Equation 7]. This can be done in the following manner for all I ∈ {0, ... , k}:

1. Find p 1 ∈ P + x P - that minimizes (or maximizes) .

2. Starting from p 1 , iteratively find p 2 , ...,p j ∈ P + x P- s.th. = (or arg max).

3. Let

4. If is classified as infeasible.

[00111] Due to the linearity of the considered cost function, the solution P 1 in step 1 is attained at one of the four points

[00112] Flexibility Envelopes

[00113] Available flexibility for each time in a day ahead prediction is quantified, with flexibility envelopes similar to the ones introduced in R. D’hulst et al., “Demand response flexibility and flexibility potential of residential smart appliances: Experiences from large pilot test in Belgium,” Applied Energy, vol. 155, pp. 79- 90, 2015, and used in J. Gasser, H. Cai, S. Karagiannopoulos, P. Heer, and G. Hug, “Predictive energy management of residential buildings while selfreporting flexibility envelope,” Applied Energy, vol. 288, p. 116653, Apr. 2021.

[00114] Instead of computing energy bounds, the virtual battery model 19 with its state bounds is used to define the flexibility envelopes with explicit power levels based on a given baseline. The predicted states under nominal operation, given by f (e t ) for each t, are used as starting states for the pointwise flexibility computation. For the discretized power levels of interest, a request trajectory is computed as the needed deviation from the baseline to keep this power level, and then the feasibility of this trajectory is tested as presented above. This is done in an iterative fashion with increasing length of the considered trajectory, to get the maximum time of sustainability of those power levels. The maximum sustainable time is limited to 24 hours, since forecast errors might negatively influence the quality of longer predictions. An example of flexibility envelopes can be found in Figure 6. [00115] State Definition [00116] In the experiments, a specific state definition that fulfills the requirements of the abstract state s t as defined above is used. The two key quantities for this are: the available time of running the flexible assets of the building 13 (i.e. its HVAC system) at minimum power (denoted by ) and the available time for maximum power (denoted by ), without violat ing thermal constraints, e.g. an interior temperature between 19°C and 24°C. It is assumed that these are provided at each time step ^ by the controller. Some commercial building management systems are able to provide measurements of this kind, for others, it is possible to estimate these quantities from equipment specifications and current measurements. [00117] Following Assumption 1, it is assumed that 0. [00118] Definition 3 (State Variable). The state s t ∈ ℝ of a building at time t is defined as [Equation 16] [00119] By definition, we get that s t ∈ [0,1] at all time instances ^. Moreover, this state captures the behavior we would expect from a battery like system: If the state is close to 1, a high consumption cannot be sustained for a long time, and therefore not much more additional thermal energy can be introduced into the system (i.e. is “stored” according to the virtual battery model), and vice versa for a state close to 0. [00120] Simulation results [00121] The flexibility envelope prediction for the SimpleHouseRad-v0 model from the simulation model library Energym was considered. SimpleHouseRad-v0 is a lightweight Modelica model house with a 5-minute simulation timestep, modeled as a single zone, equipped with a heat pump whose electrical power fraction is the control input (i.e. it is in the range [0,1]). The building 13 model is controlled by a PI controller that measures and reports the state introduced above based on a simplified model of the building. This PI controller is also used to track the request trajectories as close as possible without violating the temperature bounds of 19 and 24 °C.

[00122] Data collection for constructing the virtual battery model is performed during the first 6 weeks of a year, using measurements of external conditions (the external temperature and irradiance in this example) from the city of Basel, Switzerland. In the first three weeks, no requests are sent to the building, such that state data under nominal controller operation is collected for learning the nonlinear model f(e t ), using a kernel ridge regression model with squared exponential kernel. During the second three weeks, random but constant requests are sent to the building for random durations between 1 hour and 4 hours, alternating with request-free periods of 4 hours to 15 hours. Since the control input is the heat pump power fraction, input requests are considered instead of power requests. This data collection resulted in a total of 22 samples for p + and 20 samples for p-, giving N = 440 possible parameter pairs.

[00123] The flexibility envelopes of 10 days were computed, starting from the 22nd of January, for a weather file from Lausanne, Switzerland. Different values of the uncertainty parameter j (and therefore α) are used, and these were compared the results with the true available flexibility.

[00124] An example of this evaluation is given in Figure 6 for day 3 of the chosen 10 days in the test data. A decrease in conservatism is observable for an increase in j.

[00125] The pointwise predicted availability (in number of timesteps) vs. the true availability of the control inputs, is shown in the first three plots in Figure 7. Points that lie on the diagonal or slightly above are desirable, while points that are below the diagonal represent predictions that are more optimistic than the actual availability (and are therefore infeasible). For this specific day, no infeasible predictions for j = 1, were observed while for j = 200 and j = 440 the infeasible predictions make up about 3.4% and 15.7% respectively.

[00126] We get the following results regarding the percentage of infeasible predictions and mean absolute prediction error, displayed in the right plot of Figure 7. The percentage of infeasible predictions, over the course of the 10 days, is at about 0.45% for j = 1, and it rises up to about 14.80% for j = 440. On the other hand, the mean absolute prediction error decreases from about 46 timesteps for j = 1, to about 20 timesteps for j = 440, indicating a tradeoff between conservativeness and prediction error.

[00127] This tradeoff, together with the incentives for providing flexibility and penalties for not being able to provide the promised flexibility, can inform the selection of an uncertainty parameter a to be used in a flexibility scheme.

[00128] Although the invention has been described in terms of specific embodiments, variations thereto are possible without departing from the scope of the invention as defined in the appended claims.

[00129] List of Main Parameters and Variables:

[00130] e t : Vector of measurements of the external conditions at time t. May include values like external temperature, irradiance, but also time of the day, day of the week, etc.

[00131 ] s t : State of the system at time t. This is a scalar value which might be related to indoor temperatures in relation to temperature bounds, stored energy, water levels in the case of a pump, etc. It represents the virtual state of charge of the virtual battery.

[00132] r t : Relative consumption request at time t. Relative with respect to a consumption baseline which is defined through nominal controller behavior. Derived quantities are the positive and negative part of the request.

[00133] f(e t ): Function mapping the external conditions to the nominal state. Nominal state means the behavior of the state if the controller installed in the system runs with normal operation and does not receive consumption requests.

[00134] : Indicator function of the set {0}. Used to distinguish the cases of having requests and not having requests and therefore having different parts of the virtual battery model being "active”. [00135] p f : Parameter that determines how fast the state converges to its nominal value if no requests are received. Important to capture the state behavior in “recovery” periods after requests.

[00136] p + : Parameter that determines the linear state change due to positive relative consumption requests.

[00137] p-: Parameter that determines the linear state change due to negative relative consumption requests.

[00138] α: Uncertainty parameter to be set by the user. In the range (0,1]. In practice, we only consider a discretized subset of this range due to our standard choice of risk measure.

[00139] p: A risk measure. The above-defined approach works theoretically for general coherent risk measures, but in practice conditional value-at-risk (CVaR) is used.

[00140] P: Sample set of the parameters for p + ,p _ . [00141] U α : Uncertainty set for checking the request feasibility.