 This paper proposes a novel approach for optimizing the placement of battery energy storage systems, BESS, in electricity grids. It uses a modified genetic algorithm to optimize the number of BESSes and their capacities based on the daily load of wind and solar energy. This algorithm has been shown to reduce the convergence time by up to 30% compared to traditional methods. Additionally, it can also determine the optimal number of batteries needed for each group, allowing for more efficient use of resources. This article was authored by Simeen Peng, Liang Zhu, Zhenlun Dou, and others.