Next Article in Journal
Methane Hydrate Formation Enhanced by the Biofriendly Peptide-Based Promoter L-Glutathione: An Analysis of the Influencing Factors in Formation Kinetics
Next Article in Special Issue
Data-Driven Digital Twin for Real-Time Management of Community-Scale Grid-Connected Battery Energy Storage Systems
Previous Article in Journal
Optimized Design of Side-Connected Rectified Planar Transformer for Data Center DCX Modules
Previous Article in Special Issue
Optimizing Renewable Energy Distribution Networks with AI Techniques: The A-IsolE Project
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Tri-Stage Optimization Framework for Optimal Clustering of Power Distribution Systems into Sustainable Microgrids

by
Yahia N. Ahmed
,
Ahmed Abd Elaziz Elsayed
and
Hany E. Z. Farag
*
Department of Electrical Engineering and Computer Science, York University, Toronto, ON M3J 1P3, Canada
*
Author to whom correspondence should be addressed.
Energies 2026, 19(9), 2050; https://doi.org/10.3390/en19092050
Submission received: 5 March 2026 / Revised: 14 April 2026 / Accepted: 17 April 2026 / Published: 23 April 2026

Abstract

Decentralized sustainable microgrids are emerging as a promising approach for addressing the increasing complexity of modern power systems while ensuring reliable and efficient operation. A fundamental driver of this transition is the partitioning of distribution networks into self-sufficient microgrids supported by the effective integration of Distributed Energy Resources (DERs) and Energy Storage Systems (ESSs), enabling improved power flow management and enhanced voltage stability. In this regard, this paper proposes a tri-stage optimization framework designed to segment power distribution systems into multiple self-sustaining microgrids while maintaining optimal network performance. In the first stage, the distribution grid is partitioned into microgrid clusters based on electrical distance metrics and bus correlation analysis. The second stage focuses on the optimal sizing and operational management of DERs and ESSs within each identified microgrid to ensure energy self-sufficiency and minimize greenhouse gas (GHG) emissions. In the third stage, an optimal resource allocation strategy is implemented, where the resources determined in the previous stage are optimally placed within the distribution network to achieve optimal power flow, reduce system losses, and maintain voltage stability under worst-case operating conditions. The proposed framework is validated using the IEEE 33-bus test system. Simulation results demonstrate its effectiveness in multi-microgrid classification, coordinated planning, and resource allocation, highlighting its superiority in enhancing system performance and resilience.

1. Introduction

1.1. Motivation and Background

The continuous growth in electricity demand from the residential and commercial sectors, which together account for nearly 40% of total energy consumption, combined with the accelerating electrification of other energy domains such as Electric Vehicles (EVs), has imposed significant pressure on power systems to satisfy rising demand while maintaining system reliability and avoiding costly infrastructure expansion [1,2]. Moreover, the requirement to achieve net-zero Greenhouse Gas (GHG) emissions in the electricity sector has introduced a new operational paradigm for Power Distribution Systems (PDSs), increasingly dependent on Distributed Energy Resources (DERs), including distributed generation technologies such as Photovoltaic (PV) systems and distributed storage solutions such as Battery Storage Systems (BSS) [3]. The integration of DERs into medium- and low-voltage PDSs has significantly increased the complexity of centralized system operation. This added complexity has driven the emergence of microgrids as an effective framework for managing localized generation and demand. Accordingly, there is a growing need to adopt decentralized and sustainable energy solutions capable of meeting rising electricity demand while simultaneously fulfilling environmental net-zero objectives [4].
In this context, microgrids are defined as medium- or low-voltage PDSs equipped with on-site distributed generation and energy storage resources to supply local demand. Microgrids can operate either in grid-connected mode, where the main grid supports local demand, or in islanded mode, where they function independently and rely solely on on-site DERs to satisfy their energy requirements [5]. The technical and economic feasibility of operating such microgrids in complete isolation has been extensively validated in recent literature. Studies demonstrate that with the optimal sizing of hybrid DERs and BSS, isolated microgrids can robustly maintain a supply and demand balance without grid reliance. For instance, fully sustainable isolated systems have proven highly viable, utilizing diverse energy mixes such as solar, wind, and biomass to achieve economical and resilient power delivery independently of the main grid [6,7]. Furthermore, the integration of demand management and flexible load regulation, including the utilization of mobile energy storage, significantly enhances dynamic supply and demand matching during such isolated operation [8]. The optimal sizing and management of on-site DERs within microgrids play a critical role in ensuring demand satisfaction without load curtailment, particularly during islanded operation or main grid failure. However, operating PDSs as a collection of fully independent microgrids may result in oversizing DER capacity to satisfy islanded operation requirements, leading to underutilization during grid-connected operation. Conversely, sizing on-site DERs based solely on grid-connected assumptions may reduce capacity but risk failing to meet demand during islanded conditions [9]. Therefore, it is essential to establish a framework that enables PDSs to be clustered into groups of sustainable microgrids capable of collaborating during islanded operation. Such a framework should identify microgrids with similar electrical characteristics and within feasible operational distances, optimize their resources in a coordinated manner to prevent unnecessary oversizing, and allocate resources across the network buses, including reactive power support devices such as Shunt VAR compensators, to ensure voltage stability and minimize system losses [10].

1.2. Literature Review

