# Optimization approach for the aggregation of flexible consumers

Mohammad Dib, Rouwaida Abdallah, Omar Dib

► To cite this version:

Mohammad Dib, Rouwaida Abdallah, Omar Dib. Optimization approach for the aggregation of flexible consumers. Electronics, 2022, 11 (4), pp.628. 10.3390/electronics11040628. hal-04132806

HAL Id: hal-04132806

https://hal.science/hal-04132806

Submitted on 19 Jun 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Optimization Approach for the Aggregation of Flexible Consumers

Mohammad Dib <fnref n="1" />,*, Rouwaida Abdallah <fnref n="2" /> and Omar Dib <fnref n="3" />,*

**Abstract:** In an electric distribution system, the management of peak demands is becoming increasingly difficult. Every method we have to flatten the consumption curve greatly reduces the energy generation costs, CO₂ emissions, and congestion in the generation, transmission, and distribution systems. Therefore, we can act on consumers' consumption, especially when we know that some consumers can be interested in reducing their consumption levels for monetary compensations. This can be done by reporting a part of consumption or shifting it. For this, a new profession called aggregation is born to manage the flexible consumers and meet the network requirements. To maximize their revenues, aggregators need to own an intelligent system to manage their portfolio of flexible consumers. They should optimize the way they modify the load curve of their flexible assets by respecting the system requirements and a set of consumer constraints. In this article, we address this task by proposing a Mixed Integer Linear Programming (MILP) formulation for two different modes: The economic mode (Evaluation of the potential of the portfolio to generate benefits. The aggregator uses this mode to make bids on the energy market) and the dispatch mode (to be used in an operational situation to respect the bids already submitted). Experimentation studies on real and random in-stances (>1000 instances) demonstrate the effectiveness of the proposed MILP.

**Keywords:** demand response; aggregation; load deformation; smart grids; energy transition

## 1. Introduction

The energy transition promotes intermittent and de-centralized sources of power generation that are usually variable and hard to control since their production is independent of the system's needs. At the same time, it is accompanied by a reduction in conventional generation capacity (nuclear and coal) [1,2], which de facto reduces the traditional levers of flexibility in the system. These two phenomena radically complicate the crucial task of maintaining a permanent balance between production and consumption in the electricity system, especially during peak periods [3].

In the past, energy providers have tried to encourage customers to consume more power at night by using reduced nightly prices. Flexible consumers are very different because the decision-making process shifts from the consumers to the operators meaning we can have a much more significant impact on the consumption curve and start coordinating consumers [4].

To meet this challenge, flexibility in demand (i.e., consumers convinced to reduce their consumption under some constraints) can be mobilized on a larger scale than was previously the case and made available to the system [5]. That is the role of the aggregator [6,7], who remotely controls flexible demand at least in part. The aim is to help power systems during peak demand hours or contingencies [7].

The aggregator monitors the consumers' consumption in real-time and modulates it in an acceptable manner (for instance, asking to postpone or bring forward a portion of the consumption of electric heaters or cold rooms, asking to rearrange specific production schedules, etc.). The aggregation of many such modulations twists the general consumption

<figure><img src="image_2.png" /></figure>

### check for updates

**Citation:** Dib, M.; Abdallah, R.; Dib, O. Optimization Approach for the Aggregation of Flexible Consumers. *Electronics* **2022**, *11*, 628. https://doi.org/10.3390/electronics11040628

Academic Editors: Sawsan Al Zahr, Jordi Badosa and Juan-Antonio Cordero-Fuertes

Received: 31 January 2022

Accepted: 11 February 2022

Published: 17 February 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

<figure><img src="image_3.png" /></figure>

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

<footnote n="1">¹ Engie, 1 Place Samuel de Champlain, 92400 Courbevoie, France</footnote>

<footnote n="2">² CEA, LIST, 91120 Palaiseau, France; rouwaida.abdallah@cea.fr</footnote>

<footnote n="3">³ Department of Computer Science, Wenzhou-Kean University, Wenzhou 325060, China</footnote>

<footnote>* Correspondence: mohammad.dib@engie.com (M.D.); odib@kean.edu (O.D.)</footnote>
profile on the demand side [8,9], making it possible to quickly remedy an unexpected fluctuation in intermittent generation (wind or solar).

The literature contains a significative amount of proposals in the context of DR (e.g., [10–12]). However, the aggregation of flexible demands still raises a few problems [13]. Unlike conventional generation means, electricity demand is located among many agents, spread across various voltage levels. They do not have access to the price signals from electricity markets (spot or adjustment) for the most part. They also have heterogeneous consumption characteristics, with widely varying constraints in terms of flexibility poten- tial (volume, duration, and accepted frequency of modulations). It is generally accepted that system operators cannot directly manage these constraints and their diversity [14,15]. The aggregator, therefore, acts as an interface between, on one side, the demand units or consumers (offering flexibility) and, on the other side, the system operators and/or electricity market participants.

