Algorithmic Optimization of Battery Energy Storage Systems in DC Microgrid Substations

In this study, I address the optimization of battery energy storage systems within both islanded and grid-connected direct current (DC) microgrids that integrate photovoltaic generation units operating at their maximum power points. I propose a comprehensive multi-objective optimization approach designed to enhance the operational efficiency of these systems. My method integrates a mathematical model encompassing three core objectives: minimizing operational costs, reducing energy transmission losses within the DC microgrid, and minimizing the total carbon emissions from conventional generation units.

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). Using a successive approximation method, I dynamically optimize hourly power flows and perform a multi-objective collaborative evaluation. I selected typical Colombian islanded and grid-connected microgrid systems as test scenarios. For each algorithm, I conducted 100 repeated simulations on the MATLAB platform to comprehensively evaluate the performance of the energy management system from three key dimensions: solution quality, result stability, and computational efficiency. In the islanded microgrid scenario, the Parallel Vortex Search algorithm demonstrated superior overall performance, achieving average optimization rates of 0.0076% in cost, 10.8464% in energy loss reduction, and 0.0788% in CO₂ emissions reduction.

Mathematical Model Formulation

I developed a dynamic optimization model for energy management of battery energy storage systems in DC microgrids. This model integrates three distinct objective functions within a multi-objective collaborative optimization framework, targeting the minimization of operational economic costs, network losses, and environmental emissions. By incorporating constraints typical of distributed energy resources, I systematically optimize the economic-technical-environmental benefits of the DC microgrid. My model establishes a tri-objective collaborative optimization mechanism. First, it achieves global optimization of operational costs by coordinating power purchase costs from conventional generators and maintenance costs of photovoltaic systems. Second, it suppresses active power losses based on network topology reconstruction technology. Third, it precisely quantifies and reduces the carbon emissions of conventional units using a carbon footprint tracing model. The model uses a dynamic recursive algorithm based on a 24-hour continuous timeline, integrating the stochastic fluctuation characteristics of photovoltaic output, the spatiotemporal heterogeneity of load demands, and the multi-state switching logic of battery energy storage systems. Beyond conventional line thermal stability limits, the constraints also incorporate multi-dimensional safety boundaries such as node voltage deviations and spinning reserve capacity, constructing a robust and adaptive mixed-integer nonlinear programming model.

Operational Cost Model

The first objective function is to minimize the total operating cost over the scheduling horizon. The cost of purchasing energy from the grid or from conventional generators at each time interval is defined in the following equation.

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

In this model, \( C_{EE}(t) \) is the total energy purchase cost for the DC microgrid at time \( t \). The index \( t \) represents the discrete time step in the optimization schedule, where \( t = 1, 2, \dots, 24 \). \( N \) is the set of all conventional generation units in the microgrid, and \( i \in N \) is the index for a specific unit. \( C_{CGi}(t) \) is the unit energy cost of the conventional generator at bus \( i \) during time \( t \), and \( P_{CGi}(t) \) is its power generation. The value of \( C_{CGi}(t) \) depends on the system mode: for a grid-connected microgrid, it is the purchase price from the main grid; for an islanded microgrid, it is the fuel cost of a diesel generator.

The maintenance cost for photovoltaic distributed generators and battery energy storage systems is given by the following equation.

$$ C_M(t) = \sum_{i \in N} \left[ C_{MDGi} \times P_{DGi}(t) + C_{MBi} \times P_{Bi}(t) \right] $$

Here, \( C_{MDGi} \) and \( C_{MBi} \) are the unit maintenance costs for the photovoltaic array and battery storage, respectively. \( P_{DGi}(t) \) is the actual power output of the distributed generator at bus \( i \), and \( P_{Bi}(t) \) is the charge/discharge power of the battery energy storage unit at bus \( i \). The total operating cost \( C(t) \) for a given time interval is the sum of the energy purchase cost and the maintenance cost.

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

