Optimal Scheduling of Energy Battery Storage in Active Distribution Networks Using a Mutation-Improved Grey Wolf Optimizer

Active distribution networks combine distributed generation, flexible loads, and automated control at the distribution level. The variability of wind and photovoltaic output does not make these resources less useful; it makes the network’s dispatch problem more demanding. A battery energy storage system (BESS) can shift active power in time, provide frequency support, and contribute to resilience during severe events. In this setting, energy battery storage is not a passive backup resource but a controllable bus-level device whose charge and discharge schedule affects network losses, voltage profiles, and line loading.

The scheduling layer considered here is short-term and loss-oriented. Given forecasts of load and renewable generation, the operator selects BESS active-power exchanges over T time intervals to minimize total active-power losses while keeping state of charge, node voltages, and branch currents within limits. The optimization is solved with a mutation-improved grey wolf optimizer (MIGWO), which modifies the standard grey wolf optimizer (GWO) to improve feasible initialization, exploration, and leader diversity.

Containerized battery energy storage system for grid applications
Battery energy storage provides short-term active-power flexibility in distribution networks.

Dispatch model: losses, state of charge, and network limits

The decision vector contains the BESS active-power exchange in each interval:

$$x=[P_{B,1},P_{B,2},\ldots,P_{B,T}]$$

A passive sign convention is used. When \(P_{B,t}\ge 0\), the battery is charging and draws active power from the network. When \(P_{B,t}<0\), the battery is discharging and injects active power. The state of charge evolves from the previous interval according to

$$\mathrm{SOC}_t=\mathrm{SOC}_{t-1}+\Delta \mathrm{SOC}_t$$

$$\Delta \mathrm{SOC}_t=
\begin{cases}
\dfrac{P_{B,t}\Delta t\,\eta_{ch}}{W_{B,\max}}, & P_{B,t}\ge 0,\\[6pt]
\dfrac{P_{B,t}\Delta t}{W_{B,\max}\eta_{dsc}}, & P_{B,t}<0,
\end{cases}$$

where \(W_{B,\max}\) is the usable energy capacity, \(\eta_{ch}\) is the charging efficiency, \(\eta_{dsc}\) is the discharging efficiency, and \(\Delta t\) is the interval length. The objective is the sum of active-power losses over the scheduling horizon:

$$f(x)=\sum_{t=1}^{T}\Delta P_{tot,t}$$

$$\Delta P_{tot,t}=P_{s,t}+\sum_{i\in N_B}(P_{Gi,t}-P_{Li,t})-P_{B,t}$$

Here \(P_{s,t}\) is the active power supplied by the slack node, \(P_{Gi,t}\) is distributed generation at bus \(i\), \(P_{Li,t}\) is load at bus \(i\), and \(N_B\) is the set of network buses. The term \(P_{B,t}\) removes the storage exchange from the net network demand so that the objective represents losses rather than the energy shifted by the battery.

The equality constraints are the usual active- and reactive-power flow equations. For each bus \(i\) and interval \(t\),

$$P_{Gi,t}-P_{Li,t}-P_{B,i,t}
-V_{i,t}\sum_{k\in N_B}V_{k,t}
\left[G_{ik}\cos(\theta_{i,t}-\theta_{k,t})
+B_{ik}\sin(\theta_{i,t}-\theta_{k,t})\right]=0$$

$$Q_{Gi,t}-Q_{Li,t}
-V_{i,t}\sum_{k\in N_B}V_{k,t}
\left[G_{ik}\sin(\theta_{i,t}-\theta_{k,t})
-B_{ik}\cos(\theta_{i,t}-\theta_{k,t})\right]=0$$

where \(V_{i,t}\) and \(\theta_{i,t}\) are voltage magnitude and angle, and \(G_{ik}\) and \(B_{ik}\) are the real and imaginary parts of the bus admittance matrix. The inequality constraints cover the battery and the network:

$$P_{B,\min}\le P_{B,t}\le P_{B,\max}$$

$$\mathrm{SOC}_{\min}\le \mathrm{SOC}_t\le \mathrm{SOC}_{\max}$$

$$\left|\mathrm{SOC}_0-\mathrm{SOC}_T\right|\le \varepsilon_{\mathrm{SOC}}$$

$$V_{\min,k}\le V_{k,t}\le V_{\max,k}$$

$$I_{ij,t}\le I_{\max,ij}$$

The terminal state-of-charge condition prevents the schedule from ending with an arbitrarily depleted or overcharged battery. The tolerance \(\varepsilon_{\mathrm{SOC}}\) defines how closely the final state must return to the initial state.

Because a metaheuristic solver is used, the constraints are handled through a combination of variable bounds, power-flow solution, and penalty terms. The fitness function is

$$F(x)=w_0 f(x)+w_1P_1+w_2P_2+w_3P_3+w_4P_4$$

The penalty term \(P_1\) penalizes state-of-charge violations, \(P_2\) penalizes terminal state-of-charge imbalance, \(P_3\) penalizes voltage-limit violations, and \(P_4\) penalizes branch-current violations. The coefficient \(w_0\) is set to a high value when a candidate produces a divergent power flow and to 1 when the power flow converges. The power-flow equality constraints are not converted into penalties; they are solved directly for each candidate.

MIGWO: four changes to the standard grey wolf optimizer

The standard GWO ranks candidate solutions as alpha, beta, delta, and omega wolves. The alpha, beta, and delta positions guide the rest of the pack. For iteration \(l\), the surrounding behavior is written as

$$\vec D=\left|\vec C\,\vec X_p(l)-\vec X(l)\right|,\qquad
\vec X(l+1)=\vec X_p(l)-\vec A\vec D$$

$$\vec A=2a\vec r_1-a,\qquad
\vec C=2\vec r_2,\qquad
a=2\left(1-\frac{l}{l_{\max}}\right)$$

where \(\vec X_p\) is the prey position, \(\vec r_1\) and \(\vec r_2\) are random vectors in \([0,1]\), and \(a\) decreases linearly from 2 to 0. The coefficient \(\vec A\) shifts the search between exploration and exploitation, while \(\vec C\) introduces randomness in the influence of the current position. The hunting step combines the three leader positions:

$$\vec X(l+1)=\frac{\vec X_1+\vec X_2+\vec X_3}{3}$$

The standard algorithm can still suffer from premature convergence when the leading wolves occupy similar positions or when the initial population contains many infeasible battery schedules. Four modifications address these failure modes.

1. State-of-charge-feasible initialization

Randomly generated BESS schedules often violate the state-of-charge limits before the first iteration. Instead of relying on penalties to repair them, the initializer constructs charge and discharge bounds that keep each interval inside the allowed state-of-charge window:

$$P_{B,t}^{\max}=
\min\left(P_{B,\max},
\frac{W_{B,\max}\left(\mathrm{SOC}_{\max}-\mathrm{SOC}_t\right)}
{\eta_{ch}\Delta t}\right)$$

$$P_{B,t}^{\min}=
\max\left(P_{B,\min},
-\frac{W_{B,\max}\left(\mathrm{SOC}_t-\mathrm{SOC}_{\min}\right)\eta_{dsc}}
{\Delta t}\right)$$

Each \(P_{B,t}\) is then sampled inside these interval-specific bounds. This first strategy guarantees the state-of-charge bounds but does not guarantee the terminal balance condition. A second strategy generates a larger pool of candidates satisfying the first condition and filters them for the terminal condition. In a study of \(10^6\) trials with \(\varepsilon_{\mathrm{SOC}}=5\%\), the average share of individuals satisfying both state-of-charge constraints was 15.73%. For \(N_{tot}=10^4\), the share ranged from 14.06% to 17.09%; for \(N_{tot}=10^3\), it ranged from 10.7% to 21.7%. For small populations, at least 100 candidates were needed to obtain a feasible individual.