To meet its commitments to the system operator and/or market participants, the aggregator will have to solve a problem whose structure is similar to optimizing a fleet of conventional power plants [16–18], with a much higher level of complexity [19], how- ever. This involves complying with instructions received and supplying the modulation profiles actually sold while respecting the customers’ constraints. This needs to be done as economically as possible so that the aggregation business is profitable [20].

The size of the problem (number of flexible demand units to manage) and the diversity of constraints to be taken into account are two significant challenges. The storage capacity inherent to such flexibility introduces arbitrage options that are hard to grasp. Lastly, the calculations must be done in a very short computation time.

The availability of a computational tool capable of taking these specificities into consideration influences the commercial capacity of the aggregator and is critical for its business model [21].

In [22], a blockchain-enabled transactive energy platform entitled Electron Volt Ex- change was introduced. The integration of blockchain allows a secured process for handling individual bids (prosumers) and collective bids (aggregators). The authors in [22] also model the flexible resources with a single form of equation in order to represent various flexible resources. However, this method of modeling does not take into consideration the operational constraints of flexible assets.

Unlike the work done in [23], for individual households equipped with various domestic loads, which aims to build an advanced solution to schedule the day-ahead power consumption, we propose in this article a solution able to aggregate the flexibility of many assets under industrial constraints in order to sell this flexibility on the electricity market.

In this article, we propose also a novel manner to represent the deformation of the load profile of a given asset. With our proposal, we can, at the same time, interrupt an asset and report its consumption.

This paper presents an exact approach for aggregating consumer flexibilities in an electric distribution system. We propose an optimization approach allowing, firstly, the aggregator to gather flexibility and generate bids on the energy market. Once the bids are accepted by the energy market (as submitted or modified), the aggregator has a target on volume to be respected (a volume to be interrupted or a volume to be added for each time slot). Our approach, secondly, allows the aggregator to find the best sequence of deformations to be chosen to respect his engagement.

## 2. Flexible Consumers

A flexible consumer is a consumer who accepts that an aggregator acts on his con- sumption by respecting a set of rules that he has defined. Sometimes, this flexible consumer offers several interruptible resources (such as an electric heater, a cold room, etc.). Pumping stations and water treatment plants are an example of flexible assets. These facilities could be selected by our method to deform their load curve (by interrupting them or by shifting
a part of their electrical consumptions). The aim will be to minimize the cost of electricity
while ensuring operational limits.

To consider the specificities of each of those resources, separately modeling each of
them is required.

A flexible or interruptible resource is a unit that consumes energy and is subject
to several technical constraints. To correctly model this resource, a certain number of
constraints linked to its functioning, and valid on all the time horizons, must be taken into
consideration, such as:

* Ramp-up power rates.

* Ramp-down power rates.

* Response time when a deformation profile is activated.

* Power consumption on each time slot.

* Maximal power on each time slot: so we cannot increase the consumption beyond this maximum.

* Minimal power on each time slot: so we cannot go below this minimum.

* The minimal duration of interruption: The deformation profile, if applied, must last at least for a minimum time.

* The maximal duration of interruption.

* Delay between two interruptions: It is the time to wait between two consecutive interruptions.

For some specific periods, the following constraints must be respected:

* The maximal number of interruptions done during the period: for example, interrupting a cold room more than five times during ten consecutive hours is banned.

* The maximal interruption duration: For example, stopping a cold room for more than five consecutive hours is banned.

* Maximal cumulated interrupted volume: The cumulated volume (energy) to be interrupted must not exceed a maximum value.

Some constraints involving a set of resources over a predefined period must also be
respected, such as:

* Exclusive activation between a set of resources: this is useful for some consumers who do not want to interrupt more than one resource at the same time.

* The maximal number of interruptions on a set of resources.

* The maximal duration of interruption on a set of resources.

* The maximal cumulated interrupted volume on a set of resources.

### 3. Deformation Profiles

In this article, the choice of modeling flexible consumers with "deformation profiles" was made. These contract-based deformations can be applied to the consumption of any interruptible resource over any time slot. Another advantage of this representation is that the consumption of an energy asset can be interrupted and shifted easily.

In an actual situation, flexible assets have power consumption for every time step that is called the nominal consumption. Flexible assets behave precisely like any fixed demand when no deformation profiles are applied. To adjust the consumption, deformation profiles can be applied.

This section will define deformation profiles under their raw form. This form is called a "normalized deformation profile". Normalized deformation profiles can be seen as shapes applied to the nominal consumption. The basic rules are:

* Not more than one deformation profile can be active on a flexible resource at the same time.

* There is a downtime after applying a deformation profile during which no other deformations can be applied.

* When deformation is applied on a flexible resource, the customer should be paid to compensate for the inconvenience caused.
Deformation profiles exist in small numbers under their raw form (normalized deformation profiles). The strength of those normalized deformation profiles is that their durations can be stretched from two periods to as many periods as we like, and they can be started and stopped at any given time.

Each normalized deformation profile is defined on a normalized period of one unit. When a normalized profile is activated, it can be stretched between a minimum duration and a maximum duration of interruption for a flexible resource. The normalized period is split up into several segments. For each segment, we have:

