# Techno-economic sizing and multi-objective energy management of AC multi-bus microgrids for enhanced reliability and cost efficiency: Application to small villages in Morocco

Ayoub Chrif, Elhoussin Elbouchikhi, Abdelmajid Abouloifa, Mohamed Machmoum

► To cite this version:

Ayoub Chrif, Elhoussin Elbouchikhi, Abdelmajid Abouloifa, Mohamed Machmoum. Techno-economic sizing and multi-objective energy management of AC multi-bus microgrids for enhanced reliability and cost efficiency: Application to small villages in Morocco. Energy Conversion and Management: X, 2025, 28, pp.101246. 10.1016/j.ecmx.2025.101246. hal-05267717

HAL Id: hal-05267717

https://hal.science/hal-05267717v1

Submitted on 16 Oct 2025

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

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

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

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

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

# Techno-economic sizing and multi-objective energy management of AC multi-bus microgrids for enhanced reliability and cost efficiency: Application to small villages in Morocco

Ayoub Chrif<sup>a,b,c</sup><sup>ID,*</sup>, Elhoussin Elbouchikhi<sup>dID,*</sup>, Abdelmajid Abouloifa<sup>bID</sup>, Mohamed Machmoum<sup>c</sup>

## ARTICLE INFO

### Keywords:

Multi-microgrids

Energy management system

Optimization

Renewable energy

Demand management

Genetic algorithm

Rural electrification

## ABSTRACT

Rural electrification in remote areas remains a critical challenge due to limited infrastructure and the need for reliable, cost-effective energy solutions. Microgrids offer promising solutions to address these challenges. In particular, multi-microgrid (MMG) configurations outperform standalone microgrids for scalable and sustainable rural energy access. However, their design and operation require advanced methods, including artificial intelligence (AI), to manage their complexity. This study seeks to develop a techno-economic model for the optimal sizing and energy management of an AC multi-bus microgrid. The model, implemented using MATLAB software, uses a two-stage framework that first determines the optimal sizing of distributed energy resources (DERs) using the intelligent genetic algorithm (GA), then coordinates real-time energy management across interconnected microgrids based on a multi-objective optimization. By incorporating detailed representations of active and reactive power flows, the approach ensures voltage stability and system resilience under both grid-connected and isolated operating conditions. An incentive-based demand response (IDR) program is also integrated to shift loads from on-peak to off-peak periods, reducing operational costs. A case study involving a modified IEEE 5-bus system demonstrates 24.6% reduction in operational costs through peer-to-peer (P2P) energy exchange and grid reliance minimization. Results highlight voltage stability (±5% deviation), effective battery utilization, and resilience in islanding mode, with 10% cost reduction from demand response.

# 1. Introduction

## 1.1. Background and motivation

While urban areas often benefit from reliable and sufficient electricity to support economic and social activities, rural communities frequently lack this fundamental resource due to various factors such as geographical isolation, lack of infrastructure, and lower financial incentives for utilities to invest in these areas. In Morocco, despite the significant progress made through the Global Rural Electrification Program (PERG), certain remote and mountainous areas, particularly in the High Atlas region, still face limited or unreliable access to electricity. According to recent data, approximately 5% of the rural population remains underserved, which restricts access to essential

services such as lighting, water pumping, and basic medical and educational infrastructure. Achieving robust economic growth and a high standard of living is challenging in regions experiencing significant electricity deficits.

To address this energy challenge, microgrids (MGs) can serve as an efficient and flexible solution [1]. Microgrids, which are self-sufficient low/medium voltage power distribution systems, provide localized and decentralized energy sources [2]. MGs are capable of operating in both grid-connected or standalone mode and are highly effective for rural electrification [3]. Moreover, the integration of renewable energy sources (RES), such as solar photovoltaic (PV) and wind turbines (WT), in these systems is becoming increasingly cost-effective, largely due to government policies like subsidies and feed-in tariffs [4].

<footnote><sup>a</sup> LABISEN, ISEN Yncréa Ouest, Nantes, France</footnote>

<footnote><sup>b</sup> ESE laboratory, ENSEM, Hassan 2 University, Casablanca, Morocco</footnote>

<footnote><sup>c</sup> IREENA, Nantes University, Saint Nazaire, France</footnote>

<footnote><sup>d</sup> SATIE UMR CNRS 8029, CY Cergy-Paris University, Cergy-Pontoise, France</footnote>

<footnote>* Corresponding author.</footnote>

<footnote>E-mail addresses: ayoub.chrif@etu.univ-nantes.fr (A. Chrif), elhoussin.elbouchikhi@cyu.fr (E. Elbouchikhi), abdelmajid.abouloifa@univh2c.ma (A. Abouloifa), mohamed.machmoum@univ-nantes.fr (M. Machmoum).</footnote>
Among renewable energy technologies, solar PV stands out as the most mature and widely adopted solution for off-grid households. However, the intermittent nature of solar energy, driven by daily weather variations, poses challenges in maintaining a consistent power supply. To mitigate these fluctuations, hybrid systems combining multiple distributed energy resources (DER), such PV and WT, along with storage technologies, such as battery energy storage systems (BESS), are often employed [5]. These systems can provide more stable and reliable power outputs.

A more complex type of microgrid, known as a multi-bus microgrid, consists of multiple interconnected buses, or nodes, within the same network, allowing energy to be distributed across various points. Each bus may have a local load, generation sources, or energy storage, enabling localized power management. These multi-bus microgrids enhance the flexibility and resilience of energy supply within a single system. When each bus within a multi-bus microgrid contains both generation sources and loads, the system can further expand into a multi-microgrid (MMG) or a microgrid network (MGN). These systems interconnect neighboring microgrids, enabling interactions at both the physical and cyber levels. This interconnected framework enhances operational flexibility, resilience, and energy efficiency, allowing for optimized energy management and coordination between MGs and the main grid. Due to their geographical proximity, neighboring microgrids frequently exhibit substantial variability in electricity consumption. This situation creates opportunities for renewable energy complementarity between microgrids, allowing for a more efficient and balanced use of renewable energy resources. Moreover, MMGs enable each microgrid to effectively manage local resources while maintaining coordinated interactions with distribution grid and adjacent microgrids.

When designing and planning MMGs, several key characteristics must be considered. The primary objectives for a successful MMG system include maximizing system reliability and minimizing overall operational and maintenance costs. Energy management in MMGs plays a critical role in balancing intermittent RES, dynamic load demands, and BESS state of charge. The stable and cost-efficient operation of MMG systems relies on the implementation of an effective energy management system (EMS) [6]. EMS is responsible for managing dispatchable distributed generators (DGs), controllable loads, and energy exchanges to maintain power supply–demand balance and enhance overall system efficiency [7]. Prior to the deployment of the energy management strategy, each DER must be optimally sized, taking into consideration factors including total load requirements, resources availability, and economic viability.

## 1.2. Literature review

Extensive research efforts have recently focused on the development of strategies and technologies for the sizing, energy management, and optimization of multi-bus microgrids and MMG systems. For instance, in [8], a convex integer-free programming model is used to achieve optimal energy management for an AC 7-bus islanded MG. The model proposes efficient integration of renewable energy sources, an incentive-based demand response scheme, and significant computational reductions for real-time implementation. Similarly, [9] addresses a 6-bus DC microgrid considering battery degradation and system losses to enhance efficiency and reliability. The study proposes an energy management model and aims to minimize total operational cost. In addition, [10] presents a multi-objective optimization framework designed to improve unbalanced three-phase power distribution networks. The proposed methodology integrates demand response programs, energy storage systems, and distributed generation units into a unified optimization model. A customized genetic algorithm (GA) simultaneously determines the optimal capacity, siting, and phase assignment for various energy assets, while probabilistic scenario generation captures variability in load demand and renewable outputs. The proposed approach is tested on an IEEE 13-bus system to address critical

challenges including voltage instability, energy losses, cost inefficiencies, and uncertainties related to renewable energy intermittency. In another study [11], the authors explored optimal day-ahead active and reactive power management for microgrids with a high penetration of renewable energy sources (RESs). The proposed approach is validated on both a simplified 4-bus (nodes) system and a full network 6-bus system.

Regarding MMG configurations, in [12], a distributed game theory algorithm facilitates energy cooperation among multiple microgrids focusing on matching energy supply and demand in a decentralized system. The study showcases a resilient, decentralized, and autonomous strategy for deploying microgrids in rural or remote regions lacking traditional grid infrastructure. As for [13], the authors proposed a collaborative scheduling of storage devices as energy controllers for MMG coordination, by developing an optimal dispatching strategy to maximize renewable energy absorption, lower operating costs, and reduce reliance on the main distribution network. The proposed energy strategy prioritize energy exchanges among microgrids to leverage complementary resources and is validated via simulations using a modified IEEE-33-node test system. In [14], authors proposed a two-step optimization (local and global) for energy management in MMG systems considering several scenarios generated using Monte Carlo simulations. Results on an IEEE 33-bus test system confirm robustness and operational efficiency of the proposed model. In Ref. [15], an innovative approach is presented to optimize the economic operation of a MMG system integrating biogas, wind, solar, and hydrogen. The proposed model incorporates multi-timescale coupling constraints and uses a consensus-based approach to enable decentralized decision-making among autonomous microgrids. The study highlights the importance of effective cooperation between microgrids to enhance stability and optimize renewable energy utilization. A hierarchical communication framework leveraging cloud-edge coordination is established by [16] in a market-driven environment to optimize stakeholder benefits. The authors construct a bi-level distributed optimization model. At the upper level, microgrids negotiate energy trading with the distribution network operator (DNO) to maximize profits, while the lower level employs chance constraint programming to manage uncertainties in renewable sources and loads, aiming to minimize operational cost. This framework allows for decentralized management of MMGs while ensuring microgrids privacy. The model integrates analytical target cascading with the augmented Lagrange method for decomposition and coordination, and applies diagonal quadratic approximation for efficient parallel solving. A fair pricing mechanism is introduced to facilitate energy exchange among multiple microgrids. Extensive case studies confirm the proposed model's effectiveness. In [17], a stochastic multi-energy management using a coupling matrix is proposed for interconnected MGs. The distributed stochastic optimization uses a decentralized algorithm with minimal data exchange, enabling scalability for large systems, enhanced privacy, reduced communication and real-time adaptability. Moreover, in [18], a stochastic bi-level optimization model is introduced for managing active distribution networks with MMGs. The model employs a bi-level structure where the DNO is at the upper level, which interacts with multiple MGs at the lower level, ensuring optimal scheduling across the entire system.