The optimal planning and management of microgrids have been extensively investigated in previous studies, primarily focusing on estimating DER capacity and ensuring efficient real-time operation [11]. In this context, the interaction between microgrids and PDSs is commonly represented in two forms: (1) microgrids are allocated at a single bus within the PDS, typically modeled as a DER or fixable load at the point of coupling [12,13,14,15], and (2) microgrids are structured as a group of interconnected PDS buses that share common DERs and a coordinated control system [16,17,18,19,20,21,22,23,24,25,26].
In the first form, microgrids host on-site distributed generation, energy storage, and loads that are jointly controlled to create a bus within the PDSs capable of exhibiting flexible generation or load behavior, thereby enhancing overall system flexibility and operational performance [27]. Within this context, Chenjia Gu et al. [12] proposed a Mixed Integer Non-linear Programming (MINLP) framework for the optimal planning of DERs in hydrogen-based microgrids. To promote reduced GHG emissions, the accumulated carbon intensity is explicitly modeled, penalized in the objective function, and constrained by an upper limit. The hydrogen-based microgrids, together with DERs across the PDSs, are then optimally coordinated to minimize GHG emissions while improving hydrogen profitability and overall system efficiency. Similarly, the study in [13] introduced a two-stage stochastic rolling planning framework for microgrids. The proposed approach adopts a collaborative decentralized structure in which each microgrid manages its own resources while a centralized coordinator facilitates energy exchange among microgrids, allowing them to share surplus energy or request support from neighboring microgrids for energy trading among microgrids, while excluding support from the main grid.
In a similar vein, Atazadegan et al. [14] investigated the effects of islanded, non-cooperative, and cooperative strategies on microgrid generation expansion planning. The findings indicate that enabling energy trading among microgrids can significantly enhance economic performance, yielding an improvement of approximately 18% in financial outcomes. To address the operational complexity of cooperative microgrids, the study in [15] proposed a master–slave game-based scheduling approach for a group of microgrids sharing a common BSS. In the first stage of the two-stage framework, the capacity allocation share of the BSS for the microgrid groups and the PDS is determined, along with the optimal scheduling of charge and discharge power. In the second stage, power interactions among the microgrids are coordinated under a cooperative alliance to ensure reliable demand satisfaction. However, these efforts predominantly model microgrids as single-bus entities (e.g., individual facilities or aggregated loads), which limits the representation of their physical and electrical interactions with the PDSs. Such simplifications often overlook the spatial distribution of resources, network constraints, and power flow impacts across multiple buses. Moreover, limited attention is given to how cooperative coordination among microgrids can be systematically leveraged to enhance overall PDS performance, particularly in terms of voltage regulation, reactive power support, and network loss minimization.
On the other hand, the second form partitions the PDS electric buses into clusters of microgrids, where each microgrid is represented by a set of electrically interconnected and collaborative buses operating under distributed control frameworks [16]. The primary objective of this structure is to ensure reliable demand supply in the absence of main grid support or, alternatively, to minimize dependence on the main grid by maximizing the utilization of local resources. An early study in [17] addressed the resilience of PDSs against natural disasters by clustering the network into isolated spatial zones. Within this framework, distributed generation units were optimally planned and allocated across the PDSs under worst-case scenarios to minimize demand outages and enhance system resilience. Similarly, Habib et al. [18] proposed a Linear Programming (LP) planning framework for PDSs that considers clustering into four microgrids. The objective was to reduce overall operational costs while accounting for uncertainties associated with renewable energy and EVs integration, through the adoption of smart prosumers, Vehicle-to-Grid (V2G), and BSS, thereby improving demand management and the controllability of clustered microgrids.
Zhao et al. [19], on the other hand, utilized hydrogen refueling stations to enhance the resilience of PDSs during main grid failures, where hydrogen transportation among stations is explicitly modeled through a spatial transportation network that accounts for geographical locations. Information gap decision theory is employed to achieve robust planning under uncertainties in demand and renewable energy generation. Likewise, the study in [20] proposed a microgrid formation and scheduling framework to support real-time system restoration during natural disasters while minimizing the number of load outages. The proposed two-stage framework first determines the optimal microgrid formation and subsequently performs the optimal scheduling of the formed microgrids. Although these studies account for PDS interaction and represent microgrids as clusters of buses, the clustering process is often arbitrary or primarily driven by low-probability contingency events. Consequently, such approaches do not provide PDS operators with a systematic method to classify the network based on its electrical characteristics, which is essential for enabling effective decentralized control and ensuring long-term sustainable operation of clustered microgrids.
In another line of research, several clustering techniques have been proposed for partitioning PDSs. In [21], a cooperative increment-based strategy is introduced, which relies on prior individual planning of each microgrid before the clustering process, thereby limiting its flexibility when microgrid planning is still evolving. In [22], a graph theory-based method is presented that offers computational efficiency but primarily focuses on topological uniformity and employs fixed cluster size thresholds based on the number of buses, with limited consideration of electrical characteristics. Among existing approaches, hierarchical clustering has attracted considerable attention for PDS applications due to its interpretability and adaptability. The method initially treats each node as an independent cluster and iteratively merges the most similar clusters according to a predefined proximity metric until a stopping criterion, such as a desired number of clusters, is satisfied. A crucial element in this process is the definition of electrical distance, which measures the similarity between nodes based on their electrical behavior. Electrical distance can be quantified using different metrics, including geographical distance, line impedance, voltage magnitude sensitivity, phase angle sensitivity [23], and power flow distribution factors [24]. These metrics capture diverse aspects of electrical interactions and facilitate the construction of distance matrices that better represent the intrinsic electrical structure of the network. Nevertheless, some of these formulations [23,24] become computationally intensive for large-scale systems. Although the approach in [25] integrates spectral clustering with electrical distance matrices, its performance is highly dependent on the accuracy of the sensitivity matrix, and it still entails considerable computational burden when applied to large distribution networks. Recent advancements in microgrid planning have explored complex multi-level optimization structures to manage operational uncertainties. For instance, a tri-level robust optimization model was recently developed for planning bi-directional converter interconnections among predefined hybrid AC/DC microgrids [26]. This approach addresses dynamic converter efficiency and renewable energy uncertainty via a data-correlated uncertainty set formulated within a min-max-min mathematical structure. While highly effective for ensuring robust component sizing and operation against worst-case scenarios, such frameworks typically assume fixed, pre-existing microgrid boundaries.
Despite the extensive body of literature on microgrid planning, clustering, and cooperative operation, existing frameworks largely address specific aspects of the problem in isolation and lack a holistic perspective tailored to PDSs. In particular, several key research gaps can be identified:
  • Most studies model microgrids as single-bus or aggregated entities, neglecting their multi-bus electrical interactions within PDSs and limiting the accuracy of system-level representation;
  • Existing clustering approaches often rely on arbitrary partitioning, topological metrics, or contingency-driven designs, rather than electrically informed and accurate clustering that reflects true network characteristics;
  • Limited attention is given to the resource allocation within PDS buses, including both active and reactive power support, to enhance voltage regulation, loss minimization, and operational efficiency;
  • Most approaches do not provide a unified operational structure that enables flexible modes, such as cooperative energy sharing among clustered microgrids, or islanded operation from the main grid.
Consequently, none of the existing frameworks ensures accurate microgrid clustering within PDSs for long-term sustainability, while simultaneously supporting adaptive resource planning, scalable expansion, and coordinated allocation of resources across interconnected microgrids. A comparative summary of the discussed literature and the proposed framework is presented in Table 1.

1.3. Contribution and Paper Organization

To address the aforementioned research gaps, this paper proposes a hierarchical tri-stage optimization framework for clustering PDSs into sustainable and cooperative microgrids. In the first stage, a simple yet effective hierarchical agglomerative clustering method is developed based on an electrical distance matrix constructed from the impedance characteristics of distribution lines, enabling electrically meaningful partitioning of the network. In the second stage, the DERs of the formed microgrids are optimally planned, where renewable generation and BSS capacities are designed to ensure resilient operation with minimal dependence on the main grid, including the capability for fully isolated operation when required. In the third stage, the planned DER capacities are optimally allocated across the PDS buses, together with reactive power support resources, to enhance voltage stability and minimize network power losses while ensuring coordinated operation of the clustered microgrids.
The main contributions of the proposed framework can be summarized as follows:
  • The development of an electrically grounded hierarchical clustering approach that accurately partitions PDSs into sustainable and collaborative microgrids;
  • A comprehensive co-optimization of DER planning and microgrid clustering that supports both predefined and expandable resource capacities for long-term sustainability;
  • An integrated resource allocation strategy within clustered microgrids, including both active and reactive power resources, to improve voltage regulation and reduce system losses;
  • The provision of a flexible operational structure that enables cooperative, grid-connected, and fully islanded modes of operation among microgrids;
The remainder of this paper is organized as follows. Section 2 presents the proposed tri-stage framework and details the associated mathematical formulation. Section 3 describes the studied system and provides the case studies along with the corresponding results and discussions. Finally, Section 4 concludes the paper.

2. The Proposed Tri-Stage Optimization Framework

This section presents the mathematical formulation of the proposed tri-stage optimization framework, which includes PDS microgrid clustering, optimal DER resource planning for the clustered microgrids, and the optimal allocation of DERs and reactive power components across the PDS in successive stages. Figure 1 illustrates the overall tri-stage process of the proposed framework, comprising: (1) microgrid clustering formulation, (2) optimal DER planning under different operational scenarios, and (3) coordinated allocation of DERs within the PDS along with reactive power resources to enhance voltage regulation and minimize network losses.

2.1. Stage I: PDS Clustering Algorithm