1. The start of the segment: UnitStartTime UnitStartTime ∈ [0, 1].

2. The end of the segment: UnitStartTime UnitEndTime ∈ [0, 1].

3. The value "ValueStart" at the beginning of the segment in percentage.

4. The value "ValueEnd" at the end of the segment in percentage.

5. The type of the segment: Action or Reaction.

Depending on the normalized duration of each segment, the values at the beginning and the end of the segment, the effective duration of the applied profile (non-standardized, in minutes), the different methods of applying the profiles for each time step *t* included in the deformation interval are defined as follows:

1. A value *V(t)* is calculated as a linear interpolation between *ValueStart* and *ValueEnd* of the segment after stretching.

2. If the segment is of type *Action* and if *V(t)* ≥ 0: in this case, the consumption *C(t)* will be increased:

$$C(t) = C(t) + \max(P_{max}(t) - C(t); 0) * V(t)$$

3. If the segment is of type *Action* and if *V(t)* ≤ 0: in this case, the consumption *C(t)* will be decreased:

$$C(t) = C(t) + \max(C(t) - P_{min}(t); 0) * V(t)$$

4. If the segment is of type *Reaction*, the interrupted energy during the *Action* period will be compensated during the *Reaction* period as follows:

$$C(t) = C(t) + \text{InterruptedEnergy} * V(t) / \text{durationOfSegmentAfterStretching}$$

Let us introduce some examples to illustrate the notion of normalized deformation profile and how to apply it on a flexible resource.

**Example 1.** In a 3 h model, a flexible resource has a nominal consumption of 100 kW for the first hour, 105 kW for the second hour, and 103 kW for the third hour (see Figure 1).

A normalized deformation profile will be applied, with an action segment of 100% reduction and a reaction segment of 30% increasing (see Figure 2). We can either apply this deformation starting from the first or second period. If we use it during the first period, the consumption is first reduced by 100%, which causes a drop of 100 kW in consumption. Afterward, the second part will catch up to 30% of the lost power so that the customer will consume an extra 30 kW during the second period. The resulting consumption of the customer is thus (0 kW; 135 kW; 103 kW) as illustrated in Figure 3. Similarly, if we apply it during the second period, the consumption would be (100 kW; 0 kW; 134.5 kW) as illustrated in Figure 4.

**Example 2.** As we said, every normalized deformation profile can be stretched over time. Consider the normalized deformation profile of example 1; Action: (−100%), Reaction: (30%). If we stretch this over four periods, the profile becomes Action: (−100%; −100%), Reaction: (30%; 30%).

**Example 3.** Consider the normalized deformation profile of example 1; Action: (−100%), Reaction: (30%). If we stretch this over five periods, the profile becomes Action: (−100%; −100%, −100%), Reaction: (30%; 30%).
<figure><img src="image_4.png" /><figcaption>Figure 1. The consumption of the consumers in example 1.</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Figure 2. The normalized deformation profile of example 1.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Figure 3. The resulting consumption when the deformation profile is applied starting from the first period.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Figure 4. The resulting consumption when the deformation profile is applied starting from the second period.</figcaption></figure>
4. Flexibility Aggregation and Price Signals

As mentioned before, some consumers’ consumption can be anticipated, postponed,
or canceled. These specific actions may have value in the electricity market and can bring
solutions to meet network requirements [24]. One of the primary roles of an aggregator is
to predict the electricity market prices correctly and then use those prices to evaluate his
portfolio of interruptible assets. This evaluation results in a sequence of interruptions to
maximize the global profit (revenues by selling interrupted volumes on the market minus
the cost of reported consumption minus incentive remuneration for the consumer).

It is not very challenging to forecast electricity prices, mainly when it covers a small
time horizon (1 to 10 days). In this article, the electricity prices are an input provided by an
industrial partner. Some used instances are based on historical prices, while others include
forecasted ones.

Two optimization modes are distinguished: On the one hand, the Economic mode is for a short-term period (typically 10 days with 1 h as time step) in which the aggregator will look at the sequence of calls to the interruptible assets that will maximize the difference between the immediate income of the deformation (reselling the non-delivered energy to the client with the spot market price), the loss of medium-term value from the use of “available stock” of calls to deformation, and the loss of the cashback to the holder of the interruptible assets. The economic mode allows the aggregator to estimate the monetary value of his portfolio at a given time *t*. If the aggregator has a good tool to predict electricity market prices and electricity consumption, he can estimate the future economic value of his portfolio. Based on the obtained results, the aggregator can make deals on the market and then make profits.

On the other hand, the Dispatch mode deals with a very short-term horizon (typically one day with 5 min as a time step) in which the aggregator will try to use the flexibility available in the portfolio to achieve a deformation target. Potential deviations from this rule will be penalized. Once the aggregator makes deals on the market with the Transmission System Operator (TSO), the objective is to keep promises. When the aggregator makes the deals, his portfolio can change (some assets become non-interruptible or interruptible, prices change, constraints change, etc.). In this case, the aggregator should use the dispatch mode to find the best solution, with the available interruptible resources, to meet the target he promises with minimum penalties and maximum profit.