2. Mutation

A mutation operator adds diversity during the exploration phase. The number of mutation wolves decreases linearly with iteration:

$$N_{mut}(l)=N_{mut}^{\max}-
\left(N_{mut}^{\max}-N_{mut}^{\min}\right)\frac{l}{l_{\max}}$$

A parent is selected from the top 85% of the population. The selection probabilities are 15% for the alpha wolf, 15% for a beta or delta wolf, and 70% for the remaining wolves within that top group. Six mutation forms are used: replacing one variable with a random value; swapping two variables; adding a small random quantity to one variable and subtracting it from another; generating a new feasible wolf; adding a small random amount to one variable; and adding a small random amount to one variable while subtracting an equal share from all other variables. The mutated wolf replaces one of the weakest members of the population.

3. Survival of the fittest

The survival-of-the-fittest mechanism removes the least-fit wolves, defined by the highest objective-function values. The number removed equals \(N_{mut}\), so the population size remains constant while the mutation pool shrinks. This couples mutation to selection: mutation introduces new candidates, and selection prevents weak candidates from persisting.

4. Multiple beta and delta wolves

In the standard GWO, the alpha, beta, and delta wolves are the three best-ranked individuals. If their positions are nearly identical, the pack receives little directional diversity. The modified hierarchy uses one alpha wolf, \(N_\beta\) beta wolves, \(N_\delta\) delta wolves, and the remaining omega wolves, with

$$N_\beta(l)=\max\left(1,\operatorname{round}\left(N_\beta^{\max}\left(1-\frac{l}{l_{\max}}\right)\right)\right)$$

$$N_\delta(l)=\max\left(1,\operatorname{round}\left(N_\delta^{\max}\left(1-\frac{l}{l_{\max}}\right)\right)\right)$$

During the position update, a beta or delta guide is selected randomly from the corresponding group. In the reported configuration, \(N_\beta^{\max}=5\) and \(N_\delta^{\max}=7\), with both declining to 1 at \(l_{\max}=100\). The early iterations therefore draw on several leaders, while the final iterations concentrate on exploitation around a smaller leadership set.

The population size and iteration count are also chosen with computation in mind. Objective-function evaluations can be parallelized, so a larger population of \(10^4\) individuals is compatible with parallel evaluation. Iterations are serial, so reducing the iteration count to 100 limits the serial part of the runtime. The same settings are used for the benchmark tests and the BESS scheduling problem.

Power-flow engine and numerical accuracy

Distribution networks are often radial and can have high resistance-to-reactance ratios, which makes transmission-oriented power-flow methods less reliable. The scheduling model therefore uses a backward-forward sweep method (BFSM) with a breadth-first search ordering of nodes. The backward pass accumulates load currents and downstream branch currents from the network extremities toward the source. The forward pass updates node voltages from the source toward the extremities using branch impedance drops. Convergence is checked from the change in the complex power supplied by the slack node.

The BFSM implementation was checked against MATPOWER as a reference. The maximum absolute voltage error was below \(9\times10^{-10}\) pu, and the maximum absolute branch active-power error was below \(3.9\times10^{-5}\) kW. The mean absolute errors were \(4.6\times10^{-10}\) pu for voltage and \(9.9\times10^{-5}\) kW for branch active power. The errors in slack-node active and reactive power were below \(1.8\times10^{-5}\) kVA. These values indicate that the power-flow engine is sufficiently accurate for the screening and optimization tasks performed by the metaheuristic.

Benchmark performance

The optimizer was tested on 23 standard minimization functions: seven unimodal functions (F1–F7), six multimodal functions (F8–F13), and ten fixed-dimension multimodal functions (F14–F23). Each algorithm was run 30 times per function under identical parameter settings, with \(N_{tot}=10^4\) and \(l_{\max}=100\). Lower objective values indicate better performance.