The relationships among buses in a PDS are governed not only by their physical topology but also by their underlying electrical characteristics, which are inherently reflected in the electrical distance between buses. Although the concept of electrical distance has been employed in various power system applications, its utilization for network structural analysis and clustering remains relatively limited. In Stage I of the proposed framework, the electrical distance between any two buses i and j, defined based on the impedance of the distribution line connecting them, is used as the primary metric for assigning buses to the same cluster. Accordingly, the pairwise electrical distance between Bus i and Bus j is computed using (1).
d i j = Z i j = R i j 2 + X i j 2 , i , j N
Here, R i j and X i j denote the per-unit resistance and reactance of the line connecting Buses i and j, respectively, while the square matrix D R N × N represents the electrical proximity among the PDS N buses. For non-adjacent buses, a sufficiently large constant value is assigned to capture weak or indirect electrical coupling. The diagonal elements of D are set to zero, indicating zero electrical distance of each bus from itself.
Initially, each bus is treated as an individual cluster, resulting in a total of N clusters. The average linkage electrical distance between two clusters, denoted as groups A and B, is then defined according to (2).
d ( A , B ) = 1 | A | | B | i A j B d i j
Clusters are then iteratively merged using the average linkage criterion, where, at each iteration, the pair of clusters with the minimum distance d ( A , B ) is combined, thereby progressively reducing the total number of clusters. This hierarchical merging process continues until a predefined number of clusters M is obtained [28]. The selection of the optimal number of clusters M is guided by domain-specific requirements and analysis of the clustering dendrogram, ensuring that each resulting microgrid exhibits strong internal electrical coherence and feasible operational boundaries. Algorithm 1 highlights the clustering steps of the PDSs.
Algorithm 1 Hierarchical Agglomerative Clustering for PDS Partitioning
Input: 
Distribution network topology, line parameters ( R i j , X i j ), and target number of clusters M .
Output: 
Partitioning of N buses into M sustainable microgrid clusters.
  1:
Initialize Distance Matrix:
  2:
for each pair of buses ( i , j )  do
  3:
    if bus i and j are directly connected then
  4:
        Compute d i j = R i j 2 + X i j 2
  5:
    else if i = j then
  6:
        Set d i j = 0
  7:
    else
  8:
        Set d i j =
  9:
    end if
10:
end for
11:
Initial Clustering: Assign each bus i to its own cluster C i = { i : i N } .
12:
Iterative Merging:
13:
while number of clusters > M  do
14:
    Calculate inter-cluster distances for all pairs ( A , B ) using average linkage:
15:
     d ( A , B ) = 1 | A | | B | i A j B d i j
16:
    Find the pair of clusters ( A * , B * ) that minimizes d ( A , B )
17:
    Merge A * and B * into a single cluster: C n e w = A * B *
18:
    Update the set of clusters by replacing A * and B * with C n e w
19:
end while
20:
return Final set of M microgrid clusters.

2.2. Stage II: Optimal Planning of Microgrids DERs

The first Stage I provides the set of microgrids M and the corresponding set of buses assigned to each microgrid m (i.e., B m B , m M ). Subsequently, Stage II is employed to determine the optimal sizing of DER components, including distributed generation and ESSs, for each clustered microgrid. In this paper, Photovoltaic (PV) and wind turbines are used as distributed generation and the BSS is used as ESS to improve the microgrids flexibility.
The objective function is formulated to minimize the DER investment and operational costs for each microgrid m across three distinct operational modes: a fully islanded mode with no collaboration, a local cooperation mode among microgrids without external utility support, and a full coordination mode between the microgrids and the main grid. Depending on the operating mode, the microgrids can rely on the installed DERs, power imported from the main grid, or power exchanged with adjacent microgrids within the PDS.
The planning decision variables include the optimal capacities S m { . } and corresponding PCS ratings P C m { . } for the DER units (PV, wind, and BSS). The operational decision variables represent the system states across various scenarios and time steps; these include the power imported from the main grid P m , t , s g r i d , the power exchanged between microgrid m and adjacent microgrids P m , t , s μ g , and the power utilized P m , t , s { . } , U or curtailed P m , t , s { . } , C r from PV and wind generation. Furthermore, these variables encompass the charging P m , t , s Ch and discharging P m , t , s Dch power of the BSS, in addition to its state of charge (SOC) SoC m , t , s .

2.2.1. Objective Function

The objective function is formulated to balance asset investment and energy cost. It optimizes Capital Expenditures (CAPEX) associated with PV, wind, and BSS sizing, and corresponding PCS ratings. From an operational perspective, the objective function minimizes Operational Expenditures (OPEX), including the cost of energy procurement and energy trading among microgrids as well as with the main grid. The objective function is given in (3).
min : m M C A P E X m + m M s S P ( s ) · O P E X m , s
Here, C A P E X m denotes the investment cost of DERs for microgrid m, while the term s S P ( s ) · O P E X m , s represents the expected OPEX, where uncertainties in DER generation and microgrid demand are captured through a set of discrete operational scenarios s, each characterized by a probability of occurrence P ( s ) .
The C A P E X represents the upfront investment costs for PV, wind, BSS, and PCS units, which are normalized into hourly equivalents and summed over the optimization horizon specified in Equation (4).
C A P E X m = t T Δ t 8760 [ C PV S m PV + C U n i P C P C m PV τ PV + C W S m W + C U n i P C P C m W τ W + C BSS S m BSS + C B i P C P C m BSS τ BSS ]
The planning decision variables for microgrid m include the capacity S m { . } and the associated PCS rating P C m { . } (in kW or kWh) for the PV, wind, and BSS units. In this formulation, C { . } and τ { . } represent the unit investment cost (in $/kW or $/kWh) and the expected lifetime of each component in years.
The O P E X accounts for the cost of energy imported from the main grid and the bidirectional energy exchange between microgrid m and adjacent microgrids, as formulated in (5)
O P E X m , s = t T ( E g r i d · P m , t , s g r i d + E μ g · P m , t , s μ g ) Δ t
The operational decision variables for microgrid m include the power imported from the main grid P m , t , s g r i d and the power exchanged with adjacent microgrids P m , t , s μ g (in kW). A positive value for P m , t , s μ g indicates power received by microgrid m, and a negative value indicates power supplied to neighboring microgrids. In this formulation, E g r i d and E μ g represent the unit energy costs (in $/kWh) for main grid purchases and inter-microgrid exchanges, respectively.

2.2.2. Constraints

