Next Article in Journal
Capacity Optimization of Offshore Microgrids Considering Uncertainty and Conditional Risk
Previous Article in Journal
Robust Fault Location in Distribution Networks Under Noisy and Incomplete Measurements Using Physics-Aware Decoupled Inference
Previous Article in Special Issue
Correction: Scholliers et al. Modeling Merit-Order Shifts in District Heating Networks: A Life Cycle Assessment Method for High-Temperature Aquifer Thermal Energy Storage Integration. Energies 2026, 19, 212
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimal Operation of Multi-Microgrids Using Stochastic Distributed Energy Management Approach Considering the Risk of Microgrid Islanding

by
Abdulraheem H. Alobaidi
Center of Research Excellence in Renewable Energy and Power Systems, Department of Electrical and Computer Engineering, King Abdulaziz University, Jeddah 21589, Saudi Arabia
Energies 2026, 19(11), 2584; https://doi.org/10.3390/en19112584
Submission received: 15 April 2026 / Revised: 16 May 2026 / Accepted: 23 May 2026 / Published: 27 May 2026
(This article belongs to the Special Issue Energy Management and Life Cycle Assessment for Sustainable Energy)

Abstract

Microgrids (MGs) have lately received significant attention from researchers as a contemporary solution to better employ the high penetration of renewable energy sources (RESs) to enhance energy sustainability. They can improve the reliability, resilience, and security of distribution systems. However, a distributed energy management framework is required for the optimal operation of distribution systems with multiple microgrids, given the limited communication between the distribution system operator (DSO) and the microgrid operators. Moreover, distribution systems are unbalanced in nature due to the unbalanced connected loads. Thus, modeling the unbalanced power flow in distributed energy management is essential to ensuring the feasibility of operational decisions. This paper proposes a distributed algorithm based on the alternating direction method of multipliers (ADMM) for optimal operation of distribution systems with multi-microgrids, accounting for uncertainty in demand, RESs, and MG operation modes, as well as unbalanced power flow. A modified IEEE 34-bus distribution system with six microgrids is used to validate the effectiveness of the proposed method. The proposed distributed energy management framework can achieve high solution accuracy with limited information shared among operators, as demonstrated in the case study, providing results comparable to those of the centralized energy management approach, with an insignificant 0.24% error in total operating cost. Moreover, numerical results show that compared with the distribution system and microgrids with forecasted loads and PV outputs under normal operation, the proposed stochastic model yields a 0.56% higher total expected operating cost due to uncertainty in load and PV power outputs. When probabilistic MG islanding operation is considered, the total expected operating cost of the distribution system decreases by 1.03% compared with the stochastic solution under normal operation due to the microgrids’ disconnection from the distribution system during islanding in a few scenarios, hence relieving the distribution system of excessive load.

1. Introduction

