Dispatch Optimization for Battery Energy Storage in DC Microgrid Substations

DC microgrids are attractive at substation level because photovoltaic (PV) arrays, battery racks, and many loads already operate on direct current. Removing unnecessary AC/DC conversion stages eliminates reactive-power management, reduces conversion losses, and can simplify voltage and current control. The benefit comes with a dispatch problem: the battery energy storage system (BESS) must be scheduled hour by hour against variable PV output, load demand, fuel or electricity prices, and network constraints. If the battery is dispatched poorly, the microgrid may import too much energy, waste PV production, or violate voltage and line-current limits.

Containerized battery energy storage system
Battery energy storage provides the controllable buffer between PV generation and load in a DC microgrid.

The dispatch problem is not simply energy arbitrage. In a networked DC microgrid, battery charge and discharge change the power flow on every line. A schedule that reduces purchased energy can increase line losses; a schedule that reduces losses can shift conventional-generator output and therefore change CO2 emissions. The optimization must therefore represent the network, the battery state, and the generator limits together, rather than treating the battery as an isolated storage unit.

Three objectives: cost, losses, and carbon

The energy management model is formulated over a 24 h horizon with hourly time steps. It contains three objective functions: operating cost, energy transmission loss, and CO2 emissions from conventional generation. The cost term combines the cost of buying energy or burning fuel with the maintenance cost of PV and battery operation:

$$C_{EE}(t)=\sum_{i\in N} C_{CGi}(t)P_{CGi}(t)$$

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

$$C(t)=C_{EE}(t)+C_M(t),\qquad \mathrm{OF}_1=\min\sum_{t=1}^{24}C(t)$$

Here, \(C_{CGi}(t)\) is the unit energy cost of the conventional generator at bus \(i\), \(P_{CGi}(t)\) is its output, \(P_{DGi}(t)\) is the PV output, and \(P_{Bi}(t)\) is the battery power. In grid-connected operation, \(C_{CGi}(t)\) represents the electricity purchase price; in islanded operation, it represents diesel fuel cost. The sign convention is that positive \(P_{Bi}\) discharges the battery and negative \(P_{Bi}\) charges it.

The second objective minimizes the sum of line losses. For a set of lines \(L\), with line resistance \(R_{ij}\) and current \(I_{ij}(t)\):

$$P_{\mathrm{loss}}(t)=\sum_{(i,j)\in L} I_{ij}^{2}(t)R_{ij}$$

$$\mathrm{OF}_2=\min\sum_{t=1}^{24}P_{\mathrm{loss}}(t)$$

The third objective accounts only for the conventional generator, because PV is treated as zero-emission generation:

$$E(t)=\sum_{i=1}^{n}\gamma_{CGi}P_{CGi}(t),\qquad \mathrm{OF}_3=\min\sum_{t=1}^{24}E(t)$$

where \(\gamma_{CGi}\) is the CO2 emission intensity of the generator at bus \(i\). The three objectives are linked through the same power-flow solution. A battery schedule that lowers cost may raise losses, and a schedule that lowers losses may leave more diesel generation online. The model therefore evaluates the objectives separately rather than assuming that one objective automatically improves the others.

Constraints, feasibility, and the fitness function

The battery schedule must satisfy the nodal power balance at every bus and every hour:

$$P_{CGi}(t)+P_{DGi}(t)\pm P_{Bi}(t)-P_{di}(t)=U_i(t)\sum_{j\in N}G_{ij}U_j(t)$$

where \(P_{di}(t)\) is the load at bus \(i\), \(U_i(t)\) is the bus voltage, and \(G_{ij}\) is the conductance matrix element between buses \(i\) and \(j\). Conventional generators and PV units are bounded by their available output ranges:

$$P_{CGi}^{\min}\le P_{CGi}(t)\le P_{CGi}^{\max}$$

$$P_{DGi}^{\min}(t)\le P_{DGi}(t)\le P_{DGi}^{\max}(t)$$

The battery is constrained by its charge and discharge power limits, its state of charge (SOC), and its initial and final SOC. The SOC update is:

$$S_{Bi}(t)=S_{Bi}(t-1)-\phi_{Bi}P_{Bi}(t)\Delta t$$