To ensure demand satisfaction for each microgrid, the objective function is constrained by the power balance condition at the microgrid level, as formulated in (6).
P m , t , s g r i d + P m , t , s μ g + P m , t , s P V , U + P m , t , s W , U + P m , t , s D c h P m , t , s C h = b B m P b L , t T m M s S
where the operational variables P m , t , s { . } , U and P m , t , s { . } , C r denote the distributed generation utilized and curtailed power (kW), respectively, while P m , t , s c h and P m , t , s D c h represent the BSS charging and discharging power (kW). The term b B m P b L corresponds to the aggregated load demand of microgrid m across all buses assigned to it.
The power exchanged between microgrids must also satisfy a balance condition, ensuring that any power imported or exported by a microgrid is compensated by corresponding exports or imports from other microgrids, as defined in (7).
m M P m , t , s μ g = 0 , t T m M s S
The utilized and curtailed PV and wind power are limited to the maximum generation available from the installed capacities by constraints (8) and (9), respectively:
P m , t , s P V , U + P m , t , s P V , C r = S m P V · P t , s P V | 1 M W , t T m M s S
P m , t , s W , U + P m , t , s W , C r = S m W · P t , s W | 1 M W , t T m M s S
where P t , s { . } | 1 MW denotes the maximum power output per 1 MW of distributed generation under time t and scenario s.
The BSS SoC is constrained by the energy balance, such that any change in S o C m , t , s corresponds precisely to the energy charged into or discharged from the BSS at each time step. The BSS energy balance is formally expressed in (10).
SoC m , t + 1 , s = SoC m , t , s + η PCS P m , t , s Ch P m , t , s Dch / η PCS Δ t , t T m M s S
α ̲ S m BSS SoC m , t , s α ¯ S m BSS , t T m M s S
Here, η PCS denotes the efficiency of the PCS, while α ̲ and α ¯ represent the lower and upper bounds of the SoC, respectively, to prevent excessive BSS degradation. Additionally, the BSS charging and discharging powers are constrained to prevent simultaneous charging and discharging, as specified in (12).
P m , t , s Ch × P m , t , s Dch = 0 , t T m M s S
To ensure that the coordinated power dispatch from DERs remains within the limits of their respective PCS converter ratings, the operational power decision variables are constrained by the corresponding PCS capacities as follows:
0 P m , t , s P V , U P C m P V , t T m M s S
0 P m , t , s W , U P C m W , t T m M s S
0 P m , t , s C h , P m , t , s D c h P C m B S S , t T m M s S
The planning decision variables are subject to upper bounds to ensure feasible component sizing as follows:
0 S m { . } S ¯ m { . } , m M
0 P C m { . } P C ¯ m { . } , m M
where S ¯ m { . } and P C ¯ m { . } denote the maximum allowable capacity and PCS rating for each respective component (PV, wind, and BSS) within microgrid m.
Finally, two additional constraints are introduced to enable flexible adjustment of the optimization framework under different operational scenarios, including grid-connected, cooperative, and fully islanded microgrid operation. To enforce islanded operation from the main grid, constraint (18) is incorporated to prohibit energy import from the main grid. Under this condition, microgrids are allowed to operate cooperatively through energy exchange among themselves. For fully isolated operation, constraint (19) is further included to prevent any import or export of energy between microgrids, thereby ensuring completely independent operation.
P m , t , s g r i d = 0 , t T m M s S , ( Prevents   main   grid   contribution . )
P m , t , s μ g = 0 , t T m M s S , ( Prevents   microgrids   energy   exchange . )

2.3. Stage III: DERs and Reactive Power Resources Allocations

Stage II determines the optimal sizing of the DERs within each microgrid under different operation scenarios to address the uncertainties in both generation and demand, focusing mainly on active power. Subsequently, Stage III determines the optimal placement and allocation of the DERs within each microgrid, as well as the required reactive power resources (i.e., shunt capacitors) to meet the reactive power demand. During this stage, the optimization is designed for two main objectives: (1) reactive power demand fulfillment, and (2) improving the microgrids’ operation, represented by voltage regulation and PDS power losses. Under this configuration, the planning decision variables of Stage III are the allocated capacity of wind ( S b W , P C b W ), PV ( P C b P V , S b P V ), BSS ( S b BSS , P C b BSS ), and the reactive power resources ( S b Q ) for each bus within each microgrid. On the other hand, the management decision variables include the PDS state variables ( | V b , t | δ b , t ) and active and reactive power coordination from the DERs and reactive power resources ( P b , t W , U , P b , t P V , U , P b , t C h , P b , t D c h , Q b , t V a r )

2.3.1. Objective Function

In this stage, the objective is designed to reduce the CAPEX of the reactive power resources, i.e., one-time investment cost, and to enhance the PDS operation represented by improving the voltage regulation and minimizing overall PDS power losses. The multi-objective function of Stage III is defined by (20).
min : w 1 P l o s s + w 2 Δ V + w 3 C A P E X V a r
P l o s s = t T b B b B | V b , t | | V b , t | | Y b b | C o s ( δ b , t δ b , t θ b b )
Δ V = t T b B | 1 p . u | V b , t | |
C A P E X V a r = t T Δ t 8760 C Var b B S b Q τ Q
Here, w 1 , 2 , 3 are weighting coefficients that regulate the trade-off among the multiple objective components. Equation (21) quantifies the network power losses as a function of the bus voltage magnitudes | V b , t | , voltage angles δ b , t , and the elements of the admittance matrix | Y b b | θ b b between interconnected buses. Equation (22) represents the voltage deviation of all buses from the nominal value of 1 p.u. Finally, (23) models the CAPEX associated with reactive power components, where S b Q denotes the reactive power resource allocated at bus b. This term stands for the CAPEX alone, where reactive power OPEX is accounted for within the energy cost provided by the PDS operator; i.e., the energy cost of the main grid accounts for the reactive power needed by the consumers.
The weighting coefficients are calculated to normalize the three objectives into the same operational range. This is achieved by calculating the ratio between the lower bounds of each objective, as defined in (24).
w 1 = C A P E X V a r ̲ P l o s s ̲ , w 2 = C A P E X V a r ̲ Δ V ̲ , w 3 = 1
Here, C A P E X V a r ̲ represents the lower bound of the reactive resources CAPEX when all other objectives are ignored (i.e., w 1 = w 2 = 0 ). Similarly, P l o s s ̲ represents the lower bound of the PDS power loss when the other objectives are ignored, and Δ V ̲ represents the lower bound of the PDS voltage regulation.

2.3.2. Constraints

To ensure power flow balance, these objectives are subject to the power flow constraints defined in (25)–(27).
V b ̲ V b , t V b ¯ , t T b B
P b , t P V , U + P b , t W , U + P b , t D c h P b , t C h P b , t D = | V b , t | b B | V b , t | | Y b b | C o s δ b , t δ b , t θ b b , t T b B
Q b , t V a r Q b , t D = | V b , t | b B | V b , t | · | Y b b | S i n δ b , t δ b , t θ b b , t T b B
where V b ̲ and V b ¯ denote the lower and upper voltage magnitude limits at bus b, respectively. The term P b , t { . } , U represents the utilized distributed generation power at bus b, while P b , t C h and P b , t D c h denote the BSS charging and discharging power at the same bus. Furthermore, P b , t D and Q b , t D correspond to the active and reactive power demand, respectively, and Q b , t V a r represents the reactive power injected by the VAR resources at bus b.
In this stage, each bus is assumed to be capable of hosting on-site DERs, including wind, PV, and BSS units. However, the injected power from these on-site resources is constrained by their corresponding installed capacities, as defined in (30)–(33).
P b , t P V , U + P b , t P V , C r = S b P V · P t P V | 1 M W , t T b B
P b , t W , U + P b , t W , C r = S b W · P t W | 1 M W , t T b B
0 P b , t P V , U P C b P V , t T b B
0 P b , t W , U P C b W , t T b B
0 P b , t C h , P b , t D c h P C b B S S , t T b B
S b Q Q b , t V a r S b Q , t T b B
Here, S b P V and S b W denote the allocated PV and wind capacities at bus b, respectively, while P C b B S S represents the allocated BSS PCS rating at that bus. The energy storage system at bus b is further constrained by the energy balance Equation (34), the upper and lower SoC bounds defined in (35), and the constraint preventing simultaneous charging and discharging as specified in (36).
SoC b , t + 1 = SoC b , t + η PCS P b , t Ch P b , t Dch / η PCS Δ t , t T b B
α ̲ S b BSS SoC b , t α ¯ S b BSS , t T b B
P b , t C h × P b , t D c h = 0 , t T b B
Finally, to ensure consistency between the optimal design determined in Stage II and the allocation process in Stage III, the capacities assigned within each microgrid are constrained to comply with the previously estimated optimal values under different operational scenarios. This is achieved by bounding the allocated capacities in this stage within predefined upper and lower limits, as specified in (37)–(42).
S m P V b B m S b P V ( 1 + Δ S ) S m P V , m M
S m W b B m S b W ( 1 + Δ S ) S m W , m M
S m B S S b B m S b B S S ( 1 + Δ S ) S m B S S , m M
P C m P V b B m P C b P V ( 1 + Δ S ) P C m P V , m M
P C m W b B m P C b W ( 1 + Δ S ) P C m W , m M
P C m B S S b B m P C b B S S ( 1 + Δ S ) P C m B S S , m M
The term ( 1 + Δ S ) is introduced to permit an increase in the total design capacity by a percentage Δ S in order to compensate for the PDS line losses. The value of Δ S is estimated to represent the worst-case power loss in the system, which is calculated by assuming no DERs are installed and PDSs rely on the main power grid alone. It is worth noting that while Stage II is solved for multiple scenarios S to account for DERs and demand uncertainty, Stage III is solved under the worst-case operational scenario due to the strong nonlinearity of the power flow equations.
In order to account for the geographical limitations of installing wind turbines, constraint (43) is used to ensure that wind turbines are installed at suitable buses.
S W b = 0 , b B m B m W m M
Here, B m W represents the set of buses within microgrid m where wind turbines can be installed, while the term B m B m W denotes the remaining buses within microgrid m

