**5. Discussions and Conclusions**

The reactive power flow in the active electricity distribution networks has an important influence on the bus voltage level and the active power losses. Therefore, in order to control the reactive power absorbed by consumers, their consumption must be characterized by a power factor approximately equal to the neutral value (0.9 in Romania). Optimal allocation of reactive sources in the electricity distribution networks is made for power losses reduction, power factor correction and/or voltage profile improvement.

The optimization model considered in the paper has as main objective the optimal allocation of capacitor banks (CBs) in the medium voltage networks to minimize the power/energy losses, taking into account the technical restrictions imposed by the available CB stock, the compensation

level in each bus, branch current flows, and bus voltages. This is very useful for distribution network operators that install now large amounts of capacitor banks (CB) in the distribution networks. In order to optimize the location of these CBs, the used test networks (the IEEE 33-bus system and a real 215-bus EDN from Romania) were modelled considering the MV lines, the MV/LV transformers from the electric distribution substations, where available, and the MV and LV buses. The different algorithms (Genetic Algorithm (GA), Particle Swarm Optimization (PSO), Bat Optimization Algorithm (BOA), Whale Optimization Algorithm (WOA) and Sperm-Whale Algorithm (SWA)) were tested to see which would be the best to solve the problem of capacitor bank allocation. The study, made using the IEEE 33-bus system, highlighted the fact that the SWA leads to the best results compared to the other algorithms. Compared with the reference case, the best compensation solution found by the SWA leads to a loss reduction of 726.73 kW for the analyzed day, which, if it is extrapolated for a year, amounts to 265.26 MW loss saving. The difference between SWA and the second best result, given by WOA, is of 6.25 kW per day or 2.28 MW for an entire year. In the case of the voltage level, an improvement was observed on the entire electricity distribution network, in all nodes, also obtained with the help of SWA. The minimum reference voltage value in bus 18 (the farthest node), at hour 10.00, was increased by 1.65%.

Moreover, the algorithms were tested in a real electricity distribution network (215-bus EDN) from Romania. The best CB allocation solution, obtained again with the SWA, achieves a loss reduction of 833.91 kW or 10.36% for the entire network, in 24 h, which amounts to 304.38 MW in an entire year. The next best solution, found with the PSO algorithm, achieves only 816.58 kW (10.15%). The difference between the two solutions is of 17.33 kW in the analyzed day, or 6.32 MW in a year. The solutions found led to an increase of the voltage in the farthest node (215) with maximum 1.36%.

Based on the obtained results, it can be affirmed that the use of capacitor banks is an easy solution to be implemented with technical and economic benefits to the electricity distribution networks that maximizes long-term return on investment as the network develops. An intelligent control of capacitor banks leads to improved energy efficiency and voltage level in the buses of electricity distribution networks, resulting in an increase in the percentage of energy delivered to consumers. Amongst the tested algorithms, the SWA finds the best compensation solutions, which can lead to significant additional loss savings and shorter investment recovery times.

**Supplementary Materials:** The following are available online at http://www.mdpi.com/1996-1073/12/22/4239/ s1, file IEEE33\_load\_data.xls, active and reactive load profiles for the IEEE-33bus test system, and file EDN215\_load\_data.xls, active and reactive load profiles for the 215-bus distribution network.

**Author Contributions:** Conceptualization, O.I., B.-C.N. and G.G.; methodology, O.I. and G.G.; software, O.I. and B.-C.N.; validation, B.-C.N. and G.G.; formal analysis, M.G.; investigation, O.I. and B.-C.N.; data curation, B.-C.N.; writing—original draft preparation, O.I. and B.-C.N.; writing—B.-C.N., G.G. and M.G.; supervision, M.G.

**Funding:** This research received no external funding.

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