High penetration of renewable energy sources (RESs) poses several security and operational issues in distribution systems, such as reducing system inertia, hence increasing the likelihood of larger frequency excursions and instability in system voltage [1]. Microgrids (MGs) are gaining popularity as a potential solution to boost the penetration of RESs in distribution systems because of their operational capability and flexibility [2]. They can incorporate various distributed generation resources to enhance energy sustainability, including distributed generators (DGs), photovoltaic (PV) systems, and battery energy storage systems (BESSs). Moreover, microgrids can efficiently utilize RESs and enhance the resilience of distribution systems during extreme events by locally energizing outage areas [3]. They have the ability to operate in grid-connected mode to exchange power with the distribution system or in islanding mode to supply energy to their local demand [4]. During extreme events, they can manage to restore power to critical loads and enhance the availability of the energy supply [5]. Furthermore, the utilization of microgrids in distribution systems can improve ancillary services such as reactive power compensation [6]. However, distributed energy management algorithms are required to determine optimal operational decisions for distribution systems with multi-microgrids, since the distribution system operator (DSO) and microgrid operators are usually independent [7]. Consequently, the shared information is limited due to microgrid privacy issues [8]. Moreover, the operating decisions of microgrids and the distribution system may violate each other’s robustness [9]. Therefore, efficient coordination among these private entities in distributed frameworks is necessary to achieve optimal energy management for distribution systems and MGs.
Centralized energy management approaches using heuristic algorithms with deterministic load demands and RESs are proposed in [10,11,12,13,14]. Reference [10] proposes an optimal microgrid energy management strategy, considering RESs and BESS. The microgrid energy management system utilizes forecasted outputs for RESs, and the proposed problem is solved using improved gradient-based optimization. Optimal energy management is proposed in [11] to minimize the operating cost of a residential microgrid consisting of DGs, PV systems, wind generation, and BESSs while reducing environmental emissions. The proposed energy management system is solved using the particle swarm optimization (PSO) algorithm to determine the optimal sizing of distributed energy resources. Bi-level optimization for energy management of a microgrid in grid-connected mode is proposed in [12], considering uncertainties in RESs and loads. At the first level, optimal scheduling for day-ahead operation is performed, while real-time adjustment of generation setpoints occurs at the second level based on the actual RESs output, loads, and electricity prices. The proposed optimization problem aims to minimize microgrid operational costs and is solved using the Honey Badger Algorithm (HBA). Reference [13] proposes an energy management system in a multi-stage framework for the optimal scheduling of grid-connected MGs with residential and industrial loads, considering demand response and the carbon trading market. The RES uncertainty is modeled using scenarios, and the quantum particle swarm optimization (QPSO) algorithm is used to find optimal operational decisions of MGs. The energy management of multi-MGs under RES uncertainty is addressed in [14] using a hybrid algorithm. Here, the proposed technique combines several learning-based metaheuristic optimization methods to obtain an optimal strategy that minimizes the total operating costs of MGs while enhancing load forecast accuracy using neural networks. However, the technical constraints of distribution systems and microgrids, such as voltage limits and power flow constraints, are not accounted for in the energy management system proposed in [10,11,12,13,14]. Centralized energy management methods using heuristic algorithms under uncertainty are proposed in [2,15,16,17]. A stochastic approach is proposed in [2] for the optimal scheduling of microgrids in the interconnected electricity–natural gas systems with demand response. The proposed method aims to minimize the total operating cost of supplying electric and thermal loads, and the water wave optimization (WWO) algorithm is utilized to solve the optimization problem. Reference [15] proposes a multi-objective optimization method for optimal design and management of the multi-microgrids. Here, the distribution system is clustered into microgrids using the k-means algorithm. The optimal sizing of RESs and BESSs, considering reliability indices, is determined using the Pareto-fuzzy (IPF) method, and generation adequacy in energy management for each microgrid in the multi-microgrid system is assessed by incorporating total line losses. A multi-objective framework for energy management of unbalanced microgrids is proposed in [16]. Here, the objectives of the energy management system are to minimize the expected operational costs of microgrids, the expected environmental emissions, the expected energy not supplied, and voltage deviations under uncertainties in load, RESs, electricity prices, and network equipment outages. Based on the weighted sum, Pareto optimization is used to convert multi-objective optimization into single-objective optimization, and the combined teaching–learning-based optimization (TLBO) with the gray wolf optimizer (GWO) algorithm is used to solve the proposed optimization problem. Reference [17] addresses the energy management of unbalanced microgrids with the objective of minimizing operating costs while considering network constraints, such as three-phase AC power flow. The uncertainties in load and RESs are considered using scenarios, and the genetic algorithm (GA) is used to solve the proposed nonlinear optimization problem. However, the methods proposed in [2,10,11,12,13,14,15,16,17] are heuristic approaches that do not guarantee an optimal global solution for energy management decisions [18].
Mathematical programming models used in centralized energy management systems under load and RES uncertainty are proposed in [19,20,21,22,23,24,25,26,27,28]. Two-stage robust optimization (RO) with multi-objectives is formulated in [19] for the optimal operation of microgrids with electric vehicles (EVs) and BESSs, as well as demand response. The proposed microgrid energy management aims to minimize total operating costs while optimizing the energy usage of BESSs and EVs under RES and load uncertainty. The proposed problem is decomposed into two stages and solved using the column-and-constraint generation (C&CG) algorithm. In this first stage, the optimal scheduling of DGs, BESSs, and EVs is determined, while the operation decisions are then adjusted in the second stage under the worst-case conditions for RESs and load. Reference [20] proposes a robust optimal scheduling strategy for a residential microgrid in grid-connected mode with RESs, BESSs, and plug-in electric vehicles (PEVs). Here, the proposed RO problem is reformulated into a mixed-integer quadratic programming (MIQP) model using duality theory. Deep reinforcement learning (DRL)-based energy management is proposed in [21] to determine the optimal operation of microgrids under uncertainties in RESs and loads. The proposed energy management problem is formulated as a Markov decision process and solved using the interior-point policy optimization (IPO) algorithm. A four-stage RO framework for optimal energy management of multi-energy microgrids with electric and thermal loads is proposed in [22]. The proposed method accounts for uncertainties in RESs and load by considering the worst-case realizations of the uncertain parameters within probability-based uncertainty sets. The C&CG algorithm is used to solve the proposed four-stage RO problem. Reference [23] proposes a two-stage energy management system for industrial microgrids with RESs and BESSs. In the first stage, the optimal sizing of the BESSs is determined, and in the second stage, the optimal operation of the microgrid is determined to minimize total microgrid operating costs, considering stochastic scenarios for RESs and loads. The proposed two-stage optimization problem is formulated as a single linear programming (LP) model. The risk of microgrid islanding mode is not evaluated in the energy management systems proposed in [19,20,21,22,23]. However, it is essential to incorporate such uncertainties into microgrid energy management systems to enhance system resilience and prevent instability [29]. Reference [24] develops an energy management approach for MGs under uncertainties in RES and MG islanding operations. The proposed optimization is formulated as a two-stage adaptive robust optimization (ARO) problem solved using the C&CG algorithm to find the optimal operation of MGs under the worst-case conditions for RES and the MG operation modes. An energy management framework with a data-driven approach is proposed in [25] to improve the resilient operation of microgrids with demand response under the uncertainties in RES, load, electricity prices, and microgrid islanding mode. The proposed optimization problem is formulated as ARO and solved using the C&CG algorithm. Reference [26] proposes a two-layer approach for microgrid energy management based on model predictive control (MPC), integrating Wasserstein distributionally robust optimization (DRO) and conditional value-at-risk (CVaR) constraints. The first layer utilizes DRO to determine the optimal scheduling of MGs under uncertainties in RESs and load, while the resilient operation decisions are ensured in the second layer using constrained MPC to handle the probabilistic operation of MGs. However, earlier research works in [19,20,21,22,23,24,25,26] do not consider unbalanced power flow in distribution systems with multi-microgrids. Reference [27] proposes a stochastic nonlinear programming (NLP) model for the optimal energy management system of unbalanced microgrids with RES and EVs, aiming to minimize the total operational cost and voltage deviations. The proposed optimization manages uncertainties in electricity prices, electricity load, RESs, and EV charging demands using scenarios. A stochastic mixed-integer nonlinear programming (MINLP) model is proposed in [28] to determine the optimal energy management for the unbalanced microgrids. The proposed MINLP problem is reformulated as a stochastic mixed-integer linear programming (MILP), with uncertainties in RESs and load being modeled by scenarios and microgrid islanding operations being modeled using contingency constraints.
Energy management systems in [2,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28] are applied in a centralized framework; however, the operators of distribution systems and microgrids are usually independent [7] and require limited information sharing [8]. Decentralized algorithms for microgrid energy management systems are discussed in [30,31,32,33,34,35]. Reference [30] proposes a bi-level framework with a data-driven model for the optimal energy management of a distribution system with multi-microgrids. At the upper level, the DSO optimizes operational decisions for the distribution system, while MG operators optimize their own energy management decisions at the lower level based on the power shared and electricity prices received from the DSO. The interaction between MG operators and the DSO is modeled using game theory, with the Stackelberg equilibrium determined by a DRL multi-agent system. In [31], a decentralized energy management framework for unbalanced multi-MGs is proposed and formulated as convex optimization. The proposed framework allows MGs to interact with the distribution system operator in a local energy market in two stages through pre-dispatch and energy transaction strategies, considering technical constraints and power quality in each step, including unbalanced power flow, voltage limits, and total harmonic distortion limits. However, the uncertainties in RESs, load and microgrid islanding operation are not considered in [30,31]. Decentralized energy management systems under uncertainty are proposed in [32,33,34,35]. In [32], a bi-level scenario-based approach is proposed for the optimal energy management of a distribution system with MGs under uncertainty in RESs. The interaction between MG operators and DSO is based on game theory, and the proposed energy management problem is formulated as a Mathematical Program with Equilibrium Constraints (MPEC). Reference [33] proposes a two-stage hierarchical decentralized framework for the optimal scheduling of microgrids and distribution systems, considering the uncertainties in RESs, load, and electricity prices. In the first stage, the two-objective optimization problem is formulated as an MILP model with the objectives of minimizing the total operating cost and maximizing the customers’ comfort index to obtain the optimal scheduling for each microgrid. In the second stage, the DSO identifies the optimal system operation by solving an MILP model to minimize the operating costs of the distribution system and the penalty terms associated with deviations in microgrid scheduling. Reference [34] proposes a multi-agent system in which energy management for microgrids is formulated as a finite Markov decision process. The Q-learning algorithm is used to solve the proposed microgrid energy management problem, aiming to maximize microgrid benefits while accounting for load and RES generation uncertainties. A decentralized energy management framework based on Bender’s decomposition is proposed in [35] to achieve optimal operation of an unbalanced distribution system with multi-microgrids under uncertainties in RESs, loads, and microgrid islanding operations. Here, the optimization problem is formulated as an MILP master problem with LP subproblems, and coordination between the DSO and microgrid operators in the energy management system is achieved through Bender’s cuts.
Distributed algorithms can promote the implementation of modern automation of distribution systems with multi-microgrids with higher efficiency and reliability [36]. Distributed algorithms for microgrid energy management systems are proposed in [8,37,38,39,40,41,42,43,44,45,46,47]. Reference [37] proposed a distributed communication framework for the energy management system in a distribution system with multiple microgrids. The problem is formulated as deterministic MILP for each microgrid, aiming to minimize the microgrid operating costs with limited information shared. However, the work in [37] assumes that the DSO maintains the voltage limits on the point of common couplings. Reference [38] proposes distributed energy management based on the ADMM to coordinate the scheduling of multi-microgrids and utility grids via price signals, with the objective of minimizing the total operational costs of the multi-microgrids. Here, the interaction between the distribution system and microgrids is captured through pricing signals, in which each operator adjusts its generation scheduling in response to the received signals. The quadratic terms associated with the augmented Lagrange in the ADMM algorithm are approximated using piecewise linearization to reformulate the optimization problem to an equivalent MILP problem. However, the energy management systems in [38] neglect voltage limits and power flow constraints. Reference [39] proposes a distributed approach using the ADMM algorithm for energy management of a distribution system with multiple microgrids and controllable loads. Here, the optimal operation of each microgrid is determined iteratively by independent operators based on their own objectives, electricity prices, and the updated generation–demand mismatch signals at each iteration. The work in [37] assumes balanced three-phase systems using the linearized Distflow model in the proposed formulation. Distributed energy management for unbalanced microgrids is addressed in [40,41]. Reference [40] proposes a distributed control based on leader–follower multi-agents for coordination of hybrid AC-DC microgrids, where power sharing among MGs is ensured in the upper layer, while power flow on each phase in AC microgrids is controlled in the lower layer. A distributed approach is proposed in [41] for the optimal dispatch of unbalanced microgrids in islanding mode. The proposed generation optimization problem is solved using primal–dual constrained decomposition in a distributed framework, where communication among neighboring MGs is performed through consensus protocols. However, the uncertainties in RESs, load, and microgrid islanding mode are not taken into account in the distributed energy management frameworks proposed in [37,38,39,40,41].
Distributed energy management systems under uncertainty are proposed in [8,42,43,44,45,46,47]. A distributed approach is proposed in [42] for microgrid energy management under denial-of-service attacks, and the Gaussian distribution is used to model forecast errors in RES generation. The proposed method is based on graph theory, aiming to provide defense mechanisms while reducing the information shared and the communication resources required. Reference [43] proposes a generalized Nash bargaining-based energy management system for multi-microgrids with peer-to-peer communication, combining the ADMM and consensus protocols. The proposed algorithm takes into account the uncertainty in power outputs of PV systems and wind turbines using the RO formulation solved using the C&CG algorithm. Reference [44] proposes a distributed algorithm for energy management of a distribution system with microgrids, where the operation of the MGs is coordinated through transactive signals using the ADMM. The uncertainty in RESs is handled using RO to determine the optimal scheduling of MGs in the worst-case scenario. In [45], a distributed energy management approach for islanded multi-MGs using MPC is proposed, considering uncertainty in RESs using RO. To ensure the privacy of independent microgrids, the analytical target cascading (ATC) method is applied to the proposed energy management problem to coordinate the operation of MGs. Although the uncertainty in RES generations is addressed in the distributed energy management systems proposed in [42,43,44,45], the uncertainty in load and the risk of microgrid islanding as well as the unbalanced power flow constraints are neglected. Reference [8] proposed a distributed method for energy management of AC-DC MGs, in which the ADMM is applied to coordinate the operation of independent MGs with limited information sharing. In the proposed microgrid energy management model, ARO is used to consider uncertainties in RESs and loads within each microgrid. The distributed operation of MGs and energy storage systems is addressed in [46] and is implemented using the Bregman ADMM algorithm, considering worst-case conditions for RESs and loads via two-stage RO in microgrid energy management. In the first stage, distributed cooperation among MGs and energy storage systems is performed, while the optimal scheduling of MGs is performed in the second stage. However, the technical constraints of distribution systems and microgrids, including voltage limits and power flow constraints, are not modeled in the energy management system proposed in [46]. Reference [47] proposes a distributed method based on the ADMM for energy management in a distribution system with multi-microgrids. The proposed method considers the uncertainty in loads, RES generation, and energy price by formulating an ARO problem solved using the nested C&CG algorithm, while the ADMM algorithm is used to coordinate between microgrid operators and the DSO and limit the information shared among operators. However, unbalanced power flow constraints and the risk of islanding operation are not addressed in [8,42,43,44,45,46,47]. Table 1 compares earlier works on energy management for distribution systems and multi-microgrids.
Several earlier research works propose energy management for distribution systems with MGs in decentralized and distributed frameworks to coordinate between the DSO and MG operators. However, coordinated unbalanced power exchange among distribution systems and MGs in distributed frameworks, with uncertainties in RESs, loads, and microgrid islanding operations, has not been thoroughly studied. Developing a coordinated energy management strategy that accounts for unbalanced power flow is significant, as a distribution system with MGs is inherently unbalanced due to unequal loadings on the three-phase lines [48]. Furthermore, modeling islanded and grid-connected operation modes of MGs in a stochastic framework plays a crucial role in making operational decisions of the distribution system with MGs. Accounting for the uncertainty in MG operation mode in microgrid energy management systems can improve system reliability [49] and enhance system resiliency [29]. Moreover, distributed energy management algorithms are required to determine the optimal operation strategy for distribution systems with multi-MGs since the DSO and MG operators are independent [7] and the shared information is limited due to microgrid privacy concerns [8]. Therefore, the reasons mentioned above necessitate modeling unbalanced power flow in distribution systems with multi-MGs in energy management systems while considering uncertain RES outputs and load, as well as stochastic MG operation modes in distributed frameworks. The contributions of this work are as follows:
  • A distributed energy management framework for unbalanced operations in networked MGs is proposed. The interaction of DSO and MG operators is in terms of real and reactive power flow in the shared lines, as well as the bus voltage at points of common coupling (PCCs). The proposed algorithm is based on the ADMM algorithm, where the mismatches in the exchanged parameters are minimized in the energy management problems in the distribution system problem and microgrid sub-problems. The proposed distributed algorithm can achieve high solution accuracy, as demonstrated in the case study, yielding results that closely match those obtained with the centralized energy management approach, with an insignificant 0.24% error in total operating cost. Hence, the proposed distributed energy management framework can attain high solution accuracy with limited information shared among operators, i.e., only the exchanged real and reactive power flows between neighboring regions and the bus voltage magnitudes at PCCs.
  • Uncertainties in RESs, loads, and MG operation modes are taken into account in the proposed distributed algorithm using Monte Carlo simulation. A large number of scenarios for the uncertain variables are generated to ensure that optimal operational decisions made by energy management systems account for the intermittent nature of RESs, unpredictable loads, and islanding operation of MGs. The proposed stochastic model yields a 0.56% higher total expected operating cost compared with the deterministic solutions. Hence, the robustness of the solution obtained from the proposed distributed energy management is ensured by addressing such system uncertainties.
  • The linearized formulation for the unbalanced power flow derived from [50] is used in the proposed distributed energy management approach to avoid convergence issues, since the ADMM cannot guarantee convergence for nonconvex problems such as the AC OPF problem [51]. Therefore, this paper leverages approximation techniques to convexify the formulated problem with AC power flow constraints, thereby providing a globally optimal solution and reducing computational complexity. The microgrids in the unbalanced distribution system include unbalanced distributed energy sources, such as diesel generators, PV systems, and BESSs. Unbalanced MGs are dispersed throughout the distribution system to resemble real MGs and draw realistic conclusions. The modified 34-bus IEEE distribution system with six MGs is used to test the effectiveness of the proposed method.
The rest of this paper is organized as follows: solution methodology and problem formulations are described in Section 2, simulation results and discussion are presented in Section 3, and the main conclusions are in Section 4.

2. Solution Methodology and Problem Formulation

In this section, the proposed distributed algorithm is developed for the optimal operation for a distribution system coupled with microgrids, achieving simultaneous optimal operation of the distribution grid and microgrids under unbalanced operation, with demand and PV generation uncertainties. Furthermore, the proposed method takes into account the risk of microgrid islanding by generating a large number of scenarios that capture the uncertainty of the coupling line being connected at a given probability. First, the distributed algorithm is described in this section. Subsequently, the formulations for unbalanced optimal operation in the distribution grid and microgrids are described.

2.1. The Proposed Distributed Algorithm Based on the ADMM

The proposed distributed algorithm is described in the flowchart depicted in Figure 1. The distributed energy management framework for a distribution system with multi-microgrids is divided into two separate optimization problems, which are iteratively solved in two stages. The DSO solves the distribution operation problem and shares the real and reactive power flow between neighboring regions, bus voltages at points of common coupling (PCCs), and the binary variables representing the connections of the coupling lines to the MG operators. Each MG operator solves its own operational problem and updates the exchanged real/reactive power flows and bus voltage parameters. Subsequently, mismatches between the procured parameters and their corresponding parameters in the previous iteration are compared. If the equations in (1)–(6) are satisfied, the results obtained from the DSO are compared to their corresponding parameters that are obtained from MG operators. If the mismatches are negligible, in which case the equations in (7)–(9) are satisfied, then the algorithm will be terminated, and the optimal operation in the unbalanced networked microgrids is obtained. Otherwise, the mismatch weights are updated according to the equations in (10) and (11), where (.) denotes the corresponding parameters that must be updated (i.e., PL, QL, and/or U), and the procedure is repeated.
| P L i m , t , s φ * , i n P L i m , t , s φ * , ( i n 1 ) | ε 1
| Q L i m , t , s φ * , i n Q L i m , t , s φ * , ( i n 1 ) | ε 1
| U m , t , s φ * , i n U m , t , s φ * , ( i n 1 ) | ε 1
| P L i m , t , s φ , i n P L i m , t , s φ , ( i n 1 ) | ε 1
| Q L i m , t , s φ , i n Q L i m , t , s φ , ( i n 1 ) | ε 1
| U m , t , s φ , i n U m , t , s φ , ( i n 1 ) | ε 1
| P L i m , t , s φ * , o u P L i m , t , s φ , o u | ε 2
| Q L i m , t , s φ * , o u Q L i m , t , s φ , o u | ε 2
| U m , t , s φ * , o u U m , t , s φ , o u | ε 2
α m g , t , s ( . ) , φ , ( o u + 1 ) = ( α m g , t , s ( . ) , φ , ( o u ) + 2 β m g , t , s ( . ) , φ , ( o u ) ( ( . ) i m , t , s φ * , o u ( . ) i m , t , s φ , o u ) ) · y i m , s *
β m g , t , s ( . ) , φ , ( o u + 1 ) = γ · β m g , t , s ( . ) , φ , ( o u ) · y i m , s *
The next sections describe the formulations for the optimal unbalanced operation of a distribution system with multi-microgrids. To reduce the complexity of the proposed method, all terms in the distribution and MG formulations are linearized except for the mismatch penalty terms, which are quadratic terms in the objective functions. The cost functions for DG units in both models are linearized using the piecewise linearization method [52]. Other linearization techniques used in this paper are described in the following sections.