3. Simulation Results

This section evaluates the performance of the proposed tri-stage optimization framework, validated on the IEEE 33-bus test system. The analysis begins by demonstrating the clustering algorithm’s flexibility and interpretability, utilizing distribution line impedances to decentralize the system into electrically coherent microgrids. Following this decentralization, the framework addresses the coordinated planning of multi-microgrid systems. Utilizing historical load and renewable generation data from the Ontario electricity market [29], the model determines the optimal sizing of PV, wind, and BSS units by evaluating the aggregated bus loads within each microgrid cluster alongside the maximum power output per 1 MW of distributed generation. As illustrated in Figure 2, these profiles represent the microgrid loads and the maximum power output per 1 MW of distributed generation over five representative days. This sizing process is conducted across three distinct operational scenarios: Case 1, a fully islanded mode with no collaboration; Case 2, a local cooperation mode among microgrids without external utility support; and Case 3, which incorporates full coordination between the microgrids and the main grid. Table 2 summarizes the simulation parameters for the optimization.
In the final stage, an optimal resource allocation strategy is implemented to finalize the system design. In this stage, the resources determined in the previous sizing phase are optimally placed within the distribution network. This step is designed to achieve optimal power flow, minimize system losses, and maintain voltage stability under worst-case operating conditions. The simulation framework was developed in Python and utilized the Gurobi optimizer to solve the models for Stages II and III on an Apple workstation equipped with an M1 Pro processor and 16 GB of RAM. The solver was configured with an aggressive level two presolve and an MIPFocus of one to prioritize the rapid discovery of high-quality feasible solutions. To address the non-convex formulation, a level one cutting plane strategy was employed with a relative optimality gap (MIPGap) of 3.5 percent. This configuration guarantees that the final incumbent solution is within a 3.5 percent relative difference from the best possible objective bound. Additionally, a primal feasibility tolerance of 0.01 was implemented to ensure the solver yields high-precision results within a practical timeframe.

3.1. Microgrid Clustering

The clustering Stage I begins by specifying the target number of microgrid clusters, which is set to M = 3 for the IEEE 33-bus test system. This selection demonstrates the flexibility of the proposed method in determining M based on system characteristics. Figure 3 presents the clustering dendrogram, illustrating how different buses are progressively merged into the same cluster according to their electrical distance. The grouping of buses and the resulting clustered microgrids for the IEEE 33-bus system are shown in Figure 4, indicating that electrically adjacent buses are assigned to the same microgrid. Furthermore, power flow analysis under full-load conditions confirms that the clustering algorithm effectively captures the network’s electrical structure through line impedance characteristics. As depicted in Figure 5, transitions between clusters correspond to noticeable variations in voltage magnitude while maintaining compliance with operational limits.

3.2. Optimal Planning of Clustered Microgrid DERs

In Stage II, following the clustering process, representative load profiles are constructed by aggregating the buses within each microgrid and averaging the renewable generation profiles at the bus level. These aggregated profiles are then incorporated into the optimization model over a one-year planning horizon with hourly resolution Δ t = 1 h.
To capture stochastic behavior, scenario-based variations are generated for the demand P b L , solar generation profiles P t , s P V | 1 M W , and wind generation profiles P t , s W | 1 M W . These variations are created independently for each microgrid m M and scenario s S . Each parameter is obtained by perturbing its base profile at time t T using a Gaussian distribution centered around the nominal value. The Probability Density Function (PDF) of this distribution is defined as:
f ( x ) = 1 σ 2 π e 1 2 x μ σ 2
where x denotes the generated stochastic variable, μ represents the mean (base) value, and σ denotes the standard deviation. For the demand profile, a standard deviation of 5 % × P b L is applied, with sampled values clipped to the interval [ 0.8 P b L , 1.2 P b L ] . Similarly, both P t , s P V | 1 M W and P t , s W | 1 M W are generated using a standard deviation equal to 10 % of their respective base values, and are restricted to the range [ 0.7 , 1.3 ] times the nominal profile. This independent sampling approach captures the localized spatial and temporal variability of both load demand and renewable generation across the system.
However, while practical for current computational frameworks, simple statistical distributions may struggle to fully capture the complex, non-Gaussian temporal dependencies inherent in real-world energy profiles. Recent advancements in deep generative models have demonstrated a strong ability to learn and reproduce these intricate data distributions. Specifically, adversarial learning architectures, such as cycle-consistent Generative Adversarial Networks (GANs), offer robust representations of load series characteristics within low-dimensional latent spaces [30]. Furthermore, modern diffusion models equipped with 3D attention mechanisms have been developed to effectively capture complex hierarchical, temporal, and feature correlations across diverse energy communities [31]. While employing such advanced time-series foundation models for scenario generation represents a promising direction for achieving highly realistic operational conditions, their implementation is currently beyond the scope of this work. Under these stochastic conditions, the model is assessed under three distinct operational cases: Case 1 considers independent islanded operation without peer collaboration; Case 2 allows microgrids cooperation while remaining isolated from the main grid; and Case 3 assumes fully coordinated operation among all microgrids and the main utility grid.
The optimal capacity sizing results for both the individual microgrids and the aggregated system are summarized in Table 3. As observed, the required asset capacities vary across the different operational cases. In Case 1, independent islanded operation necessitates the highest generation capacity, as each microgrid must independently hedge against stochastic variations to reliably satisfy its local demand. In Case 2, the introduction of a collaboration strategy enables microgrids to share resources and exchange power. This cooperation reduces the required renewable generation capacity; however, it necessitates the highest storage capacity to facilitate energy exchange and enhance operational flexibility among the interconnected microgrids. The operational behavior of Case 2 over 10 representative days is illustrated in Figure 6. The subplots present the individual microgrid power profiles, including load profiles, utilized PV and wind power, and BSS charge/discharge cycles with their corresponding SoC trajectories, alongside the aggregated system power profiles. The figure highlights the synergistic performance among the microgrids, particularly during periods when renewable generation exceeds demand. In Case 3, both the generation and storage capacity requirements decrease significantly with the integration of the main utility grid. The availability of the main grid as an effectively unlimited energy buffer substantially reduces the need for large local renewable generation and storage capacities, resulting in the most capacity-efficient configuration among the considered scenarios.
Furthermore, the results highlight distinct technology preferences. Across all three operational cases, wind generation is consistently preferred over solar PV. This preference is driven by wind’s lower relative cost and its potential for continuous generation throughout the day, which aligns better with self-sufficiency goals compared to solar power, which is strictly limited to certain daylight hours. Additionally, the BSS capacity is sized significantly larger than the renewable capacity to account for restricted depth-of-discharge constraints due to SoC limits and the necessity of bridging intermittent generation gaps to ensure year-round autonomous operation during days of the year with low solar and wind availability.
Collaboration and grid integration significantly influence the economic feasibility of the microgrid system. In Case 2, the introduction of collaboration results in a total cost of $5,604,449, representing a slight reduction from the $5,632,767 required in the standalone configuration of Case 1. This improvement highlights how shared flexibility can offset minor increases in capital requirements, which is compensated for by lower operational costs in this configuration. However, the most substantial economic shift occurs in Case 3 with the transition to a grid-connected model. By leveraging the main utility grid, the total cost drops drastically to $1,074,738, which is less than a quarter of the cost of the fully islanded scenarios and underscores the massive financial advantage of grid integration over fully islanded operation.