The optimization model for the economic and dispatch modes will be presented in the
next section, and a non-exhaustive list of constraints will be given.

5. Problem Formulation: MILP

The aggregator needs to solve the flexibility aggregation problem (by finding a se-
quence of calls to flexibility assets) w.r.t. a set of constraints negotiated with flexible
consumers (owners of flexible assets). The final objective of an aggregator is to maximize
the profit by selling a maximum interrupted volume of electricity on the market and, at the
same time, by minimizing the induced costs (remunerations of consumers and the cost of
shifted consumption).

The first thing is to ensure that not more than one deformation can be active simulta-
neously. After that, a set of constraints must be respected, such as the minimum waiting
time between two interruptions (example: a waiting time must be respected between two
consecutive interruptions of a cold room) or the maximum duration of the interruption
or the maximum volume of interruption (some assets need a minimum volume to be in
standby mode). Another kind of constraint must sometimes be respected: constraints
coupling several assets during an interval of time. For instance, during a given time slot, it
is required to interrupt only one flexible asset (exclusive constraint), or a maximum number
of calls must be respected, etc.

In this article, the choice of modeling all the constraints as coupling constraints was
made. A coupling constraint can involve one (unary) or n flexible assets (n-ary).
The problem was formulated as a Mixed Integer Linear Programming Model (MILP).
Input data of this latter are the following:

* T: Set of time steps covering the time horizon.

* T_PROFILE: Duration in time steps for stretched deformation profile. This set contains unique elements.

* SUB_PERIOD: List of sub-periods. Each sub-period is defined over a set of time periods.

* MAP_SUB_T (s, t): s is a sub-period, and t is a time step. This map is defined if the t is a part of the sub-period s.

* RESOURCE: Set of flexible assets to interrupt.

* MIN_OFFTIME (res): Minimum waiting time between two interruptions for the flexible asset res.

* RICH_DEFORMATION_PROFILE: A set of enriched deformation profiles (stretched deformation profiles). Each one (called rdp) is linked to only one asset. Each rdp has a duration. An enriched deformation profile is computed for a flexible resource, a normalized deformation profile, and a duration.

* MAP_RESOURCES_RDP (res, rdp): is defined if the asset res is linked to the deformation profile rdp. A rdp is related to only one resource, but a resource can be linked to many rdp.

* RDP Duration (rdp): Duration of the rdp.

* DEVIATION (rdp, t, t_profile): The impact, in volume, on each time step, if rdp is activated (the effect might be negative or positive) starting from t.

* ALLOW (rdp, t): Binary parameter. It has one if rdp can be activated starting from t.

* OPP_VALUE (rdp, t): The revenue we can get if rdp is activated starting from t.

* COUPLING_CNSTR: Set of coupling constraints.

* MAP_COUPLING_RESOURCES (cc, res): Is defined if the asset res is involved in the coupling constraint cc.

* SUB_MAX_NUM Calls (s, cc): Gives the value of maximum calls for the constraint cc during the subperiod s.

* SUB_MAX_DUR Calls (s, cc): Gives the maximum allowed duration for all resources belonging to coupling constraint cc and during the sub period s.

* SUB_MAX_VOL Calls (s, cc): Gives the maximum allowed volume to be interrupted for all assets belonging to the coupling constraint cc and during the sub period s.

* IS_EXCLUSIVE (s, cc): Binary parameter. One of the coupling constraints cc is exclusive: It means that only one asset could be activated during the sub period s of the coupling constraint cc or 0 otherwise.

* EXCLUIMPACT (rdp, t, rdp2, tt) is defined if different assets linked to deformations rdp and rdp2, respectively, are mutually exclusive when activated on t (tt, respectively). This parameter will ensure that for an exclusive constraint cc, only one asset can be called at each time belonging to the sub-period of cc.

For the dispatch mode, we have additional parameters:

* TARGET_VOL_T(t): The target volume to be interrupted/consumed (negative or positive) for each time step.

* Penalties: The penalty used in our work is defined as a linear piecewise function for each time step with increasing slopes (so this function is convex).

* SEGM: Set of segments. Each segment represents a part of the penalty function (see Table 1).

* SEGM_PENALTY_UP_T(t, segm): Gives the penalty in EUR/kWh associated with the segment segm for the period t. This is the penalty to be used for the excess volume.

* SEGM_PENALTY_LO_T(t, segm): Gives the penalty in EUR/kWh associated with the segment segm for the period t. This is the penalty to be used for the missing volume.
<table><caption>**Table 1.** Illustration of an example for penalties calculation.</caption><thead><tr><th>Segment</th><th>Threshold</th><th>Penalty</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>0.1</td><td>0</td><td>If the gap to the target = 0.1 → penalty = 0.1 × 0 = 0</td></tr><tr><td>2</td><td>0.5</td><td>5</td><td>If the gap to the target = 0.5 → penalty = 0.1 × 0 + 0.4 × 5.</td></tr><tr><td>3</td><td>2</td><td>20</td><td>If Gap to the target = 1.8 → penalty = 0.1 × 0 + 0.4 × 5 + 1.3 × 20. In fact, the gap is dispatched on three segments (1.8 = 0.1 + 0.5 + 1.3)</td></tr></tbody></table>

