The development of the electricity grid and the use of intelligent control in real-time has today become one of the most important pillars that control the quality and continuity of the electricity supply for industrial consumers and even ordinary consumers. The increase in the load led to an increase in the demand for electrical energy, so this increase was accompanied by multiple problems such as a decrease in the voltage, an increase in the reactive energy in the lines of transport, a decrease in active transited energy, also an increase in active losses and other problems related to electrical synchronization and ultimately overall instability of the electrical network. Through this study, we offer some solutions related to electrical control, using specially developed algorithms to determine the optimal reactive energy compensation locations, taking into account the technical limitations in transformer stations related to high lines 220 kV electric transmission voltage. Thanks to the good results obtained, we were able to apply the algorithms to the real network by taking the southwest region of Algeria as a study sample in order to improve the electrical quality of this region. The modelling, analysis, control and confirmation techniques were studied using an advanced numerical simulation.