3.3. Optimal Resources Allocation

In Stage III, the DERs and reactive power resources are optimally allocated within the clustered microgrids of the PDS using the capacity values obtained from Stage II, with the objective of minimizing system losses and improving voltage regulation. In this stage, the allocation is performed based on Case 2, where the main grid does not provide support, and the microgrids operate in a decentralized cooperative manner to ensure smooth and reliable PDS operation.
Figure 7 illustrates the optimal locations of the DERs, including PV, wind, and BSS units within each microgrid, in addition to the placement of reactive power resources. Table 4 summarizes the corresponding resource capacities and their associated PCS ratings. A clear pattern emerges in the optimal allocation results, where buses located at the beginning and end of distribution branches are frequently selected. This selection is primarily driven by the need to mitigate voltage drops that become more pronounced along longer feeder sections. By placing generation resources at these critical points, voltage profiles are effectively improved. Furthermore, reactive power resources are predominantly installed near the middle locations of PDS branches within each microgrid. This placement enables a more effective distribution of reactive power support, reducing line currents by compensating reactive components locally. Consequently, this leads to lower system losses and enhanced voltage regulation performance. In most allocation scenarios, BSS units are installed either at the same bus as wind or PV generation units or at adjacent buses. This strategy facilitates direct charging from locally generated renewable power and minimizes additional transmission losses that would otherwise occur if energy were transferred across longer feeder distances.
Figure 8 illustrates the operating voltage range of the IEEE 30-bus system at each bus, demonstrating a clear improvement, with all voltage magnitudes maintained within ± 1 % of the nominal value. Buses located at the ends of feeders exhibit a wider voltage variation range, whereas buses equipped with installed DERs show enhanced voltage regulation due to their capability to provide localized voltage support through DERs. Buses 20–25 exhibit the highest variation range, primarily due to the presence of PV resources at the end of the feeder. During nighttime hours, when PV active power generation is unavailable, the reduced local support results in a larger voltage drop, causing the voltage magnitude to decrease to approximately 0.99 p.u. Nevertheless, this performance remains significantly improved compared to the case without DERs, where voltages at the end of feeders can drop to nearly 0.9 p.u.
This behavior is further confirmed by the time-series voltage analysis shown in Figure 9, which presents the maximum, minimum, and mean voltage values across all buses. As indicated, the average voltage consistently remains close to 1 p.u. The minimum voltage profile reflects the contribution of PV generation, increasing during periods when PV output supports the PDS and clustered microgrids. Conversely, during high-demand periods with low solar irradiation (e.g., 17:00–21:00), the minimum voltage decreases, indicating relatively weaker voltage regulation. Despite these variations, the voltage across all scenarios remains within approximately 0.99 1.002 p.u., highlighting the effectiveness of the proposed framework in enhancing overall PDS voltage regulation under islanded yet collaboratively operated microgrids.

4. Conclusions

This paper presented a comprehensive tri-stage optimization framework for coordinated microgrid clustering, optimal DER planning, and network-level resource allocation within PDSs. The first stage introduced an electrical-distance-based clustering approach that effectively partitions the PDS into coherent microgrids while preserving the inherent electrical structure of the network. The second stage formulated a stochastic capacity planning model that determines optimal DER sizing under multiple operational scenarios, capturing load and renewable uncertainties. The third stage allocated DERs and reactive power resources across the clustered PDS with the objective of minimizing system losses and improving voltage regulation.
The results demonstrated that operational strategies significantly influence the required generation and storage capacities. Independent islanded operation requires the highest installed capacity to ensure local reliability, whereas cooperative microgrid operation reduces generation requirements at the expense of increased storage flexibility. Full integration with the main grid leads to the most capacity-efficient configuration. Furthermore, the optimal allocation results confirmed that strategic placement of DERs and reactive power resources enhances voltage stability, reduces feeder losses, and maintains voltage magnitudes within tight operational limits, even under stochastic and islanded conditions.
While the proposed hierarchical clustering algorithm utilizes the default, static physical impedance of distribution lines to establish the fixed, resilient boundaries necessary for long-term microgrid capacity planning, active distribution networks also exhibit dynamic electrical coupling and frequently undergo topological reconfigurations due to fault isolation or routine switching. To advance Stage I of the framework, future work will explore adapting the clustering approach for short-term, operational microgrid formation by redefining the initial distance matrix. Instead of relying solely on an intact network’s static line parameters, the distance metric could be dynamically updated to reflect post-fault impedance changes, or initialized using dynamic bus-to-bus sensitivity matrices, such as Jacobian-based voltage-to-power sensitivities, derived from real-time power flow states, or by analyzing historical locational marginal pricing correlations to group nodes with similar economic behaviors. This approach would allow the clustering framework to capture time-varying network stress, topological shifts, and market dynamics, complementing the long-term structural baseline established in this study. Furthermore, to build upon the optimal planning developed in Stage II, expanding the model to large-scale real distribution networks and considering market-based coordination mechanisms between microgrids and utility operators also represent promising research directions.

Author Contributions