2.2. Optimal Operation of Distribution System

The distribution system optimization problem is developed as a mixed-integer quadratically constrained programming (MIQCP) problem. Mismatch penalties are quadratic terms that capture mismatches in the real and reactive power flow between the distribution system and microgrids, and mismatches in the bus voltage at the point of common coupling. The distribution grid model is considered a mixed-integer problem due to the presence of binary variables in the energy storage system model. The optimal operation for the distribution grid is shown in (12)–(52). The objective function in (12) minimizes the operational cost while accounting for the cost associated with curtailed load and the quadratic terms for mismatches in real and reactive power exchanged between the DSO and MG operators, as well as mismatches in bus voltages at the PCCs.
min s p r s ( t ϵ T ( C g r t (   φ P g r , t , s φ ) + i ϵ N g F i ( φ P g , t , s i , φ ) + V O L L g r ( i ϵ N D φ ( P i , t , s D , φ P i , t , s d , φ ) ) + N m (   φ ( α m g , t , s P L , φ ( P L i m , t , s φ P L i m , t , s φ ) + β m g , t , s P L , φ ( P L i m , t , s φ P L i m , t , s φ   ) 2 2 + α m g , t , s Q L , φ ( Q L i m , t , s φ Q L i m , t , s φ   ) + β m g , t , s Q L , φ ( Q L i m , t , s φ Q L i m , t , s φ   ) 2 2 + α m g , t , s U , φ ( U m , t , s φ U m , t , s φ   ) + β m g , t , s U , φ ( U m , t , s φ U m , t , s φ   ) 2 2 )   )   ) )  
The objective function in (12) is constrained by (13)–(52). Real and reactive nodal power balance constraints are described in (13)–(16). The nodal balance for buses not connected to MGs is shown in (13) and (14), while the nodal balance for buses connected to MGs is given in (15) and (16). It is assumed that the power flows from the distribution grid to the MGs; reverse flow will result in a negative sign.
P g r , t , s i , φ + P g , t , s i , φ + P p v , t , s i , φ Δ i , P L i j , t , s φ + Δ i , + P L i j , t , s φ + P e , t , s i , φ , d c P e , t , s i , φ , c h = P i , t , s d , φ   ; i N   |   i N m
Q g r , t , s i , φ + Q g , t , s i , φ + Q p v , t , s i , φ Δ i , Q L i j , t , s φ + Δ i , + Q L i j , t , s φ + Q e , t , s i , φ , d c Q e , t , s i , φ , c h = Q i , t , s d , φ   ; i N   |   i N m
P L i m , t , s φ + P g , t , s i , φ + P p v , t , s i , φ Δ i , P L i j , t , s φ + Δ i , + P L i j , t , s φ + P e , t , s i , d c P e , t , s i , c h = P i , t , s d , φ ;   i N m
Q L i m , t , s φ + Q g , t , s i , φ + Q p v , t , s i , φ Δ i , Q L i j , t , s φ + Δ i , + Q L i j , t , s φ + Q e , t , s i , d c Q e , t , s i , c h = Q i , t , s d , φ ;   i N m
The served load constraints are described by (17) and (18), which ensure that the served load is equal to or less than the demand at every time t and scenario s. The linearized power flow equations for the unbalanced distribution system, based on the squared magnitudes of bus voltages derived from [50], are given in (19)–(22). The constraints in (19) and (20) apply to each phase of the distribution lines, excluding the lines connected to the MGs that are presented in (21) and (22). Instead of stating equations for the three line phases,   { φ 1 , φ 2 , φ 3 } defines the three phases’ indices of line i − j, where   { φ 1 , φ 2 , φ 3 } corresponds to power flow in line phases a, b, and c: {a, b, c,}, {b, c, a}, and {c, a, b}, respectively. Constraints (19)–(22) are relaxed using the big M method because if the line does not exist, two bus voltages, e.g., U i , t , s φ   and   U j , t , s φ , should not be equal.
P i , t , s d , φ P i , t , s D , φ ;   i N D
Q i , t , s d , φ Q i , t , s D , φ ;   i N D  
U i , t , s φ 1 U j , t , s φ 1 2   r i j φ 1 φ 1   P L i j , t , s φ 1 + 2   x i j φ 1 φ 1   Q L i j , t , s φ 1 r i j φ 1 φ 2 P L i j , t , s φ 2 + 3   x i j φ 1 φ 2 P L i j , t , s φ 2 x i j φ 1 φ 2 Q L i j , t , s φ 2 3   r i j φ 1 φ 2 Q L i j , t , s φ 2 r i j φ 1 φ 3 P L i j , t , s φ 3 3   x i j φ 1 φ 3 P L i j , t , s φ 3 x i j φ 1 φ 3 Q L i j , t , s φ 3 + 3   r i j φ 1 φ 3 Q L i j , t , s φ 3 + M ( 1 ϕ i j φ 1 ) ;   i , j N   |   i , j N m    
U i , t , s φ 1 U j , t , s φ 1 2   r i j φ 1 φ 1   P L i j , t , s φ 1 + 2   x i j φ 1 φ 1   Q L i j , t , s φ 1 r i j φ 1 φ 2 P L i j , t , s φ 2 + 3   x i j φ 1 φ 2 P L i j , t , s φ 2 x i j φ 1 φ 2 Q L i j , t , s φ 2 3   r i j φ 1 φ 2 Q L i j , t , s φ 2 r i j φ 1 φ 3 P L i j , t , s φ 3 3   x i j φ 1 φ 3 P L i j , t , s φ 3 x i j φ 1 φ 3 Q L i j , t , s φ 3 + 3   r i j φ 1 φ 3 Q L i j , t , s φ 3 M ( 1 ϕ i j φ 1 ) ;   i , j N   |   i , j N m    
U i , t , s φ 1 U m , t , s φ 1 2   r i m φ 1 φ 1   P L i m , t , s φ 1 + 2   x i m φ 1 φ 1   Q L i m , t , s φ 1 r i m φ 1 φ 2 P L i m , t , s φ 2 + 3   x i m φ 1 φ 2 P L i m , t , s φ 2 x i j φ 1 φ 2 Q L i m , t , s φ 2 3   r i m φ 1 φ 2 Q L i m , t , s φ 2 r i m φ 1 φ 3 P L i m , t , s φ 3 3   x i m φ 1 φ 3 P L i m , t , s φ 3 x i j φ 1 φ 3 Q L i m , t , s φ 3 + 3   r i m φ 1 φ 3 Q L i m , t , s φ 3 + M ( 1 y i m , s   ϕ i m φ 1 ) ;   i N m ,     m K m  
U i , t , s φ 1 U m , t , s φ 1 2   r i m φ 1 φ 1   P L i m , t , s φ 1 + 2   x i m φ 1 φ 1   Q L i m , t , s φ 1 r i m φ 1 φ 2 P L i m , t , s φ 2 + 3   x i m φ 1 φ 2 P L i m , t , s φ 2 x i j φ 1 φ 2 Q L i m , t , s φ 2 3   r i m φ 1 φ 2 Q L i m , t , s φ 2 r i m φ 1 φ 3 P L i m , t , s φ 3 3   x i m φ 1 φ 3 P L i m , t , s φ 3 x i j φ 1 φ 3 Q L i m , t , s φ 3 + 3   r i m φ 1 φ 3 Q L i m , t , s φ 3 M ( 1 y i m , s   ϕ i m φ 1 ) ;   i N m ,     m K m  
Constraint (23) ensures that the system power factor is within a desirable range, while the limits on grid generation are enforced by (24). Equation (24) can be linearized to (25)–(27) using the hexagon approximation proposed by [53]. Generation limits for DG units are given by (28) and (29).
t a n ( cos 1 P F ) P g r , t , s Q g r , t , s i t a n ( cos 1 P F ) P g r , t , s
( S g r m a x ) 2 ( P g r , t , s φ ) 2 + ( Q g r , t , s φ ) 2  
3   ( P g r , t , s φ + S g r m a x ) Q g r , t , s φ 3   ( P g r , t , s φ S g r m a x )
3 / 2   S g r m a x Q g r , t , s φ 3 / 2   S g r m a x
3   ( P g r , t , s φ S g r m a x ) Q g r , t , s φ 3   ( P g r , t , s φ + S g r m a x )
P g m i n P g , t , s i , φ P g m a x
Q g m a x Q g , t , S i , φ Q g m a x
The limits on real and reactive power flow in lines are presented by (30)–(37). Constraints (30) and (31) are for distribution lines, excluding the line connecting to MGs, which are relaxed using big M to ensure that power flows only through the existing line phases. Real and reactive power flow between the distribution grid and MGs is confined by (32) and (33) based on the existing line phases and the binary variables that represent either connection or disconnection for each line at each time t and scenario s. Constraint (34) enforces the distribution line capacity, which is linearized in (35)–(37).
M ϕ i j P L i j , t , s φ M ϕ i j ;   i , j N   |   { i , j N m   }  
M ϕ i j Q L i j , t , s φ M ϕ i j   ;   i , j N   |   { i , j N m   }
M · y i m , s · ϕ i m φ P L i m , t , s φ M ·   y i m , s .   ϕ i m φ ;   i N m ,     m K m
M   y i m , s   ϕ i m φ Q L i m , t , s φ M   y i m , s   ϕ i m φ ;   i N m ,   m K m
( S L i j m a x ) 2 ( P L i j , t , s φ ) 2 + ( Q L i j , t , s φ ) 2 ; i , j { N ,   K m }
3   ( P L i j , t , s φ + S L i j m a x ) Q L i j , t , s φ 3   ( P L i j , t , s φ S L i j m a x )
3 / 2   S L i j m a x Q L i j , t , s φ 3 / 2   S L i j m a x
3   ( P L i j , t , s φ S L i j m a x ) Q L i j , t , s φ 3   ( P L i j , t , s φ + S L i j m a x )
Generation limits on the inverters of PV units are shown in (38)–(40). Constraints on the energy storage system are shown in (41)–(48). Real/reactive power charging and discharging are limited by (41)–(44). Constraint (45) ensures that the charging and discharging states of the battery cannot happen at the same time t and scenario s. Constraint (46) describes the optimal battery state of charge at a specific time. The battery state of charge is limited by (47), and its initial value is assumed to be a percentage of its maximum limit, as shown in (48).
0 P p v , t , s i , φ P p v m a x   ψ p v i , φ  
0 Q p v , t , s i , φ Q p v m a x ψ p v i , φ
P p v , t , s i , φ η p v i   A p v i   R t , s i   δ p v i   ψ p v i , φ
0 P e , t , s i , φ , c h P e c h , m a x · x e , t , s i , c h
0 P e , t , s i , φ , d c P e d c , m a x · x e , t , s i , d c
x e , t , s i , c h   Q e c h , m i n Q e , t , s i , c h Q e c h , m a x   x e , t , s i , c h
x e , t , s i , d c   Q e d c , m i n Q e , t , s i , d c Q e d c , m a x   x e , t , s i , d c
x e , t , s i , c h + x e , t , s i , d c 1
E e , t , s i , φ = E e , t 1 , s i , φ + ( P e , t , s i , φ , c h * η c h P e , t , s i , φ , d c / η d c ) Δ t
E e m i n E e , t , s i , φ E e m a x ;   t T |   t   { 0,24 }
E e , t , s i , φ = % E e m a x ; t { 0,24 }
The squared magnitude of bus voltage is limited by (49). Constraint (50) represents the probability that the coupling lines remain connected and hence that the exchanged power flow between the microgrids and the distribution system is satisfied within the specified confidence level. In other words, the constraint models probabilistic outages of coupling lines between the distribution system and microgrids, resulting in stochastic microgrid islanding operation. For instance, microgrid m may operate in islanding mode under probabilistic outage conditions, where ξ m represents the lower bound on the probability of microgrid operating in islanding mode, while 1 ξ m represents the upper bound on the probability that coupling lines remain connected, as shown in (50). The constraint in (50) is approximated using the scenario approximation approach in (51), where the Monte Carlo simulation [54] is used to generate a large number of scenarios to capture the uncertainty associated with stochastic disconnection events leading to microgrid islanding.
( V i m i n ) 2 U i , t , s φ ( V i m a x ) 2   ;   i N   |   i N g r   U g r , t , s φ = 1.05   p . u .
P r { y i m , s = 1 } 1 ξ m
s p r s · y i m , s 1 ξ m