The list of decision variables involved in our model is:

* CALL (rdp, t): Binary variable; its value will be set to 1 if the rdp is activated (the asset's load associated to the rdp is chosen to be deformed), 0 otherwise.

* MISMATCH_UP (t): Excess volume to the target by time step.

* MISMATCH_LO (t): Missing volume to the target by time step.

* SEG_MISM_UP (t, segm): The excess volume by time step and segment. This is important to ensure that we apply the correct penalty factor by segment.

* SEG_MISM_LO (t, segm): The missing volume by time step and segment.

Set of constraints:

(1) $\forall t, CALL(rdp, t) \le ALLOW(rdp, t)$
For each time step $t$, we cannot choose a flexible asset to interrupt if this is not allowed.

(2) $\sum CALL(rdp, t) \le SUB_MAX_NUM CALLS(s, cc)$
For each coupling constraint $cc$, the number of activations of deformations for all periods belonging to the sub-period of $cc$ must be less than the bound.

(3) $\sum (CALL(rdp, t) * RDP \_DURATION(rdp) * INTERSEC \_RDP \_SUB(s, t_{profile}, t)) \le SUB \_MAX \_DUR \_CALLS(s, cc)$

For each coupling constraint $cc$, the maximum duration of interruptions defined for the constraint $cc$ and for the sub period $s$ must be respected. `INTERSEC RDP_SUB` gives the intersection ratio between a time step $t$ and a subperiod $s$.

(4) $\sum (CALL(rdp, t) * DEVIATION(rdp, t, t_{profile})) \le SUB \_MAX \_VOL \_CALLS(s, cc)$
The maximum volume defined for the sub period $s$ of the coupling constraint $cc$ must be respected.

(5) $RDP \_DURATION(rdp) * (1 - CALL(rdp, t)) \ge \sum_{rdp2, tt} CALL(rdp2, tt)$
$exclu \_impact(rdp, t, rdp2, tt)$

For an exclusive constraint $cc$, only one flexible asset could be called during the sub-period of $cc$.

(6) $\sum_{tt \ge t + RDP \_DURATION(rdp)} CALL(rdp2, tt) \le 1 - CALL(rdp, t)$
$tt < t + RDP \_DURATION(rdp) + MIN \_FFTIME(res)$
$MAP \_RESOURCE \_RDP(res, rdp)$
$MAP \_RESOURCE \_RDP(res, rdp2)$
$ALLOW(rdp2, tt) = 1$

This constraint aims to respect the minimum waiting time between two activations of a flexible asset.

(7) $\sum_{rdp, tt} CALL(rdp, t) \le 1$
$MAP \_RESOURCE \_RDP(res, rdp)$
$ALLOW(rdp, tt)$
$tt \le t$
$tt > t - RDP \_DURATION(rdp)$

For each time step and each flexible asset, only one rdp can be activated. For the dispatch mode, some additional equations must be taken into consideration:
$$ (8) \quad \sum_{rdp,tt} \text{CALL}(rdp,tt) * \sum_{t\_profile} \text{DEVIATION}(rdp,tt,t\_profile) = \\ \qquad t\_profile = t - tt + 1 \\ \qquad \text{TARGET\_VOL\_T}(t) + \text{MISMATCH\_UP}(t) - \text{MISMATCH\_LO}(t) $$

This constraint aims to respect the target volume. The two variables `MISMATCH_UP` and `MISMATCH_LO` represent the gap to the target (UP for the excess volume and LO for the lack volume). They are penalized in the objective function to be minimized.

$$ (9) \quad \sum_{segm} \text{SEG\_MISM\_UP}(t, segm) = \text{MISMATCH\_UP}(t) \\ \text{The sum of excess volume on all time steps and all segments should equal the sum of the entire extra volume. Using this constraint and the objective function, the excess volume will be dispatched correctly between segments (and respect the penalty linear piecewise function).} $$

$$ (10) \quad \sum_{segm} \text{SEG\_MISM\_LO}(t, segm) = \text{MISMATCH\_LO}(t) \\ \text{The sum of lack volume on all time steps and all segments should be equal to the sum of the entire lack volume.} $$

Objective Functions:

For the economic mode, revenues of the aggregator should be maximized:

$$ \max \quad \sum_{rdp,t} \text{OPP\_VALUE}_{(rdp)} * \text{CALL}(rdp,t) \\ \text{allow}(rdp,t) = 1 $$

For the dispatch mode, revenues should be maximized, and penalties should be minimized:

$$ \max \quad \sum_{rdp,t} \text{OPP\_VALUE}_{(rdp)} * \text{CALL}(rdp,t) \\ \text{allow}(rdp,t) = 1 \\ - \sum_t \left( \sum_{segm} \text{SEG\_MISM\_UP}(t, segm) * \text{SEG\_MISM\_UP}(t, segm) \right. \\ \left. + \sum_{segm} \text{SEG\_MISM\_LO}(t, segm) * \text{SEG\_MISM\_LO}(t, segm) \right) $$

## 6. Experimental Results

The problem to solve in this work belongs to the NP-Hard problems since it can be simplified (by eliminating some constraints) to a classic knapsack optimization problem [25]. The search space is enormous since we can interrupt a resource at any time and for any duration we want. We also treat a list of constraints varying from dealing with one flexible asset (such the minimum waiting time between two consecutive interruptions), to constraints coupling the time (such that the maximum number of interruptions in a given period should not exceed a bound), to constraints coupling several assets and other constraints coupling assets and time.

The experimental tests aim to ensure that the computational time of the proposed approach is acceptable compared to the performance needed by the aggregator. This latter has to face the quick changes of prices, and he must be rapid to evaluate the economic potential of his portfolio of flexible assets and then make bids on the market. The aggregator also needs to be very reactive when he needs to respect the engagements done on the market by using the dispatch mode.

Therefore, experimental tests aim to verify if the proposed approach can be used in an operational context.

To reach this goal, and for each of two optimization modes (economic and dispatch), an aggregator (an industrial partner) gave us more than 1000 instances of real and possible real portfolios (from small to large size: 50 to 1000 flexible assets) with a combination of real constraints (simple and coupling constraints).

A horizon of 10 days with hourly periods for the economic mode (240 time steps) and one day with a 5 min time step for the dispatch mode (288 time steps) were considered.
Horizons were defined w.r.t. the real needs of the aggregator regarding the electricity market structure.

The proposed MILP was written in GAMS [26] and solved using the IBM CPLEX solver on a machine with a 2 GHz processor and 16 GB RAM.

Table 2 gives the results of the experiments done for the economic mode. Six sets of instances were considered. Each one is composed of 250 instances with different compositions. For example, set 1 contains 250 instances with several assets varying from 56 to 246 and many possible deformations ranging from 20,540 to 91,928. The number of profiles directly gives the number of binary variables of the model (a maximum of 91,928 binary variables for the set 1; the number of continuous variables is not counted). As seen in Table 2, Cplex solved all instances to the optimality (MILP gap of 0.01%) in an acceptable time.

<table><caption>**Table 2.** Some results for the economic mode.</caption><thead><tr><th>Set of Instances</th><th>Min Assets</th><th>Max Assets</th><th>Min # Profiles</th><th>Max # Profiles</th><th>Mean Time—MILP</th></tr></thead><tbody><tr><td>1</td><td>56</td><td>246</td><td>20,540</td><td>91,928</td><td>46 s</td></tr><tr><td>2</td><td>51</td><td>241</td><td>28,992</td><td>124,111</td><td>44 s</td></tr><tr><td>3</td><td>51</td><td>246</td><td>18,320</td><td>92,319</td><td>22 s</td></tr><tr><td>4</td><td>51</td><td>250</td><td>25,537</td><td>133,438</td><td>62 s</td></tr><tr><td>5</td><td>502</td><td>994</td><td>185,891</td><td>366,132</td><td>132 s</td></tr><tr><td>6</td><td>501</td><td>997</td><td>245,885</td><td>523,899</td><td>215 s</td></tr></tbody></table>

The results also show that, in all cases, the computational time of the proposed model did not exceed 5 min, even with a vast number of possible deformations (a huge number of binary variables), which is reasonable to be integrated into an operational context.

As shown in Figure 5, the computational effort increased with the number of possible deformations. This is easily explainable because the number of decision variables depends directly on the number of possible deformations. Other tests were done to see the limits of the proposed approach. If 1.5 million possible deformations are exceeded, GAMS/CPLEX cannot handle the generated problem (memory heap exception even if we have 16 GB available on the PC we used).

<figure><img src="image_8.png" /><figcaption>**Figure 5.** Evolution of execution time depending on the size of the problem. The red line gives a linear regression based on this results.</figcaption></figure>
Table 3 gives the result for the dispatch mode. Cplex can take more than 15 min to solve a problem containing a massive number of possible deformations. In an operational context, the proposed approach can be used when having a small or a medium number of flexible assets (and therefore a small or a medium number of possible deformations). Another solution is to increase the acceptable gap to optimality or to use a more powerful computer.

<table><caption>**Table 3.** Some results for the dispatch mode.</caption><thead><tr><th>Set of instances</th><th>Min Assets</th><th>Max Assets</th><th>Min # Profiles</th><th>Max # Profiles</th><th>Mean Time—MILP</th></tr></thead><tbody><tr><td>1</td><td>50</td><td>250</td><td>26,038</td><td>473,758</td><td>157 s</td></tr><tr><td>2</td><td>50</td><td>250</td><td>185,083</td><td>1,111,575</td><td>634 s</td></tr><tr><td>3</td><td>500</td><td>1000</td><td>283,576</td><td>613,296</td><td>672 s</td></tr></tbody></table>

Figure 6 presents an example of a solution found for an instance of the dispatch mode. The X axis represents the time, and the Y axis represents the interrupted volume in kWh. Each sequence of blocks, having the same color in this picture, represents a flexible asset and its deformation, over the time, in terms of interrupted volume.

<figure><img src="image_9.png" /><figcaption>**Figure 6.** Dispatch mode: Example of a target to respect and the associated solution found by our MILP.</figcaption></figure>

For example, the sequence of blocks having the orange color (we put an arrow on it on the picture) represents a flexible asset, chosen by our method, to be interrupted. For each time step (15 min), we can see the corresponding interrupted volume. In this example, even if the target is a volume to be interrupted, sometimes the solution proposes to activate flexible assets with an additional consumption (>0). This is an opportunity for the aggregator to respect the target and therefore to minimize penalties.

## 7. Conclusions and Perspectives

In this article, the problem of flexibility aggregation in an electric system was explained. First, an efficient method to model the deformation of the load curve of flexible assets was proposed. Second, a MILP model to solve the efficient integration of flexible assets into the power market was introduced.

For the economic mode, using the MILP model in a real context is possible regarding the experimental results and the performances needed by aggregators. For the dispatch mode, the situation is more crucial. Aggregators need to have a powerful optimization engine to solve the problem in a very short time (<5 min: the time step duration). The experimental results have shown that this is possible when the number of flexible consumers is small or medium. To remedy this problem, the aggregator can increase the gap to the optimality in the Cplex solver or use a more powerful computer.

In future works, we will develop an efficient heuristic to tackle this problem (or a metaheuristic if necessary). The complexity of the problem, combined with the requirement for it to be solved in a very short time, demands the use of optimization techniques that are properly suited to the structure of the problem. However, these techniques must remain
sufficiently generic in order to cover a very broad range of business cases (technical profiles and constraints) and not to limit the commercial potential to simple industrial cases. The heuristic will be compared to the exact results of the MILP.

It is important to note that the potential of the proposed approach goes beyond the issue of flexible demand management. It would certainly be conceivable to extend it to the "controllable" management of wind farms subject to market price, given the high degree of similarity between the deformation capacity of wind power generation and that of consumption. In the longer term, it might also be used for optimizing decentralized storage capacity. Generally speaking, we can use our work to aggregate distributed energy resources such wind turbines, solar panels, batteries, etc.

**Author Contributions:** Conceptualization, M.D.; methodology, M.D.; software, M.D.; validation, M.D., R.A. and O.D.; formal analysis, M.D., R.A. and O.D.; investigation, M.D., R.A. and O.D.; resources, M.D.; data curation, M.D., R.A. and O.D.; writing—original draft preparation, M.D.; writing—review and editing, M.D., R.A. and O.D.; visualization, M.D., R.A. and O.D.; supervision, M.D.; project administration, M.D.; funding acquisition, M.D. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by Engie. This research work was funded by Engie within the scope of preparing the energy transition.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.

## References

1. Henderson, J.; Sen, A. *The Energy Transition: Key Challenges for Incumbent and New Players in the Global Energy System*; No. 01. OIES Paper: ET; The Oxford Institute for Energy Studies: Oxford, UK, 2021.

2. Kalghatgi, G. Challenges of energy transition needed to meet decarbonization targets set up to address climate change. *J. Automot. Saf. Energy* **2020**, *11*, 276.

3. Paterakis, N.; Erdinç, O.; Catalão, J.P.S. An overview of Demand Response: Key-elements and international experience. *Renew. Sustain. Energy Rev.* **2017**, *69*, 871–891. [CrossRef]

4. Zehir, M.A.; Bagriyanik, M. Demand side management by controlling refrigerators and its effects on consumers. *Energy Convers. Manag.* **2012**, *64*, 238–244. [CrossRef]

5. Kirby, B.; Hirst, E. *Load as a Resource in Providing Ancillary Services*; Technical Report; Oak Ridge National Labortory: Oak Ridge, TN, USA, 1999.

6. Dethlefs, T.; Beewen, D.; Preisler, T.; Renz, W. A consumer-orientated architecture for distributed demand-side-optimization. In *Proceedings of the 28th EnviroInfo Conference, Oldenburg, Germany*, 10–12 September 2014.

7. Sebastian, M.; Marti, J.; Lang, P. Evolution of DSO control centre tool in order to maximize the value of aggregated distributed generation in smart grid. In *Proceedings of the 2008 CIRED Seminar: SmartGrids for Distribution, Frankfurt, Germany*, 23–24 June 2008. Paper Number 0034. [CrossRef]

8. Aalami, H.A.; Moghaddam, M.P.; Yousefi, G.R. Demand response modeling considering interruptible/curtailable loads and capacity market programs. *Appl. Energy* **2010**, *87*, 243–250. [CrossRef]

9. Palensky, P.; Dietrich, D. Demand side management: Demand response, intelligent energy systems, and smart loads. *IEEE Trans. Ind. Inform.* **2011**, *7*, 381–388. [CrossRef]

10. Esnaola-Gonzalez, I.; Jelić, M.; Pujić, D.; Diez, F.; Tomašević, N. An AI-powered system for residential demand response. *Electronics* **2021**, *10*, 693. [CrossRef]

11. Habeeb, S.A.; Tostado-Véliz, M.; Hasanien, H.M.; Turky, R.A.; Meteab, W.K.; Jurado, F. DC Nanogrids for integration of demand response and electric vehicle charging infrastructures: Appraisal, optimal scheduling and analysis. *Electronics* **2021**, *10*, 2484. [CrossRef]

12. Brusco, G.; Burgio, A.; Menniti, D.; Pinnarelli, A.; Sorrentino, N.; Scarcello, L. An energy box in a cloud-based architecture for autonomous demand response of prosumers and prosumages. *Electronics* **2017**, *6*, 98. [CrossRef]

13. Peeters, E.; Belhomme, R.; Batlle, C.; Bouffard, F.; Karkkainen, S.; Six, D.; Hommelberg, M. ADDRESS: Scenarios and architecture for active demand development in the smart grids of the future. In *Proceedings of the 2009 CIRED 20th International Conference on Electricity Distribution, Prague, Czech Republic*, 8–11 June 2009. Paper Number 0406. [CrossRef]

14. Pallonetto, F.; De Rosa, M.; Milano, F.; Finn, D.P. Demand response algorithms for smart-grid ready residential buildings using machine learning models. *Appl. Energy* **2019**, *239*, 1265–1282, ISSN 0306-2619. [CrossRef]
15. Lopes, F.; Algarvio, H. Demand response in electricity markets: An overview and study of the price-effect on the Iberian daily market. In *Electricity Markets with Increasing Levels of Renewable Generation: Structure, Operation, Agent-Based Simulation, and Emerging Designs*; Lopes, F., Coelho, H., Eds.; Springer: Cham, Switzerland, 2018. [CrossRef]

16. Tan, Z.; Fan, W.; Li, H.; De, G.; Ma, J.; Yang, S.; Ju, L.; Tan, Q. Dispatching optimization model of gas-electricity virtual power plant considering uncertainty based on robust stochastic optimization theory. *J. Clean. Prod.* **2020**, *247*, 119106. [CrossRef]

17. Pourghaderi, N.; Fotuhi-Firuzabad, M.; Moeini-Aghtaie, M.; Kabirifar, M. Commercial demand response Programs in bidding of a technical virtual power plant. *IEEE Trans. Ind. Inform.* **2018**, *14*, 5100–5111. [CrossRef]

18. Sheble, G.B.; Fahd, G.N. Unit commitment literature synopsis. *IEEE Trans. Power Syst.* **1994**, *9*, 763–773. [CrossRef]

19. Tang, W.-J.; Yang, H.-T. Optimal operation and bidding strategy of a virtual power plant integrated with energy storage systems and elasticity demand response. *IEEE Access* **2019**, *7*, 79798–79809. [CrossRef]

20. Biegel, B.; Andersen, P.; Stoustrup, J.; Madsen, M.B.; Hansen, L.H.; Rasmussen, L.H. Aggregation and control of flexible consumers: A real life demonstration. In *IFAC Proceedings Volumes, Proceedings of the 19th IFAC World Congress, Cape Town, South Africa*, 24–29 August 2014, 1st ed.; IFAC Workshop Series; IFAC Publisher: New York, NY, USA, 2014; Volume 19, pp. 9950–9955.

21. Kaddah, R.; Kofman, D.; Mathieu, F.; Pioro, M. Advanced demand response solutions for capacity markets. In Proceedings of the IEEE International Conference on Innovations in Information Technology, Dubai, United Arab Emirates, 1–3 November 2015; pp. 23–28.

22. Saha, S.; Ravi, N.; Hreinsson, K.; Baek, J.; Scaglione, A.; Johnson, N.G. A secure distributed ledger for transactive energy: The Electron Volt Exchange (EVE) blockchain. *Appl. Energy Part A* **2021**, *282*, 116208, ISSN 0306-2619. [CrossRef]

23. Al Zahr, S.; Doumith, E.A.; Forestier, P. Advanced demand response considering modular and deferrable loads under time-variable rates. In Proceedings of the IEEE GLOBECOM Global Communications Conference, Singapore, 4–8 December 2017. [CrossRef]

24. Eurelectric. *Designing Fair and Equitable Market Rules for Demand Response Aggregation*; A Eurelectric Paper; Eurelectric: Brussels, Belgium, 2015.

25. Hromkovic, J.; Kralovic, R.; Kralovic, R. Information complexity of online problems. In *Mathematical Foundations of Computer Science 2010, Proceedings of the 35th International Symposium on Mathematical Foundations of Computer Science (MFCS 2010)*, Brno, Czech Republic, 23–27 August 2010; Volume 6281 of Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany; pp. 24–36.

26. GAMS Development Corporation. General Algebraic Modeling System (GAMS), Fairfax, VA, USA. Available online: https://www.gams.com/download/ (accessed on 31 January 2022).