Conceptualization, H.E.Z.F.; Methodology, A.A.E.E. and H.E.Z.F.; Software, Y.N.A. and A.A.E.E.; Validation, Y.N.A.; Formal analysis, Y.N.A.; Investigation, Y.N.A. and A.A.E.E.; Writing—original draft, A.A.E.E.; Writing—review & editing, H.E.Z.F.; Visualization, A.A.E.E.; Supervision, H.E.Z.F.; Funding acquisition, H.E.Z.F. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Natural Sciences and Engineering Research Council of Canada (NSREC).

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Pérez-Lombard, L.; Ortiz, J.; Pout, C. A review on buildings energy consumption information. Energy Build. 2008, 40, 394–398. [Google Scholar] [CrossRef]
  2. Dubey, A.; Santoso, S. Electric Vehicle Charging on Residential Distribution Systems: Impacts and Mitigations. IEEE Access 2015, 3, 1871–1893. [Google Scholar] [CrossRef]
  3. Wang, K.; Huang, Y.; Liu, Y.; Huang, T.; Zang, S. A Review of Optimization Scheduling for Active Distribution Networks with High-Penetration Distributed Generation Access. Energies 2025, 18, 4119. [Google Scholar] [CrossRef]
  4. Alhasnawi, B.N.; Jasim, B.H.; Sedhom, B.E.; Hossain, E.; Guerrero, J.M. A new decentralized control strategy of microgrids in the internet of energy paradigm. Energies 2021, 14, 2183. [Google Scholar] [CrossRef]
  5. Abbasi, M.; Abbasi, E.; Li, L.; Aguilera, R.P.; Lu, D.; Wang, F. Review on the microgrid concept, structures, components, communication systems, and control methods. Energies 2023, 16, 484. [Google Scholar] [CrossRef]
  6. Rathod, A.A.; Balaji, S. Modified Harris Hawks optimization for the 3E feasibility assessment of a hybrid renewable energy system. Sci. Rep. 2024, 14, 20127. [Google Scholar] [CrossRef] [PubMed]
  7. Das, T.K.; Kundu, D. Feasibility and sensitivity analysis of a self-sustainable hybrid system: A case study of a mountainous region in Bangladesh. Energy Convers. Manag. X 2023, 20, 100411. [Google Scholar] [CrossRef]
  8. Luo, X.; Shi, W. Optimal regulation of flexible loads in rural residential buildings considering mobile batteries: A case study in Shaanxi Province. Build. Simul. 2024, 17, 1065–1083. [Google Scholar] [CrossRef]
  9. Li, X.; Jones, G. Optimal sizing, location, and assignment of photovoltaic distributed generators with an energy storage system for islanded microgrids. Energies 2022, 15, 6630. [Google Scholar] [CrossRef]
  10. Maknouninejad, A.; Qu, Z. Realizing unified microgrid voltage profile and loss minimization: A cooperative distributed optimization and control approach. IEEE Trans. Smart Grid 2014, 5, 1621–1630. [Google Scholar] [CrossRef]
  11. Agha Kassab, F.; Rodriguez, R.; Celik, B.; Locment, F.; Sechilariu, M. A comprehensive review of sizing and energy management strategies for optimal planning of microgrids with PV and other renewable integration. Appl. Sci. 2024, 14, 10479. [Google Scholar] [CrossRef]
  12. Gu, C.; Liu, Y.; Wang, J.; Li, Q.; Wu, L. Carbon-oriented planning of distributed generation and energy storage assets in power distribution network with hydrogen-based microgrids. IEEE Trans. Sustain. Energy 2022, 14, 790–802. [Google Scholar] [CrossRef]
  13. Vera, E.G.; Cañizares, C.A.; Pirnia, M.; Guedes, T.P.; Trujillo, J.D.M. Two-stage stochastic optimization model for multi-microgrid planning. IEEE Trans. Smart Grid 2022, 14, 1723–1735. [Google Scholar] [CrossRef]
  14. Atazadegan, M.H.; Rokrok, E.; Doostizadeh, M. A cooperative generation expansion planning of microgrids to improve the resiliency of active distribution networks. IEEE Access 2024, 12, 192230–192249. [Google Scholar] [CrossRef]
  15. Qiao, J.; Mi, Y.; Shen, J.; Lu, C.; Cai, P.; Ma, S.; Wang, P. Optimization schedule strategy of active distribution network based on microgrid group and shared energy storage. Appl. Energy 2025, 377, 124681. [Google Scholar] [CrossRef]
  16. Cortes, C.A.; Contreras, S.F.; Shahidehpour, M. Microgrid topology planning for enhancing the reliability of active distribution networks. IEEE Trans. Smart Grid 2017, 9, 6369–6377. [Google Scholar] [CrossRef]
  17. Yuan, W.; Wang, J.; Qiu, F.; Chen, C.; Kang, C.; Zeng, B. Robust optimization-based resilient distribution network planning against natural disasters. IEEE Trans. Smart Grid 2016, 7, 2817–2826. [Google Scholar] [CrossRef]
  18. Habib, S.; Ahmarinejad, A.; Jia, Y. A stochastic model for microgrids planning considering smart prosumers, electric vehicles and energy storages. J. Energy Storage 2023, 70, 107962. [Google Scholar] [CrossRef]
  19. Zhao, Y.; Lin, J.; Song, Y.; Xu, Y. A robust microgrid formation strategy for resilience enhancement of hydrogen penetrated active distribution networks. IEEE Trans. Power Syst. 2023, 39, 2735–2748. [Google Scholar] [CrossRef]
  20. Pang, K.; Wang, C.; Hatziargyriou, N.D.; Wen, F. Microgrid formation and real-time scheduling of active distribution networks considering source-load stochasticity. IEEE Trans. Power Syst. 2023, 39, 2801–2813. [Google Scholar] [CrossRef]
  21. Zhang, H.; Liu, W.; Sun, S.; Yu, P.; Cui, C. Microgrid Cluster Division and Optimal Allocation Method Considering Cooperative Increment. In Proceedings of the 2023 International Conference on Power Energy Systems and Applications (ICoPESA), Nanjing, China, 24–26 February 2023; pp. 561–570. [Google Scholar] [CrossRef]
  22. Jayawardene, I.; Herath, P.; Venayagamoorthy, G.K. A Graph Theory-Based Clustering Method for Power System Networks. In Proceedings of the 2021 IEEE International Conference on Power Energy Systems and Applications (ICoPESA), Online, 30 October–2 November 2021; pp. 1–6. [Google Scholar]
  23. Chai, Y.; Guo, L.; Wang, C.; Zhao, Z.; Du, X.; Pan, J. Network Partition and Voltage Coordination Control for Distribution Networks with High Penetration of Distributed PV Units. IEEE Trans. Power Syst. 2018, 33, 3396–3407. [Google Scholar] [CrossRef]
  24. Sánchez-García, R.J.; Fennelly, M.; Norris, S.; Wright, N.; Niblo, G.; Brodzki, J.; Bialek, J.W. Hierarchical Spectral Clustering of Power Grids. IEEE Trans. Power Syst. 2014, 29, 2229–2237. [Google Scholar] [CrossRef]
  25. Ge, J.; Luo, Y.; Zhang, J.; Cao, Y.; Li, Z. A Clustering Algorithm Based on Intelligent Distribution Network. In Proceedings of the 2022 4th International Conference on Frontiers Technology of Information and Computer (ICFTIC), Qingdao, China, 2–4 December 2022; pp. 914–918. [Google Scholar] [CrossRef]
  26. Liang, Z.; Chung, C.; Wang, Q.; Chen, H.; Yang, H.; Wu, C. Fortifying Renewable-Dominant Hybrid Microgrids: A Bi-Directional Converter Based Interconnection Planning Approach. Engineering 2025, 51, 130–143. [Google Scholar] [CrossRef]
  27. Khan, A.A.; Minai, A.F.; Pachauri, R.K.; Malik, H. Optimal sizing, control, and management strategies for hybrid renewable energy systems: A comprehensive review. Energies 2022, 15, 6249. [Google Scholar] [CrossRef]
  28. Ahmed, Y.N.; Hany Farag, E.Z. Clustering-Based Stochastic Optimization of PV-Battery Sizing for Self-Sufficient Multi-Microgrid Systems. In Proceedings of the 2025 IEEE Electrical Power and Energy Conference (EPEC), Waterloo, ON, Canada, 15–17 October 2025; pp. 348–353. [Google Scholar] [CrossRef]
  29. Khani, H.; Elsayed, A.A.E.; Farag, H.E.Z.; Mohamed, M. Adaptive Feasibility Area Estimation to Enhance Cybersecurity of Electrolysis-Based Hydrogen Refueling Stations Integrated with Power Distribution Systems. IEEE Trans. Intell. Transp. Syst. 2025, 26, 18525–18541. [Google Scholar] [CrossRef]
  30. Yang, H.; Liang, Z.; Shi, X.; Cheng, J.; Liang, J.; Dong, H.; Chung, C.Y. Adversarial Data Anomaly Detection and Calibration for Nonintrusive Load Monitoring. IEEE Internet Things J. 2025, 12, 544–555. [Google Scholar] [CrossRef]
  31. Dong, H.; Zhu, J.; Chung, C.Y.; Chen, Y.; Yang, H.; Liang, Z. A Cross-Level Consistency-Aware Diffusion Model of Hierarchical Imputation for Energy Prosumers. IEEE Trans. Smart Grid 2026, 17, 870–873. [Google Scholar] [CrossRef]