MMG systems are inherently complex and subject to significant uncertainty due to the fluctuating nature of renewable energy resources and the variability of load demand patterns. Robust, stochastic, multi-layer [19–21] and AI-based optimization methods [1,22] are widely adopted in the literature to tackle these challenges. For example, [23,24] introduce robust model predictive control (MPC)-based energy management strategies for autonomous and islanded MMG systems. These approaches integrate the strengths of robust optimization and MPC to address uncertainties in renewable generation and load demand, achieving a balance between operational robustness and economic efficiency. In [25], authors present an optimization framework for MMG systems that addresses uncertainties in renewable energy
generation and load demand through a stochastic modeling approach. The authors employ Monte Carlo simulations to generate diverse supply and demand scenarios, which are then incorporated into a mixed integer linear programming (MILP) model. The study further explores predictive strategies by aligning dynamic pricing mechanisms with uncertainty distribution model, effectively shaping consumer behavior and mitigating peak load stress. As in [26], the study introduces a robust stochastic optimization framework grounded in Information Gap Decision Theory (IGDT), designed to improve decision-making under conditions of deep uncertainty. The model captures economic dynamics through a two-part tariff mechanism, which separates energy usage from demand charges, and incorporates distributed energy storage to buffer supply-demand mismatches. An envelope constraint formulation quantifies uncertainty in the net load by framing deviations in PV output and consumption patterns. The optimization is structured as a bi-level problem, allowing microgrids to make proactive scheduling decisions that anticipate cost variability while maintaining operational robustness. In [27], authors applied a multi-objective model and considered system reconfiguration using tie line switches and a bus selector switches for energy transaction between four microgrids. The model addresses a MILP problem that is solved via fuzzy satisfaction method including uncertainty in renewable generation, with reserve planning using a scenario-based robust optimization. In [28], the authors used the grey wolf optimization algorithm for the optimal sizing of a grid-connected MMG including a stochastic analysis of load, weather, and energy price uncertainties, which has been applied to a modified IEEE 14-bus system. In [29], the authors introduced a novel method for the optimal design that integrates multiple MGs into a MMG using a K-means clustering algorithm, enhanced by graph partitioning and silhouette methods to intelligently sectionalize the system into microgrids. To optimally size RES and BESS, a multi-objective iterative parto-fuzzy algorithm is proposed considering system reliability, cost, and excess energy. In [30], the study explores energy management in networked microgrids integrating renewable energy sources such as biomass, PV, WT, BESS, and pumped hydro storage. It evaluates a hierarchical deep learning approach combined with predictive analytics to optimize energy distribution under varied scenarios including peak loads, faults, and extreme events. As for [31], the authors proposed a model-free approach and formulated the optimization problem as a Markov game by taking each MG as an agent that is centrally trained using a Deep Dense Neural Network. The framework is designed to operate within increasingly decentralized energy networks that feature diverse and heterogeneous energy sources, including renewable resources, energy storage systems, and energy conversion devices coupled with fluctuating local loads. Finally, [32] addresses the complexity of demand forecasting and energy scheduling in MMG environments with a high penetration of renewable energy resources. A novel machine learning approach is introduced using Metapath Context Convolution-based Heterogeneous Graph Neural Networks (MCCHGNN) to model and forecast electricity demand with high accuracy. MCCHGNN leverages the relational structure within diverse microgrid components, such as distributed generators, energy storage, and variable loads, to extract contextual information via metapaths, improving the predictive granularity. Complementing this, the demand forecasts are utilized by the improved Bald Eagle Search optimization algorithm, an evolutionary optimization model inspired by eagle hunting behavior, to generate optimal dispatch plans.

## 1.3. Research gap and contribution

Although the aforementioned studies have achieved promising results, several limitations remain that can be addressed. Firstly, few articles address both sizing and energy management within their optimization problems. Typically, researchers either focus on energy management using predefined rated parameters or concentrate on sizing while relying on rule-based strategies for energy management that

often require significant computational effort giving the complex nature of MMG systems. Secondly, most of the existing studies focus on mono-objective optimization, primarily targeting cost minimization. As a consequence, they often neglect other important objectives, such as maximizing local renewable energy production. Furthermore, many studies rely on simplified models that do not account for all the technical aspects of MMG, such as multidirectional active and reactive power flow. Moreover, precise cost modeling is often overlooked. A comprehensive economic analysis should consider all external economic factors, including long-term price fluctuations, subsidies, and incentives, as well as maintenance and operational costs.

Therefore, this paper proposes a realistic model for the optimization of an AC MMG system considering a real case study based on a remote village in Morocco (Imlil region), using actual meteorological data to design and evaluate the proposed MMG under realistic operating conditions. The key contributions of this work are:

* A two-stage hierarchical techno-economic optimization framework is presented for the evaluation and operation of AC MMG, with a focus on both technical performance and cost-effectiveness. The first stage employs an enhanced Genetic Algorithm (GA), an Artificial Intelligence (AI) technique, to determine the most cost-effective configuration of DERs within each microgrid. The second stage implements a multi-objective energy management strategy to coordinate energy exchange among interconnected MGs and the main grid, aiming to minimize operational costs and maximize the utilization of locally available renewable energy sources. This structured approach ensures computational efficiency and improved overall system performance.

* A comprehensive representation of both active and reactive power flows is implemented, capturing multidirectional energy exchanges among interconnected microgrids to ensure voltage stability, power quality, and efficient energy distribution. Additionally, a realistic cost model is developed, incorporating not only installation and operational costs but also external economic factors such as equipment degradation, inflation, discount rates, and interest rates.

* An Incentive-Demand Response (IDR) program is proposed to encourage customers to adjust and reduce their consumption during peak periods.

* A rigorous evaluation framework is developed to assess MMG performance under realistic and extreme operating conditions by explicitly considering multiple weather profiles, demand response events, and grid outage scenario. To rigorously quantify the benefits of interconnecting microgrids, the study performs a techno-economic comparison between standalone MG and interconnected MMG architectures.

The rest of this paper is structured as follows: Section 2 presents the detailed modeling of the multi-microgrid (MMG) system, including architecture, component models, and economic formulations. Section 3 introduces the proposed two-stage optimization framework, comprising the sizing and energy management strategy. Section 4 describes the simulation setup and discusses the case-study results for summer and winter scenarios. In Section 5, the study is concluded with a summary of key outcomes and a discussion of potential directions for subsequent work.

# 2. MMG modeling

## 2.1. System architecture

### 2.1.1. Infrastructure architecture

The proposed design (Fig. 1) features an AC grid-connected multi-microgrid system with four microgrids located in different locations and interconnected by distribution lines. Each MG is equipped with DERs,
<figure><img src="image_4.png" /><figcaption>Fig. 1. System architecture.</figcaption></figure>

which are photovoltaic systems, wind turbines and batteries, to meet local energy demands. This architecture promotes collaboration among MGs to share renewable energy and reduce dependence on the main grid while improving overall efficiency and economic benefits [33].

### 2.1.2. Control architecture

The control architecture of the MMG system is designed using a three-level hierarchical structure to ensure stability, reliability, and optimal operation. Each level has a specific role, operating within a defined time horizon, enabling seamless coordination and efficient utilization of energy resources across the power network [34].

At the top of the hierarchy, tertiary control is managed by a central controller, which is the energy management system (EMS) that oversees system-level optimization, planning, and coordination [35]. This layer integrates inputs from the energy market and weather forecasts to optimize energy sharing and reduce reliance on the main grid. It supports a day-ahead planning and implements operational strategies in coordination with the local controllers of the microgrids by communicating generation setpoints for DERs. Tertiary control relies on robust communication between central and local controllers, enabling system-wide data collection to ensure optimal configurations, while balancing technical and economic objectives.

Secondary control, which is the role of the local controllers, bridges the strategic oversight of tertiary control with the dynamic responses of primary control. Its primary goal is to ensure real-time energy balance and power quality. By managing the flow of active and reactive power

within and between microgrids, it enables dynamic power sharing while respecting local demand and generation constraints. Secondary control ensures reliable operation both when microgrids operate as standalone entities and in interconnected configurations, adapting to real-time disturbances and operational changes. It provides the necessary adjustments to maintain system stability and supports seamless transitions between different operational modes.

At the foundation of the hierarchy, primary control ensures the immediate stability of each microgrid by regulating voltage and frequency locally. Using droop control and local sensor measurements, it operates autonomously to manage inverters and rapidly respond to disturbances, thereby stabilizing fluctuations in load and generation levels [36,37]. This work primarily focuses on tertiary control while also incorporating selected aspects of secondary control.

### 2.1.3. Communication architecture

The adopted communication architecture follows a hybrid approach, integrating both centralized and decentralized features [38]. This architecture consists of a central controller operating at the MMG system level, with local controllers at the microgrid level. Central EMS is responsible for high-level decision-making using optimization algorithm to manage the entire MMG system. While local controllers, which are embedded within each microgrid, perform energy management and optimization for their respective microgrids, reporting surplus or deficit energy to the central controller. The central EMS communicates with
local controllers and the distribution network operator (DNO) to resolve control inconsistencies and economic conflicts, thereby ensuring globally coordinated operation of the MMG system.

This two-level architecture enhances privacy by ensuring that customer-specific data is only managed at the local microgrid level. Each local controller acts as a single point of interaction between customers and the central controller, offering a streamlined connection and safeguarding customer data privacy. The hybrid architecture effectively combines the scalability and robustness of centralized systems with the flexibility and autonomy of decentralized approaches, ensuring a balanced and efficient MMG operation.

To enable real-time implementation and supervisory control, the proposed MMG leverages IoT (Internet of things) and low cost embedded platforms [39]. Local controllers can be implemented on devices such as Arduino, STM32, Raspberry Pi, or BeagleBone, which collect measurements (voltage, current, SOC, weather data) via distributed sensor networks (voltage and current transducers) and environmental sensors (e.g. temperature, irradiance, and wind speed) that communicate using lightweight protocols (e.g., Modbus, Wi-Fi, ZigBee or Bluetooth) chosen for their data rate/infrastructure cost balance in rural settings [9,40]. These controllers exchange real-time status and control signals with a central EMS implemented on a Supervisory Control and Data Acquisition (SCADA) system or a cloud-edge platform, enabling dynamic adjustments of setpoints, demand response events, and peer-to-peer (P2P) energy trading.

## 2.2. MMG load flow

The MMG network model is integrated into EMS to achieve its global optimal operation. Power flow within the network is modeled using Kirchhoff's laws that describe the active and reactive power conservation at each bus i. The AC power flow equations of the network model are [41]:

$$P_{i,t} = \sum_{j=1}^{N} |V_{i,t}| |V_{j,t}| (G_{ij} \cos(\theta_{i,t} - \theta_{j,t}) + B_{ij} \sin(\theta_{i,t} - \theta_{j,t})) \quad (1)$$

