1. Introduction
Electricity distribution systems are undergoing a fundamental transformation as a result of the energy sector’s continuous shift toward low-carbon and decentralized operations. Voltage deviations, reverse power flow, congestion, and peak demand growth are some of the new operational challenges brought about by the growing use of distributed energy resources (DERs), electrification of transportation, and advanced home energy management systems (HEMSs). These technologies also have a great deal of flexibility potential that can be used to improve system performance and financial efficiency.
Prosumers, or consumers with local generation and storage capabilities, can now actively participate in electricity markets thanks to the development of smart grids, which have made bidirectional power flow possible. Prosumers can adjust their consumption patterns in response to price signals or system requirements by utilizing demand response (DR) programs. However, as noted in [
1], an uncoordinated demand-side response may have a detrimental effect on system reliability and operation. For DR participation to benefit both prosumers and distribution system operators (DSOs), appropriate coordination frameworks are therefore necessary.
Optimal scheduling of controllable appliances, electric vehicles (EVs), energy storage systems (ESSs), and photovoltaic (PV) generation through HEMSs can achieve flexibility at the residential level. Without specifically taking network-level goals like voltage regulation and loss minimization into account, conventional HEMS implementations usually seek to reduce electricity costs or maximize user comfort. This lack of coordination with DSO could result in operational and technical infeasibility in distribution networks as DER penetration rises [
2]. The need for structured coordination frameworks is highlighted by the competing goals of DSOs and HEMSs [
3].
Several studies have investigated two-level coordination frameworks. For instance, ref. [
4] presented a two-level energy management system for homes and aggregators, focusing on EV charging coordination. Similarly, ref. [
5] proposed a two-stage transactive charging strategy for EVs. While these works demonstrate economic advantages, they primarily focus on EV flexibility and neglect other residential DERs and controllable appliances. Moreover, distribution network operational constraints are often ignored, potentially resulting in technically infeasible solutions. In [
6], uncertainty-aware transactive coordination for EVs and PVs was explored; however, voltage limits and network constraints were not explicitly incorporated into the optimization framework.
Centralized and decentralized demand-side management approaches have also been proposed. A day-ahead load shifting strategy was introduced in [
7], demonstrating peak demand reduction. A real-time scheduling algorithm for multiple homes was developed in [
8]. Nevertheless, these approaches did not explicitly examine the impact of demand-side flexibility on grid operational metrics such as power losses and voltage profiles.
Recent studies have also investigated coordinated scheduling of distributed energy systems within active distribution networks. For example, Reza et al. [
9] proposed a multi-stage stochastic scheduling framework for networked microgrids integrating hydrogen refueling stations and electric vehicle charging infrastructure. While such approaches focus on coordinated operation of interconnected microgrids, the present work focuses on residential flexibility coordination within a hierarchical HEMS–aggregator–DSO architecture with uncertainty-aware scheduling and network-level validation through AC optimal power flow.
Other studies have explored thermal flexibility in residential and commercial buildings. For example, ref. [
10] proposed thermal flexibility for a public library with HEMS. Similarly, ref. [
11] proposed an uncertainty-aware transactive framework for thermal storage under real-time pricing, while [
12] developed a thermal response model for HVAC systems. Similarly, Ma et al. [
13] proposed a two-stage optimization model for day-ahead energy scheduling of an electro-thermal microgrid incorporating solid electric thermal storage. However, these works primarily address thermal flexibility and do not fully integrate electrical DERs such as ESS and EVs, nor do they comprehensively consider active distribution network operation as part of the optimization objective.
The role of aggregators in coordinating distributed flexibility has been widely recognized. Aggregators enable small-scale prosumers to participate in DR programs and electricity markets by pooling individual flexibility resources [
14]. Recent research has investigated prosumer flexibility for energy management [
15], frequency regulation [
16], voltage rise mitigation [
17], congestion management [
18], and renewable integration [
19]. Although multi-level coordination frameworks have been proposed in [
20,
21,
22], these studies often neglect explicit modeling of upward and downward flexibility or do not include adaptive incentive mechanisms. Similarly, the authors in [
23] calculated the upward and downward flexibility, but they did not consider the uncertainty in the power demand and PV generation, which is not realistic.
Incentive-based DR mechanisms have been explored in various contexts. Autonomous scheduling with incentives was studied in [
24], though limited to shiftable appliances. Fixed incentive schemes for peak reduction were proposed in [
20], but network-level constraints were not fully incorporated. Regression-based incentive design was investigated in [
25], while residential aggregation frameworks were developed in [
26]. However, many of these approaches focus on specific load categories and do not provide a comprehensive coordination structure linking HEMS, aggregator, and DSO objectives.
Recent studies have also explored data-driven approaches for residential flexibility aggregation and demand response coordination. These approaches employ machine learning and data analytics techniques to analyze smart meter data, identify consumption patterns, and segment residential consumers according to their flexibility potential. For example, the MAS-DR framework proposed in [
27] introduces a machine-learning-based aggregation and segmentation methodology that groups residential consumers according to their consumption characteristics in order to improve participation in demand response programs. Similarly, recent work has applied machine learning techniques to cluster residential electricity load profiles and support demand response program design [
28]. While such data-driven frameworks are effective for identifying flexibility potential and customer segmentation, they typically focus on flexibility estimation rather than optimization-based scheduling and network-level operational validation. In contrast, the approach proposed in this work focuses on optimization-driven coordination of residential flexibility within a hierarchical HEMS–aggregator–DSO framework while explicitly accounting for uncertainty in distributed energy resource behavior. More recently, artificial intelligence and reinforcement learning methods have also been explored for uncertainty-aware operation of distributed energy systems. While these approaches enable adaptive decision-making based on historical data, optimization-based methods such as robust optimization provide transparent mathematical formulations and explicit guarantees on constraint satisfaction under uncertainty.
Three-level coordination architectures have recently gained attention. Studies such as [
29,
30,
31,
32,
33] investigated tri-level interactions among supply, aggregators, and consumers. Nevertheless, flexibility was not consistently treated as a system-support service, and the operational impact on DSOs was not thoroughly quantified. More comprehensive three-level frameworks integrating HEMS, aggregator coordination, and network-level optimization were presented in [
34]. Similarly, ref. [
35] proposed a device-level flexibility provision for HEMS in the distribution system. These works demonstrated improvements in loss reduction and cost minimization; however, they did not investigate the impact of uncertainty on flexibility provision or incentive allocation.
In practical distribution systems, load demand and PV generation are inherently uncertain. Ignoring uncertainty may lead to overestimation of available flexibility and misallocation of incentives. Conversely, incorporating robustness may increase operational costs and alter economic signals. Despite the growing adoption of robust optimization techniques in power systems, the impact of uncertainty on incentive distribution and prosumer participation within hierarchical flexibility coordination frameworks remains insufficiently explored.
To address this gap, this paper investigates the impact of uncertainty on incentive allocation in a multi-level flexibility coordination framework. Building upon a previously developed deterministic architecture [
23], this work introduces a
-budget-robust optimization model to capture uncertainty in load demand and PV generation. The proposed framework consists of three interconnected stages: (i) HEMS-level optimization, (ii) aggregator-level flexibility coordination and adaptive incentive allocation, and (iii) DSO-level optimal power flow (OPF) validation. By integrating uncertainty modeling, this study quantifies the economic cost of robustness and evaluates how uncertainty affects incentive distribution, flexibility participation, and system-level performance.
It is important to note that the individual components used in the proposed framework—such as HEMS optimization, aggregator-based coordination, AC optimal power flow validation, and robust optimization—have been studied in prior literature. However, most existing multi-level coordination frameworks adopt deterministic formulations in which scheduling decisions rely on forecasted load and generation profiles. In contrast, the present work extends the deterministic coordination architecture proposed in [
23] by introducing an uncertainty-aware formulation that explicitly captures deviations in household demand, PV generation, and EV availability using a
-budget-robust optimization model. This extension enables the proposed framework to evaluate how uncertainty propagates through the different coordination layers, influencing household scheduling decisions, aggregated flexibility envelopes, incentive allocation by the aggregator, and the resulting network operation as validated through the DSO-level OPF.
The main contributions of this paper are summarized as follows:
An uncertainty-aware three-level coordination framework for residential flexibility management is proposed, integrating HEMS optimization, aggregator-level flexibility coordination, and DSO network validation within a unified architecture.
A -budget-robust optimization formulation is introduced to explicitly model uncertainty in load demand, PV generation, and EV availability within the hierarchical flexibility scheduling process.
An incentive–penalty mechanism is incorporated within the hierarchical coordination structure to reward verified flexibility provision and discourage deviations from allocated flexibility limits.
The proposed framework is implemented using the PYOMO optimization platform and validated on the IEEE 33-bus radial distribution test system [
36] with a large-scale residential scenario involving 437 prosumers.
From an operational perspective, the proposed uncertainty-aware coordination framework provides a systematic approach for integrating residential flexibility into distribution system operation under uncertain conditions. By coordinating prosumer-level flexibility with network-level constraints, the framework enables DSOs to maintain secure and reliable operation while effectively leveraging distributed energy resources.
2. Methodology
This section presents the mathematical formulation and modeling assumptions of the suggested hierarchical flexibility coordination framework. We assume the availability of household-level controllers, bidirectional communication, and smart metering infrastructure. The approach is structured as a three-level EMS: (i) a household optimization level (HEMS); (ii) an aggregator coordination level for incentive computation and flexibility accounting; and (iii) a DSO level that uses distribution-level OPF to calculate network-feasible flexibility requests. Every home has an electric water heater (EWH), PV, ESS, and EV. In line with the finding that a number of household appliances do not offer complete upward/downward flexibility services, other appliances are combined into a non-controllable base-load component [
37].
The proposed framework follows a sequential hierarchical optimization process involving three interconnected layers: the HEMS, the aggregator, and the DSO level. First, each household solves a local HEMS optimization problem to schedule controllable devices and determine the baseline power exchange with the grid. Second, the aggregator collects the flexibility information from individual households and determines the allowable flexibility limits together with the associated incentive–penalty signals. Third, the DSO performs an AC OPF analysis to evaluate the network feasibility of the aggregated flexibility and determine system-level flexibility requirements. Based on these limits, households perform re-optimization under the flexibility constraints and incentive signals. This sequential process enables coordinated flexibility provision while maintaining network operational constraints.
2.1. Level 1: Home Energy Management System (HEMS)
Every household solves a day-ahead optimization over discrete time steps with duration . The HEMS schedules the EV and ESS charging and discharging, EWH heating, PV power distribution, and grid power exchange. Energy state variables are expressed in kWh, while active power variables are expressed in kW. The symbols for grid import and export are and , respectively, and the associated tariffs are (buying price) and (selling price). The HEMS is designed with user comfort (e.g., hot-water temperature constraints) and device operating limits in mind.
2.1.1. Objective Functions
To quantify flexibility and enable incentive-based coordination, three objective functions are computed.
- (i)
Cost-minimizing schedule.
The baseline schedule minimizes the net electricity bill under time-varying import/export prices.
Here, the first term represents the import cost paid to the DSO, whereas the second term represents the revenue from exporting surplus energy (e.g., PV or discharging storage) under an export tariff.
- (ii)
Energy/self-consumption-driven schedule.
A second schedule is computed to construct a flexibility reference that is less price-driven and more focused on reducing grid dependency through local resources. This schedule minimizes the household net electric demand required to satisfy the same service needs:
where
and
denote the base load and EWH electric demand,
and
denote EV and ESS charging power, and the terms with “
” denote power supplied to the house from PV/EV/ESS, respectively.
2.1.2. Grid Exchange and Non-Simultaneity
Household net import is obtained from an active power balance that aggregates all electrical consumption and on-site supplies.
The export power is decomposed by the source that injects into the grid:
To prevent simultaneous buying and selling within the same time step, a binary variable
and a sufficiently large constant
are used:
2.1.3. EWH Thermal Dynamics
The EWH temperature dynamics follow a first-order thermal model that captures ambient heat exchange, water withdrawal, and the heater on/off state [
38,
39]. The tank temperature at time
t is denoted by
, the ambient temperature by
, and the binary heater status by
:
where
and
are the equivalent thermal resistance and capacitance of the tank,
is the heater power-to-heat conversion coefficient,
is the tank volume, and
is the hot-water withdrawal at time
t. User comfort is ensured by bounding the water temperature:
2.1.4. PV Power Split
The available PV generation
is allocated among exporting to the grid, charging the ESS, and serving the household load:
2.1.5. EV Model
The EV state of energy is denoted by
and evolves over plugged-in periods
according to charging and discharging actions. Charging efficiency and discharging efficiency are
and
, respectively:
Charging and discharging are limited by rated powers
and
, and a binary variable
prevents simultaneous charge/discharge:
The EV energy is bounded within
and
, and arrival/departure requirements are enforced at
and
:
2.1.6. ESS Model
The home battery state-of-energy is denoted by
and is updated based on charging
and discharging actions, with efficiencies
and
:
The ESS can be charged either from the grid or from PV:
Initial and terminal energy conditions are imposed to avoid end-effects and ensure inter-day consistency:
Charging and discharging are bounded by rated powers
and
, and mutual exclusivity is enforced through a binary variable
:
Finally, the battery energy is restricted within admissible bounds
and
:
2.2. HEMS Re-Optimization Under Uncertainty
To account for forecast errors and user-behavior variability, the Level-1 HEMS is re-optimized under uncertainty in (i) the uncontrollable household demand, (ii) PV generation, and (iii) EV availability and state-of-charge (SoC) requirements. We adopt a budgeted-uncertainty (“-robust”) formulation that limits the number of time periods (or homes) in which worst-case deviations may occur. The uncertainty budget parameter controls the level of conservativeness in the robust optimization model. Specifically, limits the number of uncertain parameters that are allowed to simultaneously deviate from their nominal forecast values within the optimization horizon. A higher value of represents a more conservative scheduling decision, as the model prepares for a larger number of adverse deviations, while smaller values of rely more heavily on forecasted conditions.
2.2.1. Budgeted Uncertainty for Load and PV
Let
denote a home and
a time step. The nominal uncontrollable load
corresponds to the household base load
defined in
Section 2.1. Similarly, the nominal PV generation
corresponds to the available household PV power introduced in the PV power split model. Load forecast error is modeled as an adverse increase, while PV uncertainty is modeled as an adverse decrease. The uncertain realizations are defined as
where
and
are maximum relative deviation levels, and
,
represent deviation magnitudes.
To activate uncertainty only in a limited number of periods, binary variables
and
are introduced with the coupling constraints
where
and
are minimum deviation magnitudes when uncertainty is activated.
The per-home budget of uncertainty is enforced as
where the maximum number of time steps in which load and PV deviations may occur is specified by
and
, respectively. To prevent trivial solutions where no uncertainty is activated (i.e.,
for all periods), a minimum-usage requirement can optionally be enforced:
where
are minimum activation fractions.
2.2.2. EV Uncertainty: Timing and SoC Requirements
Uncertainty in arrival and departure times, as well as in the initial and required final SoC, can affect EV availability. Let
and
be the maximum deviations, and let
and
be the nominal arrival and departure indices. The variables
and
represent the uncertainty-adjusted counterparts of the nominal EV arrival and departure times used in the deterministic HEMS model. Robust arrival and departure variables
and
are introduced for every home:
Binary activators
enable the deviation only when activated:
Let
be the EV energy capacity (kWh),
the nominal initial SoC fraction, and
the nominal required departure SoC fraction. Worst-case SoC uncertainty is modeled via binary activators
:
where
and
are maximum deviations in initial SoC and final SoC requirement, respectively. Hence, the robust formulation assumes less initial energy and a more stringent departure requirement in the activated worst case.
To control the total number of EV uncertainty activations, a global budget is enforced:
In addition, a home-level indicator
can be used to require that at least a fraction of homes experience EV uncertainty:
where
is the minimum fraction of homes with at least one EV uncertainty component activated.
The re-optimization (HEMS) problem is then solved using the uncertain quantities , , , , and the robust timing variables within the household power balance and device constraints.
2.3. Level 2: Aggregator Model
Distribution feeders supplying residential customers are typically operated in a radial configuration. In the proposed architecture, the aggregator acts as the interface between prosumers and the DSO by collecting privacy-preserving household trajectories, quantifying flexibility availability, and translating the DSO flexibility request into household-level operating limits. Specifically, individual appliance-level schedules remain local to each HEMS; only net import and export profiles are communicated to the aggregator to avoid disclosure of device-specific behavior.
2.3.1. Bus-Level Aggregation of Household Exchange
Let
denote the set of households electrically connected to bus
. The aggregator forms bus-level import and export trajectories by summing the household net exchanges:
Here, represents the aggregated real-power demand seen by the DSO at bus n, while represents the aggregated export resulting from local DER surplus (e.g., PV injection and storage discharge). These aggregate trajectories define the effective net load and injection time series used for network-level assessment in Level 3.
2.3.2. Flexibility Accounting and Participation Factors
To quantify flexibility provision in a contract-compliant manner, the aggregator compares two household schedules computed at Level 1: the cost-driven schedule and the energy-oriented reference schedule. The household flexibility deviation is defined as the difference between the corresponding net import trajectories:
A positive
indicates that the household can reduce import relative to the reference (upward flexibility from the DSO perspective, i.e., demand reduction), whereas a negative value indicates the ability to increase import (downward flexibility). For compact notation and to avoid case-by-case definitions, the upward and downward components are expressed via positive/negative parts:
The resulting bus-level flexibility envelopes are obtained by aggregating household contributions:
To distribute DSO requests proportionally while accounting for heterogeneity across households, a flexibility participation factor is defined as:
In the above formulation, denotes the flexibility offered by household h at time interval t, defined as the deviation between the cost-driven schedule and the reference energy-oriented schedule. The variables and represent the positive and negative components of the flexibility deviation, corresponding to upward (demand reduction) and downward (demand increase) flexibility, respectively. The sets and denote the set of households and the scheduling time intervals, while represents the set of distribution network buses. The subset identifies the households connected to bus n. The aggregated quantities and represent the total upward and downward flexibility available at bus n and time t. Finally, the participation factor indicates the proportional contribution of each household to the aggregated flexibility at the corresponding bus and is used by the aggregator to allocate the flexibility request received from the DSO among participating prosumers.
2.3.3. Translation of DSO Requests into Household Import Caps
Let
denote the DSO-requested flexibility at bus
n (computed in Level 3). The aggregator converts this nodal request into a household-level import cap by combining the energy-oriented reference trajectory with the proportional allocation rule:
The resulting incentive–penalty signal sent to household
h at time
t is denoted by
, which is then used in the incentive-aware HEMS objective in Equation (
42).
The cap is subsequently enforced in the activated HEMS re-optimization at Level 1, ensuring that household schedules remain consistent with network-driven flexibility requirements. In the proposed workflow, deviations from these allocated caps—particularly under load and PV uncertainty—are later reflected through incentive/penalty signals in the re-optimization stage.
2.3.4. Incentive–Penalty Signal and Household Re-Optimization
When the flexibility service is activated, the HEMS incorporates an incentive/penalty signal computed by the aggregator. This is modeled by adding an incentive-adjusted term proportional to grid import:
where
is the incentive/penalty rate varying in time sent by the aggregator. With this sign convention,
represents an incentive, while
represents a penalty.
The incentive–penalty mechanism is based on the flexibility delivered by each household relative to a reference baseline consumption. Let
denote the baseline grid import obtained from the reference scheduling stage, and
denote the realized grid import after flexibility activation. The flexibility delivered by household
h at time
t is therefore defined as
A positive value of represents a reduction in grid import relative to the baseline (upward flexibility), while a negative value represents an increase in grid import. The aggregator evaluates the delivered flexibility against the requested flexibility allocation and adjusts the signal accordingly to reward verified flexibility contributions or penalize deviations from the allocated flexibility limits.
Accordingly, the incentive–penalty settlement associated with flexibility provision can be represented as
where
denotes the verified flexibility contribution and
represents any shortfall relative to the requested flexibility level. The coefficients
and
correspond to the incentive and penalty rates, respectively.
From an economic perspective, the proposed incentive–penalty mechanism acts as a local flexibility remuneration scheme implemented by the aggregator. Households that deliver verified flexibility are rewarded through positive incentive signals, while deviations from allocated flexibility limits trigger penalties. This structure encourages reliable delivery and discourages overcommitment. The proposed mechanism represents a local coordination scheme for residential flexibility management rather than a direct representation of a specific wholesale electricity market product.
2.4. Level 3: DSO Network-Constrained Optimal Power Flow
At the network layer, the distribution system operator (DSO) determines time-varying flexibility requests that satisfy distribution-network operating constraints. The DSO receives from the aggregator the aggregated nodal net import and export trajectories, denoted by , together with the corresponding upward and downward flexibility envelopes for each bus and time interval .
Flexibility is modeled as a controllable real-power adjustment variable at each bus. Under the adopted sign convention, represents a demand-reduction request (net import decrease), whereas represents a demand-increase request. The resulting nodal flexibility signal is transmitted to the aggregator, which redistributes it proportionally among households and enforces it through HEMS re-optimization.
2.4.1. Objective Function
The DSO optimization seeks to minimize total active power losses and calculate optimal flexibility requests. The objective function is formulated as
where
denotes the set of distribution lines,
is the conductance of line
,
and
are the voltage magnitude and phase angle at bus
n, and
is a weighting coefficient regulating the trade-off between loss minimization and flexibility usage. The first term corresponds to network real-power losses expressed in admittance form, while the second term regularizes flexibility activation to avoid unnecessary control effort.
2.4.2. AC Power Flow Constraints
The network is modeled using a full AC formulation in polar coordinates. Let
and
denote the magnitude and angle of the
element of the bus-admittance matrix. The active and reactive power balance equations at each bus are given by
Here, and denote active and reactive injections from the upstream grid (nonzero only at the substation bus), represents aggregated reactive demand, and is the reactive component associated with flexibility activation.
Aggregated reactive demand and reactive flexibility are approximated using a constant power factor
:
2.4.3. Operational Constraints
Voltage magnitudes are constrained within admissible limits:
Substation active and reactive injections are bounded as
2.4.4. Network-Level Flexibility Feasibility
To ensure that the implementation is feasible, the DSO’s flexibility request must remain within the flexibility limits set by the aggregator. Thus, the nodal flexibility variable is constrained as follows:
These bounds guarantee that the OPF solution does not rely on unavailable household flexibility, thereby preserving consistency between network-level optimization and prosumer-level capabilities.
2.5. Coordination Framework
The proposed hierarchical flexibility coordination framework operates through a sequential interaction among three layers: the household-level HEMS, the aggregator, and the DSO. The main coordination steps are summarized as follows:
Each household solves a local HEMS optimization problem to schedule controllable devices (EWH, EV, ESS) while minimizing electricity cost based on the demand response signals and user preferences. The resulting optimal power exchange with the grid represents the baseline household demand.
The aggregator collects the baseline power schedules from individual households and evaluates the available upward and downward flexibility of each prosumer. The aggregator then aggregates these flexibility quantities at the feeder level.
The aggregated flexibility information is transmitted to the DSO. The DSO performs a distribution-level AC OPF analysis to determine the network-feasible flexibility requirements while satisfying voltage and network constraints.
Based on the flexibility request from the DSO, the aggregator allocates flexibility limits to individual households and determines the corresponding incentive–penalty signals according to the flexibility contribution of each prosumer.
Households then perform a re-optimization of the HEMS problem considering the flexibility limits and incentive signals provided by the aggregator.
This sequential coordination process enables the integration of residential flexibility into distribution system operation while preserving household privacy and maintaining network operational constraints.
It should be noted that the interaction between the HEMS and DSO layers follows a sequential coordination structure rather than a fully iterative co-optimization process. In the proposed framework, the flexibility limits communicated to households are derived from previously identified flexibility envelopes, which constrain the re-optimized household schedules within feasible operating ranges.
3. Results and Discussions
3.1. Case Study
The Python Optimization Modeling Objects (Pyomo, version 6.6.1) package [
40] is used to implement the proposed three-level hierarchical energy management framework in Python (version 3.11.9). All simulations are performed on a MacBook Pro running macOS on an Apple M1 processor with 8 GB of RAM.
The CPLEX solver is used to solve the mixed-integer linear programming (MILP) models for the first-stage HEMS and second-stage aggregator coordination problems. The IPOPT solver is used to solve the third-stage DSO problem, which is formulated as a nonlinear AC-OPF model. This hybrid solution approach ensures complete AC network feasibility validation at the distribution level while facilitating effective handling of discrete scheduling decisions at the household level.
The IEEE 33-bus radial distribution system, which supplies 437 residential prosumers spread across several buses, is the subject of the case study, as shown in
Figure 1.
From a computational perspective, the proposed framework remains tractable due to its hierarchical decomposition. Instead of solving a single centralized optimization problem for all prosumers and network variables, the framework separates the coordination process into three sequential layers: household-level HEMS scheduling, aggregator-level flexibility coordination, and DSO-level AC optimal power flow validation. At the HEMS level, each household solves a local scheduling problem whose size scales approximately linearly with the number of prosumers and time intervals. At the aggregator level, flexibility is computed using aggregated household exchange trajectories rather than detailed device-level variables. Finally, the DSO solves a network-level AC OPF whose size depends primarily on the distribution feeder model rather than the number of individual households. This decomposition significantly reduces the dimensionality of each optimization stage and improves scalability as the number of participating prosumers increases. In the present study, the proposed framework was successfully implemented for an IEEE 33-bus distribution system with 437 residential prosumers and a 24-h scheduling horizon, demonstrating the practical tractability of the hierarchical coordination architecture for large-scale residential flexibility management.
The IEEE 33-bus radial distribution system is selected as the test network because it is widely used as a benchmark feeder for evaluating distribution-level optimization, flexibility coordination, and distributed energy resource integration strategies. The use of this standard test system enables consistent comparison with existing studies in the literature and allows the proposed coordination framework to be evaluated under well-established network conditions. Every home has an EV, an ESS, an EWH, and a 5 kW rooftop PV system. A homogeneous DER configuration is assumed across households in order to isolate the impact of the proposed coordination framework within a controlled benchmark scenario. In practical distribution feeders, prosumers typically exhibit heterogeneous DER portfolios; incorporating such heterogeneity represents an important direction for future research.
Table 1 summarizes the modeling parameters of the EV, ESS, and EWH systems. These parameters were taken from [
38,
41]. The selected parameters represent typical residential DER characteristics reported in the literature and are commonly used in household energy management studies. The values for ESS capacity, charging/discharging limits, and efficiencies are based on representative EV and ESS specifications, while the EWH parameters reflect typical residential water heater thermal properties. These parameter values were adopted to ensure realistic device behavior while maintaining consistency with prior studies.
3.2. HEMS Level
Figure 2 presents the optimal daily scheduling of the HEMS under the two objective formulations. When the cost-minimization objective
is applied, flexible devices respond strongly to the time-varying tariff. EV and ESS charging are concentrated during low-price intervals, while grid import is reduced during high-tariff periods (as shown by the black dotted line). This results in pronounced charging peaks and a highly price-sensitive net load profile. The EWH operation is similarly adjusted within thermal comfort limits to avoid high-cost intervals. Overall, the cost-driven schedule minimizes electricity expenditure but introduces significant temporal variability in household demand.
In contrast, under the energy-oriented objective , device scheduling becomes less dependent on tariff fluctuations and more aligned with local PV generation and intrinsic consumption needs. Charging of the EV and ESS is distributed more evenly over time, reducing peak concentration and increasing PV self-consumption. The resulting grid import trajectory is smoother compared to the cost-minimizing case. The deviation between the two schedules defines the household’s upward and downward flexibility margins, which serve as inputs to the aggregator-level coordination mechanism.
3.3. Aggregator-Level Flexibility Results
Figure 3 illustrates the temporal evolution of aggregated upward and downward flexibility at the feeder level. The solid black curve represents the total upward flexibility (
), while the dashed black curve denotes the aggregated downward flexibility (
). The stacked colored bars correspond to the individual household contributions, demonstrating how system-level flexibility emerges from distributed prosumer participation.
A clear time-dependent structure is observed in the flexibility envelope. During late morning and afternoon hours (approximately 10:00–16:00), the available upward flexibility increases substantially, reaching peak values close to 800 kW. This reflects coordinated postponement of flexible loads, primarily EV charging and controllable ESS operation, which enables a significant reduction in feeder net demand when requested by the DSO. The broad and sustained plateau during this interval indicates that flexibility is not limited to short spikes but can be maintained over extended periods.
In contrast, pronounced downward flexibility appears during evening hours (approximately 18:00–22:00), with aggregated values approaching kW at maximum activation. This downward capability represents the feeder’s potential to increase consumption or reduce export through controlled charging or load restoration. The symmetry between the positive and negative envelopes demonstrates that the proposed coordination framework supports bidirectional flexibility services.
Importantly, the stacked representation confirms that flexibility provision is widely distributed among households rather than concentrated in a small subset of participants. The layered contributions across the feeder validate the effectiveness of the proportional allocation mechanism implemented at the aggregator layer and highlight the scalability of the proposed multi-level coordination framework.
From a distribution system operator’s perspective, this aggregated flexibility provides a valuable operational resource that can be activated to mitigate peak demand and relieve local network constraints. By coordinating distributed household flexibility through the aggregator layer, the proposed framework enables the DSO to access a controllable flexibility envelope without directly managing individual prosumers. This coordinated response can support peak shaving, improve feeder loading conditions, and provide additional operational headroom for integrating higher levels of distributed energy resources.
3.4. HEMS Re-Optimization Under DSO Flexibility Request
After receiving the optimal flexibility request from the DSO through the aggregator layer, the HEMS optimization is executed again under two operating conditions: (i) a deterministic coordinated case without uncertainty and (ii) a robust coordinated case incorporating load and PV uncertainty. The impact of this re-optimization on a representative household is illustrated in
Figure 4a.
As illustrated in
Figure 4a, the deterministic re-optimization closely follows the flexibility-adjusted import trajectory defined during the coordination stage. In contrast, the uncertainty-aware case shows visible deviations caused by stochastic variations in household demand and PV generation. These deviations remain relatively small but occasionally exceed the allocated flexibility limits, which subsequently activates the penalty mechanism defined in the aggregator coordination model.
An important observation is that once a household agrees to provide a flexibility profile during the coordination phase, the realized power trajectory under uncertainty may deviate from the initially promised flexibility commitment. Such deviations are inherent to realistic operating conditions, where stochastic fluctuations in load and PV output prevent perfect tracking of the contracted flexibility envelope. As shown in
Figure 4b, these deviations activate the penalty component of the incentive mechanism during the re-optimization stage. Specifically, when the realized import exceeds the flexibility-adjusted cap allocated by the aggregator, a penalty is applied proportionally to the deviation. Conversely, households that over-deliver flexibility receive additional incentive compensation. The uncertainty-aware case, therefore, exhibits both moderated incentive magnitudes and more frequent small penalty activations, reflecting realistic contractual enforcement under variability.
From a quantitative perspective, the incentive signals are primarily concentrated during the time intervals where the DSO requests flexibility activation, while penalty signals occur when uncertainty-induced deviations exceed the allocated flexibility margins. Compared with the deterministic case, the uncertainty-aware scenario results in a larger number of smaller penalty events rather than a few large violations, indicating that the robust scheduling strategy distributes operational risk more evenly across the scheduling horizon.
The system-level financial implications are further illustrated in
Figure 5, where stacked incentive and penalty payments for all households are presented for both operating conditions. The temporal clustering of payments aligns with periods of DSO flexibility activation, confirming effective coupling between network-level requirements and residential response. In the deterministic case, higher peak incentives are observed due to more aggressive flexibility provision. However, under uncertainty, payment distributions become smoother and more evenly spread across time, as households adopt risk-aware schedules as shown in
Figure 5b. Importantly, the presence of penalties in the uncertainty-aware case reflects deviation from initially declared flexibility commitments, demonstrating that the proposed mechanism enforces accountability and prevents overly optimistic flexibility declarations.
Quantitatively, the deterministic coordination case tends to produce higher aggregated incentive payments because households are able to track the requested flexibility profiles more accurately. In contrast, the uncertainty-aware case exhibits slightly reduced total incentive payments but a larger number of smaller penalty activations. This reflects the conservative scheduling behavior adopted by households when accounting for uncertainty in load demand and PV generation.
Finally, the comparative net daily cost results shown in
Figure 6 highlight the economic impact of the proposed coordination mechanism. The re-optimization without uncertainty significantly reduces the household electricity cost compared to the baseline case. However, the net electricity cost under uncertainty is higher because the prosumer is penalized for deviations from the promised flexibility and scheduled power demand.
As illustrated in
Figure 6, the deterministic coordinated case achieves the lowest daily electricity cost because device scheduling can be closely aligned with both flexibility incentives and tariff signals. In contrast, the uncertainty-aware case results in a moderate increase in daily net cost due to the combined effect of deviation penalties and the conservative operational margins adopted by households to hedge against uncertainty in demand and PV generation.
This additional cost corresponds to maintaining feasibility margins and absorbing deviation risk under uncertainty. Overall, the results demonstrate that incorporating uncertainty slightly reduces economic optimality but substantially enhances operational reliability, contractual integrity, and realistic enforcement of flexibility agreements within the hierarchical EMS framework.
To further position the proposed framework relative to existing flexibility coordination approaches reported in the literature, the following benchmarking discussion is provided. Deterministic coordination models typically rely on forecasted load and generation profiles and therefore do not explicitly account for uncertainty in distributed energy resources. Stochastic or multi-stage scheduling approaches incorporate uncertainty through scenario-based optimization but often require the generation of a large number of scenarios, which increases computational complexity in large-scale residential systems. Data-driven demand response coordination methods use machine learning techniques for customer segmentation and flexibility estimation but primarily focus on identifying flexible consumers rather than performing optimization-based scheduling with network-level validation. In contrast, the proposed framework integrates uncertainty-aware HEMS scheduling, aggregator-level flexibility allocation, and DSO-level AC optimal power flow validation within a unified architecture using a -budget-robust optimization formulation. This enables explicit modeling of uncertainty in distributed energy resources while maintaining computational tractability for large-scale residential systems.
3.5. DSO-Level Optimal Power Flow Results
To evaluate the network-level impact of the proposed hierarchical coordination framework, the OPF is executed after the HEMS re-optimization under both deterministic and uncertainty-aware conditions.
Figure 7 illustrates the voltage magnitude profile across all buses of the 33-bus distribution system at time step
, which corresponds to a high loading interval.
The base power flow case without coordination exhibits significant voltage drops along downstream buses, with several nodes approaching the lower admissible limit. The OPF-only case (opt) improves the voltage profile by optimally dispatching network resources; however, noticeable voltage deviations remain in heavily loaded segments. In contrast, the coordinated cases (re-opt) that integrate flexibility requests from the DSO and re-optimized HEMS schedules demonstrate substantial voltage profile enhancement. Both deterministic and uncertainty-aware coordination maintain bus voltages close to the nominal value (1.0 p.u.) and well within the statutory limits.
Although the uncertainty-aware case shows slightly more conservative voltage support compared to the deterministic case, the overall voltage regulation performance remains significantly improved relative to the base and OPF-only scenarios. This confirms that the proposed flexibility-based coordination not only reduces household electricity costs but also enhances network operational security. Importantly, incorporating uncertainty does not compromise voltage feasibility; rather, it ensures robustness against potential load and generation deviations while preserving system stability.
From an operational perspective, this result indicates that uncertainty-aware flexibility coordination can assist DSOs in maintaining secure voltage profiles while accommodating variability in distributed generation and demand. Such coordinated flexibility can therefore serve as an operational support tool for managing increasing DER penetration in distribution networks.