Figure 1. The proposed tri-stage framework for PDSs clustering and planning.
Figure 1. The proposed tri-stage framework for PDSs clustering and planning.
Energies 19 02050 g001
Figure 2. Microgrid loads and maximum power output per 1 MW of distributed generation over five representative days.
Figure 2. Microgrid loads and maximum power output per 1 MW of distributed generation over five representative days.
Energies 19 02050 g002
Figure 3. Hierarchical agglomerative clustering dendrogram for the IEEE 33-bus system.
Figure 3. Hierarchical agglomerative clustering dendrogram for the IEEE 33-bus system.
Energies 19 02050 g003
Figure 4. Single line diagram of IEEE 33-bus system under study and network partitioning.
Figure 4. Single line diagram of IEEE 33-bus system under study and network partitioning.
Energies 19 02050 g004
Figure 5. Voltage magnitude profile of the IEEE 33-bus system.
Figure 5. Voltage magnitude profile of the IEEE 33-bus system.
Energies 19 02050 g005
Figure 6. Operational results for Case 2 over 10 representative days. Individual microgrid power profiles and SoC alongside aggregated system power profiles.
Figure 6. Operational results for Case 2 over 10 representative days. Individual microgrid power profiles and SoC alongside aggregated system power profiles.
Energies 19 02050 g006
Figure 7. DERs and reactive power resources allocations within the clustered microgrids under collaborative operation of Case 2.
Figure 7. DERs and reactive power resources allocations within the clustered microgrids under collaborative operation of Case 2.
Energies 19 02050 g007
Figure 8. Voltage variation of the IEEE 33-bus test system after DER and reactive power resources allocation.
Figure 8. Voltage variation of the IEEE 33-bus test system after DER and reactive power resources allocation.
Energies 19 02050 g008
Figure 9. Bus voltage change over simulation period showing the maximum, minimum and mean voltage of the buses.
Figure 9. Bus voltage change over simulation period showing the maximum, minimum and mean voltage of the buses.
Energies 19 02050 g009
Table 1. Summary of literature review and comparison with the proposed model.
Table 1. Summary of literature review and comparison with the proposed model.
Refs.DecentralizationPlanningManagementOp. ModesResource Allocation
[12,13,26]
[14,15]
[16]
[17]
[18]
[21,28]
[22,24,25]
[19,20,23]
Proposed Model
Table 2. Simulation Parameters used in the optimization.
Table 2. Simulation Parameters used in the optimization.
PV
C PV = 2 , 500 , 000 $ / MW S ¯ PV = 1000 MW τ PV = 20 ( years )
C PCS , PV = 470 , 000 $ / MW P C ¯ PV = 1000 MW τ PCS , PV = 20 ( years )
C PV curt = 10 $ / MWh
Wind
C W = 1 , 800 , 000 $ / MW S ¯ W = 1000 MW τ W = 20 ( years )
C PCS , W = 470 , 000 $ / MW P C ¯ W = 1000 MW τ PCS , W = 20 ( years )
BSS
η ch = 0.92 η dch = 0.92 α ̲ = 0.20
α ¯ = 0.90 S ¯ BSS = 8000 MWh τ BSS = 20 ( years )
C BSS = 200 , 000 $ / MWh η PCS = 0.90 P C ¯ BSS = 1000 MW
C PCS , BSS = 470 , 000 $ / MW τ PCS , BSS = 20 ( years )
Objective Parameters
E grid = 180 $ / MWh P ¯ grid = 100 MW Δ t = 1 ( hour )
S = 1 ( scenario ) M = 3 ( microgrids ) Δ S = 5 %
E μ g = 120 $ / MWh
Table 3. Optimal sizing for each microgrid and the system aggregate across three operational cases.
Table 3. Optimal sizing for each microgrid and the system aggregate across three operational cases.
MicrogridCaseSizing
S PV (MW) PC PV (MW) S W (MW) PC W (MW) S BSS (MWh) PC BSS (MW)
111.30.658.91.7493.581.32
21.670.817.891.74103.661.85
3--3.051.03--
210.60.3515.12.1972.891.37
20.770.4313.392.1980.741.92
3--3.051.030.290.05
310.440.224.180.8136.750.52
20.560.273.70.8140.70.72
3--3.051.037.570.68
Aggregate12.341.2228.184.74203.223.21
231.5124.984.74225.14.49
3--9.153.097.860.73
Table 4. Optimal DER and Reactive Power Resources Locations.
Table 4. Optimal DER and Reactive Power Resources Locations.
Resource
Type
MicrogridBusesSize
(MW/MWh/MVar)
PCS
(MW)
PV1[22, 25][0.93, 0.74][0.74, 0.36]
2[6][0.77][0.43]
3[12][0.56][0.27]
Wind1[2, 5][5.3, 2.59][1.17, 0.57]
2[8, 28][5.18, 8.21][0.85, 1.34]
3[15][3.7][0.81]
BSS1[2, 5][69.7, 33.96][1.19, 0.66]
2[9, 31][40, 40.74][0.95, 0.97]
3[12][40.7][0.72]
Q V a r 1[4][0.9]
2[29, 7][0.55, 0.45]
3[11][1.1]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ahmed, Y.N.; Elsayed, A.A.E.; Farag, H.E.Z. Tri-Stage Optimization Framework for Optimal Clustering of Power Distribution Systems into Sustainable Microgrids. Energies 2026, 19, 2050. https://doi.org/10.3390/en19092050

AMA Style

Ahmed YN, Elsayed AAE, Farag HEZ. Tri-Stage Optimization Framework for Optimal Clustering of Power Distribution Systems into Sustainable Microgrids. Energies. 2026; 19(9):2050. https://doi.org/10.3390/en19092050

Chicago/Turabian Style

Ahmed, Yahia N., Ahmed Abd Elaziz Elsayed, and Hany E. Z. Farag. 2026. "Tri-Stage Optimization Framework for Optimal Clustering of Power Distribution Systems into Sustainable Microgrids" Energies 19, no. 9: 2050. https://doi.org/10.3390/en19092050

APA Style

Ahmed, Y. N., Elsayed, A. A. E., & Farag, H. E. Z. (2026). Tri-Stage Optimization Framework for Optimal Clustering of Power Distribution Systems into Sustainable Microgrids. Energies, 19(9), 2050. https://doi.org/10.3390/en19092050

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop