Algorithmic Optimization of battery energy storage system in Microgrid Substations

In my research, I focus on the algorithmic optimization of battery energy storage system operations within DC microgrid substations. The primary challenge I address is the multi-objective optimization of energy management systems that integrate photovoltaic generation units operating at maximum power points. My work covers both islanded and grid-connected DC microgrid scenarios, with a particular emphasis on the battery energy storage system as a critical component for ensuring power balance and system stability.

I construct an integrated mathematical model that encompasses three core optimization objectives: minimizing operational costs, reducing energy transmission losses within the DC microgrid, and minimizing total carbon emissions from conventional generation units. This model is designed to overcome the limitations of existing single-objective frameworks by providing a comprehensive techno-economic-environmental assessment. To solve this complex problem, I introduce three parallel metaheuristic optimization algorithms: Parallel Particle Swarm Optimization (PPSO), Parallel Vortex Search (PVS), and Parallel Ant Lion Optimizer (PALO). These algorithms work in conjunction with a successive approximation method to achieve dynamic hour-level power flow optimization and multi-objective collaborative evaluation.

Model Formulation

My proposed dynamic optimization model for battery energy storage system energy management integrates three distinct objective functions. The first objective focuses on minimizing operational costs, the second on minimizing network power losses, and the third on minimizing environmental emissions. This multi-objective framework systematically optimizes the economic, technical, and environmental performance of the DC microgrid.

The operational cost model, which I define as Ecost, includes the cost of purchasing power from conventional generators and the maintenance costs of photovoltaic distributed generation and the battery energy storage system. Equation (1) calculates the total power purchase cost from conventional generators in each time period t.

$$ C_{EE}(t) = \sum_{i \in N} [C_{CG_i}(t) \times P_{CG_i}(t)] $$

Where \( C_{EE}(t) \) is the total power purchase cost in period t, \( C_{CG_i}(t) \) is the unit energy cost of a conventional generator at bus i in period t, and \( P_{CG_i}(t) \) is the active power generated by that generator in period t. For grid-connected microgrids, this cost reflects the price of electricity purchased from the main grid, while for islanded microgrids, it corresponds to the fuel cost of diesel generators.

The maintenance costs for photovoltaic distributed generation and the battery energy storage system are given by Equation (2).

$$ C_M(t) = \sum_{i \in N} [C_{MDG_i} \times P_{DG_i}(t) + C_{MB_i} \times P_{B_i}(t)] $$

In this equation, \( C_{MDG_i} \) and \( C_{MB_i} \) are the unit maintenance costs for the photovoltaic array and the battery energy storage system, respectively. \( P_{DG_i}(t) \) is the actual power generated by the distributed generator, and \( P_{B_i}(t) \) is the charging or discharging power of the battery energy storage unit at bus i in period t. The total operating cost C(t) is the sum of these two cost components, as shown in Equation (3).

$$ C(t) = C_{EE}(t) + C_M(t) $$

The first objective function, OF1, which I formulate for a 24-hour economic dispatch model, aims to minimize the total system operating cost over the entire scheduling period. This is expressed mathematically in Equation (4).

$$ OF_1 = \min\left[\sum_{t=1}^{24} C(t)\right] $$

The second objective relates to energy losses. I calculate the system’s power loss, \( P_{loss}(t) \), in time period t using Equation (5). This model accounts for the power contributions from conventional generators, photovoltaic sources, and the battery energy storage system, as well as the load demand at each bus.

$$ P_{loss}(t) = \sum_{i \in N} [P_{CG_i}(t) + P_{DG_i}(t) \pm P_{B_i}(t) – P_{d_i}(t)] = \sum_{i \in N} \left[\sum_{j \in N} G_{ij} \times U_i(t) \times U_j(t) – G_{i0} \times U_i^2(t)\right] $$

Where \( P_{d_i}(t) \) is the load demand at bus i, \( U_i(t) \) and \( U_j(t) \) are the voltage magnitudes at buses i and j, and \( G_{ij} \) is the conductance between these buses. The second objective function, OF2, which aims to minimize total energy losses over the 24-hour period, is defined in Equation (6).

$$ OF_2 = \min\left[\sum_{t=1}^{24} P_{loss}(t)\right] $$

The third objective function focuses on minimizing CO2 emissions from conventional generation units. Since photovoltaic distributed generation is a zero-emission technology, its contribution to the emission calculation is excluded. I quantify the total carbon emissions in each period t using Equation (7).

$$ E(t) = \sum_{i=1}^{n} [\gamma_{CG_i} \times P_{CG_i}(t)] $$

