**6. Conclusions**

The optimal siting and sizing of BESS in the distribution network with RESs was presented. The objective function considered to be minimized is the total costs incurred in the distribution network consisting of the costs of voltage deviations, power losses, and peak demands. The BESS installation was operated in an IEEE 33-bus distribution network by using the GA and PSO algorithm for optimizing the objective function, and the results received from both algorithms were compared to verify the accuracy. The results provided by both GA and PSO showed that the BESS installation could improve the efficiency of the distribution network in terms of cost minimization, the reduction of voltage deviations, power losses, and peak demand. It can also well support the RES connection that has a fluctuation in electricity generations. It was also found that PSO is more efficient than GA in terms of the objective function optimization for this problem.

**Author Contributions:** Conceptualization, P.B., A.S., P.F., and S.K.; Software, P.B.; Validation, P.B., A.S., and S.K.; Formal Analysis, P.B. and S.K.; Investigation, P.B. and S.K.; Resources, P.B.; Data Curation, P.B.; Writing—Original Draft Preparation, P.B. and S.K.; Writing—Review & Editing, P.B., A.S., and S.K.; Visualization, P.B.; Supervision, A.S. and S.K.; Project Administration, A.S. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the Provincial Electricity Authority (PEA) of Thailand.

**Acknowledgments:** Authors would like to acknowledge Pradit Fuangfoo for his helpful technical discussions.

**Conflicts of Interest:** The authors declare no conflict of interest.