2.3. Optimal Operation of Microgrids

In microgrids, the problem is formulated as QCP. The objective function is shown in (52). Similar to the distribution problem, the MG objective is to minimize the operating cost, including the cost of loss of load and the mismatch penalty.
min s p r s ( t ϵ T ( m ϵ k g F m ( φ P g , t , s m , φ ) + V O L L m g ( m ϵ k D φ ( P m , t , s D , φ P m , t , s d , φ ) ) + φ ( α m g , t , s P L , φ ( P L i m , t , s φ * P L i m , t , s φ ) + β m , t , s P L , φ ( P L i m , t , s φ * P L i m , t , s φ ) 2 2 + α m g , t , s Q L , φ ( Q L i m , t , s φ * Q L i m , t , s φ   ) + β m g , t , s Q L , φ ( Q L i m , t , s φ * Q L i m , t , s φ ) 2 2 + α m g , t , s U , φ ( U m , t , s φ * U m , t , s φ ) + β m , t , s U , φ ( U m , t , s φ * U m , t , s φ ) 2 2 )   ) )
The objective is subject to the constraints in (53)–(79). Equations (53) and (54) represent the real and reactive power nodal balance for MG buses, excluding buses connecting to the distribution system, whose constraints are enforced by (55) and (56). As mentioned earlier, power flows from the distribution grid to the MGs.
P g , t , s m , φ + P p v , t , s m , φ Δ m , P L m n , t , s φ + Δ m , + P L m n , t , s φ + P e , t , s m , φ , d c P e , t , s m , φ , c h = P m , t , s d , φ ;   m K   |   m K m
Q g , t , s m , φ + Q p v , t , s m , φ Δ m , Q L m j , t , s φ + Δ m , + Q L m n , t , s φ + Q e , t , s m , φ , d c Q e , t , s m , φ , c h = Q m , t , s d , φ ;   m K   |   m K m
P L i m , t , s φ + P g , t , s m , φ + P p v , t , s m , φ Δ m , P L m n , t , s φ + Δ m , + P L m n , t , s φ + P e , t , s m , d c P e , t , s m , c h = P m , t , s d , φ ; m K m ,   i N m
Q L i m , t , s φ + Q g , t , s m , φ + Q p v , t , s m , φ Δ m , Q L m n , t , s φ + Δ m , + Q L m j , t , s φ + Q e , t , s m , d c Q e , t , s m , c h = Q m , t , s d , φ ; m K m ,   i N m
Load served in the MGs is limited by (57) and (58). The linearized forms of power flow equations for the unbalanced networked microgrids are (59) and (60). The generation limits of DG units are shown in (61) and (62). Real and reactive power flows in the MGs’ lines, excluding the line connected to the distribution grid, are relaxed in (63) and (64) to ensure that power flows only through the existing lines while enforcing zero power flow in the non-existent lines. Similarly, the real and reactive power flows in lines connected to the distribution system are enforced by (65) and (66) using the shared coupling-line parameters obtained from the distribution system model.
P m , t , s d , φ P m , t , s D , φ ;   m K m
Q m , t , s d , φ Q m , t , s D , φ ;   m K D
U m , t , s φ 1 U n , t , s φ 1 2   r m n φ 1 φ 1   P L m n , t , s φ 1 + 2   x m n φ 1 φ 1   Q L m n , t , s φ 1 r m n φ 1 φ 2 P L m n , t , s φ 2 + 3   x m n φ 1 φ 2 P L m n , t , s φ 2 x m n φ 1 φ 2 Q L m n , t , s φ 2 3   r m n φ 1 φ 2 Q L m n , t , s φ 2 r m n φ 1 φ 3 P L m n , t , s φ 3 3   x m n φ 1 φ 3 P L m n , t , s φ 3 x m n φ 1 φ 3 Q L m n , t , s φ 3 + 3   r m n φ 1 φ 3 Q L m n , t , s φ 3 + M ( 1 ϕ m n φ 1 ) ;   m , n K    
U m , t , s φ 1 U n , t , s φ 1 2   r m n φ 1 φ 1   P L m n , t , s φ 1 + 2   x m n φ 1 φ 1   Q L m n , t , s φ 1 r m n φ 1 φ 2 P L m n , t , s φ 2 + 3   x m n φ 1 φ 2 P L m n , t , s φ 2 x m n φ 1 φ 2 Q L m n , t , s φ 2 3   r m n φ 1 φ 2 Q L m n , t , s φ 2 r m n φ 1 φ 3 P L m n , t , s φ 3 3   x m n φ 1 φ 3 P L m n , t , s φ 3 x m n φ 1 φ 3 Q L m n , t , s φ 3 + 3   r m n φ 1 φ 3 Q L m n , t , s φ 3 M ( 1 ϕ m n φ 1 ) ;   m , n K
P g m i n P g , t , s m , φ P g m a x
Q g m a x Q g , t , S m , φ Q g m a x
M ϕ m n φ P L m n , t , s φ M ϕ m n φ ; m , n K   |   { m , n K m   }      
M ϕ m n φ Q L m n , t , s φ M ϕ m n   φ ; m , n K   |   { m , n K m }
M · y i m , s   * · ϕ i m φ P L i m , t , s φ M · y i m , s   * · ϕ i m φ ; i N m ,   m K m
M · y i m , s * · ϕ i m φ Q L i m , t , s φ M · y i m , s * · ϕ i m φ ; i N m ,   m K m
Constraint (67) represents the capacity of the line, which is linearized to the set of constraints in (68)–(70). The generation of the PV units is limited by (71)–(73). The continuous model for energy storage systems in MG buses is shown in (74)–(78) [55]. The real and reactive power of battery inverters in MG buses are limited by the upper and lower bounds in (74) and (75). The optimal MG battery state of charge is described by (76), and its limits and initial values are given by (77) and (78), respectively. The lower and upper bounds of the squared magnitude of the MG bus voltage are stated in (79).
( S L m n m a x ) 2 ( P L m n , t , s φ ) 2 + ( Q L m n , t , s φ ) 2 ; m , n { K ,   N m }
3   ( P L m n , t , s φ + S L i j m a x ) Q L m n , t , s φ 3   ( P L m n , t , s φ S L m n m a x )
3 / 2   S L m n m a x Q L m n , t , s φ 3 / 2   S L m n m a x
3   ( P L m n , t , s φ S L m n m a x ) Q L m n , t , s φ 3   ( P L m n , t , s φ + S L m n m a x )
0 P p v , t , s m , φ P p v m a x   ψ p v m , φ  
0 Q p v , t , s m , φ Q p v m a x ψ p v m , φ
P p v , t , s m , φ η p v m   A p v m   R t , s m   δ p v m   ψ p v m , φ
P e m , m a x P e , t , s m , φ P e m , m a x
Q e m , m a x Q e , t , s m , φ Q e m , m a x
E e , t , s m , φ = E e , t 1 , s m , φ + ( P e , t , s m , φ ) Δ t
E e m i n E e , t , s m , φ E e m a x ;   t T |   { 0,24 }
E e , t , s m , φ = % E e m a x ;   t { 0,24 }
( V m m i n ) 2 U m , t , s φ ( V m m a x ) 2 ;   m K

3. Simulation Results and Discussion

In this section, a modified IEEE 34-bus system is used to illustrate the effectiveness of the proposed methodology. Six MGs are connected to the IEEE 34-bus distribution system, as depicted in Figure 2.
The MGs are coupled to the distribution system via six points of common coupling (PCCs). The proposed method aims to ensure that power exchange between the MGs and the distribution system via the PCCs converges to optimal values in a distributed framework. The probabilistic constraints for the PCC line index ensure that the power exchange between the MGs and the distribution system via the PCCs is above a certain threshold. In other words, the MG islanding modes remain below specific limits. Two case studies are presented in this section. First, the deterministic model is presented, in which the distribution system and the MGs are connected through PCCs, considering the forecasted load and PV outputs. Second, the stochastic model is presented; it accounts for uncertainties in the load, PVs, and MG islanding operation. The base power is set to 100 MVA, and the line-to-line base voltage is set to 24.9 kV. The bus voltage magnitudes are in per units (p.u.), while real and reactive power are presented in kW and kVAr, respectively. The maximum and minimum bus voltages are 0.95 and 1.05 p.u., respectively. As the squared bus voltages are used in the unbalanced power flow equations in this paper, the minimum and maximum limits are 0.9025 and 1.1025 p.u., respectively. The maximum MVA of the main distribution feeder is assumed to be 1.8 MVA, with a minimum power factor of 0.9 at each time t and scenario s. The charging and discharging efficiency of BESSs is assumed to be 90%. The locations and characteristics of dispatchable generating units, PV units, and BESSs are described in Table 2, Table 3 and Table 4, respectively. The costs of DGs are linearized into four segments using piecewise linearization, and the marginal costs for each segment are shown in Table 5.
The hourly energy prices in U.S. dollars are shown in Figure 3. The models are simulated in the General Algebraic Modeling System (GAMS) Version 2018 and run on a personal laptop with an Intel(R) Core(TM) i7-5500U CPU @2.4GHz and 12 GB of RAM. The following subsections present the results of the deterministic and stochastic models, respectively.

3.1. Deterministic Model

In this model, six MGs are connected to the distribution system. The total average hourly demands in the distribution network and microgrids are shown in Figure 4 and Figure 5, respectively. The solar irradiance in the area of the PV units is shown in Figure 6. The PV penetration rate is 27.41%, which is the ratio of the total peak PV power to the total peak load [56], where the total peak load in the distribution system with microgrids is 2054 kW. The proposed algorithm is tested under load unbalance levels on each line phase. Figure 7 shows the three-phase active power demand at each bus in the three-phase distribution network during the peak load hour (i.e., hour 18). The three-phase active power demand at each bus in the three-phase microgrids during peak load hours is shown in Figure 8. The mismatch tolerance for the inner loop (e1) is set to 0.01, and the mismatch tolerance for the outer loop (e2) is 0.001. The initial values of Alpha and Beta are set to 1; the convergence parameter ( γ ) is set to 1.15 for the deterministic model and 1.3 for the stochastic model. The results at the peak load hour (i.e., hour 18) are presented throughout this paper to analyze the impact of coordination between the DSO and the MGs during this peak hour. The following two deterministic cases are performed.

3.1.1. Deterministic Case 1: All Microgrids Are Connected to the Distribution System Under Normal Operation

In this case, all MGs are connected to the distribution system. The exchanged real power flow between the distribution network operator (DSO) and microgrid-1 (MG1) at each iteration during the peak load hour (i.e., hour 18) on line phase a, line phase b, and line phase c are shown in Figure 9 in (a), (b), and (c), respectively. The bus voltage magnitudes for phase a, phase b, and phase c at PCC1 at each iteration during the peak hour are shown in Figure 10 in (a), (b), and (c), respectively. As shown in these figures, the deterministic model converged to optimal values after 12 outer iterations and 120 inner iterations. The solution time for this case is 13 min and 50 s. Table 6 presents the final optimal values for real and reactive power exchanged between the DSO and the MGs during the peak hour. Positive values indicate power flow from the distribution system to the MGs, while negative values indicate reversed flow. The operating costs, load curtailments, and the total demand for 24 h are shown in Table 7. The operational costs of MG1, MG5, and MG6 are zero because there is no DG generation cost or load curtailment. Meanwhile, the operating costs associated with the DG units of MG2, MG3, and MG4 are $251.12, $108.04, and $117.31, respectively, while the operation cost of the distribution system is $14,884.80, including the cost of the energy supplied to the MGs. For this case, the total operating cost of the distribution system and microgrids is $15,361.27.
The solution to the proposed distributed energy management based on the ADMM is compared with that of centralized energy management. Here, centralized energy management is formulated as a mixed-integer programming (MIP) problem and solved using the GAMS. The total operational cost of the distribution system and microgrids is $15,324.31, which is $36.96 lower than the proposed distributed energy management system. Hence, the total operational cost of the distribution system with microgrids obtained using the proposed distributed algorithm is 0.24% higher than that of the centralized method. In terms of computational time, the centralized energy management solution executed in 3 s, which is faster than the proposed distributed algorithm. Although the centralized approach is faster and results in lower operational costs, it assumes full access to microgrid system information, which may not be feasible. The operators of distribution systems and microgrids are usually independent [7], and the information shared is limited due to microgrid privacy concerns [8]. On the other hand, the proposed distributed algorithm can achieve high solution accuracy with limited information shared among operators, i.e., only sharing the related information of the exchanged real and reactive power flows between neighboring regions and the bus voltage magnitudes at the PCCs, yielding results that closely match those obtained with the centralized approach, with an insignificant error of 0.24% in the total operating cost.

3.1.2. Deterministic Case 2: Microgrid Outage Analysis

In this case, MG1 is chosen to be out of the distribution system. The results of this case converge to optimal values after 12 outer iterations and 255 inner iterations, and the solution time is 16 min and 46 s. Table 8 shows the final optimal values for the real and reactive power exchanged between the DSO and the MGs during peak load at hour 18. The operating costs, load curtailments, and the total demand for 24 h are shown in Table 9. The distribution operating cost is $14,120.05, including the cost of energy sold to the MGs, which is lower than the cost in case 1 by $764.75 due to load curtailment at MG1, resulting in a reduction in power supply from the distribution system. Since MG1 is out, the corresponding Alpha and Beta will be zero according to (1); hence there is no communication or mismatch between MG1 and DSO. The operational costs of MG1 are $90.798.72 due to the curtailed load penalty, as MG1 experiences excessive demand while its generation depends on only one PV unit and one BESS unit, as shown in Figure 2, which are insufficient to meet the entire demand in MG1. Similar to Case 1, the operating costs of MG5 and MG6 are zero, because there is no DG generation cost or load curtailment. Compared with Case 1, the operating costs of the distribution system, MG2, MG3, and MG4 are reduced to $14,120.05, $100.60, $93.71, and $62.46, respectively, due to the loss of MG1 demand, resulting in lower power dispatch of the DG units.

3.2. Stochastic Model

In this section, 3000 scenarios are developed using Monte Carlo simulation to account for uncertain demand and PV system power outputs. Scenario generation is based on the average values of demand shown in Figure 4 and Figure 5 and the solar irradiation presented in Figure 6, with a standard deviation of ±3% of the mean. Subsequently, the backward scenario reduction method [57] is applied to reduce the number of scenarios to 10, with the associated probabilities shown in Figure 11. The scenario reduction method used in this paper is presented in detail in [57]. The constraint in (50) models probabilistic outages of coupling lines between the distribution system and microgrids, resulting in stochastic microgrid islanding operation. For instance, microgrid m may operate in islanding mode under probabilistic outage conditions, where ξ m (e.g., 12%) represents the lower bound on the probability of islanding mode, while 1 ξ m (e.g., 88%) represents the upper bound on the probability that coupling lines remain connected, as shown in (50). The constraint in (50) is approximated using the scenario approximation approach in (51), where the Monte Carlo simulation [54] is used to generate a large number of scenarios to capture the uncertainty associated with stochastic disconnection events leading to microgrid islanding. It is important to note that when ξ m = 0 % , it refers to microgrids operating in grid-connected mode throughout the entire time horizon; this is equivalent to the deterministic model described earlier. To test the effectiveness of the proposed methodology, the following three stochastic cases are performed.

3.2.1. Stochastic Case 1: All MGs Operate in Grid-Connected Mode Throughout the Entire Time Horizon in All Scenarios

In this case, all six MGs are connected to the distribution system with 100% certainty, which is equivalent to Deterministic Model Case 1. The results of this case converge to optimal values after 25 outer iterations and 225 inner iterations, and the solution time is 3 h, 20 min and 44 s. Table 10 presents the expected exchanged real and reactive flow between the DSO and the MGs at peak hour 18. Compared with Deterministic Model Case 1, the power flow exchanged between the DSO and the MGs at peak hour 18 is slightly higher, reflecting the increase in the expected load served and the uncertain PV power output. Table 11 shows the expected operating costs, expected total demand curtailments, and the expected total load in the MGs. The expected operating cost of the distribution system is increased by $14,977.86 due to load uncertainty and uncertain PV power output. The expected operating costs of MG2 and MG3 are reduced to $241.01 and $107.08, respectively, due to reduced power dispatch of DG units in these microgrids, while the expected operating cost of MG4 is increased to $121.12. As previously stated, the operational costs of MG1, MG5, and MG6 are zero, as there is no DG generation cost or load curtailment in these microgrids. The total expected operational cost of the distribution system and microgrids is $15,447.07, which is 0.56% higher than the total operational costs in Deterministic Model Case 1.

3.2.2. Stochastic Case 2: MG Operating in Islanding Mode Throughout the Entire Time Horizon in All Scenarios

In this case, MG1 is disconnected from the distribution system with a 0% certainty of connection, which is equivalent to Deterministic Case 2. In other words, the probability of MG1 operating in islanding mode is 100%. The results of this case converge to optimal values after 22 outer iterations and 189 inner iterations, and the solution time is 3 h, 18 min and 20 s. The expected real and reactive flow between the distribution system and the MGs at peak load hour 18 are given in Table 12. The expected operating costs, the expected load curtailments, and the expected total load in the distribution system and the MGs are presented in Table 13. Compared with Deterministic Case 2, the total real power flows in all three-phase lines from the distribution system to MG2 and MG3 at peak hour 18 are reduced by 11.07 kW and 8.63 kW, respectively. Hence, the expected operating costs of MG2 and MG3 are increased compared with Deterministic Case 2 to $150.62 and $94.62, respectively, in response to a reduction in power supply from the distribution system to these microgrids, necessitating increased power dispatch of the generation units to meet their respective expected demand. The expected operating cost of the distribution system is increased compared with Deterministic Case 2 to $14,124.09 due to higher expected power dispatch of the generation units to meet the increased expected demand.
Compared with Stochastic Case 1, the expected real power flows in the three-phase lines between the distribution system and MG2 at peak load hour 18 are increased to 10.61 kW, 10.62 kW, and 12.69 kW in line phase a, line phase b, and line phase c, respectively, and the expected real power flowing from the distribution system to MG2 because the islanding operation of MG1 relieves the distribution system from its excessive load. For instance, in line phase a during the peak hour in Stochastic Case 1, the real power flow from MG2 to the distribution system is 2.31 kW, and the real power flow from the distribution system to MG1 is 41.001 kW. Meanwhile, in line phase a during the same peak hour in Stochastic Case 2, MG2 received real power of 10.61 kW from the DSO because the outage of MG1 relieved the distribution system of its excessive load of 41.001 kW. Similarly, the distribution system supplied MG4 during the peak hour with real power of 1.14 kW, 1.39 kW, and 3.33 kW, flowing in line phase a, line phase b, and line phase c, respectively. The total expected operating cost of the distribution system is reduced to $14,124.09, which is a 5.70% reduction compared with Stochastic Case 1 due to the outage of MG1.

3.2.3. Stochastic Case 3 Risk Analysis: 12% Lower Bound on Probability of Islanding Mode for All Microgrids

This case is studied to evaluate the MG probabilistic islanding operating mode and validate the effectiveness of the proposed method. In this case, a stochastic model with a 12% lower bound on the probability of islanding mode for all microgrids is used. In other words, the probability of microgrids operating in grid-connected mode is less than 88%. The stochastic outages of MG1 are shown in Figure 12, where MG1 is in islanding mode in two scenarios, with a total probability of 15.73%. Likewise, the total probability of MG2 operating in islanding mode is 17.54%, while the total probability of MG3, MG4, MG5, and MG6 operating in islanding mode is 15.73% each, as determined by the developed formulation in (51). The results of this case converge to optimal values after 25 outer iterations and 225 inner iterations, and the solution time is 2 h, 30 min and 2 s. Table 14 shows the expected real and reactive power flow exchanged between neighboring regions at peak load hour 18. The expected operating costs of the distribution system and microgrids, expected load demand curtailments, and the expected total load in the distribution system and the MGs are presented in Table 15.
Compared with Stochastic Case 1 at the peak load hour, the expected power flow exchanged between the distribution system and the MGs decreases due to the probabilistic islanding of MGs. The expected operating costs of MG1, MG5, and MG6 are increased to $14,239.41, $1144.09, and $1902.09, respectively, and are associated with penalty costs for load curtailment of 355.985 kW, 28.602 kW, and 47.553 kW, respectively. The expected operating costs of MG4 are reduced to $114.57 due to a decrease in power dispatch of its DG units. However, the expected operating costs of MG2 and MG3 are increased to $266.50 and $306.32, respectively, due to the increased power dispatch during islanding modes, where they have sufficient generation to supply energy to their own expected demand in most expected scenarios, with small expected demand curtailment of 0.012 kW and 4.952 kW, respectively, in a few scenarios. Compared with Stochastic Case 1, the total expected operating cost of the distribution system is reduced by 1.03% due to the disconnection of microgrids from the distribution system during islanding operation in a few scenarios, which relieves the distribution system from its excessive load. Table 16 compares operational costs of the distribution system and the MGs across the different cases.

4. Conclusions

In this paper, a distributed algorithm for energy management of the distribution system with multi-microgrids is proposed to optimally coordinate power flow exchange between neighboring regions, considering unbalanced operation. The stochastic nature of demand and PV generation is captured in the stochastic programming formulation. Moreover, the proposed distributed energy management algorithm accounts for probabilistic operation modes of microgrids to ensure that the optimal operational decisions are resilient to the risk of microgrid islanding. The proposed framework is performed in an IEEE 34-bus distribution system with six microgrids. The proposed distributed energy management can reach high solution accuracy with limited information shared among operators, as indicated in the case study, providing results comparable to those of the centralized energy management method, with an insignificant 0.24% error in total operating cost. The results of the deterministic and stochastic cases are compared to analyze the stochastic operation of MGs, the uncertainty in load and PV power outputs, and their impact on the proposed distributed energy management. The case study shows that considering only the uncertainty in load and PV outputs increases the total operating cost of the distribution system and microgrids by 0.56% compared with the case under normal operation with forecasted load and PV generation. However, by considering the probabilistic operation mode of microgrids, the total expected operating cost of the distribution system decreases by 1.03% due to the microgrids’ disconnection from the distribution system during islanding in a few scenarios, thereby relieving the distribution system of excessive load. Future work can be extended to include data-driven tools in energy management systems to ensure the accurate forecasting of RESs and load. Moreover, advanced reliability techniques can be incorporated into the proposed algorithm to address several factors that may contribute to microgrid islanding risk, such as weather events, line faults, and equipment failure rates.

Funding

This project was funded by the Deanship of Scientific Research (DSR) at King Abdulaziz University, Jeddah, Saudi Arabia, under grant No. (IPP: 991-135-2025). The authors, therefore, acknowledge with thanks the DSR for technical and financial support.

Data Availability Statement

Datasets analyzed or generated during the study are included within this manuscript.

Conflicts of Interest

The author declares no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
g Index of DG units.
g r Index of distribution grid connection points.
p v Index of photovoltaic panels.
e Index of battery energy storage systems.
c h Index of battery charging mode.
d c Index of battery discharging mode.
i n , o u Index of inner/outer iteration.
sIndex of scenario.
i , j Index of distribution system buses.
m , n Index of microgrid buses.
m g Index of microgrids.
φ Index of phases a, b, and c.
D , d Index of demand.
t Index of time interval.
N Set of distribution system buses.
N g r Set of distribution system buses connected to main distribution feeder.
N g Set of distribution system buses connected to DG units.
N D Set of distribution system buses connected to demand.
N m Set of distribution system buses coupled to MGs.
K Set of microgrid buses.
K m Set of microgrid buses coupled to distribution buses.
K g Set of microgrid buses coupled to DG units.
K D Set of microgrid buses coupled to demand.
Δ i , + , Δ i , lSet of lines entering/leaving distribution bus i , respectively.
Δ m , + , Δ m , Set of lines entering/leaving microgrid bus m , respectively.
F i ( . ) ,   F m ( . ) Production cost of a DG unit at buses i and m , respectively.
P ( . ) , t , s   i , φ , Q ( . ) , t , s i , φ Real and reactive power dispatch of a unit located at distribution bus i in phase φ at hour t in scenario s , respectively.
P ( . ) , t , s   m , φ , Q ( . ) , t , s m , φ Real and reactive power dispatch of a unit located at microgrid bus m in phase φ at hour t in scenario s , respectively.
P g r , t , s   φ , Q g r , t , s   φ Real and reactive power of main distribution substation in phase φ at hour t in scenario s , respectively.
P i , t , s d , φ ,   Q i , t , s d , φ Real and reactive load served at distribution bus i in phase φ   at hour t in scenario s , respectively.
P m , t , s d , φ ,   Q m , t , s d , φ Real and reactive load served at microgrid bus m in phase φ at hour t in scenario s , respectively.
P L i j , t , s φ , Q L i j , t , s φ Real and reactive power flow in distribution line i j in phase φ at hour t in scenario s , respectively.
P L m n , t , s φ , Q L m n , t , s φ Real and reactive power flow in microgrid line m n   in phase φ at hour t in scenario s , respectively.
P L i m , t , s   φ , Q L i m , t , s φ Real and reactive power flow in line phase φ connecting distribution bus i with microgrid at bus m at hour t in scenario s , respectively.
U i , t , s φ Squared voltage phase φ at distribution bus i at hour t in scenario s .
U m , t , s φ Squared voltage phase φ at microgrid bus m at hour t in scenario s .
E e , t , s i , φ State-of-charge phase φ for battery at distribution bus i at hour t in scenario s .
E e , t , s m , φ State-of-charge phase φ for battery at microgrid bus m at hour t in scenario s .
P e c h ,   m a x ,   P e d c ,   m a x Maximum real power charging and discharging of battery energy storage systems in distribution system, respectively.
Q e c h ,   m a x ,   Q e d c ,   m a x Maximum reactive power charging and discharging of inverters in battery energy storage systems in distribution system, respectively.
Q e c h ,   m i n ,   Q e d c ,   m i n Minimum reactive power charging and discharging of inverters in battery energy storage systems in distribution system, respectively.
P e m , m a x , Q e m , m a x Maximum real power and reactive power of battery energy storage systems at microgrid bus m , respectively.
y i m , s lBinary variable 1 or 0 represents connection or disconnection of coupling line between distribution bus i and microgrid bus m .
x e , t , s     i , c h ,   x e , t , s i , d c Binary variables that represent battery charging and discharging states at distribution bus i in phase φ   at hour t in scenario s , respectively.
r i j , x i j Resistance and reactance of distribution line i j , respectively.
r i m , x i m Resistance and reactance of coupling line i m , respectively.
r m n , x m n Resistance and reactance of microgrid line m n , respectively.
PFMinimum power factor.
V O L L Value of lost load.
M Big M—very large number.
ε 1 , ε 2   Mismatch tolerance.
α m g , t , s ( . ) , φ , β m g , t , s ( . ) , φ Weights for mismatches in results between DSO and microgrid at hour t and scenario s.
γ Convergence parameter.
P L i m , t , s φ *     Q L i m , t , s φ * Exchanged real and reactive power flow in coupling line i m in phase φ at hour t in scenario s , obtained from DSO, respectively.
U m , t , s φ * Exchanged squared voltage phase φ at point of common coupling at hour t in scenario s obtained from DSO.
y i m , s * Parameter obtained from DSO that represents connection/ disconnection of coupling line i m .
P L i m , t , s φ     Q L i m , t , s φ Exchanged real and reactive power flow in coupling line i m in phase φ at hour t in scenario s obtained from MG operator, respectively.
U m , t , s φ Exchanged squared voltage at points of common coupling in phase φ at hour t   in scenario s obtained from MG operator.
P i , t , s D , φ   Q i , t , s D , φ Real and reactive demand at distribution bus i in phase φ at hour t   in scenario s , respectively.
P m , t , s D , φ   Q m , t , s D , φ Real and reactive demand at microgrid bus m in phase φ at hour t in scenario s , respectively.
P ( . ) m i n ,   P ( . ) m a x Minimum and maximum real power dispatch for each phase of a unit, respectively.
Q ( . ) m i n , Q ( . ) m a x Minimum and maximum reactive power dispatch of a unit for each phase, respectively.
S g r m a x Maximum allowable apparent power from the main grid feeder in the distribution system.
V i m i n , V i m a x Minimum and maximum acceptable voltage at distribution bus i , respectively.
V m m i n , V m m a x Minimum and maximum acceptable voltage at microgrid bus m , respectively.
U g r , t , s φ Squared voltage phase φ at the main distribution bus (slack bus).
S L i j m a x , S L m n m a x Maximum kVA capacity of distribution line i j and microgrid line m n , respectively.
E e m i n ,   E e m a x Minimum and maximum battery state of charge, respectively.
ϕ i j φ Constant {0 or 1} represents existing phases of distribution line i j .
ϕ m n φ Constant {0 or 1} represents existing phases of microgrid line m n .
ϕ i m φ Constant {0 or 1} represents existing phases of coupling line i m .
ψ p v i , φ , ψ p v m , φ Constant {0 or 1} represents existing phases of PV panels at distribution buses i   and microgrid bus m , respectively.
p r s Probability of scenario s.
η c h , η d c Efficiency of battery charging and discharging.
η p v i , η p v m Efficiency of PV panels at distribution bus i and microgrid bus m , respectively.
A p v i , A p v m Total area of PV panels at distribution bus i and microgrid bus m , respectively.
δ p v i , δ p v m Output power loss coefficient of PV panels at distribution bus i and microgrid bus m , respectively.
R t , s i , R t , s m Solar irradiance during hour t in scenario s at distribution bus i and microgrid bus m , respectively.
C g r t Hourly energy price for the main distribution grid.
Δ t Time difference in hours.
T Total number of hours under study.
ξ m The lower bound on the probability of microgrid operating in islanding mode.

References

  1. Ghosh, S.; Isbeih, Y.J.; El Moursi, M.S. Assessment of bus inertia to enhance dynamic flexibility of hybrid power systems with renewable energy integration. IEEE Trans. Power Deliv. 2023, 38, 2372–2386. [Google Scholar] [CrossRef]
  2. Jiang, W.; Wang, X.; Huang, H.; Zhang, D.; Ghadimi, N. Optimal economic scheduling of microgrids considering renewable energy sources based on energy hub model using demand response and improved water wave optimization algorithm. J. Energy Storage 2022, 55, 105311. [Google Scholar] [CrossRef]
  3. Zhang, Q.; Ma, Z.; Zhu, Y.; Wang, Z. A two-level simulation-assisted sequential distribution system restoration model with frequency dynamics constraints. IEEE Trans. Smart Grid 2021, 12, 3835–3846. [Google Scholar]
  4. R. Singh, A.; Kumar, R.S.; Bajaj, M.; Khadse, C.B.; Zaitsev, I. Machine learning-based energy management and power forecasting in grid-connected microgrids with multiple distributed energy sources. Sci. Rep. 2024, 14, 19207. [Google Scholar] [CrossRef]
  5. Saki, H.; Zangeneh, A.; Aghaei, J. Distributed minimum spanning tree approach for critical load restoration using microgrid formation in resilient distribution systems. Electr. Power Syst. Res. 2025, 239, 111186. [Google Scholar]
  6. Gali, V.; Jamwal, P.K.; Gupta, N.; Kumar, A. An adaptive dynamic power management approach for enhancing operation of microgrid with grid ancillary services. Renew. Energy 2023, 219, 119413. [Google Scholar] [CrossRef]
  7. Renani, Y.K.; Ehsan, M.; Shahidehpour, M. Optimal transactive market operations with distribution system operators. IEEE Trans. Smart Grid 2017, 9, 6692–6701. [Google Scholar] [CrossRef]
  8. Xu, Q.; Zhao, T.; Xu, Y.; Xu, Z.; Wang, P.; Blaabjerg, F. A distributed and robust energy management system for networked hybrid AC/DC microgrids. IEEE Trans. Smart Grid 2019, 11, 3496–3508. [Google Scholar] [CrossRef]
  9. Foruzan, E.; Soh, L.K.; Asgarpoor, S. Reinforcement learning approach for optimal distributed energy management in a microgrid. IEEE Trans. Power Syst. 2018, 33, 5749–5758. [Google Scholar] [CrossRef]
  10. Alghamdi, A.S. Microgrid energy management and scheduling utilizing energy storage and exchange incorporating improved gradient-based optimizer. J. Energy Storage 2024, 97, 112775. [Google Scholar] [CrossRef]
  11. Tooryan, F.; HassanzadehFard, H.; Collins, E.R.; Jin, S.; Ramezani, B. Optimization and energy management of distributed energy resources for a hybrid residential microgrid. J. Energy Storage 2020, 30, 101556. [Google Scholar] [CrossRef]
  12. Hassaballah, E.G.; Keshta, H.E.; Abdel-Latif, K.M.; Ali, A.A. A novel strategy for real-time optimal scheduling of grid-tied microgrid considering load management and uncertainties. Energy 2024, 299, 131419. [Google Scholar] [CrossRef]
  13. Hwang Goh, H.; Shi, S.; Liang, X.; Zhang, D.; Dai, W.; Liu, H.; Yuong Wong, S.; Agustiono Kurniawan, T.; Chen Goh, K.; Leei Cham, C. Optimal energy scheduling of grid-connected microgrids with demand side response considering uncertainty. Appl. Energy 2022, 327, 120094. [Google Scholar] [CrossRef]
  14. Ramkumar, M.S.; Subramani, J.; Sivaramkrishnan, M.; Munimathan, A.; Michael, G.K.O.; Alam, M.M. Optimal energy management for multi-energy microgrids using hybrid solutions to address renewable energy source uncertainty. Sci. Rep. 2025, 15, 7755. [Google Scholar] [CrossRef]
  15. Ibrahim, N.N.; Jamian, J.J.; Rasid, M.M. Optimal multi-objective sizing of renewable energy sources and battery energy storage systems for formation of a multi-microgrid system considering diverse load patterns. Energy 2024, 304, 131921. [Google Scholar] [CrossRef]
  16. Roustaee, M.; Kazemi, A. Multi-objective energy management strategy of unbalanced multi-microgrids considering technical and economic situations. Sustain. Energy Technol. Assess. 2021, 47, 101448. [Google Scholar] [CrossRef]
  17. Maghami, M.R.; Yaghoubi, E.; Mohamed, M.; Yaghoubi, E.; Jahromi, M.Z.; Fei, T.K. Multi-objective optimization of unbalanced power distribution systems: A comprehensive approach to address uncertainties and enhance performance. Energy Convers. Manag. X 2025, 27, 101087. [Google Scholar] [CrossRef]
  18. Kim, R.K.; Glick, M.B.; Olson, K.R.; Kim, Y.S. MILP-PSO combined optimization algorithm for an islanded microgrid scheduling with detailed battery ESS efficiency model and policy considerations. Energies 2020, 13, 1898. [Google Scholar] [CrossRef]
  19. Hematian, H.; Askari, M.T.; Ahmadi, M.A.; Sameemoqadam, M.; Nik, M.B. Robust optimization for microgrid management with compensator, EV, storage, demand response, and renewable integration. IEEE Access 2024, 12, 73413–73425. [Google Scholar] [CrossRef]
  20. Hosseini, S.M.; Carli, R.; Dotoli, M. Robust optimal energy management of a residential microgrid under uncertainties on demand and renewable power generation. IEEE Trans. Autom. Sci. Eng. 2020, 18, 618–637. [Google Scholar] [CrossRef]
  21. Ye, Y.; Wang, H.; Chen, P.; Tang, Y.; Strbac, G. Safe deep reinforcement learning for microgrid energy management in distribution networks with leveraged spatial–temporal perception. IEEE Trans. Smart Grid 2023, 14, 3759–3775. [Google Scholar] [CrossRef]
  22. He, W.; Wu, X.; Li, X.; He, M.; Cao, B.; Wang, X. Low-carbon economic operation of multi-energy microgrid based on multi-level robust optimisation. IET Energy Syst. Integr. 2024, 6, 606–621. [Google Scholar]
  23. Vu, D.H.; Muttaqi, K.M.; Sutanto, D. An integrated energy management approach for the economic operation of industrial microgrids under uncertainty of renewable energy. IEEE Trans. Ind. Appl. 2020, 56, 1062–1073. [Google Scholar] [CrossRef]
  24. Guo, Y.; Zhao, C. Islanding-aware robust energy management for microgrids. IEEE Trans. Smart Grid 2016, 9, 1301–1309. [Google Scholar] [CrossRef]
  25. Hussain, A.; Rousis, A.O.; Konstantelos, I.; Strbac, G.; Jeon, J.; Kim, H.M. Impact of uncertainties on resilient operation of microgrids: A data-driven approach. IEEE Access 2019, 7, 14924–14937. [Google Scholar] [CrossRef]
  26. Yaseen, M.; Nizami, I.F.; Aldajani, M.B.; Raja, A.A.; Haroon, F.; Abbas, Q. Resilient Constraint Energy Management for Microgrids: Integrating Wasserstein DRO and CVaR-Constrained MPC Under Renewable Uncertainty. IEEE Access 2026, 14, 11534–11559. [Google Scholar] [CrossRef]
  27. Zandrazavi, S.F.; Guzman, C.P.; Pozos, A.T.; Quiros-Tortos, J.; Franco, J.F. Stochastic multi-objective optimal energy management of grid-connected unbalanced microgrids with renewable energy generation and plug-in electric vehicles. Energy 2022, 241, 122884. [Google Scholar]
  28. Silva, J.A.A.; López, J.C.; Arias, N.B.; Rider, M.J.; da Silva, L.C. An optimal stochastic energy management system for resilient microgrids. Appl. Energy 2021, 300, 117435. [Google Scholar] [CrossRef]
  29. Anam, M.I.; Nguyen, T.T.; Vu, T. Risk-based preventive energy management for resilient microgrids. Int. J. Electr. Power Energy Syst. 2023, 154, 109391. [Google Scholar] [CrossRef]
  30. Guo, C.; Wang, X.; Zheng, Y.; Zhang, F. Optimal energy management of multi-microgrids connected to distribution system based on deep reinforcement learning. Int. J. Electr. Power Energy Syst. 2021, 131, 107048. [Google Scholar] [CrossRef]
  31. Castellanos, J.; Correa-Flórez, C.A.; Garcés, A.; Ordóñez-Plata, G.; Uribe, C.A.; Patino, D. An energy management system model with power quality constraints for unbalanced multi-microgrids interacting in a local energy market. Appl. Energy 2023, 343, 121149. [Google Scholar] [CrossRef]
  32. Zhang, R.; Li, X.; Fu, L.; Jiang, T.; Li, G.; Chen, H. Network-aware energy management for microgrids in distribution market: A leader-followers approach. Appl. Energy 2023, 332, 120522. [Google Scholar] [CrossRef]
  33. Mansouri, S.A.; Ahmarinejad, A.; Nematbakhsh, E.; Javadi, M.S.; Nezhad, A.E.; Catalão, J.P. A sustainable framework for multi-microgrids energy management in automated distribution network by considering smart homes and high penetration of renewable energy resources. Energy 2022, 245, 123228. [Google Scholar] [CrossRef]
  34. Darshi, R.; Shamaghdari, S.; Jalali, A.; Arasteh, H. Decentralized energy management system for smart microgrids using reinforcement learning. IET Gener. Transm. Distrib. 2023, 17, 2142–2155. [Google Scholar] [CrossRef]
  35. Alobaidi, A.H.; Khodayar, M.E.; Shahidehpour, M. Decentralized energy management for unbalanced networked microgrids with uncertainty. IET Gener. Transm. Distrib. 2021, 15, 1922–1938. [Google Scholar] [CrossRef]
  36. Eriksson, M.; Armendariz, M.; Vasilenko, O.O.; Saleem, A.; Nordström, L. Multiagent-based distribution automation solution for self-healing grids. IEEE Trans. Ind. Electron. 2014, 62, 2620–2628. [Google Scholar] [CrossRef]
  37. Sezgin, M.E.; Gol, M. Distributed energy management and communication strategy for network of microgrids. Electr. Power Syst. Res. 2025, 238, 111079. [Google Scholar] [CrossRef]
  38. Liu, G.; Ferrari, M.F.; Ollis, T.B.; Tomsovic, K. An MILP-based distributed energy management for coordination of networked microgrids. Energies 2022, 15, 6971. [Google Scholar] [CrossRef]
  39. Liu, G.; Ollis, T.B.; Ferrari, M.F.; Sundararajan, A.; Chen, Y. Distributed energy management for networked microgrids embedded modern distribution system using admm algorithm. IEEE Access 2023, 11, 102589–102604. [Google Scholar] [CrossRef]
  40. Zhou, J.; Xu, Y.; Sun, H.; Li, Y.; Chow, M.Y. Distributed power management for networked AC–DC microgrids with unbalanced microgrids. IEEE Trans. Ind. Inform. 2019, 16, 1655–1667. [Google Scholar]
  41. Vergara, P.P.; Rey, J.M.; Shaker, H.R.; Guerrero, J.M.; Jørgensen, B.N.; Da Silva, L.C. Distributed strategy for optimal dispatch of unbalanced three-phase islanded microgrids. IEEE Trans. Smart Grid 2018, 10, 3210–3225. [Google Scholar] [CrossRef]
  42. Yang, F.; Liu, J.; Du, Y.; Yan, C.B. Predefined-time secure distributed energy management for microgrids against DoS attack based on dynamic event-triggered approach. IEEE Trans. Autom. Sci. Eng. 2025, 22, 12791–12801. [Google Scholar] [CrossRef]
  43. Yuan, Z.P.; Li, P.; Li, Z.L.; Xia, J. A fully distributed privacy-preserving energy management system for networked microgrid cluster based on homomorphic encryption. IEEE Trans. Smart Grid 2023, 15, 1735–1748. [Google Scholar] [CrossRef]
  44. Rajaei, A.; Fattaheian-Dehkordi, S.; Fotuhi-Firuzabad, M.; Moeini-Aghtaie, M. Decentralized transactive energy management of multi-microgrid distribution systems based on ADMM. Int. J. Electr. Power Energy Syst. 2021, 132, 107126. [Google Scholar] [CrossRef]
  45. Zhao, Z.; Guo, J.; Luo, X.; Lai, C.S.; Yang, P.; Lai, L.L.; Li, P.; Guerrero, J.M.; Shahidehpour, M. Distributed robust model predictive control-based energy management strategy for islanded multi-microgrids considering uncertainty. IEEE Trans. Smart Grid 2022, 13, 2107–2120. [Google Scholar] [CrossRef]
  46. Rong, H.; Wang, J.; Kuang, H. A two-stage, four-layer robust optimisation model for distributed cooperation in multi-microgrids. IET Energy Syst. Integr. 2024, 6, 406–420. [Google Scholar] [CrossRef]
  47. Seyednouri, S.R.; Safari, A.; Ravadanegh, S.N.; Quteishat, A.; Taghizadegan, N. Distributed and adaptive robust energy management of an active distribution network with multi-microgrid considering transactive energy. Electr. Power Syst. Res. 2025, 248, 111969. [Google Scholar] [CrossRef]
  48. Schmidt, H.P.; Guaraldo, J.C.; Jardini, J.A.; da Mota Lopes, M. Interchangeable balanced and unbalanced network models for integrated analysis of transmission and distribution systems. IEEE Trans. Power Syst. 2014, 30, 2747–2754. [Google Scholar] [CrossRef]
  49. Farzin, H.; Fotuhi-Firuzabad, M.; Moeini-Aghtaie, M. Role of outage management strategy in reliability performance of multi-microgrid distribution systems. IEEE Trans. Power Syst. 2017, 33, 2359–2369. [Google Scholar] [CrossRef]
  50. Chen, B.; Chen, C.; Wang, J.; Butler-Purry, K.L. Sequential service restoration for unbalanced distribution systems and microgrids. IEEE Trans. Power Syst. 2017, 33, 1507–1520. [Google Scholar] [CrossRef]
  51. Yi, X.; Zhang, S.; Yang, T.; Chai, T.; Johansson, K.H. Sublinear and linear convergence of modified ADMM for distributed nonconvex optimization. IEEE Trans. Control. Netw. Syst. 2022, 10, 75–86. [Google Scholar] [CrossRef]
  52. Zhadan, A.; Martemyanov, A.; Allahverdyan, A.; Petrosian, O.; Gao, H. Linearization method for MINLP energy optimization problems. Sci. Rep. 2025, 15, 27853. [Google Scholar] [CrossRef]
  53. Ahmadi, H.; Martı, J.R. Linear current flow equations with application to distribution systems reconfiguration. IEEE Trans. Power Syst. 2014, 30, 2073–2080. [Google Scholar] [CrossRef]
  54. Chen, B.; Li, P.; Wu, H.J.; Husain, T.; Khan, F. MCFP: A Monte Carlo simulation-based fuzzy programming approach for optimization under dual uncertainties of possibility and continuous probability. J. Environ. Inf. 2017, 29, 88–97. [Google Scholar] [CrossRef]
  55. Bahramirad, S.; Reder, W.; Khodaei, A. Reliability-constrained optimal sizing of energy storage system in a microgrid. IEEE Trans. Smart Grid 2012, 3, 2056–2062. [Google Scholar] [CrossRef]
  56. Saini, P.; Gidwani, L. An investigation for battery energy storage system installation with renewable energy resources in distribution system by considering residential, commercial and industrial load models. J. Energy Storage 2022, 45, 103493. [Google Scholar] [CrossRef]
  57. Heitsch, H.; Römisch, W. Scenario reduction algorithms in stochastic programming. Comput. Optim. Appl. 2003, 24, 187–206. [Google Scholar] [CrossRef]