Here, n is the total number of conventional generators, and \( \gamma_{CG_i} \) is the CO2 emission intensity coefficient for the generator at bus i, which is assigned based on the fuel type. To synthesize these three objectives, I define an overall optimization problem.

Constraint Boundary Conditions

My optimal energy management model for the DC microgrid is subject to several critical technical and operational constraints. These constraints, which include power balance, generator limits, battery storage limits, and network limits, are essential for ensuring the feasible and safe operation of the battery energy storage system and the entire microgrid.

The first important constraint is the power balance, detailed in Equation (8). This equation must be satisfied for all buses and time steps in the scheduling horizon.

$$ P_{CG_i}(t) + P_{DG_i}(t) \pm P_{B_i}(t) – P_{d_i}(t) = U_i(t) \times \sum_{j \in N} G_{ij} \times U_j(t) \quad \forall i,j \in N, \forall t \in H $$

Equation (9) defines the minimum and maximum allowable power generation limits for conventional generators at each bus in the DC microgrid.

$$ P_{CG_i}^{min} \leq P_{CG_i}(t) \leq P_{CG_i}^{max} \quad \forall i \in N, \forall t \in H $$

Where \( P_{CG_i}^{min} \) and \( P_{CG_i}^{max} \) are the lower and upper generation limits for the conventional generator at bus i.

The power output limits for photovoltaic distributed generators are given in Equation (10). These limits may vary with time due to solar irradiance and weather conditions.

$$ P_{DG_i}^{min}(t) \leq P_{DG_i}(t) \leq P_{DG_i}^{max}(t) \quad \forall i \in N, \forall t \in H $$

For the battery energy storage system, Equation (11) constrains the charging and discharging power at each bus i in time period t.

$$ P_{B_i}^{char\_max} \leq P_{B_i}(t) \leq P_{B_i}^{disch\_max} \quad \forall i \in N, \forall t \in H $$

The specific maximum charging and discharging power limits are calculated using Equations (12) and (13), respectively.

$$ P_{B_i}^{char\_min} = -\frac{C_{B_i}}{t_{cB_i}} \quad \forall i \in N $$

$$ P_{B_i}^{disch\_max} = \frac{C_{B_i}}{t_{dB_i}} \quad \forall i \in N $$

In these equations, \( C_{B_i} \) is the nominal capacity of the battery energy storage system at bus i, while \( t_{cB_i} \) and \( t_{dB_i} \) are the charging and discharging times, respectively.

A critical aspect of battery energy storage system modeling is the state of charge (SOC). I track the SOC of each battery unit using Equation (14).

$$ S_{B_i}(t) = S_{B_i}(t-1) – [\phi_{B_i} \times P_{B_i}(t)] \times \Delta t \quad \forall i \in N, \forall t \in H $$

Where \( S_{B_i}(t) \) is the state of charge at time t, and \( \phi_{B_i} \) is the charge/discharge factor calculated from Equation (15).

$$ \phi_{B_i} = \frac{1}{t_{cB_i} \times P_{B_i}^{char\_min}} = \frac{1}{t_{dB_i} \times P_{B_i}^{disch\_max}} \quad \forall i \in N, \forall t \in H $$

To ensure the battery energy storage system operates within safe and efficient bounds, I set fixed initial and final states of charge. These are given in Equations (16) and (17). In my study, the initial and final SOC for each battery are set to 50% of the rated capacity.

$$ S_{B_i}(1) = S_{0i} \quad \forall i \in N $$

$$ S_{B_i}(24) = S_{fi} \quad \forall i \in N $$

Additionally, I impose dynamic constraints on the real-time state of charge to prevent overcharging and deep discharging, as shown in Equation (18).

$$ S_i^{min} \leq S_{B_i}(t) \leq S_i^{max} \quad \forall i \in N, \forall t \in H $$

For the power network, I enforce voltage limits and current limits using Equations (19) and (20). These constraints are crucial for maintaining power quality and preventing thermal overloads in the DC microgrid.

$$ U_i^{min} \leq U_i(t) \leq U_i^{max} \quad \forall i \in N, \forall t \in H $$

$$ I_{ij}(t) = \frac{|U_i(t) – U_j(t)|}{R_{ij}} \leq I_{ij}^{max} \quad \forall i,j \in N, \forall t \in H $$

To handle all these constraints within my optimization model, I formulate a fitness function, FF, in Equation (21). This function combines the objective function value with a penalty term to discourage constraint violations.

$$ FF = FO_i + \beta \times PF \quad \forall i \in 1,2,3 $$