$$Q_{i,t} = \sum_{j \neq i}^{N} |V_{i,t}| |V_{j,t}| (G_{ij} \sin(\theta_{i,t} - \theta_{j,t}) - B_{ij} \cos(\theta_{i,t} - \theta_{j,t})) \quad (2)$$

where, $P_{i,t}$ and $Q_{i,t}$ are the active and reactive power at bus i at time t, $V_{i,t}$ and $V_{j,t}$ are the voltages at buses i and j, $G_{ij}$ and $B_{ij}$ are the conductance and susceptance in the lines connecting buses i and j, $\theta_{i,t}$ and $\theta_{j,t}$ are the voltage angles at buses i and j, N is the total number of buses in the system.

The network connections are modeled by an adjacency matrix A [42]:

$$A[i, j] = \begin{cases} 1 & \text{Energy flows from bus } i \text{ to } j; \\ -1 & \text{Energy flows from bus } j \text{ to } i; \\ 0 & \text{No connection;} \end{cases} \quad (3)$$

## 2.3. PV panels

PV available output power of each MG x at time t depends on its rated power and the meteorological conditions (solar irradiance $G_t$ and temperature $T_{at}$) as follows [43]:

$$P_{pv_x}^a = \eta_{pv_x} \cdot A_{pv_x} \cdot G_t \cdot (1 - \beta \cdot (T_{c_i} - T_{ref})) \quad (4)$$

where, $\eta_{pv_x}$ is the efficiency, which is linked to PV panels technology and power conditioning, $A_{pv_x}$ is the surface area of the panels ($m^2$), $\beta$ is the temperature coefficient (0.004/°C), $T_{ref}$ is the reference temperature of photovoltaic cells under standard conditions (25 °C), and $T_{c_i}$ is the temperature of the PV cell given by [43,44]:

$$T_{c_i} = T_{at} + \frac{NOCT - 20}{G_{NOCT}} G_t \quad (5)$$

where, $G_{NOCT}$ is the irradiance at nominal operating cell temperature NOCT (40 °C).

## 2.4. Wind turbines

The hourly available power production of wind generators of each MG x can be calculated based on the wind speed captured at the standard hub height [45]:

$$P_{wt_{x,t}}^a = \begin{cases} 0, & V_t < V_{\text{cut-in}} \text{ or } V_t > V_{\text{cut-out}} \\ \frac{1}{2} \cdot C_p \cdot \eta_{wt} \cdot \rho \cdot \pi \cdot R_{wt_x}^2 \cdot V_t^3, & V_{\text{cut-in}} \le V_t < V_{\text{rated}} \\ P_{wt}^{\text{ins}}, & V_{\text{rated}} \le V_t \le V_{\text{cut-out}} \end{cases} \quad (6)$$

where, $V_t$, $V_{\text{rated}}$, $V_{\text{cut-in}}$ and $V_{\text{cut-out}}$ are the wind speed at time t (m/s), the rated wind speed (m/s), the cut-in speed (m/s) and the cut-out speed (m/s), respectively. $P_{wt}^{\text{ins}}$ is the installed rated turbine power (W), $R_{wt_x}$ is the wind turbine's radius (m), $\rho$ is the air density (1.225 kg/m³), $C_p$ is the turbine's performance coefficient (0.4), and $\eta_{wt}$ is power conditioning efficiency.

## 2.5. Batteries

The battery is modeled by a dynamic state of charge (SOC) [46]:

$$SOC_{x,t}^{b} = SOC_{x,t-1}^{b} + \frac{(\eta^{b+} \cdot P_{x,t}^{b+} - \frac{P_{x,t}^{b-}}{\eta^{b-}}) \cdot \Delta t}{E_{x}^{b}} \quad (7)$$

where, $SOC_{x,t}^b$ is the state of charge of the battery of the MG x at time t, $P_{x,t}^{b+}/P_{x,t}^{b-}$ is the scheduled charging/discharging power of the battery, with charging efficiency, $\eta^{b+}$, and discharging efficiency, $\eta^{b-}$. $\Delta t$ is the time step and $E_x^b$ is the sized nominal capacity of the battery.

The charging/discharging of the battery is controlled by a charging/discharging rate:

$$P_{x,t}^{b+} = r_t^+ \cdot E_x^b \quad (8)$$

$$P_{x,t}^{b-} = r_t^- \cdot E_x^b \quad (9)$$

where, $r_t^+$ and $r_t^-$ are battery's charging and discharging rate, respectively.

## 2.6. Load active and reactive power modeling

The load is the consumption pattern that consists of both active and reactive power demands. The active load $D^p$ represents the real power demand, while the reactive load $D^q$ represents the power needed for maintaining voltage stability and ensuring the proper operation of inductive loads. The total load of the MG x at any given time t is expressed as:

$$D_{x,t} = D_{x,t}^{p} + j D_{x,t}^{q} \quad (10)$$

For the load in each microgrid, a constant power factor is assumed to simplify the joint management of active and reactive power:

$$D_{x,t}^{q} = D_{x,t}^{p} \tan(\varphi_{x}) \quad (11)$$

where, $\varphi_x$ is the power factor angle at bus x.

The loads are classified into critical and non-critical loads. Critical loads refer to the essential energy consumption required to maintain the well-being and safety of the occupants, such as hospitals, emergency systems, and communication networks. On the other hand, non-critical loads are devices that can be temporarily interrupted without significant impact, such as household appliances (washing machines, dishwashers, heating), interior lighting, entertainment systems, and non-essential industrial processes. Non-critical loads are more flexible and can participate in demand response (DR) programs.
## 2.7. Economic modeling

### 2.7.1. Total annual cost

The total annual cost (TAC) is a metric used to estimate the financial performance of the MMG system on an annual basis. It is calculated by the sum of the annual capital cost ($C_{CAP}$), the annual replacement cost ($C_{REP}$) and the annual operation and maintenance cost ($C_{O&M}$). The total annual cost (TAC) can be expressed as [47]:

$$TAC = C_{CAP} + C_{O&M} + C_{REP} \quad (12)$$

The annual capital cost ($C_{CAP}$) is the cost of initial investments, such as equipment purchase and installation, converted into an equivalent annual value using the Capital Recovery Factor (CRF) given by:

$$CRF = \frac{i(1 + i)^{\alpha}}{(1 + i)^{\alpha} - 1} \quad (13)$$

where, i is the annual interest rate, and α is the lifespan of the project. The capital cost is then expressed as:

$$C_{CAP} = \sum_{j} C_{init,j} \cdot CRF \quad (14)$$

where, $C_{init,j}$ is the initial cost of component j.

The replacement cost ($C_{REP}$) is computed using the sinking fund factor ($SFF$) [48]:

$$SFF(i, y) = \frac{i}{(1 + i)^y - 1} \quad (15)$$

where, y is the component's lifetime. The replacement cost is then given as:

$$C_{REP} = \sum_{j} C_{jREP} \cdot SFF(j) \quad (16)$$

The operation and maintenance cost ($C_{O&M}$) is calculated as:

$$C_{O&M} = \left( \sum_{j} C_{j,O&M} \right) \cdot (1 + f)^{\alpha} \quad (17)$$

where, f is the inflation rate.

### 2.7.2. PV operational cost

Operational cost (OC) refers to the expenses associated with operating the equipment and are incurred during the day-to-day operation of our system. The PV system's operational cost, $OC_{x,t}^{pv}$ of the MG x at the time t is provided by:

$$OC_{x,t}^{pv} = C^{pv} P_{pv,x,t} \quad (18)$$

where, $P_{pv,x,t}$ is the scheduled PV power and $C^{pv}$ is the levelized cost of energy (LCOE) of the PV system (€/kWh), and it is modeled as [8]:

$$C^{pv} = \frac{C_{inv}^{pv} + \sum_{i=1}^{n} C_{om}^{pv} (1 + dr)^{-i}}{\sum_{i=1}^{n} E_{an}^{pv} (1 - \sigma^{pv})^{i-1} (1 + dr)^{-i}} \quad (19)$$

This cost model incorporates the investment cost, $C_{inv}^{pv}$, operation and maintenance costs, $C_{om}^{pv}$, annual energy output, $E_{an}^{pv}$, discount rate dr, and the degradation factor of the PV system, $\sigma^{pv}$, over the system lifetime n.

### 2.7.3. WT operational cost

The WT system's operational cost, $OC_{x,t}^{wt}$ of the MG x at the time t is provided by:

$$OC_{x,t}^{wt} = C^{wt} P_{wt,x,t} \quad (20)$$

where, $P_{wt,x,t}$ is the scheduled WT power and $C^{wt}$ is the LCOE of the WT system (€/kWh) [9]:

$$C^{wt} = \frac{C_{inv}^{wt} + \sum_{i=1}^{n} C_{om}^{wt} (1 + dr)^{-i}}{\sum_{i=1}^{n} E_{an}^{wt} (1 - \sigma^{wt})^{i-1} (1 + dr)^{-i}} \quad (21)$$

The degradation of WT is caused by material fatigue, mechanical stress, erosion of blades, and wear of moving components.

### 2.7.4. Battery operational cost

The battery's operational cost, $OC_{x,t}^{b}$ of the MG x at the time t is provided by:

$$OC_{x,t}^{b} = C^{b}(\eta^{b+} P_{x,t}^{b+} + \frac{P_{x,t}^{b-}}{\eta^{b-}}) \quad (22)$$

A Li-ion battery degradation cost (BDC) model is taken from [9] including the depth of discharge (DOD) and temperature related capacity and power fading effects on the battery [49]:

$$C^{b} = \frac{1}{2} \frac{(C_{inv}^{b} + \sum_{i=1}^{n} C_{om}^{b} (1 + dr)^{-i}) (1 + dr)^{n} - RV}{(1 + dr)^{n} \chi_{T}^{E} \chi_{T}^{Y} \chi_{d}^{Y} Y_{r}^{b} E_{r}^{b}} \quad (23)$$

where, $\chi_{T}^{E}$, $\chi_{T}^{Y}$ and $\chi_{d}^{Y}$ are the normalized temperature-dependent capacity fading, the temperature- and DOD-dependent cycle life fading coefficients, respectively. $Y_{r}^{b}$ and $E_{r}^{b}$ are the rated cycle life and energy capacity of the battery. The residual value (RV) is the value of the battery at the end of its operational lifespan.

### 2.7.5. Demand response

In this model, an incentive-based demand response (IDR) mechanism is integrated to encourage consumers to adjust and shift their electricity consumption during specific periods in exchange for financial incentives [50]:

$$IC_{x,t} = C^{ic} D_{x,t}^{pr+} \quad (24)$$

where, $IC_{x,t}$ is the incentive cost of MG x at time t, $C^{ic}$ is the cost per unit (€/kWh), $D_{x,t}^{pr+}$ is the shifted demand power, and $D_{dr,t}^{-}$ is the recovered load, given by:

$$D_{dr,t}^{+} = \alpha D_{i} \quad (25)$$

$$D_{dr,t}^{-} = -\alpha D_{i} \quad (26)$$

The parameter α refers to proportion of shifted load (%).

### 2.7.6. Utility grid

The MMG maintains a connection to the utility grid to purchase electricity when local generation falls short of meeting demand or when it is economically advantageous. Conversely, when surplus energy is available, the MMG can inject power into the grid, selling excess electricity at a negotiated rate. This bidirectional interaction optimizes energy costs and enhances grid support by balancing supply and demand.

However, in the event of grid failures or planned disconnections, the MMG can operate in islanded mode, relying solely on its DERs and energy sharing. This islanding capability enhances the resilience of the system, ensuring continuity of service during utility grid outages. The main grid power exchange cost is given by:

$$C_{grid,t} = \pi_{g_t}^{+} P_{g_t}^{+} - \pi_{g_t}^{-} P_{g_t}^{-} \quad (27)$$

where, $\pi_{g_t}^{+}$ is the price of purchasing electricity from the grid. $\pi_{g_t}^{-}$ is the price of selling electricity to the grid. $P_{g_t}^{+}$ and $P_{g_t}^{-}$ are the power purchased from the grid and the power injected into the grid [9]:

$$0 \le P_{g_t}^{+}, P_{g_t}^{-} \le P_{g}^{\max}(1 - z_t), \quad t \in \mathcal{T} \quad (28)$$

$$z_t = \begin{cases} 1, & \text{if islanding mode} \\ 0, & \text{otherwise} \end{cases}, \quad t \in \mathcal{T} \quad (29)$$

### 2.7.7. Energy trading

In addition to peer-to-grid (P2G), the model incorporates peer-to-peer (P2P) energy trading, allowing microgrids to exchange surplus energy [51]. In P2P setup, microgrids can directly negotiate energy prices, enabling a decentralized and flexible market mechanism. This approach reduces reliance on the main grid, enhances the utilization of renewable energy, and lowers overall costs. By dynamically scheduling
<figure><img src="image_5.png" /><figcaption>Fig. 2. Two-stage optimization framework.</figcaption></figure>

energy trades through the EMS, the system ensures efficient energy sharing while maintaining economic fairness and operational reliability. The cost of energy exchanged between MG x and MG y at time t is given by:

$$C_{trade_{xyt}} = P_{xyt} \cdot C_{xy} \quad (30)$$

where, $C_{xy}$ is the negotiated energy price (€/kW), $P_{xyt}$ is the exchanged power between MG x and MG y (kW).

### 3. Optimization model

The optimization model is designed to achieve the optimal techno-economic performance of the MMG. It is structured into two main stages: sizing and energy management, each with specific objectives and decision [52]. As illustrated in Fig. 2 the two-stage optimization framework consists of a sequential interaction. In the first stage, each microgrid is sized individually to be self-sufficient using GA. The optimal DER sizes (PV, WT, and battery) are then transferred to the energy management stage as fixed parameters. These values define boundaries and resource availability for the second stage, where multi-objective optimization is applied to coordinate energy flows among MGs and with the main grid. The sizing optimization is conducted offline during the planning phase by experienced engineers, and the resulting parameters are directly integrated into the operational EMS. Furthermore, the EMS itself is deployed and configured by qualified engineers, and the implementation of the MMG system is accompanied by a maintenance contract guaranteeing expert intervention in the event of major faults or system malfunctions. This framework ensures that optimization can be applied without imposing technical or computational burdens on local communities.

#### 3.1. Sizing stage

In the first optimization stage, each microgrid is independently sized under the assumption of islanded operation, ensuring that it can autonomously meet its local energy requirements without dependence on other microgrids or the main grid. This approach is based on designing each microgrid to be self-sufficient and have enough capacity

to independently operate even under worst-case conditions, which are during periods of outage when connection with the main grid or other microgrids is either not feasible or uncertain. Although this approach may result in over-sizing, it can be considered robust, as it accounts for worst-case scenarios and ensures system resilience and reliability, particularly in isolated regions with high power supply uncertainty.

To simulate a scenario, the sizing stage employs a rule-based energy management approach. The objective function of this stage is to minimize the annualized system cost (ASC) [53], which represents the sum of TAC of all installed equipments:

$$\min(ASC) = P_{pv}^{ins} \cdot TAC_{pv} + P_{wt}^{ins} \cdot TAC_{wt} + E^{b} \cdot TAC^{b} \quad (31)$$

where, $P_{pv}^{ins}$, $P_{wt}^{ins}$ and $E^{b}$ are the installed PV and WT power (kW) and battery capacity (kWh).

The decision variables are:

* $A_{pv}$: The surface area of the PV panels (m²).

* $R_{wt}$: The length of the WT blades (m).

* $E^{b}$: The battery capacity (kWh).

These parameters are optimized to minimize the ASC while ensuring that the local demand is satisfied. The optimization outputs are:

* The installed PV power $P_{pv}^{ins}$.

* The installed WT power $P_{wt}^{ins}$.

* The apparent power of the PV system $S_{pv}$.

* The apparent power of the WT system $S_{wt}$.

* The apparent power of the battery $S^{b}$.

* The battery capacity $E^{b}$.

These parameters are implemented and used as inputs in the energy management stage to optimize the overall operation of the interconnected MMG system. The sizing optimization problem is solved using the Genetic Algorithm (GA) that integrates adaptive learning mechanisms to guide the search for the optimal configuration [54]. GA explores various PV/WT/battery sizing configurations to identify the most cost-effective solution, generating a diverse set of possible designs. To accelerate convergence and enhance solution quality, we
implemented an enhanced GA, refining the search by leveraging the genes of the best-performing chromosomes (illustrated by Algorithm 1). This approach improves efficiency by guiding the evolutionary process toward promising regions of the solution space while maintaining diversity. Multiple stochastic runs with parallel computing further reduces computation time, enabling an optimal configuration within a reasonable timeframe.

**Algorithm 1 Enhanced Genetic Algorithm for MMG sizing.**

**Initialize** population with random PV, WT, and battery sizes within given bounds.

**Set** GA parameters: population size $N_p$, max generations $G_{max}$, crossover and mutation rates.

**for** each run $r = 1$ to $numRuns$ **do**

Evaluate the fitness of each individual based on the total cost function.

**for** each generation $g = 1$ to $G_{max}$ **do**

**Selection:** Choose the best chromosomes based on fitness ranking.

**Crossover:** Generate new offspring by recombining genes of selected parents.

**Mutation:** Introduce small random variations to maintain diversity.

Evaluate the fitness of the new population.

**Elitism:** Retain the best individuals to ensure convergence.

**end for**

Store the best solution from this run.

**end for**

Select the best overall solution from all runs.

## 3.2. Energy management stage

This optimization stage focuses on the optimal operation of the MMG system by efficiently managing energy flows between microgrids, storage systems, local generation and the main grid. Building on the outputs from the sizing stage, this stage aims to coordinate the energy exchanges in a way that maximizes renewable energy and minimizes operational costs. The addressed problem is a multivariable, constrained, nonlinear and multi-objective optimization problem [55]:

$$ \min_x \{f_{obj1}(x)\}, \max_x \{f_{obj2}(x)\}, \text{ s.t.} \quad \left\{ \begin{array}{l} C(x) \le 0, \\ Ce(x) = 0, \\ A.x \le B, \\ A_{eq}.x = B_{eq}, \\ lb \le x \le ub. \end{array} \right. \quad (32) $$

where:

* $x$: Decision variables.

* $f_{obj1}(x)$ and $f_{obj2}(x)$: Objective functions.

* $C(x) \le 0$: Nonlinear inequality constraint.

* $C_e(x) = 0$: Nonlinear equality constraints.

* $A.x \le B$: Linear inequality constraint.

* $A_{eq}.x = B_{eq}$: Linear equality constraints.

* $lb$ and $ub$: Lower and upper bounds of decision variables, respectively.

The multi-objective optimization problem is expressed as a weighted-sum formulation [56]:

$$ F(x) = \lambda_1 \cdot f_{obj1}(x) + \lambda_2 \cdot f_{obj2}(x) \quad (33) $$

where, $\lambda_1$ and $\lambda_2$ are the weight factors, which represent the relative priorities assigned to objectives. To allow the optimization algorithm

full freedom in finding the trade-off between the two objectives and to avoid forcing any implicit priority on cost or performance in the decision-making process, the weight factors are both set to unity ($\lambda_1 = 1, \lambda_2 = -1$).

This multi-objective optimization aims to achieve the optimal operation of the MMG by reducing its operating cost and maximizing local self-produced renewable energy. To achieve this, two functions must be optimized:

$$ \left\{ \begin{array}{l} \min \sum_t \left( \sum_x \left( OC_{x,t}^b + OC_{x,t}^{pv} + OC_{x,t}^{wt} + IC_{x,t} \right) + C_{grid,t} \right) \\ \max \sum_t \sum_x \left( (P_{pv,x,t} + P_{wt,x,t}) \cdot \Delta t \right) \end{array} \right. \quad (34) $$

The decision variables include:

* $V_{i,t}$: Voltage magnitude at each bus $i$ at time $t$.

* $\theta_{i,t}$: Voltage angle at each bus $i$ at time $t$.

* $P_{pv,x,t}$: Active PV power at each MG $x$ at time $t$ (kW).

* $P_{wt,x,t}$: Active WT power at each MG $x$ at time $t$ (kW).

* $P_{x,t}^{b+}$: Active charging battery power at each MG $x$ at time $t$ (kW).

* $P_{x,t}^{b-}$: Active discharging battery power at each MG $x$ at time $t$ (kW).

* $P_{xy}$: Active exchanged power between MG $x$ and MG $y$ at time $t$ (kW).

* $D_{x,t}^{pr}$: Demand response power for each MG $x$ at time $t$ (kW).

* $Q_{pv,x,t}$: Reactive PV power for each MG $x$ at time $t$ (kVAR).

* $Q_{wt,x,t}$: Reactive WT power for each MG $x$ at time $t$ (kVAR).

* $Q_{x,t}^{b}$: Reactive battery power for each MG $x$ at time $t$ (kVAR).

* $Q_{xy}$: Reactive exchanged power between MG $x$ and MG $y$ at time $t$ (kW).

* $P_{g_i}$: Grid active power at time $t$ (kW).

* $Q_{g_i}$: Grid reactive power at time $t$ (kVAR).

The energy management stage aims to minimize power losses and ensure a balanced distribution of energy within each microgrid (MG), among interconnected MGs, and between MGs and the main grid, at each time $t$. This process complies with the technical constraints of the system and adheres to the power capacities established during the sizing stage. These constraints are as follows:

$$ \sum_x P_{pv,x,t} + \sum_x P_{wt,x,t} + \sum_x (P_{x,t}^{b-} - P_{x,t}^{b+}) + P_{g_i} - \sum_x (D_{x,t}^{p} - D_{x,t}^{pr} + D_{x,t}^{pr-}) = 0 \quad (35) $$

$$ V_i^{min} \le V_{i,t} \le V_i^{max} \quad (36) $$

$$ \theta_i^{min} \le \theta_{i,t} \le \theta_i^{max} \quad (37) $$

$$ 0 \le P_{pv,x,t} \le P_{pv,x,t}^{a} \quad (38) $$

$$ 0 \le P_{wt,x,t} \le P_{wt,x,t}^{a} \quad (39) $$

$$ P_{g}^{min} \le P_{g_{i}} \le P_{g}^{max} \quad (40) $$

$$ P_{xy}^{min} \le P_{xy,t} \le P_{xy}^{max} \quad (41) $$

$$ 0 \le P_{x,t}^{b-} \le P_{max_x}^{b-} \quad (42) $$

$$ 0 \le P_{x,t}^{b+} \le P_{max_x}^{b+} \quad (43) $$

$$ P_{x,t}^{b+} \cdot P_{x,t}^{b-} = 0 \quad (44) $$

$$ P_{pv,x,t}^{2} + Q_{pv,x,t}^{2} \le S_{pv,x}^{2} \quad (45) $$

$$ P_{wt,x,t}^{2} + Q_{wt,x,t}^{2} \le S_{wt,x}^{2} \quad (46) $$
$$ (P_{x,t}^{b+} - P_{x,t}^{b-})^2 + (Q_{x,t}^{b})^2 \leq (S_x^b)^2 \qquad (47) $$

$$ P_{g_t}^2 + Q_{g_t}^2 \leq S_g^2 \qquad (48) $$

$$ (SOC_{max_x}^b - DOD_x^b) \leq SOC_{x,t}^b \leq SOC_{max_x}^b \qquad (49) $$

$$ SOC_{x,t}^b = SOC_{x,t}^b \qquad (50) $$

$$ D_{x,t}^{pr+} \cdot D_{x,t}^{pr-} = 0 \qquad (51) $$

$$ \sum_t D_{x,t}^{pr+} = \sum_t D_{x,t}^{pr-} \qquad (52) $$

$$ D_{x,t}^{pr+} \leq D_{x,max}^{pr} \qquad (53) $$

The voltage magnitudes $V_{i,t}$ and angles $\theta_{i,t}$ at each bus $i$ are constrained within permissible operational limits to ensure stable and reliable system operation (36) and (37). The PV and WT generation at each MG $x$ and time $t$ is limited by the available powers (38) and (39). The grid power supplied or absorbed by the main grid $P_{g_t}$ is also limited adhering to the contractual and technical requirements set by the grid operator (40). The power exchanged between MGs must remain within acceptable limits to comply with the transmission line capacity (41). Reactive power plays a crucial role in stabilizing bus voltages and maintaining the balance between power flows within the MMG. Although PV panels and batteries primarily generate active power, they can also supply or absorb reactive power through their inverters, within the limits of their apparent power ratings (45) and (47). Similarly, WT contribute to reactive power management, depending on the type of generator and the used power converters (46). The MMG also exchange reactive power with the main grid governed by the apparent power limit (48).

It is important that the charging and discharging of the batteries do not occur simultaneously (44) and complies with power limits (42) and (43), SOC limits and DOD (49) to avoid degradation and extend battery lifespan. The SOC at the end of the day must be equal to the initial state to ensure battery availability for the next day (50). The demand response (DR) constraints include: prohibition of simultaneous load shifting and recovery (Eq. (51)), equality between total shifted and recovered load (Eq. (52)), and limits on the shiftable load (Eq. (53)).

The energy management process is implemented as a time-series, hour-ahead optimization, iterating over each of the 24 hours in a day and incorporating both linear and nonlinear constraints, as presented in Algorithm 2. The optimization problem is solved using the interior point method [57].

**Algorithm 2** Energy management via Interior Point Method.

1: **Input:** Sized capacities, demand profiles, available energy, network parameters, cost components.

2: **Initialize:** Set initial state for $t = 1$.

3: **for** $t = 1$ to 24 **do**

4: Formulate equality constraints: power balance and battery energy update.

5: Define inequality constraints: variable bounds (generation, storage, voltage limits, etc.).

6: Construct the objective functions

7: Solve the nonlinear optimization problem using the interior-point algorithm

8: Extract optimal variables (e.g., energy dispatch, battery charging/discharging, renewable outputs, voltages, etc.).

9: Update battery SOC and other state variables for the next time step.

10: **end for**

11: **Output:** Optimal energy management over 24 hours.

<figure><img src="image_6.png" /><figcaption>Fig. 3. MMG 5-bus Network.</figcaption></figure>

<table><caption>**Table 1**
5-bus network data.</caption><thead><tr><td>Line</td><td>From bus</td><td>To bus</td><td>R (Ω)</td><td>X (Ω)</td></tr></thead><tbody><tr><td>1</td><td>1</td><td>2</td><td>0.385</td><td>0.05</td></tr><tr><td>2</td><td>2</td><td>3</td><td>0.308</td><td>0.04</td></tr><tr><td>3</td><td>3</td><td>4</td><td>0.462</td><td>0.06</td></tr><tr><td>4</td><td>4</td><td>5</td><td>0.385</td><td>0.05</td></tr><tr><td>5</td><td>5</td><td>1</td><td>0.539</td><td>0.07</td></tr></tbody></table>

## 4. Simulation setup and results

The proposed model is tested on a modified IEEE 5-Bus system (Fig. 3) with a cluster of four local buses connected to microgrids and one external bus connected to the main grid [42]. Each local microgrid is powered by PV, WT, and batteries, and can exchange energy with other microgrids, as well as with the main grid. The MMG is a low-voltage (LV) network (230V), and the line impedances are set according to a R/X ratio of 7.7, which is a typical value for LV distribution networks, known for their predominantly resistive nature [8,58]. All buses in the network are assumed to be balanced, and the system is modeled using a single-phase equivalent circuit. Although the case study uses a modified IEEE 5-bus system tailored to a group of neighboring villages, the proposed framework is designed to be modular and scalable. Its mathematical formulation, optimization structure, and control logic are independent of the specific network size or topology and can be adapted to larger and more complex rural electrification networks.

The network data are provided in Table 1. The load power factor at each bus is considered 0.95. The model is implemented in MATLAB software with an i7 1.90 GHz processor and 16 GB RAM. The simulation horizon is 24 h with a time step of 1 h. The economic and technical data of the project are presented in Table 2 [59]. Time of use (TOU) energy prices (€/kWh) are presented in Fig. 4(a) [60].

The region of Imilil in Morocco provides an ideal practical setting for the model, as it includes several small villages such as Imilil, Aremd, Tamsoult, and Aroundd, which are spread across the area. Based on last year's trends, our study considers a sunny day in July and a windy day in December (Fig. 4(b)). The available renewable energy for each MG for summer and winter are presented in Figs. 5(a) and 5(b), which depends on the weather data and the sized capacities.

The power demands for a typical day in summer and winter are presented in Table 3. The load profiles exhibit similar trends, the energy consumption in MG1, MG2, and MG4 follows a typical daily cycle,
<figure><img src="image_7.png" /><figcaption>(a) TOU energy prices for winter (top) and summer (bottom).</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>(b) Weather data.</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>(a) Summer.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>(b) Winter.</figcaption></figure>

<caption>Fig. 5. Available renewable energy for MG1 (top), MG2, MG3, and MG4 (bottom).</caption>

corresponding to household activities. However, MG3 demonstrates a distinct demand pattern, characterized by higher energy consumption. This behavior suggests that MG3 could be linked to large-scale consumers, such as commercial areas and small industries.

The validation of the proposed model relies on real data integration and representative test-case simulations. A real case study is employed, incorporating actual meteorological profiles and realistic residential load curves to ensure the model reflects local operating conditions, as commonly applied in rural microgrid studies [61,62]. In addition, the operation of the MMG is studied under various scenarios to assess energy distribution, voltage stability, storage management, and the impact of uncertainties such as weather variability, grid outages, and equipment degradation.

To ensure a robust and resilient design. The sizing is carried out under worst-case scenarios and based on the highest demand profiles. Using the GA parameters in Table 4, the sizing results for each MG are summarized in Table 5.

## 4.1. Imlil during summer

The obtained results provide insights into the performance of the energy dispatching across MGs and the main grid. During summer, the increased solar potential contributed to higher PV generation, reducing the dependency on wind turbines and grid power (Fig. 6). Fig. 6(c) presents the energy management results where the peak generation hours (midday) aligned with the high demand periods, ensuring an efficient match between supply and consumption. PV generation met 82% of daytime demand, reducing grid dependency. Excess energy

<table><caption>Table 2
Technical and economic data of the system components.</caption><tbody><tr><td rowspan="4">PV</td><td>Capital cost (per kW)</td><td>1116 €</td></tr><tr><td>Replacement cost (per kW)</td><td>1116 €</td></tr><tr><td>O & M cost (per kW)</td><td>3.72 €/year</td></tr><tr><td>Life time</td><td>20 years</td></tr><tr><td rowspan="4">WT</td><td>Capital cost (per kW)</td><td>2139 €</td></tr><tr><td>Replacement cost (per kW)</td><td>1395 €</td></tr><tr><td>O & M cost (per kW)</td><td>1.86 €/year</td></tr><tr><td>Life time</td><td>20 years</td></tr><tr><td rowspan="10">Battery</td><td>Depth of discharge (DOD)</td><td>80%</td></tr><tr><td>Max state of charge (SOC<sub>max</sub>)</td><td>100%</td></tr><tr><td>Charging/discharging efficiency (η<sup>b</sup>)</td><td>90%</td></tr><tr><td>Maximum charging/discharging rate (r<sup>b</sup>)</td><td>10%</td></tr><tr><td>Capital cost (per kWh)</td><td>155.31 €</td></tr><tr><td>Replacement cost (per kWh)</td><td>62.31 €</td></tr><tr><td>O & M cost (per kWh)</td><td>1.55 €/year</td></tr><tr><td>Life time</td><td>5 years</td></tr><tr><td>Residual value (RV)</td><td>40% of C<sub>CAP</sub></td></tr><tr><td rowspan="6">Project</td><td>Discount rate</td><td>4%</td></tr><tr><td>Interest rate</td><td>8%</td></tr><tr><td>Inflation rate</td><td>2%</td></tr><tr><td>Incentive cost</td><td>0.01 €/kWh</td></tr><tr><td>DR limits (%D<sup>g</sup>)</td><td>10% (MG1)<br>10% (MG2)<br>20% (MG3)<br>10% (MG4)</td></tr><tr><td>Life time</td><td>20 years</td></tr></tbody></table>
<table><caption>**Table 3**
Daily consumption — summer and winter.</caption><thead><tr><th rowspan="2">Hour (h)</th><th colspan="2">MG 1 (kW)</th><th colspan="2">MG 2 (kW)</th><th colspan="2">MG 3 (kW)</th><th colspan="2">MG 4 (kW)</th></tr><tr><th>Summer</th><th>Winter</th><th>Summer</th><th>Winter</th><th>Summer</th><th>Winter</th><th>Summer</th><th>Winter</th></tr></thead><tbody><tr><td>1.00</td><td>1.50</td><td>1.62</td><td>2.26</td><td>2.44</td><td>7.52</td><td>8.12</td><td>3.76</td><td>4.06</td></tr><tr><td>2.00</td><td>1.40</td><td>1.47</td><td>2.10</td><td>2.21</td><td>7.00</td><td>7.36</td><td>3.50</td><td>3.68</td></tr><tr><td>3.00</td><td>1.35</td><td>1.37</td><td>2.02</td><td>2.05</td><td>6.75</td><td>6.85</td><td>3.37</td><td>3.42</td></tr><tr><td>4.00</td><td>1.14</td><td>1.20</td><td>1.71</td><td>1.79</td><td>5.70</td><td>5.98</td><td>2.85</td><td>2.99</td></tr><tr><td>5.00</td><td>1.14</td><td>1.22</td><td>1.71</td><td>1.83</td><td>5.70</td><td>6.11</td><td>2.85</td><td>3.06</td></tr><tr><td>6.00</td><td>1.12</td><td>1.19</td><td>1.68</td><td>1.79</td><td>5.59</td><td>5.96</td><td>2.79</td><td>2.98</td></tr><tr><td>7.00</td><td>1.26</td><td>1.28</td><td>1.89</td><td>1.93</td><td>6.31</td><td>6.42</td><td>3.15</td><td>3.21</td></tr><tr><td>8.00</td><td>1.35</td><td>1.22</td><td>2.03</td><td>1.83</td><td>6.76</td><td>6.11</td><td>3.38</td><td>3.06</td></tr><tr><td>9.00</td><td>1.53</td><td>1.39</td><td>2.29</td><td>2.08</td><td>7.63</td><td>6.94</td><td>3.82</td><td>3.47</td></tr><tr><td>10.00</td><td>1.63</td><td>1.42</td><td>2.44</td><td>2.12</td><td>8.13</td><td>7.08</td><td>4.07</td><td>3.54</td></tr><tr><td>11.00</td><td>1.66</td><td>1.47</td><td>2.49</td><td>2.21</td><td>8.28</td><td>7.37</td><td>4.14</td><td>3.69</td></tr><tr><td>12.00</td><td>1.83</td><td>1.64</td><td>2.75</td><td>2.46</td><td>9.16</td><td>8.20</td><td>4.58</td><td>4.10</td></tr><tr><td>13.00</td><td>1.91</td><td>1.70</td><td>2.86</td><td>2.54</td><td>9.53</td><td>8.48</td><td>4.76</td><td>4.24</td></tr><tr><td>14.00</td><td>1.99</td><td>1.76</td><td>2.99</td><td>2.65</td><td>9.97</td><td>8.82</td><td>4.99</td><td>4.41</td></tr><tr><td>15.00</td><td>1.83</td><td>1.67</td><td>2.75</td><td>2.50</td><td>9.16</td><td>8.33</td><td>4.58</td><td>4.16</td></tr><tr><td>16.00</td><td>1.69</td><td>1.72</td><td>2.54</td><td>2.58</td><td>8.46</td><td>8.60</td><td>4.23</td><td>4.30</td></tr><tr><td>17.00</td><td>1.69</td><td>1.69</td><td>2.54</td><td>2.54</td><td>8.46</td><td>8.46</td><td>4.23</td><td>4.23</td></tr><tr><td>18.00</td><td>1.85</td><td>1.75</td><td>2.77</td><td>2.62</td><td>9.23</td><td>8.74</td><td>4.61</td><td>4.37</td></tr><tr><td>19.00</td><td>1.91</td><td>1.78</td><td>2.87</td><td>2.66</td><td>9.57</td><td>8.88</td><td>4.79</td><td>4.44</td></tr><tr><td>20.00</td><td>2.00</td><td>1.89</td><td>3.00</td><td>2.84</td><td>10.00</td><td>9.46</td><td>5.00</td><td>4.73</td></tr><tr><td>21.00</td><td>1.89</td><td>1.91</td><td>2.84</td><td>2.87</td><td>9.46</td><td>9.57</td><td>4.73</td><td>4.79</td></tr><tr><td>22.00</td><td>1.87</td><td>1.86</td><td>2.80</td><td>2.79</td><td>9.34</td><td>9.31</td><td>4.67</td><td>4.65</td></tr><tr><td>23.00</td><td>1.63</td><td>1.72</td><td>2.45</td><td>2.58</td><td>8.17</td><td>8.59</td><td>4.09</td><td>4.29</td></tr><tr><td>24.00</td><td>1.32</td><td>1.63</td><td>1.98</td><td>2.44</td><td>6.58</td><td>8.13</td><td>3.29</td><td>4.07</td></tr></tbody></table>

<table><caption>**Table 4**
GA parameters.</caption><thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody><tr><td>Population size</td><td>100</td></tr><tr><td>Max generations</td><td>10</td></tr><tr><td>Crossover rate</td><td>0.8</td></tr><tr><td>Mutation rate</td><td>0.2</td></tr><tr><td>Number of runs</td><td>10</td></tr></tbody></table>

is stored in batteries or exchanged between MGs. Voltage deviations remain minimal (Fig. 6(a)) and within the safety range, even with high PV penetration, validating the reactive power management of inverters (Eqs. (45)–(47)). The SOC profiles (Fig. 6(b)) demonstrate efficient energy buffering, with batteries discharging during peak demand hours and periods of low renewable energy availability, while recharging during surplus renewable energy supply periods. Fig. 6(d) illustrates the power flow between MGs over time. The energy flows are optimized allowing for efficient power trading and minimizing the reliance on the main grid, with higher interaction at night and in the morning exchanging storage energy and exporting energy to MG3 (05:00-10:00), which has the highest demand. The energy exchange during midday is low because the surplus energy during midday is rather stored than exchanged. A sharp variation is observed around 23:00, which is due to the SOC constraint requiring batteries to return to the initial SOC (50%) by the end of the day, to ensure energy availability for the next day. To satisfy this, MGs with excess charge (e.g., MG2) discharge their batteries to support others that need to recharge, leading to a noticeable spike in power exchange.

The cost breakdown in Fig. 7 highlights the contribution of each individual MG in the economic performance of the interconnected MMG system. MG3 was observed to have the highest costs due to its larger installed capacities and higher demand, which increased investment and operational expenses. MG1 and MG4, being directly connected to the main grid, experience the highest transaction costs due to energy interactions with the utility grid. However, they compensate for these costs by selling energy to other MGs, effectively redistributing power and optimizing overall cost efficiency within the system. The total transaction cost with the main grid is 3.46 €/day, while the total operational cost amounts to 12.20 €/day.

## 4.2. Imlil during winter

In winter, the renewable energy availability is lower due to reduced solar irradiance (Fig. 8). Despite these unfavorable conditions, The system maintains voltage stability across all buses (Fig. 8(a)), and bus voltages remain within acceptable limits (1.05–0.95 p.u), ensuring overall system stability, with the slack bus (Bus 1), which is connected to the main grid, holding a constant voltage reference with some minor fluctuations due to energy exchange. Batteries exhibited frequent charge/discharge cycles (Fig. 8(b)), reflecting their critical role in smoothing solar intermittency, with conservative cycling (limited to 20% DOD) to preserve battery lifespan. The energy management strategy effectively coordinates local generation and storage to minimize grid dependency, ensuring a robust operation even during peak loads (Fig. 8(c)). Energy flows between MGs (Fig. 8(d)) show a similar dynamic to summer, with minimal interactions during midday and increased exchanges at night and in the morning to compensate for energy deficit.

In terms of cost analysis, the operational expenses during winter are found to be marginally higher compared to summer (Fig. 9). This difference is primarily attributed to the increased degradation costs of the batteries. The lower ambient temperatures in the region adversely affect battery performance, leading to more pronounced capacity losses over time. According to [9], the optimal operating temperature range for Li-ion batteries is between 10 °C and 50 °C. When temperatures drop below 10 °C, batteries require additional thermal management, which significantly reduces their discharge capacity and increases degradation costs. MG3, with high industrial/commercial demand, incurs the highest costs in both seasons. MG4 and MG1 have lower transaction costs due to the grid injection. The interconnected MMG design mitigates seasonal cost spikes by sharing resources. Despite localized demand variations, the MMG system’s total operational costs remain relatively stable across seasons. This demonstrates the MMG’s ability to balance seasonal renewable energy variability. The transaction cost is 2.25 €/day, while the total operational cost reaches 13.72 €/day.

## 4.3. Demand response

In this section, a IDR program is implemented and tested for a winter day. The DR results are presented in Fig. 10. Load shifting
<table><caption>**Table 5**
Sizing results.</caption><thead><tr><th></th><th>P<sup>ins</sup><sub>pv</sub> (kWc)</th><th>S<sub>pv</sub> (kVA)</th><th>P<sup>ins</sup><sub>wt</sub> (kWc)</th><th>S<sub>wt</sub> (kVA)</th><th>E<sup>b</sup> (kWh)</th><th>S<sup>b</sup> (kVA)</th><th>ASC (€)</th></tr></thead><tbody><tr><td>MG1</td><td>4.5</td><td>4.74</td><td>6.64</td><td>6.99</td><td>39.69</td><td>1.69</td><td>4644.72</td></tr><tr><td>MG2</td><td>11.7</td><td>12.31</td><td>9.75</td><td>10.26</td><td>80</td><td>3.56</td><td>8906.9</td></tr><tr><td>MG3</td><td>16.9</td><td>17.79</td><td>19.64</td><td>20.68</td><td>129</td><td>5.76</td><td>15066.23</td></tr><tr><td>MG4</td><td>8.64</td><td>9.09</td><td>9.56</td><td>10.06</td><td>64.77</td><td>2.89</td><td>7509.84</td></tr></tbody></table>

<figure><img src="image_11.png" /><figcaption>(a) Bus voltages (p.u).</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>(b) Batteries SOC evolutions (%).</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>(c) Energy management results of MG1 (top), MG2, MG3, MG4 and the main grid (bottom).</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>(d) Energy flow between MGs.</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>**Fig. 7.** Operating costs per day in summer.</figcaption></figure>

lowered peak demand by 10% across MGs, reducing stress on storage systems and grid infrastructure. As for MG3, a 20% of non-critical demand is shifted. Early in the day, a 4 hour shift occurs by moving non-essential load from mid-peak to off-peak times. In the evening, the load is decreased during peak hours and recovered during off-peak

hours at day's end. The incentive cost for each MG at any given time is calculated based on the incentive rate amount and the shifted demand power. The goal is to encourage consumers to adjust their consumption and to shift their electricity usage to off-peak periods, which helps in balancing the load and reducing operational costs. The IDR program
<figure><img src="image_16.png" /><figcaption>(a) Bus voltages (p.u).</figcaption></figure>

<figure><img src="image_17.png" /><figcaption>(c) Energy management results of MG1 (top), MG2, MG3, MG4 and the main grid (bottom).</figcaption></figure>

<figure><img src="image_18.png" /><figcaption>(b) Batteries SOC evolutions (%).</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>(d) Energy flow between MGs.</figcaption></figure>

<figure><img src="image_20.png" /><figcaption>Fig. 9. Operating costs per day in winter.</figcaption></figure>

<table><caption>**Table 6**
Operating costs with and without DR.</caption><thead><tr><th></th><th>No DR</th><th>With DR</th><th>Cost reduction (%)</th></tr></thead><tbody><tr><td>Cost (p.u)</td><td>1.0</td><td>0.9</td><td>10%</td></tr></tbody></table>

reduced total operational costs by 10% (Table 6). Although the absolute cost reduction may appear modest, such savings can be significant over long-term operation. Moreover, when combined with other demand management strategies, DR can further enhance system sustainability and economic feasibility, making it an essential tool for modern MG optimization.

### 4.4. Islanding mode

A 6 h islanding mode simulation in summer is conducted to assess the resilience of the MMG and its ability to operate autonomously during grid outages. Results in Fig. 11 demonstrate the system's performance regarding energy sufficiency and voltage stability. During this period the system relies solely on local DERs and energy sharing. The system maintains voltage stability within acceptable limits (± 5%) (Fig. 11(a)) with higher fluctuation during the islanding transition due to the increased energy exchange during this period. Batteries discharged strategically to meet critical loads (Fig. 11(b)), with SOC levels depleting from 50% to 20% over 9 h to compensate for the lost grid supply.
<figure><img src="image_21.png" /><figcaption>Fig. 10. Demand response for MG1 (top), MG2, MG3, and MG4 (bottom).</figcaption></figure>

<figure><img src="image_22.png" /><figcaption>(a) Bus voltages (p.u).</figcaption></figure>

<figure><img src="image_23.png" /><figcaption>(b) Batteries SOC evolutions (%).</figcaption></figure>

<figure><img src="image_24.png" /><figcaption>(c) Energy management results of MG1 (top), MG2, MG3, MG4 and the main grid (bottom).</figcaption></figure>

<figure><img src="image_25.png" /><figcaption>(d) Energy flow between MGs.</figcaption></figure>

<caption>Fig. 11. MMG resilience during islanding.</caption>

Although the islanding occurred during a critical period of low RES availability, the MMG system's energy-sharing mechanism, coupled with a robust sizing strategy designed for islanded operation, ensures optimal performance and reliability during grid outages. This capability underscores the MMG's suitability for rural and remote regions where grid reliability is a persistent challenge, thereby advancing sustainable and equitable electrification efforts.

## 4.5. MMG vs MG

To evaluate the effectiveness of the MMG configuration and the techno-economic benefits of interconnecting neighboring MGs, performance of MG3, which has the highest demand, has been analyzed. This analysis compares two setups:

1. A single grid-connected MG3 system: In this case, MG3 is disconnected from the MMG network and operates independently, relying solely on its local generation (PV, WT, and batteries) and grid connection.

2. MG3 within the MMG setup: MG3 is integrated into the MMG, allowing for energy sharing with other microgrids.

A comparative cost analysis shows the MMG system significantly outperforms a single MG (Table 7). By sharing storage utilization, MMG reduced battery cycling, extending lifespan and lowering degradation costs by 8.02%, minimizing redundant storage investments. MMG reduced transaction costs by 57.87% by prioritizing P2P energy trading over grid imports. A total cost reduction of 24.6% is achieved, which highlights enhanced MMG economic efficiency and reduced operational expenses.
<table><caption>**Table 7**
Costs comparison between MG and MMG configurations.</caption><thead><tr><th></th><th>MG</th><th>MMG</th></tr></thead><tbody><tr><td>Batteries cost (p.u)</td><td>1.00</td><td>0.92</td></tr><tr><td>Transactions cost (p.u)</td><td>1.00</td><td>0.421</td></tr><tr><td>Total cost (p.u)</td><td>1.00</td><td>0.754</td></tr><tr><td>Cost reduction</td><td></td><td>24.6%</td></tr></tbody></table>

The analysis demonstrates that integrating MG3 into the MMG significantly improves its performance across all key metrics. By leveraging energy sharing and coordinated management, the MMG configuration not only reduces costs but also enhances system stability and resilience. While MMG systems involve higher infrastructure complexity and capital investment, the proposed optimization framework mitigates this drawback. The GA-based sizing approach explores multiple configurations to identify the least-cost solution that ensures demand satisfaction even during isolated operation. Additionally, the higher upfront cost is offset over time by operational savings from P2P energy trading and IDR mechanisms. These results validate the MMG's superiority over standalone microgrids, particularly for high-demand applications like industrial or commercial loads, and underscores its potential as a scalable solution for rural electrification.

## 5. Conclusion and future work

This research proposed a techno-economic optimization framework for the optimal design and operation of interconnected AC microgrids to improve energy access in rural areas. The proposed model demonstrated strong potential to enhance energy security, resilience, and economic efficiency. It maximized renewable energy and achieved higher efficiency underscoring the effectiveness of MMG systems as a viable and economic solution for regions with unreliable grid access. While the integration of varying weather conditions and grid outage scenarios enhances the operational realism of the proposed framework and addresses key sources of uncertainty, future work should extend this analysis to more diverse real-world case studies. This includes additional fault scenarios such as unexpected equipment failures, intra-day weather fluctuations, and short-term forecast errors, as well as different geographic, climatic, and socioeconomic contexts, alongside social, regulatory, and policy considerations, to further assess the broader applicability and robustness of the proposed model. Additionally, the reliance on accurate weather and demand forecasts remains a critical challenge, the framework could be further enhanced by integrating machine learning-based forecasting for renewable generation and power demand patterns, improving system efficiency under uncertainty. Furthermore, extending this framework to networks with heterogeneous DERs such as hydrogen storage systems would strengthen its practical applicability. Finally, while the proposed optimization model effectively minimizes the investment and operational costs, practical deployment in remote and economically disadvantaged rural areas may still face financial constraints. To overcome these barriers, cooperative ownership models, public-private partnerships, government subsidies, and rural electrification programs (such as Global Rural Electrification Program (GREP) in Morocco) can be leveraged. These mechanisms can facilitate infrastructure financing and make MMG deployment economically viable for small communities.

### CRediT authorship contribution statement

**Ayoub Chrif:** Writing – original draft, Validation, Software, Resources, Methodology, Conceptualization.
**Elhoussin Elbouchikhi:** Writing – review & editing, Validation, Supervision, Project administration, Methodology, Funding acquisition, Conceptualization.
**Abdelmajid Abouloifa:** Writing – review & editing, Validation, Supervision, Project administration, Methodology, Funding acquisition, Conceptualization.
**Mohamed Machmou:** Writing – review & editing, Validation, Supervision, Methodology, Conceptualization.

### Declaration of Generative AI and AI-assisted technologies in the writing process

During the preparation of this work the authors used DeepSeek and ChatGPT in order to improve the grammar and readability of some sentences. After using these tools/services, the authors reviewed and edited the content as needed and take full responsibility for the content of the publication.

### Declaration of competing interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

### Acknowledgments

The authors acknowledge the financial support from ISEN Yncréa Ouest, Nantes and PHC Toubkal under grant number N°: TBK/24/185 N° CAMPUS : 49960SJ. With the support of the CNRST, Morocco as part of the “PhD-ASSociate Scholarship – PASS” Program.

### Data availability

Data will be made available on request.

### References

[1] Hadi M, Elbouchikhi E, Zhou Z, Saim A, Shafie-khah M, Siano P, et al. Artificial intelligence for microgrids design, control, and maintenance: A comprehensive review and prospects. Energy Convers Manag 2025;27:101056.

[2] Akter A, Zafir EI, Dana NH, Joysoyal R, Sarker SK, Li L, et al. A review on microgrid optimization with meta-heuristic techniques: Scopes, trends and recommendation. Energy Strat Rev 2024;51:101298.

[3] Ahmad S, Shafiullah M, Ahmed CB, Alowaifeer M. A review of microgrid energy management and control strategies. IEEE Access 2023;11:21729-57.

[4] Babatunde OM, Munda JL, Hamam Y. A comprehensive state-of-the-art survey on hybrid renewable energy system operations and planning. IEEE Access 2020;8:75313-46.

[5] Ouramdane O, Elbouchikhi E, Amirat Y, Gall FL, Gooya ES. Home energy management considering renewable resources, energy storage, and an electric vehicle as a backup. Energies 2022;15(8):2830.

[6] Vivas F, Pajares A, Blasco X, Herrero J, Segura F, Andújar J. A novel energy management system based on two-level hierarchical economic model predictive control for use in microgrid control. Energy Convers Manag 2025;26:101027.

[7] Aeggeggn DB, Nyakoe GN, Wekesa C. A state of the art review on energy management techniques and optimal sizing of DERs in grid-connected multi-microgrids. Cogent Eng 2024;11(1):2340306.

[8] Zia MF, Elbouchikhi E, Benbouzid M, Guerrero JM. Energy management system for an islanded microgrid with convex relaxation. IEEE Trans Ind Appl 2019;55(6):7175-85.

[9] Zia MF, Elbouchikhi E, Benbouzid M. Optimal operational planning of scalable DC microgrid with demand response, islanding, and battery degradation cost considerations. Appl Energy 2019;237:695-707.

[10] Maghami MR, Yaghoubi E, Mohamed M, Yaghoubi E, Jahromi MZ, Fei TK. Multi-objective optimization of unbalanced power distribution systems: A comprehensive approach to address uncertainties and enhance performance. Energy Convers Manag 2025;27:101087.

[11] Fresia M, Bordo L, Delfino F, Bracco S. Optimal day-ahead active and reactive power management for microgrids with high penetration of renewables. Energy Convers Manag 2024;23:100598.

[12] Hammad EM, Farraj AK, Kundur D. Cooperative microgrid networks for remote and rural areas. In: 2015 IEEE 28th Canadian conference on electrical and computer engineering. 2015, p. 1572-7.

[13] Wu N, Xu J, Linghu J, Huang J. Real-time optimal control and dispatching strategy of multi-microgrid energy based on storage collaborative. Int J Electr Power Energy Syst 2024;160:110063.

[14] Naz K, Zainab F, Mehmood KK, Bukhari SBA, Khalid HA, Kim C-H. An optimized framework for energy management of multi-microgrid systems. Energies 2021;14(19):6012.

[15] Hu P, Qian L, Li Z, Yu Y, Wang D. Distributed dynamic economic dispatch of biogas-wind-solar-hydrogen multi-microgrid system considering individual selfishness. Energy Convers Manag 2024;24:100761.
[16] Kong X, Liu D, Wang C, Sun F, Li S. Optimal operation strategy for interconnected microgrids in market environment considering uncertainty. Appl Energy 2020;275:115336.

[17] Xu D, Zhou B, Chan KW, Li C, Wu Q, Chen B, et al. Distributed multienergy coordination of multimicrogrids with biogas-solar-wind renewables. IEEE Trans Ind Inf 2019;15(6):3254-66.

[18] Toutouchi AN, Seyed-Shenava S, Akbarimajd A, Contreras J. A stochastic bilevel model to manage active distribution networks with multi-microgrids. IEEE Syst J 2019;13(4):3910-20.

[19] Al-Quraan A, Athamnah I, Malkawi AMA. Efficiency maximization of stand-alone HRES based on tri-level economic predictive technique. Sustain 2024;16(23):10762.

[20] Al-Quraan A, Athamnah I. Economic tri-level control-based sizing and energy management optimization for efficiency maximization of stand-alone HRES. Energy Convers Manag 2024;302:118140.

[21] Al-Quraan A, Athamnah I. Economic predictive tri-level control for efficiency maximization of stand-alone hybrid renewable energy system. J Power Sources 2024;596:234098.

[22] Khawaja Y, Qiqieh I, Alzubi J, Alzubi O, Allahham A, Giaouris D. Design of cost-based sizing and energy management framework for standalone microgrid using reinforcement learning. Sol Energy 2023;251:249-60.

[23] Zhao Z, Guo J, Luo X, Lai CS, Yang P, Lai LL, et al. Distributed robust model predictive control-based energy management strategy for islanded multi-microgrids considering uncertainty. IEEE Trans Smart Grid 2022;13(3):2107-20.

[24] Zhao Z, Xu J, Guo J, Ni Q, Chen B, Lai LL. Robust energy management for multi-microgrids based on distributed dynamic tube model predictive control. IEEE Trans Smart Grid 2024;15(1):203-17.

[25] Abu-El-Haija L, E'layan B, Refai Y, Abu-El-Haija A. Multi-microgrid system optimization addressing the uncertainties in generation and load demand. IEEE Access 2025;PP(99):1.

[26] Rong S, Zhao Y, Wang Y, Chen J, Guan W, Cui J, et al. Information gap decision theory-based stochastic optimization for smart microgrids with multiple transformers. Appl Sci 2023;13(16):9305.

[27] Hosseini S, Gharehpetian GB, Mozafari SB, Vatani M. A techno-economic scheduling of distribution system including multi-microgrids considering system reconfiguration and bus selector switches. Sustain Cities Soc 2024;108:105489.

[28] Aeggegn DB, Nyakoe GN, Wekesa C. Optimal sizing of grid connected multi-microgrid system using grey wolf optimization. Results Eng 2024;23:102421.

[29] Ibrahim NN, Jamian JJ, Md Rasid 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.

[30] Khosravi N, Oubelaid A, Belkhier Y. Energy management in networked microgrids: A comparative study of hierarchical deep learning and predictive analytics techniques. Energy Convers Manag 2025;25:100828.

[31] Li S, Cao D, Hu W, Huang Q, Chen Z, Blaabjerg F. Multi-energy management of interconnected multi-microgrid system using multi-agent deep reinforcement learning. J Mod Power Syst Clean Energy 2023;11(5):1606-17.

[32] Satish kumar S, Pramila V, Rudhra S, Vinod S, Lakshmi D. Enhancing demand response and energy management in multi-microgrid systems with renewable energy sources. Renew Energy 2025;253:123490.

[33] Thakkar N, Kaliyaperumal D, Pandi VR. Trend and evolution in microgrid systems: A bibliometric analysis and literature review. Results Eng 2025;25:104065.

[34] Zia MF, Elbouchikhi E, Benbouzid M. Microgrids energy management systems: A critical review on methods, solutions, and prospects. Appl Energy 2018;222:1033-55.

[35] Ouramdane O, Elbouchikhi E, Amirat Y, Gooya ES. Optimal sizing and energy management of microgrids with vehicle-to-grid technology: A critical review and future trends. Energies 2021;14(14):4166.

[36] Che L, Shahidehpour M, Alabdulwahab A, Al-Turki Y. Hierarchical coordination of a community microgrid with AC and DC microgrids. IEEE Trans Smart Grid 2015;6(6):3042-51.

[37] Zia MF, Nasir M, Elbouchikhi E, Benbouzid M, Vasquez JC, Guerrero JM. Energy management system for a hybrid PV-Wind-Tidal-Battery-based islanded DC microgrid: Modeling and experimental validation. Renew Sustain Energy Rev 2022;159:112093.

[38] Zhou B, Zou J, Chung CY, Wang H, Liu N, Voropai N, et al. Multi-microgrid energy management systems: Architecture, communication, and scheduling strategies. J Mod Power Syst Clean Energy 2021;9(3):463-76.

[39] Jain R, Solanki A, Nayyar A. IoT-based Green building: Towards an energy-efficient future. In: Solanki A, Nayyar A, editors. Green building management and smart automation. IGI Global Scientific Publishing; 2020, p. 184-207.

[40] Kabalci Y. A survey on smart metering and smart grid communication. Renew Sustain Energy Rev 2016;57:302-18.

[41] Cetinay H, Soltan S, Kuipers FA, Zussman G, Mieghem PV. Comparing the effects of failures in power grids under the AC and DC power flow models. IEEE Trans Netw Sci Eng 2018;5(4):301-12.

[42] Saharuddin NZ, Abidin Iz, Mokhlis H, Abdullah AR, Naidu K. A power system network splitting strategy based on contingency analysis. Energies 2018;11(2):358.

[43] Hosseinalizadeh R, G. HS, Amalnick MS, Taghipour P. Economic sizing of a hybrid (PV-WT-FC) renewable energy system (HRES) for stand-alone usages by an optimization-simulation model: Case study of Iran. Renew Sustain Energy Rev 2016;54:139-50.

[44] Hadi M, Elbouchikhi E, Zhou Z, Saim A. Optimal energy management in multi energy microgrid with combined heat and power system and demand side response integration. Renew Energy 2025;256:124076.

[45] Lydia M, Kumar SS, Selvakumar AI, Prem Kumar GE. A comprehensive review on wind turbine power curve modeling techniques. Renew Sustain Energy Rev 2014;30:452-60.

[46] Manbachi M, Ordonez M. Intelligent agent-based energy management system for islanded AC-DC microgrids. IEEE Trans Ind Inf 2020;16(7):4603-14.

[47] Cho J-H, Chun M-G, Hong W-P. Structure optimization of stand-alone renewable power systems based on multi-object function. Energies 2016;9(8):643.

[48] Attemene NS, Agbli SK, Fofana S, Hissel D. Dimensionnement optimal d'un micro-réseau isolé constitué d'un générateur éolien, d'une pile à combustible, d'un électrolyseur, d'une batterie et d'un supercondensateur. In: Symposium de génie électrique. 2018.

[49] Khawaja Y, Shankar N, Qiqieh I, Alzubi J, Alzubi O, Nallakaruppan M, et al. Battery management solutions for li-ion batteries based on artificial intelligence. Ain Shams Eng J 2023;14(12):102213.

[50] Akhila K, Pillai AS, Krishna PR, Al-Shahri A. Towards resilient energy infrastructures: A comprehensive review on the role of demand response in smart grids. Sustain Energy Technol Assess 2025;74:104170.

[51] Ali L, Muyeen SM, Bizhani H, Simoes MG. Economic planning and comparative analysis of market-driven multi-microgrid system for peer-to-peer energy trading. IEEE Trans Ind Appl 2022;58(3):4025-36.

[52] Roy A, Olivier J-C, Auger F, Auvity B, Schaeffer E, Bourguet S, et al. A combined optimization of the sizing and the energy management of an industrial multi-energy microgrid: Application to a harbour area. Energy Convers Manag 2021;12:100107.

[53] Phan-Van L, Takano H, Duc TN. A comparison of different metaheuristic optimization algorithms on hydrogen storage-based microgrid sizing. Energy Rep 2023;9:542-9.

[54] Mohammed OH, Amirat Y, Benbouzid M. Economical evaluation and optimal energy management of a stand-alone hybrid energy system handling in genetic algorithm strategies. Electron 2018;7(10):233.

[55] Zhang H, Dang Q, Feng X, Gao X. Constrained multi-objective optimization assisted by competitive mechanism based reward auxiliary optimization problems. Swarm Evol Comput 2025;97:102021.

[56] Liu J, Wang A, Qu Y, Wang W. Coordinated operation of multi-integrated energy system based on linear weighted sum and grasshopper optimization algorithm. IEEE Access 2018;6:42186-95.

[57] Lu W, Liu M, Lin S, Li L. Fully decentralized optimal power flow of multi-area interconnected power systems based on distributed interior point method. IEEE Trans Power Syst 2018;33(1):901-10.

[58] Li C, Chaudhary SK, Vasquez JC, Guerrero JM. Power flow analysis for droop controlled LV hybrid AC-DC microgrids with virtual impedance. In: 2014 IEEE PES general meeting | conference & exposition. 2014, p. 1-4.

[59] Singh S, Singh M, Kaushik SC. Feasibility study of an islanded microgrid in rural area consisting of PV, wind, biomass and battery energy storage system. Energy Convers Manag 2016;128:178-90.

[60] Office National de l'Électricité et de l'Eau Potable (ONEE) Maroc. Tarif général de l'électricité. 2025, https://www.one.org.ma/FR/pages/interne.asp?esp=1&id1=3&id2=113&t2=1. [Accessed 14 Mars 2025].

[61] Li W, Zou Y, Yang H, Fu X, Xiang S, Li Z. Two-stage stochastic energy scheduling for multi-energy rural microgrids with irrigation systems and biomass fermentation. IEEE Trans Smart Grid 2025;16(2):1075-87.

[62] Prit G, Sharma S, Mishra S, Verma A. Energy scheduling and economic assessment of a rural microgrid using two-stage stochastic framework. Energy 2025;335:137771.