The first objective function, \( OF_1 \), which aims to minimize the total system operating cost over 24 hours, is defined as follows.

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

System Loss Model

The second objective is to minimize the total energy losses in the DC microgrid. The power loss \( P_{loss}(t) \) at time \( t \) is calculated using the following equation.

$$ P_{loss}(t) = \sum_{i \in N} \left[ P_{CGi}(t) + P_{DGi}(t) \pm P_{Bi}(t) – P_{di}(t) \right] = \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] $$

In this equation, \( P_{di}(t) \) is the real-time power demand of the load at bus \( i \). \( U_i(t) \) and \( U_j(t) \) are the voltage magnitudes at buses \( i \) and \( j \), respectively. \( G_{ij} \) is the conductance matrix element for the line connecting buses \( i \) and \( j \), and \( G_{i0} \) is the fixed resistive load component embedded within the conductance matrix. The second objective function, \( OF_2 \), which aims to minimize the total system energy loss over 24 hours, is defined as follows.

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

Carbon Emission Model

The third objective function minimizes the CO₂ emissions from the operation of conventional generators. Since photovoltaic distributed generation is a zero-emission technology, it is not included in this calculation. I used typical diesel generator emission factors. The total emissions at each time interval are given by the following equation.

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

Here, \( n \) is the total number of conventional generation units, and \( \gamma_{CGi} \) is the CO₂ emission intensity coefficient for the generator at bus \( i \). This parameter is assigned based on the fuel type of the unit.

Constraint Boundary Conditions

The optimal energy management problem for the DC microgrid is subject to several technical and operational constraints. These constraints are crucial for realistic modeling and include power flow equations, power generation limits, battery storage limits, and network security limits.

The first constraint is the power balance equation, which must hold for all buses and all time intervals.