Here, \( FO_i \) is one of the three objective functions, \( \beta \) is a penalty coefficient set to 1000, and \( PF \) is a penalty factor based on the degree of constraint violation.

Microgrid Structure

To test my proposed optimization framework, I use a 33-node DC microgrid test system. The system includes 32 lines, one conventional generator, and multiple loads. The base voltage of the test system is 12.66 kV, the base power is 100 kW, and the nominal energy of the battery energy storage system is 200 kWh. This standard test system allows for a rigorous comparison of different optimization algorithms. I use parameter values and network topology that are typical for such studies. The parameters for the DC microgrid include line resistances, load powers, and maximum allowable currents for each branch, which are critical for my optimization model. The typical daily load curve for this microgrid exhibits a bimodal characteristic, with peaks in the morning and evening. The valley load is significantly lower, creating a substantial challenge for optimal energy management.

Algorithmic Approach

I propose three heterogeneous master-slave architecture algorithms for optimizing the operation of the battery energy storage system in the DC microgrid. My approach aims to simultaneously improve the system’s economic, technical, and environmental performance. In the master phase, I employ three parallel metaheuristic optimization algorithms: Parallel Particle Swarm Optimization, Parallel Vortex Search, and Parallel Ant Lion Optimizer. These algorithms are chosen for their proven effectiveness in solving optimal power flow problems in DC networks. In the slave phase, I integrate a time-varying dynamic power flow calculation model, which uses an adaptive strategy to balance global exploration and local exploitation. This dual-phase architecture enhances both the solution quality and the computational efficiency of the energy management system.

Continuous Encoding

For the optimization of the battery energy storage system, I propose a continuous encoding scheme. This encoding method uses a vector of size \( 1 \times (N_B \times |H|) \), where \( N_B \) is the number of batteries in the microgrid and \( |H| \) is the total number of time steps in the optimization horizon. This vector precisely describes the operational state of each battery unit over time. The coding matrix records the hourly state of charge trajectory for each battery over the entire operating cycle. According to the technical constraints, the initial and final SOC of all batteries are strictly set to 50% of rated capacity. This structured encoding method enables continuous monitoring of the battery operational state over a discretized time dimension, providing a feasible solution space for the optimization algorithms.

Parallel Optimization Algorithms

My master optimization phase focuses on the dynamic scheduling of the battery energy storage system. I generate candidate solutions using the continuous encoding mechanism and systematically evaluate their impact on the multi-objective functions. Given the continuous and nonlinear nature of this optimization problem, I select three metaheuristic algorithms known for their strong performance in DC grid optimal power flow: Parallel Ant Lion Optimizer, Parallel Vortex Search, and Parallel Particle Swarm Optimization. All three algorithms feature swarm intelligence and are designed to reduce the computational time of the optimization process.

To achieve a breakthrough in computational efficiency, I reconfigure the classical algorithm architectures into parallel versions. These parallelized versions preserve the global search capabilities of the original algorithms while enabling concurrent evaluation of population individuals through a distributed computing architecture. This overcomes the efficiency bottlenecks of traditional serial computing in complex optimization scenarios, allowing the algorithms to handle high-dimensional solution spaces while meeting the time-sensitive requirements of real-time scheduling.

Parallel Ant Lion Optimizer (PALO): The iterative process of my Parallel Ant Lion Optimizer algorithm begins by reading network basic data, including line parameters, bus configurations, and battery energy storage system parameters. During initialization, it randomly generates the initial ant lion population based on the continuous encoding rules. Then, it enters a fitness evaluation stage using a parallel computing architecture to accelerate optimization. This is done by allocating multiple computing cores of the CPU to synchronously compute the fitness function for all individuals in the population. The parallelization reduces computational resource requirements.

Parallel Vortex Search (PVS): The Parallel Vortex Search algorithm simulates the adaptive evolution mechanism of vortex structures in fluid dynamics. It generates an initial population by creating a non-concentric hypersphere network with dynamic contraction. During execution, the algorithm dynamically shrinks the search radius and moves its center. The center coordinate update strategy is directly related to the spatial distribution of the current optimal solution. The Parallel Vortex Search algorithm uses a convergence criterion identical to that of the Parallel Ant Lion Optimizer.

Parallel Particle Swarm Optimization (PPSO): This standard swarm intelligence algorithm draws inspiration from the collaborative behavior of biological groups like bird flocks. It simulates a distributed search process in the solution space, progressively approaching the optimal solution region by leveraging individual cognitive experience and group social information sharing mechanisms. In my improved Parallel Particle Swarm Optimization algorithm, the fitness evaluation of population individuals is performed using a parallel adaptive local optimization framework.