Figure 1. The flowchart of the proposed algorithm.
Figure 1. The flowchart of the proposed algorithm.
Energies 19 02584 g001
Figure 2. The 34-bus IEEE distribution system coupled with 6 MGs.
Figure 2. The 34-bus IEEE distribution system coupled with 6 MGs.
Energies 19 02584 g002
Figure 3. The hourly energy prices used in this simulation.
Figure 3. The hourly energy prices used in this simulation.
Energies 19 02584 g003
Figure 4. The total average hourly demand in the distribution system.
Figure 4. The total average hourly demand in the distribution system.
Energies 19 02584 g004
Figure 5. The total average hourly demand in the microgrids.
Figure 5. The total average hourly demand in the microgrids.
Energies 19 02584 g005
Figure 6. The solar irradiance in the area of PV units.
Figure 6. The solar irradiance in the area of PV units.
Energies 19 02584 g006
Figure 7. The three-phase active power demand at each bus in the three-phase distribution system during the peak load hour (i.e., hour 18).
Figure 7. The three-phase active power demand at each bus in the three-phase distribution system during the peak load hour (i.e., hour 18).
Energies 19 02584 g007
Figure 8. The three-phase active power demand at each bus in the three-phase microgrids during the peak load hour (i.e., hour 18).
Figure 8. The three-phase active power demand at each bus in the three-phase microgrids during the peak load hour (i.e., hour 18).
Energies 19 02584 g008
Figure 9. The real power flow exchanged between the distribution system and microgrid-1 in line phase a, line phase b, and line phase c at each iteration during the peak hour.
Figure 9. The real power flow exchanged between the distribution system and microgrid-1 in line phase a, line phase b, and line phase c at each iteration during the peak hour.
Energies 19 02584 g009
Figure 10. The bus voltage magnitudes for phase a, phase b, and phase c at PCC1 at each iteration during the peak hour.
Figure 10. The bus voltage magnitudes for phase a, phase b, and phase c at PCC1 at each iteration during the peak hour.
Energies 19 02584 g010
Figure 11. Probability for each scenario.
Figure 11. Probability for each scenario.
Energies 19 02584 g011
Figure 12. The stochastic outages of MG1.
Figure 12. The stochastic outages of MG1.
Energies 19 02584 g012
Table 1. Comparison of earlier works on energy management systems for distribution systems and microgrids cited in this paper.
Table 1. Comparison of earlier works on energy management systems for distribution systems and microgrids cited in this paper.
Ref.Control
Strategy
Unbalanced Power Flow Model UncertaintySolution Methods for
Energy Management Problems
LoadRES
Output
MG
Outages
[10]CentralizedxxxxImproved gradient-based optimization
[11]CentralizedxxxxPSO
[12]Centralizedx xHBA
[13]Centralizedxx xQuantum PSO (QPSO)
[14]Centralizedxx xLearning-based metaheuristic optimization
[2]Centralizedx xWWO algorithm
[15]Centralizedxx xIPF method
[16]Centralized Combined TLBO and GWO algorithm
[17]Centralized xGA
[19]Centralizedx xRO solved using C&CG algorithm
[20]Centralizedx xRO reformulated as MIQP model using duality theory
[21]Centralizedx xDRL model solved by IPO algorithm
[22]Centralizedx xFour-stage RO solved using C&CG algorithm
[23]Centralizedx xStochastic LP model
[24]Centralizedxx ARO solved using C&CG algorithm
[25]Centralizedx Data-driven ARO solved using C&CG algorithm
[26]Centralizedx DRO and MPC with CVaR constraints
[27]Centralized xStochastic NLP model
[28]Centralized Stochastic MILP model
[30]DecentralizedxxxxDRL based multi-agent system using game theory
[31]Decentralized xxxConvex optimization and MG interaction in two stages through pre-dispatch and energy transaction strategies
[32]Decentralizedxx xMPEC
[33]Decentralizedx xTwo stage-MILP model
[34]Decentralizedx xFinite Markov decision process model solved using Q-learning algorithm
[35]Decentralized MILP-LP models solved using Bender’s decomposition
[37]DistributedxxxxMILPs
[38]DistributedxxxxADMM reformulated into MILP model
[39]DistributedxxxxADMM algorithm
[40]Distributed xxxLeader–follower multi-agent system
[41]Distributed xxxPrimal–dual
constrained decomposition and consensus algorithm
[42]Distributedxx xGraph theory-based method and the Gaussian distribution to model forecast errors in RES generation
[43]Distributedxx xRO solved using C&CG algorithm, and MG coordination using ADMM algorithm
[44]Distributedxx xRO solved using ADMM algorithm
[45]Distributedxx xRO solved using C&CG algorithm, and MG coordination using combined ATC and MPC
[8]Distributedx xARO-ADMM
[46]Distributedx xBregman ADMM and CCG method
[47]Distributedx xARO solved using nested C&CG algorithm, and MG coordination using ADMM algorithm
Proposed AlgorithmDistributed Stochastic MIQCP model solved using ADMM
Table 2. Dispatchable generation units.
Table 2. Dispatchable generation units.
Units (Location)Bus P m i n
(kW)
P m a x
(kW)
Q m i n
(kVAr)
Q m a x
(kVAr)
Main distribution substation (DSO)101850−850850
DG (DSO)240100−50 50
DG (MG2)37080−40 40
DG (MG3)40 060−3030
DG (MG4)41070−3535
Table 3. The generation specification of PV units.
Table 3. The generation specification of PV units.
Units (Location)Bus P m i n
(kW)
P m a x
(kW)
Q m i n
(kVAr)
Q m a x
(kVAr)
Area
( m 2 )
DSO100100−80801732
DSO300100−90901732
MG135050−4040866
MG238065−55551125.8
MG339050−5050866
MG442075−60601299
MG544045−3535779.4
MG646078−65651350.96
Table 4. BESS characteristics.
Table 4. BESS characteristics.
BESS OwnersBUS P m a x
(kW)
Q m a x
(kVAr)
E e m i n
(kWh)
E e m a x
(kWh)
DSO20502510100
DSO25603010120
MG1364020560
MG2373015550
Table 5. The marginal costs of DG units in each piecewise segment (1–4).
Table 5. The marginal costs of DG units in each piecewise segment (1–4).
Units1
($)
2
($)
3
($)
4
($)
DG (DSO)0.060.160.210.36
DG (MG2)0.050.150.200.35
DG (MG3)0.070.140.210.28
DG (MG4)0.040.130.220.30
Table 6. The power flow exchanged between the DSO and the MGs at hour 18 (Deterministic Case 1).
Table 6. The power flow exchanged between the DSO and the MGs at hour 18 (Deterministic Case 1).
LinesPL
(kW)
QL
(KVAR)
abcabc
DSO-MG141.042.038.0−0.004−0.004−0.003
DSO-MG2−0.532.103.43−9.22 ×   10 4 −9.08 ×   10 4 −7.17 ×   10 4
DSO-MG300500−1.239 ×   10 4
DSO-MG4−5.49−2.86−1.53−4.31 ×   10 5 −1.56 ×   10 4 −7.96 ×   10 5
DSO-MG512.0004.04 ×   10 5 00
DSO-MG6020.0000.0170
Table 7. The deterministic model results (Deterministic Case 1).
Table 7. The deterministic model results (Deterministic Case 1).
OperatorsOperating Cost ($)Total Curtailment (kW)Total Load for 24 h (kW)
DSO14,884.80037,871.35
MG1002575.85
MG2251.1201383.72
MG3108.040532.20
MG4117.310681.22
MG500255.46
MG600425.76
Table 8. The power flow exchanged between the DSO and the MGs at hour 18 (Deterministic Case 2).
Table 8. The power flow exchanged between the DSO and the MGs at hour 18 (Deterministic Case 2).
LinesPL
(kW)
QL
(KVAR)
abcabc
DSO-MG1000000
DSO-MG214.6614.6615.67−0.001−7.19 ×   10 4 −6.06 ×   10 4
DSO-MG3001000−0.001
DSO-MG43.984.755.76−3.18 ×   10 4 −3.61   ×   10 4 −2.82   ×     10 4
DSO-MG512.000−7.66   ×   10 6 00
DSO-MG6020.0000.0080
Table 9. The deterministic model results (Deterministic Case 2).
Table 9. The deterministic model results (Deterministic Case 2).
OperatorsOperating Cost ($)Total Curtailment (kW)Total Load for 24 h (kW)
DSO14,120.05037,871.35
MG190,798.722269.9682575.85
MG2100.6001383.72
MG393.710532.20
MG462.460681.22
MG500255.46
MG600425.76
Table 10. The power flow exchanged between the DSO and the MGs at hour 18 (Stochastic Case 1).
Table 10. The power flow exchanged between the DSO and the MGs at hour 18 (Stochastic Case 1).
LinesPL
(kW)
QL
(KVAR)
abcabc
DSO-MG141.00142.00238.0076.19   ×   10 6 6.05   ×   10 6 6.07  ×   10 6
DSO-MG2−2.312.513.760.0030.0020.003
DSO-MG3005.37004.86 ×   10 6
DSO-MG4−8.29−2.42−1.220.0050.0050.005
DSO-MG512.0003.95   ×   10 6 00
DSO-MG6019.92000.1280
Table 11. The stochastic model results (Stochastic Case 1).
Table 11. The stochastic model results (Stochastic Case 1).
OperatorsOperating Cost ($)Total Curtailment (kW)Total Load for 24 h (kW)
DSO14,977.86037,891.44
MG1002577.21
MG2241.0101384.45
MG3107.080532.48
MG4121.120681.58
MG500255.59
MG600425.99
Table 12. The power flow exchanged between the DSO and the MGs at hour 18 (Stochastic Case 2).
Table 12. The power flow exchanged between the DSO and the MGs at hour 18 (Stochastic Case 2).
LinesPL
(kW)
QL
(KVAR)
abcabc
DSO-MG1000000
DSO-MG210.6110.6212.694.27   ×   10 4 4.23   ×   10 4 4.22   ×   10 4
DSO-MG3009.124004.56   ×   10 6
DSO-MG41.141.393.330.0030.0030.003
DSO-MG512.002003.97   ×   10 6 00
DSO-MG6020.004005.88   ×   10 6 0
Table 13. The stochastic model results (Stochastic Case 2).
Table 13. The stochastic model results (Stochastic Case 2).
OperatorsOperating Cost ($)Total Curtailment (kW)Total Load for 24 h (kW)
DSO14,124.09037,891.44
MG190,848.03 2271.2012577.21
MG2150.6201384.45
MG394.620532.48
MG462.340681.58
MG500255.59
MG600425.99
Table 14. The power flow exchanged between the DSO and the MGs at hour 18 (Stochastic Case 3).
Table 14. The power flow exchanged between the DSO and the MGs at hour 18 (Stochastic Case 3).
LinesPL
(kW)
QL
(KVAR)
abcabc
DSO-MG134.4935.3431.983.94   ×   10 6 3.90   ×   10 6 3.95   ×   10 6
DSO-MG20.0813.784.284.01   ×   10 4 3.92 × 10 4 3.98   ×   10 4
DSO-MG3004.18004.11   ×   10 6
DSO-MG4−6.86−1.41−0.493.07   ×   10 4 3.04 × 10 4 3.08   ×   10 4
DSO-MG510.09003.38   ×   10 6 00
DSO-MG6016.73000.2410
Table 15. The stochastic model results (Stochastic Case 3).
Table 15. The stochastic model results (Stochastic Case 3).
OperatorsOperating Cost ($)Total Curtailment (kW)Total Load for 24 h (kW)
DSO14,823.451.5537,891.44
MG114,239.41355.9852577.21
MG2266.500.0121384.45
MG3306.324.952532.48
MG4114.570.008681.58
MG51144.0928.602255.59
MG61902.0947.553425.99
Table 16. Comparison of operating cost ($) of all cases.
Table 16. Comparison of operating cost ($) of all cases.
OperatorsDeterministic Model
(Probability of MG Outages)
Stochastic Model
(Probability of MG Outages)
All
0%
MG1
100%
All
0%
MG1
100%
All
12%
DSO14,884.8014,120.0514,977.8614,124.0914,823.45
MG1090,798.72090,848.0314,239.41
MG2251.12100.60241.01150.62266.50
MG3108.0493.71107.0894.62306.32
MG4117.3162.46121.1262.34114.57
MG500001144.09
MG600001902.09
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

Alobaidi, A.H. Optimal Operation of Multi-Microgrids Using Stochastic Distributed Energy Management Approach Considering the Risk of Microgrid Islanding. Energies 2026, 19, 2584. https://doi.org/10.3390/en19112584

AMA Style

Alobaidi AH. Optimal Operation of Multi-Microgrids Using Stochastic Distributed Energy Management Approach Considering the Risk of Microgrid Islanding. Energies. 2026; 19(11):2584. https://doi.org/10.3390/en19112584

Chicago/Turabian Style

Alobaidi, Abdulraheem H. 2026. "Optimal Operation of Multi-Microgrids Using Stochastic Distributed Energy Management Approach Considering the Risk of Microgrid Islanding" Energies 19, no. 11: 2584. https://doi.org/10.3390/en19112584

APA Style

Alobaidi, A. H. (2026). Optimal Operation of Multi-Microgrids Using Stochastic Distributed Energy Management Approach Considering the Risk of Microgrid Islanding. Energies, 19(11), 2584. https://doi.org/10.3390/en19112584

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