Abstract
This work proposes an intelligent strategy for the coordinated management of active and reactive power in Battery Energy Storage Systems (BESSs) within AC microgrids operating under both grid-connected (GCM) and islanded (IM) modes to minimize daily operational costs. The problem is formulated as a mixed-variable optimization model that explicitly leverages the control capabilities of BESS power converters. To solve it, a Parallel Particle Swarm Optimization (PPSO) algorithm is employed, coupled with a Successive Approximation (SA) power flow solver. The proposed approach was benchmarked against parallel implementations of the Crow Search Algorithm (PCSA) and the JAYA algorithm (PJAYA), both in parallel, using a realistic 33-node AC microgrid test system based on real demand and photovoltaic generation profiles from Medellín, Colombia. The strategy was evaluated under both deterministic conditions (average daily profiles) and stochastic scenarios (100 daily profiles with uncertainty). The proposed framework is evaluated on a 33-bus AC microgrid that operates in both grid-connected and islanded modes, with a battery energy storage system dispatched at both active and reactive power levels subject to network, state-of-charge, and power-rating constraints. Three population-based optimization algorithms are used to coordinate BESS schedules, and their performance is compared based on daily operating cost, BESS cycling, and voltage profile quality. Quantitatively, the PPSO strategy achieved cost reductions of 2.39% in GCM and 1.62% in IM under deterministic conditions, with a standard deviation of only 0.0200% in GCM and 0.2962% in IM. In stochastic scenarios with 100 uncertainty profiles, PPSO maintained its robustness, reaching average reductions of 2.77% in GCM and 1.53% in IM. PPSO exhibited consistent robustness and efficient performance, reaching the highest average cost reductions with low variability and short execution times in both operating modes. These findings indicate that the method is well-suited for real-time implementation and contributes to improving economic outcomes and operational reliability in grid-connected and islanded microgrid configurations. The case study results show that the different strategies yield distinct trade-offs between economic performance and computational effort, while all solutions satisfy the technical limits of the microgrid.
1. Introduction
The growing penetration of Distributed Energy Resources (DERs) in modern electrical systems has driven a fundamental shift from centralized generation toward more decentralized and flexible paradigms [1]. This transition has led to the emergence of new network architectures such as microgrids, which combine local generation, energy storage systems, and controllable loads within a bounded electrical area [2]. Microgrids provide several benefits, including increased reliability, higher integration of renewable energy, operational cost savings, and the ability to operate autonomously in islanded mode during grid disturbances [3]. Yet, achieving these benefits requires effective coordination among all distributed resources, which underscores the need for advanced Energy Management Systems (EMS) capable of ensuring optimal DER operation while upholding technical, economic, and operational feasibility.
The integration of Battery Energy Storage Systems (BESS) into AC microgrids (MGs) has strengthened their ability to increase flexibility and reduce energy-related expenditures [4]. Despite this progress, most existing control strategies focus predominantly on the dispatch of active power [5], using exact optimization techniques [6], metaheuristic algorithms [7], and other solution methods [8]. These methods typically pursue improvements in economic and technical performance while prioritizing robustness, repeatability, and computational efficiency, qualities that grid operators require from solutions intended to deliver reliable and meaningful operational gains [9]. Moreover, evaluating microgrid behavior in both grid-connected and islanded modes is necessary to obtain results that reflect operational realities and to verify the applicability of the proposed energy management strategies in AC microgrids. This dual-mode analysis reflects real-world operating conditions and is critical for validating the feasibility and effectiveness of proposed energy management strategies in AC microgrids [4].
Some studies have addressed the problem of active and reactive power management for BESSs in electrical systems; for example, see [10], where an active and reactive power controller for BESSs in AC microgrids is proposed to enable both power smoothing and voltage regulation. The controller operates in active and reactive power modes, with the active power reference generated by a low-pass filter (LPF) designed via a genetic algorithm. A vector diagram analysis is used to validate the voltage regulation strategy, and the approach is tested using neural networks to forecast power demand and PV generation. The methodology is validated through simulations and a 1 kW grid-connected inverter prototype, with close agreement between the experimental results and the theoretical analysis. However, the study is limited to a single-node MG, employs a single optimization method, does not consider operation in islanded mode, and does not assess robustness, repeatability, or computational time.
In [11], a multi-agent system based on a distributed control method is proposed for State of Charge (SOC) balancing and proportional reactive power sharing among BESSs in grid-connected microgrids using second-order control laws and only local information exchange. The approach reduces complexity and demonstrates fast SOC convergence, stable voltage profiles, and proportional reactive power dispatch under varying generation and demand. However, it does not address transitions between grid-connected (GCM) and islanded (IM) modes, omits robustness, repeatability, and computational time assessments, does not include comparisons with other optimization methodologies reported in the literature, and does not employ a multinodal system as found in real microgrid operation.
In [12], a real microgrid implementation at ENEA labs integrates a lithium-based BESS with an EV fast-charging station and innovative metering system to provide reactive power compensation. Two control strategies, active power priority and reactive power priority, are implemented using open ICT protocols and a LabVIEW-based controller for energy management. Experimental results confirm that the EV charger’s power factor is effectively corrected to unity, although the 30 kVA system capacity limits voltage regulation at the grid level. While the work demonstrates the practical application of BESS for ancillary services, it is limited to a single-node configuration in grid-connected mode, and does not consider multi-node operation or islanded mode. Furthermore, it does not include comparative evaluations of optimization methodologies, nor does it assess robustness or computational performance.
Recent work has addressed operational cost reduction for AC microgrids with distributed wind generation using advanced metaheuristics. In [13], four optimization algorithms, the Population-Based Genetic Algorithm (PGA), Particle Swarm Optimization (PSO), JAYA, and the Generalized Normal Distribution Optimizer, were evaluated for managing the energy production of wind-based distributed generators in a 33-node microgrid under grid-connected and isolated configurations.
Beyond these algorithmic advancements, several studies highlight the structural and mathematical challenges of optimal power flow (OPF) in distribution networks with high DER penetration. Hermann et al. demonstrate that conventional OPF formulations become computationally prohibitive when managing inverter-dominated feeders, motivating the use of convex relaxations based on semidefinite programming to optimize multi-period inverter operation [14]. Related work by Gan et al. proves that, under mild conditions, exact optimal solutions for radial networks can be recovered via second-order cone programming, offering a tractable alternative to fully nonconvex methods [15]. These results underscore the need for scheduling frameworks capable of handling nonlinear AC constraints while remaining computationally viable for real-time applications.
Complementary research highlights the increasing complexity of multi-microgrid ecosystems characterized by renewable intermittency, electric vehicle charging, and dynamic energy pricing. Datta and Das develop a bi-level optimization strategy that integrates demand-response flexibility with hybrid intelligent optimizers to reduce cost and enhance coordination across interconnected microgrids [16]. Their work shows that multi-timescale decision models and hierarchical optimization architectures can significantly improve system-wide performance, especially under deep uncertainty. This motivates the adoption of optimization frameworks that explicitly account for variability in both demand and renewable energy production.
At a broader level, the operational challenges of active distribution networks (ADNs) with high renewable penetration bring renewed relevance to coordinated active–reactive power scheduling. Wang et al. identify voltage violations, nonconvex dispatch models, and renewable intermittency as critical barriers, emphasizing the need for reformulation strategies, convex relaxations, and intelligent solution methods to maintain safety and economic efficiency [17]. Similar concerns are examined by Shi et al., who propose a two-layer convex model combining OLTC control, PV inverter dispatch, and energy storage scheduling to maintain stability under uncertainty [18]. These contributions highlight the importance of integrating storage-based reactive power support and sequential optimization techniques in future microgrid EMS frameworks.
In the specific context of AC microgrids operating under dual-mode conditions, recent findings demonstrate the benefits of coordinated active–reactive BESS scheduling when minimizing energy losses and carbon emissions using a PPSO-based framework [19]. However, it does not explicitly address cost minimization under uncertain operation in grid-connected and islanded modes. These gaps further motivate the present work.
Other researchers have emphasized the operational challenges of AC microgrids in realistic settings. Serra et al. report the design and field deployment of a mission-critical microgrid for an aerospace rocket launch center, addressing issues such as island capability, black-start operation, transformer inrush mitigation, fault detection in ungrounded systems, and power balance during off-grid operation [20]. Souza and Freitas provide an extensive overview of grid-connected AC microgrids and their transition modes, revisiting fundamental concepts, interconnection requirements, and control methods that enable reliable operation under different regimes [21]. These works motivate the present study, which focuses on cost-oriented operation of an AC microgrid that must switch between grid-connected and islanded modes while respecting realistic constraints on diesel generators, BESS units, and distribution network variables.
Building on the above, only a limited number of studies address active and reactive power management, particularly in systems operating under varying conditions such as transitions between grid-connected and islanded modes [22]. Many of these approaches oversimplify converter capabilities or overlook the dynamic coordination required to optimize both active and reactive power, thereby significantly limiting overall microgrid performance. In practice, AC microgrids frequently transition between GCM and IM, each posing distinct technical challenges and opportunities. This dual-mode behavior increases the complexity of optimal BESS scheduling, especially when aiming to fully exploit the capabilities of power electronic converters for simultaneous active and reactive power control. As DER penetration continues to grow, increasing the operational complexity of AC microgrids, the development of intelligent, high-efficiency control strategies becomes essential. In this context, optimizing BESS operation is crucial to enhancing the economic performance, reliability, and adaptability of AC microgrids under both stable and uncertain conditions.
A significant gap persists in the joint optimization of active and reactive power dispatch from BESSs in AC microgrids capable of operating in both GCM and IM. Using the complete flexibility of modern inverters enables storage systems not only to balance energy but also to improve the technical and economic conditions of microgrids. Addressing this challenge demands high-efficiency optimization strategies, preferably based on sequential programming, that minimize reliance on commercial software to reduce solution complexity and implementation costs. Moreover, it is essential to incorporate rigorous analyses of solution quality, repeatability, and computational time, and to validate the proposed methods under realistic operating scenarios. Integrating these elements with comparative evaluations of optimization methodologies reported in the literature represents a novel and practically relevant research direction.
This study proposes a hybrid optimization framework that integrates a parallel implementation of the Particle Swarm Optimization (PPSO) algorithm with a Successive Approximation (SA) power flow. The proposed methodology is applied to a modified 33-bus AC microgrid, accounting for the power demand and PV generation profiles of Medellín, Colombia, and tested under both GCM and IM. In this configuration, the PPSO algorithm generates candidate 24 h BESS dispatch schedules that simultaneously encode active and reactive power setpoints for each hour. These schedules are assessed by the SA power flow solver, which ensures technical feasibility by solving the AC network equations under the specified operating conditions, including voltage, current, power, and state of charge constraints. Evaluation scenarios include both deterministic operation and uncertainty-based cases, considering variability in demand and PV generation. For benchmarking, the proposed strategy is compared against state-of-the-art metaheuristics implemented in parallel to ensure a fair performance assessment: a parallel version of the Crow Search Algorithm (PCSA) and the JAYA algorithm, both selected due to their excellent performance reported in the specialized literature [23,24]. The parallel evaluation of candidate solutions significantly reduces computational time while maintaining high solution quality, enabling the method to address realistic and uncertain operating conditions in AC microgrids robustly.
As the main contributions of this work, from an academic standpoint, this research introduces a comprehensive and scalable framework for energy management in microgrids, using the simultaneous control of active and reactive power in BESS through converter modeling. It advances the field by addressing the complex scheduling problem under dual-mode operation and incorporating detailed system constraints into the optimization process. From an industrial perspective, the proposed methodology offers a practical tool for enhancing the performance of microgrids with high renewable penetration, enabling operators to achieve real-time cost reductions, improve voltage stability, and maintain system reliability. The strategy is particularly suitable for rural and isolated energy systems where operational resilience is critical.
The remainder of this paper is organized as follows: Section 2 presents the mathematical formulation of the optimization problem, including the objective function and constraints. Section 3 details the proposed PPSO-SA solution methodology. Section 4 introduces the benchmark optimization methods used for performance evaluation. Section 5 describes the test system, input data, and the simulation setup. Section 6 discusses the results obtained under deterministic and uncertain conditions. Finally, Section 7 provides the main conclusions and outlines future research directions.
2. Mathematical Formulation
This formulation addresses the optimal power dispatch of BESSs in AC microgrids by coordinating active and reactive power, considering PV generators under Maximum Power Point Tracking operation (MPPT). The objective is to minimize total operational costs over a 24 h horizon, as defined in Equation (1), by summing the energy cost , from the grid (GCM-Grid connected mode) or diesel (IM-Standalone connected mode), and the maintenance cost at each time step t, as shown in Equation (2).
The optimization horizon considered in this work is a single representative day, and the objective is to minimize the short-term operating cost of the microgrid. Under this setting, long-term battery degradation is not modeled explicitly. Instead, operational constraints on state of charge, depth of discharge, and power ratings are used to prevent unrealistic cycling within the day.
The cost components of the objective function are defined in Equations (3) and (4). Specifically, Equation (3) quantifies the energy-related cost , which corresponds to the aggregated price of electricity generated by conventional sources connected to each bus i in the set of network nodes N. This cost is calculated as the product of the unit generation cost and the generated power at each time t.
On the other hand, Equation (4) represents the total maintenance cost associated with the operation of distributed energy resources. This includes both distributed generators (DGs) and BESSs. The term refers to the maintenance cost per unit of energy produced by the DGs, and to the maintenance cost per unit of energy exchanged by the BESS. Their respective power contributions at time t are denoted by and .
The optimal operation of the BESS in AC microgrids with high penetration of distributed generation is constrained by the network power flow equations, nodal voltage magnitude limits, line current limits, diesel generator operating bounds, and BESS power and energy limits, as detailed in Equations (5)–(21). These equations enforce active and reactive power balance at each node, the evolution of the state of charge, and the technical limits of the power electronic devices.
Equation (5) enforces the active power balance at each node and time step in the AC distribution network. On the left-hand side, the terms and , represent the active power supplied by the conventional and PV generators, connected to node i at time h. The term corresponds to the active power demand at the same node and time, while denotes the active power exchanged by the BESS with the MG. On the right-hand side, the total power injection is matched with the net active power denotes the power management by the BESS that can be injected or absorbed to the MG flow, which is determined by the voltage magnitudes and , the magnitude admittance , and the angle difference , where and are the voltage phase angles at nodes i and j, and is the phase angle of the line admittance.
Equation (6) ensures the balance of reactive power at each node and time step. In this expression, represents the reactive power supplied by conventional generators, and corresponds to the reactive power demanded by the loads. Additionally, denotes the reactive power exchanged between the BESS and the microgrid, which may be either injected or absorbed depending on the operational requirements. This is technically feasible since the BESS is assumed to be connected through a bidirectional inverter with independent reactive power control.
The power output of conventional and PV generators is subject to operating limits, as defined in the following constraints. Equation (7) bounds the active power output of the conventional generator at node i and time step h between its minimum and maximum allowable limits, denoted by and , respectively:
Equation (8) establishes similar bounds for the reactive power output , with and defining the permissible range of reactive injection or absorption:
In IM, the Diesel generator located at the slack bus serves as the main energy supplier. Since there is no external grid connection or local energy storage, the system cannot absorb power. Therefore, non-negativity of the generator output is enforced, as shown in Equation (9):
Additionally, when , its operation is constrained within minimum and maximum limits, defined in Equation (10) as a percentage of the diesel generator’s nominal capacity:
These bounds are set to 40% and 80% of the rated power, respectively, ensuring the efficient and reliable operation of the diesel unit when grid support is unavailable [25].
Equation (11) restricts the active power generated by the PV unit located at node i and time h. The generation is bounded by a minimum value and a maximum value , both scaled by the availability factor , which reflects the hourly PV generation profile in per-unit (p.u.) as a function of the technology used and the solar irradiance conditions in the study area [26]. Notably, is set to zero during nighttime or periods of very low irradiance.
The power exchanged by the BESS at node i and hour h is constrained by Equation (12), which defines the allowable charging and discharging limits:
Here, represents the power absorbed (negative) or injected (positive) by the battery. The limits and are calculated as shown in Equation (13), based on the battery capacity and the charging/discharging durations times and :
In addition, the reactive power exchanged by the BESS is limited by the apparent power rating of its inverter. This constraint ensures that the combined active and reactive power does not exceed the converter’s capacity (). The maximum allowable reactive power at node i and time h is computed based on the instantaneous active power and the apparent power capacity of the inverter, as defined in Equation (14):
The constraint defined in Equation (15) ensures that the reactive power exchanged by the BESS, whether injected or absorbed, remains within the operational limits imposed by the inverter’s apparent power capacity.
The dynamic behavior of the battery is described in Equation (16), where is the state of charge at node i and time h, updated based on the previous state, the power exchanged , the time step , and the coefficient , defined in Equation (17) as the inverse of the battery’s nominal energy capacity .
To ensure controlled operation of the BESS, the initial and final state of charge are fixed through Equations (18) and (19). In these expressions, and represent the SoC values at the initial time and final time , respectively, while and are predefined parameters established by the operator. These constraints help preserve battery lifespan and ensure energy availability throughout the scheduling horizon [26].
Equation (20) constrains the voltage magnitude at each node within the allowable range , typically set to ±10% of the nominal value according to Colombian regulations for distributed generation.
Similarly, Equation (21) ensures that the current flowing through line remains below its thermal limit , avoiding overloads.
The power flow and optimization model are formulated in per unit using an apparent power base and a voltage base defined at the primary distribution level. For each PV inverter and BESS converter, the rated apparent power in kVA is converted to per unit as , and the instantaneous complex power injections are constrained by for all time periods. This makes explicit that the large reactive support levels observed in some time intervals remain within the apparent power ratings of the converters and do not violate the limit .
3. Solution Methodology
To determine the best way to operate BESS in AC MGs, this work implements a hybrid master–slave optimization strategy based on a parallel version of the Particle Swarm Optimization algorithm (PPSO), using a power flow method based on Successive Approximation (SA).
The parallelization focuses on the most expensive part of the fitness evaluation, namely, the solution of the SA-based distribution power flow for each candidate BESS schedule and each time step. In the proposed implementation, the independent power flow evaluations required by the candidate solutions and hourly operating points are distributed among the workers of the parallel pool. Each worker receives a subset of the decision vectors, runs the SA power flow for the corresponding hours, and returns the resulting active power losses and constraint indicators. The communication overhead is therefore restricted to sending the decision vector data and receiving scalar performance indices, which is small compared with the numerical cost of the iterative SA procedure.
The PPSO algorithm explores different schedules for charging and discharging the batteries, considering both active power (P) and reactive power (Q). These schedules cover a 24 h period and are represented by candidate solutions (particles) in the optimization process. Each particle defines the hourly active and reactive power exchange of the BESS units, which are equipped with bidirectional inverters capable of delivering or absorbing both P and Q, independently.
The PPSO searches for the operation profiles for each BESS integrated within the MG. Each particle in the swarm encodes the sequence of active and reactive power values that the batteries will inject or absorb at each hour. These values are subject to technical constraints, such as power limits, inverter capacity, and state of charge (SoC) boundaries.
Figure 1 illustrates the codification adopted to represent the 24 h operation of a BESS in the proposed optimization framework. The table on the left shows the active power schedule, where negative values indicate charging operations and positive values represent discharging. The table on the right depicts the reactive power exchange, which includes both injection (positive values) and absorption (negative) depending on the system requirements.
Figure 1.
Codification of the 24 h operating profile for active and reactive power in a BESS.
At each iteration:
- The PSO algorithm initializes a population of particles, where each particle encodes a complete 24 h operation schedule of active and reactive power for all BESS units.
- At each iteration, new candidate solutions are generated by updating the position and velocity of each particle. This update is guided by both individual experience (personal best) and the collective knowledge of the swarm (global best).
- Each candidate solution is then evaluated using the Successive Approximation (SA) power flow method in a parallel processing scheme. This enables simultaneous computation of power flow results for multiple particles, significantly reducing the overall computational time. The iterative process is stopped when the maximum absolute difference in bus voltage magnitudes between two consecutive iterations is below in per unit, or when a maximum of 1000 iterations is reached, whichever condition is satisfied first.
- The evaluation process consists of computing the objective function, which represents the total operating cost and includes both energy purchases and maintenance expenses. If a candidate solution violates any technical constraints, such as nodal voltage limits, line current capacities, or diesel generator output limits under IM, penalty values are added to its fitness function, thereby increasing the objective value. These penalties reduce the quality of the solution and guide the algorithm away from infeasible operating schedules. It is important to highlight that constraints related to power limits of BESS, inverter apparent power capacity, and SoC boundaries are inherently guaranteed by the codification scheme illustrated in Figure 1, which ensures that each particle represents a feasible BESS operation profile.
- After all particles are evaluated, the algorithm updates each particle’s personal best if the current solution is better. The global best is also updated with the best-performing solution found so far.
- This iterative process continues until the stopping criterion is met (e.g., maximum number of iterations), and the best solution is selected as the optimal BESS dispatch.
The PSO ensures that the proposed P and Q dispatches from the batteries reduce operating costs, and remain within feasible limits.
For every proposed BESS schedule, the SA method solves the power flow equations of the AC microgrid to check:
- That voltages stay within safe limits.
- That line currents do not exceed their thermal ratings.
- That the apparent power from the inverter does not surpass its rated capacity.
- That the SoC remains between the specified minimum and maximum bounds (10–90%).
- That the power limits of conventional generators are within the boundary constraints.
The objective function includes energy and maintenance costs and penalizes any violations of these constraints. Once evaluated, the resulting cost is returned to the PSO algorithm to inform the next iteration. The SA process is described below:
- 1.
- Hourly data preparation: For each time step , the following inputs are prepared:
- Active and reactive power demand at each node.
- Power generated by photovoltaic units.
- Charging/discharging values of active () and reactive () power for each battery, as proposed by the optimization stage.
- 2.
- Solving the power flow: The SA method is applied to estimate the voltage profile and line currents across the network. This is achieved by iteratively solving the nodal power balance equations based on the injected powers and system admittance.
- 3.
- Verification of operational constraints: After obtaining the electrical variables, the algorithm checks whether the candidate solution satisfies all technical constraints, including:
- Voltage limits at each bus.
- Thermal limits on line currents.
- Power limits of conventional generators.
- 4.
- Computation of operational cost: Once the power flow is solved for all 24 h, the total cost of operation is calculated. This includes:
- The cost of energy purchased from the grid or generated by diesel units.
- Maintenance costs associated with both batteries and conventional generators.
- 5.
- Penalty assessment: If any constraint is not met, a penalty is applied to the objective function to reflect the infeasibility of the solution. The penalized fitness value is used to guide the optimizer away from such scenarios.
- 6.
- Returning the fitness value: Finally, the penalized objective function, fitness function, is returned to the PSO algorithm, which uses this information to evaluate and update the performance of each particle in the population.
This methodology presents the following key features:
- Enables BESS units to deliver both active power support (P) and reactive power compensation (Q), enhancing energy balance and voltage stability.
- Considers both operational modes of the microgrid: GCM and IM; by incorporating appropriate control constraints within the mathematical model proposed in Section 2.
- Considers time-varying electricity prices, load demand, and solar PV generation profiles.
By coordinating the active and reactive power injection/absorption of the BESS, the strategy enhances the microgrid’s technical and economic performance, particularly during high-cost periods or when renewable generation is low.
4. Benchmark Optimization Algorithms: Selection and Calibration
To assess the performance of the proposed PSO-based strategy for optimal BESS operation in AC MGs, two state-of-the-art optimization techniques were selected as benchmark methods: the Crow Search Algorithm (CSA) [27] and the JAYA Algorithm (JAYA) [24]. Both methods have demonstrated high effectiveness in solving complex optimization problems in DER operation, including renewable generation scheduling, storage dispatch, and voltage control.
Three population-based optimization methods are considered to coordinate the BESS schedules. These algorithms were selected because they represent complementary search paradigms reported to be effective for nonconvex power system scheduling problems. The JAYA algorithm updates candidate solutions by moving them toward the current best and away from the current worst solution, the CSA-based exploration, and a fraction of nest replacement to escape local minima, and Particle Swarm Optimization models a swarm of agents that adapt their trajectories according to individual and global experience. Limiting the comparison to these three well-established families allows a focused analysis of their convergence behavior and solution quality in the proposed BESS scheduling framework, while maintaining a reasonable computational burden for the extensive set of scenarios and independent runs considered in this study.
The selection of PCSA and PJAYA is based on their ability to explore and exploit the search space efficiently, their proven convergence properties, and their widespread application in energy systems. These methods are recognized for producing high-quality solutions under multiple technical constraints, which makes them suitable candidates for benchmarking.
To ensure a fair and meaningful comparison, parallelized versions of CSA (PCSA) and JAYA (PJAYA) were implemented in this work. This adaptation allows all three algorithms, PPSO, PCSA, and PJAYA, to take advantage of modern multi-core computing architectures, reducing computation time and enabling consistent evaluation conditions across methods. Parallel execution is particularly relevant in this context due to the repetitive evaluation of power flows and constraints over 24 h horizons for each candidate solution [28].
To ensure fair and high-performance comparisons among the optimization methods evaluated in this study, all algorithms were independently tuned using an external calibration procedure based on the PSO strategy reported in [5]. This procedure was used to identify the parameter configuration that provides the best performance for each technique. The PSO employed for tuning used a swarm of 8 particles, a maximum of 300 generations, an inertia weight decreasing linearly from 1 to 0, and cognitive and social acceleration coefficients of 1.494, enabling an appropriate balance between exploration and exploitation.
For methodological fairness, all hyperparameters of PPSO, PCSA, and PJAYA were tuned using a single PSO-based procedure. In this tuning process, the population size and maximum number of iterations were allowed to vary within broad upper bounds (1000 individuals and 4000 iterations), but the final operating values were those selected by the tuning algorithm. Thus, the parameters reported in Table 1 (e.g., 1600, 3000, and 2000 iterations; populations of 100, 100, and 500) correspond to the optimized configurations obtained from this calibration step. All remaining algorithm-specific coefficients were also tuned within the recommended ranges provided in their original formulations. The same AC power-flow solver, the same fitness-penalization scheme, and the same computational hardware threads were used for every method, ensuring consistent evaluation conditions. Under this policy, the differences in convergence rate and wall-clock time reflect the intrinsic behavior of each tuned algorithm, providing a fair and transparent basis for comparison across GCM and IM scenarios.
Table 1.
Tuned parameters for PPSO, PCSA, and PJAYA optimization algorithms.
The optimized parameter values obtained for each method are summarized in the following table.
The optimization procedure presented in this work is modular, since the objective functions, network equations, and storage constraints are defined independently of a particular microgrid topology. As a result, the same framework can be applied to systems of different sizes and configurations by updating the network data, demand, and renewable profiles, and BESS parameters, while keeping the structure of the optimization problem and the solution algorithms unchanged.
5. Test System and Considerations
This study assesses the operational performance of a 33-node AC MG, adapted from the benchmark model presented in [29] and specifically configured to reflect the energy demand patterns and generation conditions of Medellín, Colombia. The system operates at a nominal voltage of 12.66 kV and a base power of 100 kVA, comprising 33 buses interconnected by 32 distribution lines. The network topology is illustrated in Figure 2. In this study, the battery energy storage system is modeled as the main flexibility resource of the microgrid, since it is already installed in the test system and can be dispatched within its power and state-of-charge limits to reshape the active power profile and provide reactive power support. This choice reflects the focus on improving the management of existing resources rather than increasing the installed generation capacity, while also allowing a clear assessment of how different metaheuristic algorithms affect the resulting operating cost.
Figure 2.
Topology of the 33-node AC MG [4]. Green arrow indicate the power injected from the distribution network into the microgrid, and the yellow arrow denote the power received by the microgrid during import conditions.
In the case study considered here, the transition between grid-connected and islanded operation is modeled as nonseamless, in accordance with the present protection and control philosophy of the real installation. Mode changes are executed via breaker operations that introduce a short interruption, rather than via a synchronized transfer supported by advanced grid-forming controls. This configuration differs from the seamless transition schemes reported in recent works, where coordinated control of converters and protection devices is used to preserve frequency and voltage continuity during transfers [20,21]. The adopted representation reflects a class of practical microgrids where legacy equipment or regulatory constraints still limit the implementation of fully seamless operation, and it provides a realistic context for evaluating the proposed cost-optimization strategy.
In the 33-node AC MG used in this study, Bus 1 operates as a flexible slack node, serving as the PCC (Point of Common Coupling) in GCM and as the main supply point via a dedicated diesel generator in IM. The diesel generator connected at the PCC has a rated capacity of 4000 kW, but its operation is constrained between 40% and 80% of its nominal power (1600–3200 kW) to ensure fuel efficiency and prolong equipment lifespan [25].
The MG incorporates real-world solar generation and load demand profiles for an average operation day provided by Empresas Públicas de Medellín (EPM) [30], along with solar irradiance data from NASA [19]. The normalized profiles of power demand and PV generation (in p.u.) are detailed in Figure 3.
Figure 3.
Average daily profiles of load demand and PV generation in Medellín [kW/kVA].
The system includes three PV generation units located at Bus 12 (1125 kW), Bus 25 (1320 kW), and Bus 30 (999 kW). All units operate under maximum power point tracking (MPPT) control throughout a 24 h simulation horizon.
In addition, three lithium-ion BESS units are installed at Buses 6, 14, and 31 [31]. The systems include: Type A (1000 kWh), Type B (1500 kWh) with 4 h charge/discharge cycles, and Type C (2000 kWh) with a 5 h cycle. All BESS units operate within a state-of-charge (SoC) window of 10–90%, with both initial and final SoC fixed at 50%, as recommended by IEEE standards [32].
The technical specifications of the system, including line resistances and reactances, as well as the active and reactive power demands and current limits at each node, are fully detailed in [33] to ensure transparency and reproducibility of the results. Voltage regulation across the network is maintained within a tolerance margin of with respect to the nominal voltage level, in compliance with the Colombian technical standard NTC 1340 [34].
Regarding economic considerations, the analysis focuses exclusively on operational costs. In GCM, electricity prices vary throughout the day, with a reference rate of $0.1302/kWh. The corresponding time-varying cost profile, expressed in per-unit (p.u.) values, is shown in Figure 4.
Figure 4.
Variable energy cost in p.u. for GCM.
In IM, where the system is powered solely by the diesel generator, a fixed cost of $0.2913/kWh is assumed, related to the Diesel price in Medellín-Colombia. In addition, operation and maintenance (O&M) costs are included at rates of $0.0019/kWh for photovoltaic (PV) generation and $0.0017/kWh for BESS operation.
It is worth noting that investment or capital costs associated with the BESS installations are not considered in this study, as these systems, like the PV generators, are assumed to be pre-installed components of the MG under analysis.
Initially, the simulations are performed over a single representative 24 h horizon, using actual daily profiles of demand and generation. The time series is not extended to multiple days. Both operating modes share the same physical system configuration, ensuring that performance differences are due solely to operating constraints.
This consistent testbed enables a rigorous comparison of optimization strategies. Changes in performance metrics, such as objective value, solution quality, and computational time, can be directly attributed to the operational mode and not to structural differences in system design.
To incorporate the effects of temporal variability in both power demand and PV generation, an analysis was conducted to evaluate their influence on the objective function under GCM and IM. This assessment is essential, as fluctuations in load and renewable generation significantly affect the operational performance and economic efficiency of the microgrid. By applying the proposed methodology, the system’s sensitivity to these variations was quantified, allowing for a more realistic evaluation of the optimization strategy.
The proposed optimization framework is not restricted to the 33-bus benchmark used in this work, since the objective functions, network equations, and storage constraints are formulated in a generic way. For the cost-minimization strategy to have a noticeable impact, the microgrid must include at least one grid-connected BESS with a significant usable state-of-charge window, time-varying tariffs or fuel costs, and sufficient variability in demand and renewable generation to enable energy arbitrage, peak shaving, and loss reduction. The magnitude of the economic benefit depends on both the number of installed BESS units and their aggregated energy capacity, which enlarge the feasible scheduling space but also increase the dimensionality of the decision vector and the computational effort required by the metaheuristic algorithms.
6. Results of the Simulations
The following section presents the results obtained with the proposed approach. It includes a comparative evaluation against benchmark optimization methods for active and reactive power scheduling of BESS in AC microgrids, with an emphasis on minimizing operational costs. Simulations were performed using MATLAB R2024a on a high-performance computing system equipped with an Intel Core i9-14900HX processor (24 cores, 32 threads, up to 5.8 GHz), an NVIDIA GeForce RTX 4090 GPU (16 GB GDDR6), and 32 GB of DDR5-5600 RAM, operating under a 64-bit Windows 11 environment. Two specific scenarios are analyzed: (i) Comparative Performance Assessment Against Benchmark Methods, and (ii) Sensitivity Analysis Under Demand and Solar Generation Uncertainty. These scenarios aim to evaluate both the effectiveness and the robustness of the proposed strategy under realistic operating conditions.
6.1. Comparative Performance Assessment Against Benchmark Methods
This section examines the robustness of the proposed optimization strategy under uncertainty in power demand and solar generation. The analysis is based on the natural variability observed in a representative average day in the city of Medellín-Colombia, incorporating fluctuations in both load and PV generation profiles. To carry out this evaluation, each optimization algorithm was executed 100 times under both GCM and IM. This repetition aims to assess the solution quality, result repeatability, and computational performance of each method. The impact on operational cost was analyzed to provide a comprehensive sensitivity assessment of the proposed methodology under realistic operating scenarios.
All operational costs reported in this work correspond to daily values. The term “cost reduction” refers strictly to the difference between the daily operational cost obtained with each optimization method and the baseline defined for the corresponding operating mode. In the grid-connected mode (GCM), the baseline is the operation without BESS. In the islanded mode (IM), where a BESS-free configuration is not technically feasible, the reductions are calculated as the difference between each method and the best-performing strategy. Annual savings are estimated only from the average daily reduction to ensure consistency across all comparisons and coherence between percentages, daily differences, and aggregated yearly values. The annualized cost is provided solely to indicate the average yearly savings that could be expected in each operating mode, offering a clear reference of the long-term economic impact of the proposed control strategies.
6.1.1. GCM Results and Analysis
Table 2 presents the performance of three optimization methods (PPSO, PCSA, and PJAYA) applied to the active and reactive power control of BESS in a 33-node MG under GCM. It reports operational cost (USD), including maximum and average reductions, standard deviation (%), and processing times (s). As a reference, the base case without BESS, considering only PV generators operating under MPPT, results in an operational cost of 6999.05 USD.
Table 2.
Cost performance metrics in the 33-node MG under demand and PV power variation in GCM.
The comparative results show that all three optimization methods, PPSO, PCSA, and PJAYA, effectively reduce operational costs in the 33-node microgrid under GCM, albeit with different levels of performance.
In terms of maximum reductions (i.e., best-case solution), PPSO achieved the best performance, yielding a cost saving of $199.68 (2.85%). PCSA followed closely, with a maximum saving of $192.32 (2.75%), while PJAYA recorded the lowest reduction, with $125.79 (1.80%).
The average reductions across 100 simulation runs followed a similar pattern. PPSO achieved an average daily cost saving of $198.31 (2.83%). PCSA reported an average reduction of $183.80 (2.63%), while PJAYA once again showed the lowest impact, with a cost saving of $120.64 (1.72%).
When extrapolated to a full year of operation, the impact of the proposed strategy becomes highly significant, with estimated annual savings of approximately $72,415.15 in operational costs. These findings highlight the significant economic advantages gained through effective management of active and reactive power in battery BESS within microgrids.
Figure 5 shows the percentage improvements achieved by the PPSO algorithm compared to PCSA and PJAYA in terms of energy cost. Compared to PCSA, PPSO improves energy cost by 0.11% in the best solution and 0.21% on average. Against PJAYA, the improvements reach 1.06% and 1.11%, respectively. On average, considering both comparisons, PPSO achieves a global improvement of 0.66%. These results highlight the most significant gain in average reduction, demonstrating a greater effectiveness and robustness of PPSO across multiple runs. This is particularly relevant from an operational perspective, as average performance reflects consistent improvements under varying conditions, rather than isolated optimal cases.
Figure 5.
PPSO improvements under GCM with respect to PCSA and PJAYA: best and average reductions in operational cost.
About standard deviation and processing times, PPSO outperformed the other methods, achieving the highest precision and fastest execution. It obtained the lowest variability, with standard deviations of 0.0200% and the shortest processing times: 109.27 s. This represents an average improvement of approximately 237.30 s (70.31%) in processing time compared to PCSA and PJAYA, reinforcing the suitability of PPSO for real-time applications.
Due to space limitations and to maintain focus on the most efficient strategy, the technical analysis of system constraints (voltage deviations, line currents, and battery operation) is presented exclusively for the PPSO methodology. Nevertheless, it is important to emphasize that all tested optimization methods (PCSA and PJAYA) also fully comply with the technical restrictions established in the model.
Figure 6 presents the maximum current loading of each distribution line during operation in GCM. The results confirm that all lines remain within their thermal capacity limits, with none exceeding the 100% threshold. The highest loading is observed on line 13, reaching 99.99%, followed by lines 30 and 3, with values close to 99.98% and 92.79%, respectively. Forteen lines operate above 85% of their rated capacity, highlighting areas of high utilization under the proposed scheduling strategy. Despite these high values, the methodology ensures compliance with thermal constraints across the network, guaranteeing safe and reliable operation.
Figure 6.
Validation of thermal loading limits per line operating below 100% in GCM.
Figure 7 shows the voltage deviation profile over 24 h during GCM operation. The deviations remain remarkably low throughout the entire period, with values consistently below 0.08%, peaking at only 0.075% during hour 11 and reaching a minimum of 0.0189% at hour 23. These values are almost negligible, as is visually evident in the figure, demonstrating an outstanding voltage profile across the network. This behavior highlights the effectiveness of the proposed strategy and particularly the contribution of BESS units through coordinated reactive power compensation. By supporting local voltage levels, the reactive power injections from the BESS help reduce nodal voltage fluctuations, improve overall voltage quality, and avoid stress on the main grid infrastructure.
Figure 7.
Voltage deviation profile over 24 h for GCM.
Figure 8 illustrates the hourly profiles of active, reactive, and apparent power for each BESS unit under GCM operation in p.u. The figure reveals an intelligent and coordinated use of the energy storage units, driven by variable energy cost, PV generation availability, and load demand.
Figure 8.
Hourly profile of active [kW/kVA], reactive [kVAr/kVA], and apparent [kVA/kVA] power for each BESS unit in per unit values in GCM.
Table 3 summarizes the per-unit parameters of the BESS converters using a base power of 100 kVA. For each storage unit, the nominal apparent power , the maximum charging power , and the maximum discharging power are expressed in p.u. Representing these quantities in per-unit greatly simplifies the interpretation of the converter capability, since it normalizes the ratings of the different BESS units and allows a direct comparison of their operating limits.
Table 3.
Per-unit BESS converter parameters used in the operational analysis.
The reactive-power limits are not fixed; instead, they depend on the instantaneous active-power exchange imposed by the converter capability curve, . As a result, the available reactive-power range narrows as increases and reaches its maximum when . This per-unit representation provides a clear and uniform basis for interpreting the P–Q operating profiles discussed in the manuscript.
During the early hours of the day (1–7 h), all batteries operate in charging mode with negative active power values, especially Battery A reaching up to p.u., taking advantage of the lower energy cost (around 0.72 p.u.) to store energy efficiently. This is reflected in the SoC profiles (Figure 9), where all units exhibit a continuous increase in their charge levels, with Battery A rising from 0.5 to approximately 0.9 p.u. by hour 7.
Figure 9.
State of charge [V/V] profiles of each BESS unit during GCM.
Throughout daylight hours (8–17 h), the active power of all batteries remains nearly static, suggesting a deliberate control strategy that keeps the SoC stable while maximizing the use of solar generation (peaking near 0.7 p.u. at 12 h). During this interval, the batteries do not actively inject or absorb significant active power, avoiding unnecessary cycling. Instead, they focus on providing reactive support: Battery A and Battery C maintain reactive power outputs above 3.5 p.u., close to their rated apparent power, ensuring voltage regulation and grid stability without compromising stored energy.
As the energy cost peaks between 17 h and 20 h (reaching up to 1.0 p.u.), the batteries shift to discharging mode. Batteries A and C inject active power (up to 3.94 p.u. and 2.87 p.u., respectively), while Battery B supports with more moderate values below 2 p.u. This discharge period helps minimize operational costs by reducing reliance on grid electricity when prices are highest.
During this stage, the BESS units also provide substantial reactive power support to sustain voltage profiles and relieve the reactive burden on the distribution grid, as the diesel generator is not operating in GCM. Battery A and Battery C, in particular, maintain reactive power injections above 3.7 p.u., operating close to their apparent power limits. This coordinated reactive power contribution not only enhances voltage regulation during peak demand and low solar generation hours, but also maximizes the technical utility of the inverters by exploiting their full capability in both active and reactive dispatch. Throughout the entire operation period, all BESS units maintain the required relationship between active and reactive power, ensuring that their apparent power limits are never exceeded.
The apparent power profiles confirm that all units operate within their capacity limits: Battery A at 4.0 p.u., Battery B at 2.5 p.u., and Battery C at 3.75 p.u. The proposed control achieves a cost-effective and technically sound strategy, prioritizing early charging, passive regulation during solar generation, and strategic discharging aligned with high-cost periods, all while respecting inverter and SoC constraints.
6.1.2. IM Results and Analysis
Table 4 presents the results obtained for the optimization methodologies when the microgrid operates in IM. It is important to note that, in the operation of the 33-node AC microgrid, it is not possible to run the system under a base case scenario without the presence of the BESS, since the configuration violates the power limits of the diesel generator, as shown in Reference [4]. This condition highlights that the islanded configuration always includes local storage provided by the BESS units, while the diesel generator alone is not sufficient to satisfy demand without violating its operational limits. Therefore, any previous reference to the impossibility of absorbing power in IM must be interpreted as a property of the diesel unit and the absence of an upstream grid, not as the absence of storage within the microgrid.
Table 4.
Cost performance metrics in the 33-node MG under demand and PV power variation in IM.
The diesel generator is modeled as a slack bus in the load-flow formulation, meaning that its active and reactive power outputs are adjusted to compensate for the mismatch between demand and the scheduled injections from PV and BESS units. Importantly, the slack active power is constrained to be nonnegative, , because the diesel unit is a distributed generator without energy-absorption capability. Thus, the slack bus does not act as an ideal bidirectional grid-forming source, and any surplus generation must be managed by curtailing PV output or adapting the BESS schedules, rather than by absorbing power at the diesel node. This modeling choice is intended to capture the behavior of a practical DG-based islanded microgrid.
The operational costs reported for the islanded microgrid correspond to a feasible daily operating point enabled by the BESS, since operating without batteries would require shedding approximately 15% of the load and curtailing 35% of the PV generation due to diesel generator, voltage, and line-current limits. Once feasibility is ensured, the optimization methods minimize the daily operational cost through coordinated P-Q control of the BESS. Based on 100 independent runs, PPSO achieves the best economic performance, obtaining average savings of 13.70 USD compared with PCSA and 200.53 USD compared with PJAYA. These improvements reflect PPSO’s superior capability to solve the nonlinear and highly constrained nature of the optimal BESS operation problem.
The comparative results confirm that all three optimization methods, PPSO, PCSA, and PJAYA, achieve effective reductions in operational costs when managing the 33-node microgrid under IM, although the magnitude and consistency of improvements vary across methods.
In terms of energy cost reduction, the proposed PPSO algorithm achieved the best performance, reaching the lowest operational cost of the microgrid in IM with $17,263.37, compared to $17,278.63 with PCSA and $17,435.48 with PJAYA. Moreover, when considering the average results from 100 independent simulations, PPSO once again stands out as the best strategy, obtaining the lowest mean daily cost of $17,264.93, outperforming PCSA ($17,278.63) and PJAYA ($17,465.46). These results confirm the superiority of PPSO in terms of economic efficiency, consistency, and robustness, consolidating it as the most effective and reliable optimization strategy among the benchmark methods.
Figure 10 illustrates the percentage improvements in operational cost obtained by PPSO compared to PCSA and PJAYA. With respect to PCSA, PPSO achieves a gain of 0.0870% in the best case and 0.0781% on average. Against PJAYA, the improvements are more significant, reaching 0.9807% (best) and 1.1426% (average). On average, PPSO achieves a global improvement of 0.6721% across both benchmarks, reinforcing its effectiveness under isolated operating conditions.
Figure 10.
PPSO improvements under IM concerning PCSA and PJAYA: best and average reductions in operational cost.
Regarding standard deviation and processing time, PPSO demonstrates a clear advantage. It achieved a variability of 0.2962%, higher than the other methods but still acceptable, and the shortest processing time, with an average of 100.20 s. This represents a reduction of approximately 237.53 s (or 70.33%) compared to the average processing time of PCSA and PJAYA, making PPSO particularly suitable for real-time applications in isolated microgrids, where responsiveness is critical.
To complement the analysis of computational performance in both operating modes of the microgrid (GCM and IM), we evaluated the effect of parallel processing on the PPSO and PSO algorithms. The PPSO required in average 168.57 s in sequential execution and 63.68 s in parallel mode, resulting in an acceleration factor of 2.65×. This improvement highlights the practical benefit of parallel computation for energy-management optimization, since independent solution evaluations can be processed simultaneously. Although the specific speed-up depends on the computing platform, the use of parallel execution, supported in this study by an Intel Core i9-14900HX with 32 GB RAM, proved effective in reducing computation time without affecting solution quality. This reduction is especially valuable for large-scale studies or scenarios with multiple BESS units, where the search space grows significantly and faster exploration becomes essential.
The results validate the use of PPSO for intelligent energy management in IM scenarios. The following analysis focuses on the technical constraints met by the proposed methodology in IM, aiming to demonstrate that the mathematical formulation is fully satisfied.
The results presented in the Figure 11 and Figure 12 confirm that the proposed PPSO-based methodology successfully meets the technical constraints related to current and voltage during IM operation of the MG. Specifically, the first figure shows that the thermal loading of all distribution lines remains below the 100% limit, ensuring that no overcurrent condition occurs under isolated conditions. Likewise, the second figure demonstrates that voltage deviations across the 24 h period remain well within the 10% permissible range. These results validate the effectiveness of the proposed strategy in maintaining safe and reliable operation of the MG under IM.
Figure 11.
Validation of thermal loading limits per line operating below 100% in IM configuration.
Figure 12.
Voltage deviation profile over 24 h for IM.
Figure 13 confirms that the proposed PPSO ensures compliance with the operational constraints of the diesel generator under IM. Throughout the 24 h period, the generator’s power output remains strictly within the allowed range of 1600 kW to 3200 kW.
Figure 13.
Validation of diesel generator power under IM. All values remain within the operational limits (1600–3200 kW).
Figure 14 illustrates the hourly active, reactive, and apparent power behavior of each BESS unit during islanded operation. The active power curves show that Battery A plays a critical role in peak supply support, injecting up to 4.0 p.u. at hour 21, precisely when PV generation is zero and demand remains high, as shown in Figure 3. During midday hours (10–15), when PV generation is at its peak (up to 0.7 p.u.), the BESS units predominantly absorb energy, particularly Battery A and Battery B, which register minimum active powers of p.u. and p.u., respectively.
Figure 14.
Hourly profile of active [kW/kVA], reactive [kVAr/kVA], and apparent [kVA/kVA] power for each BESS unit in per unit values in IM.
The reactive power subplot, shown in Figure 14, confirms that the three BESS units maintain stable compensation across the day. Battery A operates near its upper limit of 4.0 p.u., while Battery B remains within a narrower range around 2.1–2.5 p.u., and Battery C consistently delivers reactive support around 3.7–3.75 p.u.
Most importantly, the apparent power profile validates that all converters operate within their rated capacity. Battery A maintains a maximum value of 4.0 p.u., Battery B remains below 2.5 p.u., and Battery C stays under 3.75 p.u. at all times, thereby confirming full compliance with technical constraints defined in the model.
Figure 15 shows the SoC evolution for the three BESS units during the IM operation. All batteries operate within the allowed SoC range of 10% to 90%, ensuring safe and reliable performance. Battery A reaches its maximum charge at hour 14 and then discharges rapidly to support peak demand at hour 21, consistent with the active power injection observed in Figure 14. Battery B shows a deep discharge in the early hours and then recharges progressively until reaching its upper limit before hour 16. Battery C maintains a more stable profile, with moderate charging and discharging cycles.
Figure 15.
State of charge [V/V] profiles of each BESS unit during IM.
In islanded operation, autonomy is a fundamental performance dimension, since it indicates how long the microgrid can sustain local demand under fuel and storage constraints. The formulation adopted in this work focuses on minimizing daily operating cost and does not include an explicit autonomy index. Nevertheless, the obtained schedules can be interpreted in terms of the number of hours that the load profile can be supplied given the available BESS capacity and the diesel power and energy limitations. In regions where diesel supply is constrained or subject to logistical disruptions, it may be desirable to trade some fuel savings for extended autonomy by preserving higher minimum state-of-charge levels. Future research will explore multi-objective formulations that jointly minimize operating cost and maximize autonomy time, explicitly incorporating limitations on diesel availability in remote areas.
6.2. Sensitivity Analysis Under Demand and Solar Generation Uncertainty
This section evaluates the robustness of the proposed optimization strategy under uncertainty in load demand and PV generation. Rather than relying on a single deterministic profile, 100 daily scenarios were generated to reflect typical variations caused by user behavior and meteorological conditions. These scenarios enable a comprehensive analysis of the methodology’s ability to ensure system feasibility and cost-effectiveness under realistic operating conditions. Figure 16 and Figure 17 illustrate the resulting demand and PV generation profiles for Medellín, Colombia. These curves serve to represent the inherent uncertainty in both consumption and renewable generation, supporting the evaluation of their impact on system operation and planning.
Figure 16.
Active power demand profiles in Medellín, Colombia.
Figure 17.
Solar PV Generation Profiles in Medellín, Colombia.
The results confirm the strong adaptability of the proposed PPSO strategy under uncertain operating conditions. In the GCM, PPSO achieved an average cost reduction of 2.77%, outperforming the 2.39% obtained in the deterministic case based on a single representative day (presented in Section 6.1.1). This improvement reflects the optimizer’s ability to exploit the flexibility of grid interaction and respond effectively to daily fluctuations in generation and demand.
In the islanded mode, where operational flexibility is more constrained, PPSO still obtained an average cost reduction of 1.53%. Although slightly lower than the 1.62% achieved in the deterministic case, the difference is marginal (0.09 percentage points). This consistency is notable given the absence of external power support and the strict technical limitations of standalone operation.
The PPSO algorithm delivers stable and cost-effective solutions under variable scenarios.
7. Conclusions and Future Research
This work proposed an intelligent strategy for the active and reactive power management of BESSs in AC MG operating under both grid-connected and islanded conditions. The proposed method is based on a parallel Particle Swarm Optimization approach integrated with a Successive Approximation power flow algorithm in a master–slave structure. The methodology was designed to optimize the daily operation of BESS units, minimizing total operational costs while ensuring compliance with technical constraints and enhancing system efficiency.
Under deterministic conditions, using representative average daily profiles, the PPSO strategy achieved cost reductions of 2.39% in GCM and 1.62% in IM compared to the baseline operation without optimization. These results demonstrate the effectiveness of the proposed methodology in improving microgrid performance in both flexible and constrained scenarios.
Beyond its cost-saving capabilities, the PPSO strategy demonstrated higher consistency and computational efficiency under both operating modes. In the grid-connected mode, it achieved a remarkably low standard deviation of 0.0200%, with an average simulation time of 109.27 s. In islanded mode, despite tighter constraints, it maintained stable performance with a standard deviation of 0.2962% and a reduced execution time of 100.20 s. Compared to PCSA and PJAYA, which required over 330 s, PPSO proved significantly faster and more reliable. These results confirm its robustness and suitability for real-time applications in dynamic microgrid environments.
Furthermore, a sensitivity analysis was conducted using 100 scenarios incorporating realistic fluctuations in load demand and PV generation. In this context, the proposed strategy maintained its robustness, achieving an average cost reduction of 2.77% in the grid-connected mode and 1.53% in the islanded case.
From an academic perspective, this work contributes a hybrid and parallel optimization framework that effectively integrates metaheuristics and power flow solvers to address complex scheduling problems in modern microgrids. A key innovation lies in the explicit modeling and utilization of the power converters interfacing the BESS units, which enables coordinated control of both active and reactive power flows. This enhances the role of storage systems beyond mere energy balancing, allowing them to provide voltage support and improve the system reliability.
Moreover, the application of metaheuristic optimization methodologies in a high-dimensional decision space (spanning multiple time steps, devices, and operating modes) demonstrates the superior scalability and adaptability of the proposed strategy. The proposed PPSO method maintains robust performance under both grid-connected and islanded conditions, effectively navigating the trade-offs between cost, feasibility, and technical constraints. These results validate the methodological contribution and highlight its relevance for next-generation energy management in smart distribution networks.
In the industrial domain, the proposed strategy offers a viable tool for improving the energy management of AC microgrids, particularly in scenarios involving high renewable penetration and storage systems. Its capacity to deliver real-time operational cost savings while preserving system stability under uncertainty makes it highly applicable to smart grid environments and rural electrification projects.
The cost reductions achieved with the PPSO strategy have clear practical value. In a private microgrid, even moderate daily savings accumulate over time and lower the overall operating expenses, improving the financial performance of the system and reducing the reliance on diesel generation. In a community energy project, the impact is even more meaningful, since lower operating costs can be translated into more affordable electricity prices for the members and greater financial stability for the shared infrastructure. Improving the way batteries are managed strengthens both the technical operation and the economic sustainability of private and community-based microgrids.
Despite its demonstrated effectiveness, this study presents certain limitations. First, the current model does not incorporate battery aging or degradation dynamics, which could affect long-term operational planning and investment decisions. Second, the control of active and reactive power in distributed generation units was not integrated, potentially leading to the overestimation of the benefits solely attributed to BESS optimization.
The comparison in this study is restricted to three representative population-based methods to keep the experimental design tractable and to enable a detailed analysis of their behavior in the proposed BESS scheduling framework. Other mainstream optimizers, such as differential evolution, the grey wolf optimizer, the whale optimization algorithm, and related variants, have also demonstrated strong performance in power system applications. A systematic comparison including a larger set of algorithms would require an extended experimental protocol and additional parameter studies, which are beyond the present scope. These methods are therefore identified as candidates for future extensions of the proposed framework.
Future research will address these aspects by incorporating degradation-aware cost models, extending power control capabilities to distributed generation, and exploring multi-objective formulations that include environmental impact metrics and system reliability indicators; also, future work will extend the proposed framework to coordinate the operation of the BESS with synchronous generators and distributed generators providing reactive power, so that alternative control architectures and different sources of flexibility can be evaluated under the same optimization scheme.
An interesting extension of this work is the development of a decision-support tool that combines the proposed optimization framework with a parametric analysis of key microgrid characteristics, such as storage capacity, renewable penetration, and tariff structures. Such a tool would allow planners to relate storage investment and other design decisions to expected operating cost reductions and technical performance indicators for a wide range of microgrid configurations.
Finally, a natural future extension of this study is to evaluate a grid-forming BESS configuration, taking advantage of the flexibility of the proposed model, which already allows for assigning the slack role to any device by specifying its active and reactive capability limits. This will enable comparing diesel-based and BESS-based grid-forming strategies within the same optimization framework and assessing their impacts on microgrid performance.
Author Contributions
Conceptualization, D.S.-V., L.F.G.-N. and O.D.M.; methodology, D.S.-V., L.F.G.-N. and O.D.M.; software, D.S.-V., L.F.G.-N. and O.D.M.; formal analysis, D.S.-V., L.F.G.-N. and O.D.M.; investigation, D.S.-V., L.F.G.-N. and O.D.M.; data curation, D.S.-V., L.F.G.-N. and O.D.M.; writing—original draft preparation, D.S.-V., L.F.G.-N. and O.D.M.; writing—review and editing, D.S.-V., L.F.G.-N. and O.D.M.; visualization, D.S.-V., L.F.G.-N. and O.D.M.; supervision, D.S.-V., L.F.G.-N. and O.D.M.; project administration, D.S.-V., L.F.G.-N. and O.D.M.; funding acquisition, D.S.-V. and L.F.G.-N.; translation, O.D.M. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Data Availability Statement
The original contributions presented in this study are included in this article Further inquiries can be directed to the corresponding author.
Acknowledgments
We are grateful for the support provided by Thematic Network 723RT0150 entitled Red para la integración a gran escala de energías renovables en sistemas eléctricos (RIBIERSE-CYTED) (Network for the large-scale integration of renewable energies into power systems) funded by the Ibero-American Program of Science and Technology for Development (CYTED) under its 2022 call for thematic networks. During the preparation of this work, the authors used ChatGPT 4o and Grammarly 1.143.3.0 to improve the writing style. After using this tool/service, the authors reviewed and edited the content as needed and take full responsibility for the content of the publication.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Ejuh Che, E.; Roland Abeng, K.; Iweh, C.D.; Tsekouras, G.J.; Fopah-Lele, A. The impact of integrating variable renewable energy sources into grid-connected power systems: Challenges, mitigation strategies, and prospects. Energies 2025, 18, 689. [Google Scholar] [CrossRef]
- Babayomi, O.; Li, Y.; Zhang, Z.; Park, K.B. Advanced control of grid-connected microgrids: Challenges, advances and trends. IEEE Trans. Power Electron. 2025, 40, 7681–7708. [Google Scholar] [CrossRef]
- Dahrouj, H.; Bansal, R.C.; Tawfik, H.M. An Overview of the Prospects and Challenges of Using Artificial Intelligence for Energy Management Systems in Microgrids. arXiv 2025, arXiv:2505.05498. [Google Scholar]
- Sanin-Villa, D.; Figueroa-Saavedra, H.A.; Grisales-Noreña, L.F. Efficient BESS Scheduling in AC Microgrids via Multiverse Optimizer: A Grid-Dependent and Self-Powered Strategy to Minimize Power Losses and CO2 Footprint. Appl. Syst. Innov. 2025, 8, 85. [Google Scholar] [CrossRef]
- Llanos-Pino, M.A.; Grisales-Noreña, L.F.; Sanin-Villa, D.; Montoya, O.D.; Hernández, J.C. Optimizing economic and operational performance in AC microgrids: An intelligent energy management strategy for BESS using the Generalized Normal Distribution Optimizer. Results Eng. 2025, 27, 106005. [Google Scholar] [CrossRef]
- Grisales-Noreña, L.F.; Montoya, O.D.; Hernández, J.C. An efficient EMS for BESS in monopolar DC networks with high penetration of renewable generation: A convex approximation. Batteries 2023, 9, 84. [Google Scholar] [CrossRef]
- Vaish, J.; Tiwari, A.K.; Siddiqui, K.M. Optimization of micro grid with distributed energy resources using physics based meta heuristic techniques. IET Renew. Power Gener. 2025, 19, e12699. [Google Scholar] [CrossRef]
- Vazquez, N.; Yu, S.S.; Chau, T.K.; Fernando, T.; Iu, H.H.C. A fully decentralized adaptive droop optimization strategy for power loss minimization in microgrids with PV-BESS. IEEE Trans. Energy Convers. 2018, 34, 385–395. [Google Scholar] [CrossRef]
- Lobos-Cornejo, S.; Grisales-Noreña, L.F.; Andrade, F.; Montoya, O.D.; Sanin-Villa, D. Smart Energy Strategy for AC Microgrids to Enhance Economic Performance in Grid-Connected and Standalone Operations: A Gray Wolf Optimizer Approach. Sci 2025, 7, 73. [Google Scholar] [CrossRef]
- Gao, J.T.; Shih, C.H.; Lee, C.W.; Lo, K.Y. An active and reactive power controller for battery energy storage system in microgrids. IEEE Access 2022, 10, 10490–10499. [Google Scholar] [CrossRef]
- Kang, W.; Chen, M.; Li, B.; Chen, F.; Lai, W.; Lin, H.; Zhao, B. Distributed reactive power control and SOC sharing method for battery energy storage system in microgrids. IEEE Access 2019, 7, 60707–60720. [Google Scholar] [CrossRef]
- Sbordone, D.A.; Martirano, L.; Falvo, M.C.; Chiavaroli, L.; Di Pietra, B.; Bertini, I.; Genovese, A. Reactive power control for an energy storage system: A real implementation in a Micro-Grid. J. Netw. Comput. Appl. 2016, 59, 250–263. [Google Scholar] [CrossRef]
- Grisales-Noreña, L.F.; Vega, H.P.; Montoya, O.D.; Botero-Gómez, V.; Sanin-Villa, D. Cost Optimization of AC Microgrids in Grid-Connected and Isolated Modes Using a Population-Based Genetic Algorithm for Energy Management of Distributed Wind Turbines. Mathematics 2025, 13, 704. [Google Scholar] [CrossRef]
- Hermann, A.; Wu, Q.; Huang, S.; Nielsen, A.H. Convex relaxation of optimal power flow in distribution feeders with embedded solar power. Energy Procedia 2016, 100, 43–49. [Google Scholar] [CrossRef]
- Gan, L.; Li, N.; Topcu, U.; Low, S.H. Exact convex relaxation of optimal power flow in radial networks. IEEE Trans. Autom. Control 2014, 60, 72–87. [Google Scholar] [CrossRef]
- Datta, J.; Das, D. Energy management of multi-microgrids with renewables and electric vehicles considering price-elasticity based demand response: A bi-level hybrid optimization approach. Sustain. Cities Soc. 2023, 99, 104908. [Google Scholar] [CrossRef]
- Wang, K.; Huang, Y.; Liu, Y.; Huang, T.; Zang, S. A Review of Optimization Scheduling for Active Distribution Networks with High-Penetration Distributed Generation Access. Energies 2025, 18, 4119. [Google Scholar] [CrossRef]
- Shi, J.; Hu, S.; Fu, R.; Zhang, Q. Convex Optimization and PV Inverter Control Strategy Based Research on Active Distribution Networks. Energies 2025, 18, 1793. [Google Scholar] [CrossRef]
- Sanin-Villa, D.; Grisales-Noreña, L.F.; Montoya, O.D. Coordinated Active–Reactive Power Scheduling of Battery Energy Storage in AC Microgrids for Reducing Energy Losses and Carbon Emissions. Sci 2025, 7, 147. [Google Scholar] [CrossRef]
- dos Santos Serra, A.W.; Oliveira, H.A.; de Souza Ribeiro, L.A.; de Matos, J.G.; Oliveira, A.C.; Saavedra, O.R. Mission-critical microgrids: Strategies for safe and reliable operations. Electr. Power Syst. Res. 2025, 245, 111625. [Google Scholar] [CrossRef]
- Souza, M.E.T.; Freitas, L.C.G. Grid-connected and seamless transition modes for microgrids: An overview of control methods, operation elements, and general requirements. IEEE Access 2022, 10, 97802–97834. [Google Scholar] [CrossRef]
- Figueroa-Saavedra, H.A.; Sanin-Villa, D.; Grisales-Noreña, L.F. A Tuned Parallel Population-Based Genetic Algorithm for BESS Operation in AC Microgrids: Minimizing Operational Costs, Power Losses, and Carbon Footprint in Grid-Connected and Islanded Topologies. Electricity 2025, 6, 45. [Google Scholar] [CrossRef]
- Bjaoui, M.; Khemiri, K.; Khemissi, L.; Djebali, R.; Sellami, A. Optimized Energy Management Strategy for Non-Autonomous Microgrids Using Crow Search Optimization. In Proceedings of the 2025 15th International Renewable Energy Congress (IREC), Hammamet, Tunisia, 2–4 February 2025; IEEE: Piscataway, NJ, USA, 2025; pp. 1–6. [Google Scholar]
- Vaka, S.S.K.R.; Matam, S.K. Optimal sizing and management of battery energy storage systems in microgrids for operating cost minimization. Electr. Power Compone. Syst. 2021, 49, 1319–1332. [Google Scholar] [CrossRef]
- Issa, M.; Ibrahim, H.; Hosni, H.; Ilinca, A.; Rezkallah, M. Effects of Low Charge and Environmental Conditions on Diesel Generators Operation. Eng 2020, 1, 137–152. [Google Scholar] [CrossRef]
- Grisales-Norena, L.F.; Sanin-Villa, D.; Montoya, O.D. Optimal integration of PV generators and D-STATCOMs into the electrical distribution system to reduce the annual investment and operational cost: A multiverse optimization algorithm and matrix power flow approach. e-Prime-Adv. Electr. Eng. Electron. Energy 2024, 9, 100747. [Google Scholar] [CrossRef]
- Dey, B.; Bhattacharyya, B.; Srivastava, A.; Shivam, K. Solving energy management of renewable integrated microgrid systems using crow search algorithm. Soft Comput. 2020, 24, 10433–10454. [Google Scholar] [CrossRef]
- Grisales-Noreña, L.; Cortés-Caicedo, B.; Montoya, O.D.; Sanin-Villa, D.; Gil-González, W. Integration of BESS in grid connected networks for reducing the power losses and CO2 emissions: A parallel master-stage methodology based on PDVSA and PSO. J. Energy Storage 2024, 87, 111355. [Google Scholar] [CrossRef]
- Baran, M.; Kelley, A. A branch-current-based state estimation method for distribution systems. IEEE Trans. Power Syst. 1995, 10, 483–491. [Google Scholar] [CrossRef]
- Sinergox Database. XM SA ESP. 2022. Available online: https://sinergox.xm.com.co/Paginas/Home.aspx (accessed on 7 February 2025).
- Montoya, O.D.; Serra, F.M.; De Angelo, C.H. On the Efficiency in Electrical Networks with AC and DC Operation Technologies: A Comparative Study at the Distribution Stage. Electronics 2020, 9, 1352. [Google Scholar] [CrossRef]
- Hossain Lipu, M.S.; Hannan, M.A.; Hussain, A.; Ayob, A.; Saad, M.H.M.; Muttaqi, K.M. State of Charge Estimation in Lithium-Ion Batteries: A Neural Network Optimization Approach. Electronics 2020, 9, 1546. [Google Scholar] [CrossRef]
- Grisales-Noreña, L.; Cortés-Caicedo, B.; Montoya, O.D.; Hernandéz, J.; Alcalá, G. A battery energy management system to improve the financial, technical, and environmental indicators of Colombian urban and rural networks. J. Energy Storage 2023, 65, 107199. [Google Scholar] [CrossRef]
- El Instituto Colombiano de Normas Técnicas y Certificación (ICONTEC). Tensiones y Frecuencia Nominales en Sistemas de Energía Eléctrica En Redes de Servicio Público NTC 1340; ICONTEC: Bogotá, Colombia, 2004. [Google Scholar]
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. |
© 2025 by the authors. Published by MDPI on behalf of the International Institute of Knowledge Innovation and Invention. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).