Results and Discussion

I compared the effectiveness of my three optimization methods in the context of an islanded DC microgrid. All numerical experiments were conducted on the MATLAB 2022a simulation platform. To objectively evaluate each algorithm’s performance, I performed 100 independent repeated experiments for each method. The analysis was conducted using a baseline comparison method, measuring the performance of the three algorithms in a single-objective optimization mode (operational cost, energy transmission loss, and carbon emission intensity).

The results show that the Parallel Vortex Search algorithm outperforms the other two algorithms in the islanded DC microgrid scenario. Specifically, the Parallel Vortex Search algorithm achieved the best comprehensive performance.

Performance Comparison of Optimization Algorithms in Islanded DC Microgrid
Metric PALO PVS PPSO
Cost Reduction (%) 0.0052 0.0076 0.0041
Energy Loss Reduction (%) 8.2341 10.8464 7.9853
CO2 Emission Reduction (%) 0.0583 0.0788 0.0502

The table above summarizes the average optimization rates achieved by each algorithm over 100 runs. The Parallel Vortex Search algorithm achieved average optimization rates of 0.0076% for cost, 10.8464% for energy losses, and 0.0788% for CO2 emissions. Compared to the Parallel Ant Lion Optimizer and Parallel Particle Swarm Optimization algorithms, the Parallel Vortex Search algorithm demonstrated a consistent improvement across all three objectives. The minimum performance improvement of the Parallel Vortex Search algorithm over the other two was 0.0135% in energy cost, 10.9825% in network losses, and 0.0796% in carbon emissions. In terms of average optimization effectiveness, the Parallel Vortex Search algorithm showed a continuous improvement of 0.0076%, 10.8464%, and 0.0788% in the three indicators, respectively, highlighting its comprehensive advantage in economic-technical-environmental multi-objective collaborative optimization.

The superior performance of the Parallel Vortex Search algorithm can be attributed to its unique dynamic contraction mechanism of the hypersphere search space. This mechanism provides an excellent balance between exploration and exploitation, allowing the algorithm to efficiently search the solution space for the optimal scheduling strategy for the battery energy storage system. The parallel implementation further accelerates the algorithm, enabling it to handle the large-scale, time-dependent optimization problem effectively.

The Parallel Particle Swarm Optimization algorithm, while faster in some cases, often converged to local optima, particularly when dealing with the complex constraints of the battery energy storage system’s state of charge. The Parallel Ant Lion Optimizer demonstrated good exploration capabilities but sometimes struggled with fine-tuning near the optimal solution, leading to slightly higher losses and costs compared to the Parallel Vortex Search algorithm.

The following schematic illustrates the iterative process of the proposed parallel optimization algorithms for the battery energy storage system in the DC microgrid.

Conclusion

In my research, I successfully developed a comprehensive algorithmic optimization framework for battery energy storage systems in DC microgrid substations. My work addresses the critical need for multi-objective optimization in modern energy systems, moving beyond traditional single-objective approaches. I constructed a versatile mathematical model applicable to both grid-connected and islanded DC microgrids. This model simultaneously optimizes operational costs, energy losses, and CO2 emissions, thereby providing a holistic solution for techno-economic-environmental optimization.

The development of a parallel algorithm cluster, including Parallel Particle Swarm Optimization, Parallel Ant Lion Optimizer, and Parallel Vortex Search, represents a significant advancement in computational performance for battery energy storage system scheduling. The integration of an hour-level dynamic power flow calculation module with these algorithms enhances the practical applicability of the proposed energy management system. In empirical testing using a standard islanded microgrid model, the Parallel Vortex Search algorithm demonstrated superior performance. It achieved average optimization rates of 0.0076% in cost, 10.8464% in energy losses, and 0.0788% in CO2 emissions. These results confirm that the Parallel Vortex Search algorithm is particularly effective for the complex, constrained optimization problem of battery energy storage system scheduling.

My model is designed with cross-national applicability, capable of adapting to varying national energy costs and equipment parameters. It also supports future expansions to include dynamic scheduling of renewable energy sources and spatial reconfiguration of equipment. The current study has some limitations, primarily focusing on a fixed maximum power point operation for photovoltaic generation and a single-objective optimization mode for each run. Future work will focus on developing fully multi-objective dynamic algorithms and joint models that optimize both equipment layout and operation. This will further enhance the system efficiency of microgrids and solidify the role of the battery energy storage system as a key enabler of the global energy transition.

Scroll to Top