$$S_i^{\min}\le S_{Bi}(t)\le S_i^{\max},\qquad S_{Bi}(1)=S_{Bi}(24)=0.5$$

For the lithium-ion battery pack in the case study, the SOC limits are 0.1 and 0.9, and both the initial and final SOC are fixed at 50%. Fixing the end point at the starting value prevents the optimizer from ending the day with an empty battery, but it also removes some freedom from the dispatch. Voltage and line-current limits complete the feasibility set:

$$U_i^{\min}\le U_i(t)\le U_i^{\max}$$

$$I_{ij}(t)=\frac{|U_i(t)-U_j(t)|}{R_{ij}}\le I_{ij}^{\max}$$

The line-current constraint is important because it is often omitted in energy management studies. In a distribution network, a battery schedule can reduce total energy cost while overloading a feeder or pushing a bus voltage outside its allowed range. The model handles constraint violations through a penalized fitness function:

$$\mathrm{FF}=\mathrm{FO}_i+\beta\,\mathrm{PF},\qquad i\in\{1,2,3\}$$

where \(\mathrm{FO}_i\) is the objective value, \(\mathrm{PF}\) is a penalty factor based on constraint violation, and \(\beta\) is a normalization coefficient set to 1 000. The penalty allows the search to explore infeasible regions, but the final solution must satisfy the operating constraints.

Encoding the battery schedule

The optimization uses a continuous encoding of the battery SOC trajectory. For \(N_B\) batteries and a horizon of \(|H|\) hours, the candidate solution is a vector of length \(N_B\times |H|\). Each row corresponds to one battery, and each column corresponds to one hour. The encoded values are SOC levels, not charge or discharge powers; battery power is recovered from the change in SOC between consecutive hours.

This representation reduces the number of decision variables and keeps the search close to the physical state of the battery. For example, a battery may start at 50% SOC, discharge to 40% by the second hour, remain near 40% until hour 23, and return to 50% at the end of the 24 h cycle. The encoded trajectory must still satisfy the SOC limits, power limits, and energy balance when it is decoded into hourly battery power and passed to the power-flow calculation.

Parallel metaheuristic search

Three population-based algorithms are used: a parallel ant lion optimizer (PALO), a parallel vortex search (PVS), and a parallel particle swarm optimization (PPSO). All three are derivative-free methods suited to nonlinear, nonconvex dispatch problems. They differ in how they generate new candidates. The ant lion optimizer uses a selection mechanism around promising solutions; the vortex search shrinks and moves a set of hyperspheres through the solution space; particle swarm optimization updates particles using individual and group best positions.

The parallel versions distribute fitness evaluations across multiple CPU cores. If \(N\) is the population size and \(N_C\) is the number of cores, the number of sequential process batches is:

$$N_P=\frac{N}{N_C},\qquad P_T=M_{PT}N_P$$

where \(M_{PT}\) is the maximum time of a parallel iteration and \(P_T\) is the total population-evaluation time. This is an ideal speedup model; actual performance depends on communication overhead and hardware. The practical purpose is to make repeated stochastic runs and hourly power-flow evaluations computationally manageable.

Each candidate schedule is decoded into hourly battery powers, the hourly power flow is solved by successive approximation, and the resulting cost, loss, and emission values are used in the fitness function. The search stops when it reaches a maximum number of iterations or when the best solution has not improved for a preset number of iterations. The same convergence logic is applied to all three algorithms so that the comparison is based on solution quality and stability rather than on different stopping rules.

Test system and load profile

The case study uses a 33-bus DC microgrid with 32 lines, one conventional generator, distributed PV, and multiple loads. The base voltage is 12.66 kV, the base power is 100 kW, and the battery nominal energy is 200 kWh. Line maximum currents are derived from a grid-connected power-flow calculation. The main parameters are summarized below.

Parameter Value
Network 33 buses, 32 lines, one conventional generator
Base voltage 12.66 kV
Base power 100 kW
Battery nominal energy 200 kWh
Battery type Lithium-ion
SOC limits 0.1 to 0.9
Initial and final SOC 50%
Load peak and valley 1.2 kW and 0.4 kW
Penalty coefficient \(\beta\) 1 000
Simulation environment MATLAB 2022a, 100 independent runs per algorithm