$$ P_{CGi}(t) + P_{DGi}(t) \pm P_{Bi}(t) – P_{di}(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 $$

Here, \( H \) is the set of all discrete time intervals in the 24-hour schedule. The following constraint defines the minimum and maximum power generation limits for conventional generators.

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

Similarly, the power output of photovoltaic distributed generators is limited.

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

The charge and discharge power of the battery energy storage system is bounded.

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

The specific charge and discharge limits are calculated based on the battery’s nominal capacity and the charging/discharging times.

$$ P_{Bi}^{\text{char\_min}} = – \frac{C_{Bi}}{t_{cBi}} \quad \forall i \in N $$

$$ P_{Bi}^{\text{disch\_max}} = \frac{C_{Bi}}{t_{dBi}} \quad \forall i \in N $$

In these equations, \( C_{Bi} \) is the nominal capacity of the battery at bus \( i \), and \( t_{cBi} \) and \( t_{dBi} \) are the charging and discharging times for that battery. The state of charge (SOC) of the battery is a dynamic variable that evolves over time.

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

Here, \( S_{Bi}(t) \) is the SOC of the battery at bus \( i \) at time \( t \), and \( \phi_{Bi} \) is the charge/discharge factor, which is calculated as follows.

$$ \phi_{Bi} = \frac{1}{t_{cBi} \times P_{Bi}^{\text{char\_min}}} = \frac{1}{t_{dBi} \times P_{Bi}^{\text{disch\_max}}} \quad \forall i \in N, \forall t \in H $$

To ensure fair comparison and system stability, the initial and final SOC values are typically fixed. In this study, I set the initial and final SOC for all batteries to 50%.

$$ S_{Bi}(1) = S_{0i} \quad \forall i \in N $$
$$ S_{Bi}(24) = S_{fi} \quad \forall i \in N $$

The SOC is also bounded between a minimum and maximum value, set to 0.1 and 0.9 for the lithium-ion batteries used in this study.

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

Finally, the constraints for voltage and current limits in the DC grid are defined.

$$ 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 $$

In these equations, \( U_i^{\min} \) and \( U_i^{\max} \) are the minimum and maximum allowable voltages at bus \( i \). \( R_{ij} \) is the resistance of the line connecting buses \( i \) and \( j \), \( I_{ij}(t) \) is the current through that line at time \( t \), and \( I_{ij}^{\max} \) is the maximum allowable current for the line.

The following table summarizes the key parameters and their units used in the model.

Parameter Names and Units
Name Parameter Unit
Power \( P_{CGi}, P_{DGi}(t), P_{Bi}(t), P_{CGi}^{\min}, P_{CGi}^{\max}, P_{Bi}^{\text{char\_max}}, P_{Bi}^{\text{disch\_max}} \) kW
Voltage \( U_i, U_i^{\min}, U_i^{\max} \) kV
Current \( I_{ij}, I_{ij}^{\max} \) A
Resistance \( R_{ij} \) \( \Omega \)
Time \( t, t_{cBi}, t_{dBi} \) h
Cost \( C_{EE}(t), C_{CGi}(t), C_M(t), C_{MBi}(t), C(t) \) Currency Units
Carbon Emissions \( E(t) \) kg
Capacity \( C_{Bi} \) kWh

Fitness Function Model

To meet all constraints of the optimal operation problem for the DC microgrid, I use a fitness function (FF) consisting of three parts: the objective function to be optimized (FOi), a normalized adjustment term with a penalty coefficient (β), and a penalty factor (PF) based on the degree of constraint violation. The penalty factor dynamically adjusts to control solution feasibility. The penalty coefficient β is set heuristically to 1000. This method allows the algorithm to explore outside the feasible region for better global search, while ensuring the final solution set is fully feasible.

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

Microgrid Structure and Test System

To test my proposed optimization algorithms, I constructed 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, and the base power is 100 kW. The battery energy storage system has a rated energy of 200 kWh. The load curve of the system exhibits a double-peak characteristic, with an early peak around 08:00-10:00 and a late peak around 18:00-20:00. The minimum load occurs between 03:00 and 05:00.

DC Microgrid Parameters
Node i Node j R\(_{ij}\) / \(\Omega\) P\(_j\) / kW I\(_{ij}^{\max}\) / A Node i Node j R\(_{ij}\) / \(\Omega\) P\(_j\) / kW I\(_{ij}^{\max}\) / A Node i Node j R\(_{ij}\) / \(\Omega\) P\(_j\) / kW I\(_{ij}^{\max}\) / A
1 2 0.09 100 320 12 13 14.68 70 75 23 24 0.89 60 20
2 3 0.49 90 280 13 14 0.54 60 20 24 25 0.89 60 20
3 4 0.36 120 195 14 15 0.59 20 20 25 26 0.20 20 20
4 5 0.38 110 195 15 16 0.70 50 25 26 27 0.28 30 40
5 6 0.81 80 95 16 17 1289.00 40 35 27 28 10590.00 60 70
6 7 0.18 50 75 17 18 0.73 55 55 28 29 0.80 90 70
7 8 17114.00 90 55 18 19 0.16 85 40 29 30 0.90 80 55
8 9 10300.00 150 55 19 20 15041.00 115 70 30 31 0.57 60 55
9 10 10400.00 130 70 20 21 0.40 35 80 31 32 0.31 90 20
10 11 0.19 110 80 21 22 0.70 80 55 32 33 0.34 70 25
11 12 0.37 120 115 22 23 0.45 55 20

Continuous Encoding for Battery States

For the optimal operation of battery energy storage systems, I propose a solution based on continuous encoding. This encoding method precisely describes the sequential operational state of each battery by constructing a vector of dimension \( 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 intervals in the optimization horizon. This encoding matrix records the SOC evolution trajectory of each battery in hours over the entire operating period. According to the technical constraints, the initial and final SOC values for all batteries are strictly set at 50% of the rated capacity.

Optimization Algorithms

The main optimization phase focuses on the dynamic scheduling of battery energy storage systems in the DC microgrid. It uses the continuous encoding mechanism to generate candidate solutions and systematically evaluates the influence of each solution on the multi-objective functions. Given the continuous and nonlinear nature of the optimization problem, I selected three metaheuristic algorithms known for their performance in solving optimal power flow problems in DC networks: Parallel Ant Lion Optimizer, Parallel Vortex Search, and Parallel Particle Swarm Optimization. All three algorithms feature population intelligence and can reduce the computational time of the optimization process.

To achieve a breakthrough in computational efficiency, I parallelized the classic algorithm architectures. The parallelization enables the concurrent evaluation of population individuals through a distributed computing architecture, overcoming the efficiency bottlenecks of traditional serial computing in complex optimization scenarios. This architecture ensures the global optimality of solutions while meeting the time-sensitivity requirements of real-time scheduling.

Parallel Ant Lion Optimizer (PALO)

The iterative process of the proposed PALO algorithm begins by reading the basic data of the power network. In the initialization phase, the algorithm randomly generates an initial ant lion population based on the encoding rules. It then enters the fitness evaluation stage, using parallel computing to accelerate the optimization process. The fitness function for all \( N \) individuals in the population is calculated synchronously by allocating multiple cores of the computer’s CPU. The parallelization reduces the demand for computing resources. The model for processing time is described by the following equations.

$$ N_P = N / N_C $$
$$ P_T = M_{PT} \times N_P $$

Here, \( N_P \) is the number of processes required for traditional serial computing, \( M_{PT} \) is the maximum time for a parallel iteration, and \( P_T \) is the total population evaluation time. After the parallel fitness evaluation, the algorithm identifies the current best individual, \( \text{Antlion}_{\text{iter}} \), which serves as the benchmark solution for the subsequent search.

In the iterative optimization phase, the algorithm first updates the population based on the initial population data, random parameters, and the current best solution. It then evaluates the fitness of all individuals in the new population in parallel. The algorithm then updates the best individual to \( \text{Antlion}_{\text{iter+1}} \). For convergence determination, the algorithm uses dual termination criteria. If the solution quality improves, a non-improvement iteration counter (\( \text{iter}_{NI} \)) is reset to 0; otherwise, it is incremented. When \( \text{iter}_{NI} \) reaches a preset threshold, the algorithm terminates and outputs the current best solution. If the total number of iterations exceeds a limit, the algorithm also terminates. If neither condition is met, the algorithm continues the iterative optimization process.

Parallel Vortex Search (PVS)

The Vortex Search algorithm simulates the adaptive evolution mechanism of a vortex structure in fluid dynamics by generating a dynamically shrinking network of non-concentric hyperspheres. As the number of hyperspheres increases iteratively, the algorithm dynamically shrinks the search radius of the hyperspheres and shifts their center positions. The update strategy for the center coordinates is directly related to the spatial distribution of the current best solution. The PVS algorithm uses the same convergence criteria as the PALO algorithm.

During initialization, the PVS algorithm loads the system topology and control parameters. Based on the upper and lower bounds of the variable domain, the algorithm generates the initial geometric parameters of the hypersphere: the radius (\( r_{\text{iter}} \)) and the center coordinate (\( \mu_{\text{iter}} \)). It then generates the initial population with symmetric exploration characteristics in the solution space using a Gaussian distribution function. The fitness evaluation stage relies on a parallel computational framework, using the same distributed evaluation strategy as the PALO algorithm. Finally, it retains the current best solution (\( t_{\text{iter}} \)) as the iteration benchmark for the algorithm.

In the main iterative loop, the algorithm first sets the best solution from the last iteration (\( t_{\text{iter}} \)) as the new center of the hypersphere (\( \mu_{\text{iter+1}} \)) and updates the search radius based on a preset shrinkage rate. A new population is generated using a Gaussian distribution reconstructed from these new geometric parameters. After a parallel fitness evaluation, the algorithm identifies the best solution for the current iteration (\( t_{\text{iter+1}} \)). The algorithm terminates when a convergence criterion is met, and it outputs the current best solution. Otherwise, it continues updating the parameters and the optimization process.

Parallel Particle Swarm Optimization (PPSO)

The Particle Swarm Optimization algorithm is a classic swarm intelligence algorithm. It simulates a distributed search process in the solution space and uses individual cognitive experience and social information sharing mechanisms to gradually approach the optimal solution region. The implementation of the PPSO algorithm involves several key steps. First, it loads the system topological parameters and PPSO initialization parameters. It then generates the initial population using the encoding scheme and boundary constraints. The algorithm performs a distributed fitness evaluation of the population individuals using a parallel adaptive local optimization framework. After the initial evaluation, the algorithm identifies the global best particle and its corresponding solution, denoted as the current best solution (\( \text{iter} \)).

In the iterative optimization phase, the algorithm first updates the particle positions, considering individual historical best positions, group historical best positions, inertia weight, and cognitive factors. It uses random perturbations to balance exploration and exploitation. The updated particle swarm is then evaluated for fitness using the parallel computing architecture, and the individual best and global best solutions are updated. The iteration process ends when a termination condition is met. The algorithm outputs the current best solution as an approximate optimal solution for the grid optimization problem.

Results and Discussion

I evaluated the performance of the three optimization algorithms in a rural stand-alone DC microgrid scenario. For each method, I conducted 100 independent repeated experiments to comprehensively analyze solution quality, computational efficiency, and robustness. The results are quantified by comparing the reduction in cost, energy loss, and carbon emissions achieved by the three methods. The analysis used a baseline comparison method, comparing the performance of PALO, PVS, and PPSO for single-objective optimization of operating costs, energy transmission losses, and carbon emission intensity.

In terms of the minimum performance improvement, the PVS algorithm achieved a baseline breakthrough of 0.0135% in energy cost, 10.9825% in network loss reduction, and 0.0796% in carbon emissions when compared to PALO and PPSO. Regarding the average optimization efficacy, the PVS algorithm showed a sustained improvement of 0.0076% in cost, 10.8464% in energy loss, and 0.0788% in carbon emissions.

Average Optimization Rates of PVS vs. PALO and PPSO in the Islanded Scenario
Metric Cost (%) Energy Loss (%) CO₂ Emissions (%)
Minimum Performance Improvement 0.0135 10.9825 0.0796
Average Performance Improvement 0.0076 10.8464 0.0788

These results indicate that the Parallel Vortex Search algorithm provides a clear advantage in multi-objective collaborative optimization, especially in reducing network losses. The consistent and significant improvements across all three objectives demonstrate its robustness and effectiveness for optimizing the operation of battery energy storage systems in DC microgrids.

Conclusion

In this research, I first constructed a general mathematical model compatible with both grid-connected and islanded DC microgrids. This model breaks through the limitations of traditional single-objective optimization, achieving a three-dimensional collaborative optimization of operational costs (economic), energy losses (technical), and CO₂ emissions (environmental). Through the design of the fitness function, the algorithm gains the ability to explore infeasible regions, improving computational efficiency. Secondly, I developed a cluster of parallel optimization algorithms, including PPSO, PALO, and PVS, combined with an hourly dynamic power flow calculation module. In the empirical test on a stand-alone microgrid, the PVS algorithm showed superior performance, achieving average optimization rates of 0.0076% in costs, 10.8464% in energy losses, and 0.0788% in CO₂ emissions. The models developed in this study have cross-national applicability, as they can be adapted to different energy costs and equipment parameters, and they support future expansion with dynamic scheduling of renewable energy and spatial reconfiguration of devices. Current limitations include the fixed power operation mode for photovoltaic systems and the lack of full multi-objective collaborative optimization. Future work will focus on developing dynamic multi-objective algorithms and integrated models for equipment layout and operation to further enhance microgrid system performance.

Scroll to Top