Abstract
The global transition toward renewable energy sources (RESs) has introduced technical challenges in distribution networks, including voltage instability, increased power losses, and peak demand fluctuations. Battery Energy Storage Systems (BESSs) provide an effective solution through voltage regulation, loss minimization, and peak shaving. However, their effectiveness strongly depends on optimal location and capacity, and a single BESS may be insufficient for network with increasing RES penetration. This study proposes an optimization framework employing the crayfish optimization algorithm (COA) to determine the optimal locations and capacities of multiple BESSs within a distribution network integrated with RESs. The objective is to minimize the total system costs, including BESS investment and performance-related costs associated with voltage deviation, transmission loss, and peak power reductions. The proposed framework is applied to a real-world system, comprising 102 buses incorporating photovoltaic (PV) and biomass distributed generation. Three installation scenarios including one, two, and three BESS units are analyzed and compared against other optimization algorithms. The results confirm the optimal BESS locations and capacities found are technically feasible for real-world deployment. Moreover, COA consistently outperforms comparative methods, particularly in cost minimization and loss reduction. Notably, the two-BESS case yields the most balanced and cost-effective performance. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1038/s41598-026-40971-z.