The load curve has two peaks. The morning peak occurs from 08:00 to 10:00 at 1.2 kW; load falls to about 0.9 kW at midday and rises again to 1.15 kW from 18:00 to 20:00. The minimum load is 0.4 kW between 03:00 and 05:00, so the daily fluctuation is about 200%. PV output peaks between 12:00 and 14:00, when load is only about 0.7 kW. This timing mismatch is the main reason storage is needed: without a battery, midday PV production and evening load demand are poorly aligned.

Results for the islanded network

The quantitative comparison focuses on the islanded rural DC network. Each algorithm is run 100 times for each objective, and the results are evaluated by solution quality, stability, and computation time. On the reported average metrics, the parallel vortex search has the best combined profile. Its average improvement relative to the other two algorithms is shown in the table.

Metric Average improvement (%)
Operating cost 0.007 6
Energy transmission loss 10.846 4
CO2 emissions 0.078 8

The advantage is concentrated in loss reduction. A 10.846 4% average reduction in line losses is significant for a networked DC system, because it reflects changes in current distribution across feeders rather than a simple change in battery charging. The cost improvement of 0.007 6% and the CO2 improvement of 0.078 8% are much smaller. In the islanded case, diesel cost and emissions scale with generator output; with PV fixed at maximum power point and load fixed by the profile, the battery has limited freedom to change total fuel consumption. Loss reduction is more sensitive to where and when the battery shifts power.

A separate minimum-case panel reports reductions of 0.013 5% for cost, 10.982 5% for losses, and 0.079 6% for emissions. These values should be read as panel-specific results, not as a confidence interval around the averages. In particular, the cost minimum is larger than the cost average, which indicates that the two panels use different comparison logic. The average values are the more appropriate basis for ranking the algorithms across repeated runs.

What the results imply for design

The first implication is that line-current constraints belong in the dispatch model. A battery schedule that looks attractive at the bus level can create unacceptable feeder currents in a networked DC system. The 33-bus case is small, but the same issue appears in larger distribution networks where line impedances vary widely and some feeders are close to their thermal limits.

The second implication is that the battery SOC trajectory is a network variable, not just an energy buffer. The initial and final SOC of 50% gives the battery a daily cycling pattern, but the intermediate trajectory determines voltage profiles and line losses. The optimizer is therefore shaping the network operating state, not merely deciding when to buy or store energy.

The third implication is that algorithm selection matters more for losses than for cost or emissions in this case. PVS performs best on the combined metrics, but the margin is almost entirely due to loss reduction. A practical dispatch system could use PVS for loss-sensitive operation and still need a separate check on cost and emissions if those objectives are weighted heavily. The result does not establish a universal ranking among PALO, PVS, and PPSO; it establishes that PVS is competitive on this network and objective set.

Parallelization improves the practicality of repeated stochastic optimization, but it does not change the underlying dispatch problem. The ideal speedup model assumes that fitness evaluations are independent and that communication overhead is small. For a 33-bus system with hourly power flow, that assumption is reasonable; for a larger network with thousands of buses, the power-flow solve itself may become the bottleneck.

Scope and limitations

The formulation contains three objectives, but the reported comparison optimizes each objective separately. It does not construct a Pareto front or assign weights to cost, loss, and emissions. The result therefore identifies which algorithm performs best on each metric, not a balanced operating point that trades one objective against another. A true multi-objective dispatch would require a Pareto-based method and a trade-off analysis; that remains an open extension.

PV is operated at its maximum power point, so the model does not consider curtailment. If curtailment were allowed, the battery would have more freedom to absorb midday production, and the cost and emission results could change. The battery model also fixes the initial and final SOC at 50%, which is a scheduling convention rather than a universal requirement. Different end-point conditions would produce different daily cycles and possibly different algorithm rankings.

Finally, the case study is a single 33-bus network with a specific load and PV profile. The model is portable in the sense that fuel prices, tariffs, emission factors, and equipment parameters can be replaced with local data, but the quantitative conclusions should not be transferred without re-running the optimization. The main transferable finding is methodological: a DC microgrid BESS should be dispatched against hourly power flow, line-current limits, and multiple performance indices, and the algorithm should be selected on repeated-run stability rather than on a single best result.

Scroll to Top