Selected benchmark results for MIGWO and GWO across 30 independent runs.
Function MIGWO mean GWO mean MIGWO standard deviation GWO standard deviation
F1 1.51E-15 6.27E-15 1.32E-15 6.29E-15
F5 24.00875 25.14367 0.265131 0.79198
F8 -12536.8 -7606.3 52.7398 371.9724
F9 0.021176 6.868896 0.046863 4.852734
F13 0.000118 0.013118 1.78E-05 0.033761
F14 0.998004 0.998004 6.24E-12 1.41E-11
F18 3 3 2.42E-11 9.74E-09

MIGWO produced lower mean values on most of the 23 functions. The largest separation appeared on F8 and F9. On F8, the MIGWO mean was \(-12536.8\), compared with \(-7606.3\) for GWO. On F9, the MIGWO mean was 0.021176, compared with 6.868896 for GWO. These are multimodal functions, so the improvement is consistent with better exploration and a lower tendency to settle in a poor local basin.

The F13 result provides a useful qualification. MIGWO’s best value on F13 was \(8.49\times10^{-5}\), slightly higher than GWO’s \(7.48\times10^{-5}\). However, MIGWO’s mean, worst value, and standard deviation were lower, which indicates that its advantage lies in consistency rather than in a single best run. For F14–F19, the best, mean, and worst values were nearly identical between the two algorithms, while MIGWO generally had the smaller standard deviation. This pattern supports the interpretation that the modifications improve exploration on difficult landscapes without eroding exploitation near the best solutions.

Implications for active distribution network operation

The dispatch model is deliberately narrow: it minimizes active-power losses over a short horizon. It does not stack arbitrage revenue, frequency-regulation payments, or resilience benefits into the objective. Those services are motivations for installing storage, but they are not priced in this loss-minimization formulation. The value of the model is that it links the battery schedule directly to network physics: voltage limits, branch currents, and the location of renewable generation and demand.

Several operating assumptions matter. The formulation assumes that load and renewable-generation forecasts are accurate enough for the scheduling horizon. Forecast error would require either conservative operating margins or a rolling-horizon update. The terminal state-of-charge tolerance controls how much energy the battery may bank or spend over the horizon. The penalty weights determine how strictly voltage, current, and state-of-charge limits are enforced during the search. The BESS model includes charging and discharging efficiency but does not include battery degradation, thermal limits, converter reactive-power capability, or protection settings. Those would need to be added for a full deployment study.

The power-flow method is appropriate for radial distribution networks. Meshed or strongly looped networks would require a different solver or a generalized sweep formulation. The benchmark evidence supports MIGWO as a stronger optimizer than standard GWO on most of the tested functions, particularly multimodal functions where premature convergence is a risk. It does not establish universal superiority over all metaheuristics or all dispatch formulations.

Resilience is a separate concern from loss minimization. A battery schedule that reduces daily losses may not be the schedule that preserves critical load during an outage. The model can serve as a normal-operation layer, but resilience-oriented operation would need additional objectives, outage scenarios, and priority constraints for critical customers.

Conclusion

Short-term BESS scheduling in an active distribution network is a constrained, nonconvex optimization problem in which the battery’s active-power exchange affects losses, voltages, and line loading. The formulation presented here minimizes total active-power losses over a scheduling horizon while enforcing state-of-charge, voltage, and current limits. MIGWO addresses the standard GWO’s weaknesses through feasible initialization, mutation, survival-based replacement, and multiple beta and delta leaders. The power-flow engine matches MATPOWER to a high numerical tolerance, and the benchmark results show lower mean objective values on most of the 23 test functions, with the clearest gains on multimodal problems. The approach is best understood as a technically grounded loss-minimization layer for storage dispatch, not as a complete valuation of every service that energy battery storage can provide.

Scroll to Top