Optimal Power Flow through Artiﬁcial Intelligence Techniques

Context: The integration of optimization methods into the various processes carried out by an electric power system seeking energy efﬁciency have led to satisfying results in the reduction of consumption, as well as in terms of technical losses, security increase, and system reliability. Objective: The purpose of this article is to identify a method offering the best optimization outcome for the power ﬂow of an energy distribution system with 10 nodes at 13,2 kV. Methodology: The results obtained from the voltage proﬁles are presented for a 10-node energy distribution system using the Newton Raphson method. Afterwards, the system was optimized using genetic and ant colony algorithms. Results: The implementation of these techniques determined that the sum of the potential differences of distribution lines is notably reduced with the genetic algorithm. However, the ant colony optimization code takes less time to run and has a lower number of iterations. Conclusions: The most efﬁcient optimization is achieved with the genetic algorithm, given that the evolution of the population shows better optimization levels in comparison to the ant colony algorithm.


Materials and Methods 153
Genetic Algorithms 155

Introduction
Currently, the study and calculation of load flows in power systems is becoming a highly relevant matter (Arito, 2010).The purpose of calculating power flow is to find the values of the nodal voltages and use these variables to determine the flows in the distribution lines.The data obtained are an important tool for the design, planning, operation, and control of electric systems (Costa et al., 2001).
In most cases, the calculation of voltage values requires solving a system of simultaneous nonlinear equations.To this effect, the Newton-Raphson (NR) and Gauss-Siedel (GS) iterative methods are considered as an important basis for comparison with any artificial intelligence algorithm (Huertas, 2016).The NR method consists of an iterative procedure in which non-linear equations are used, involving variables such as voltage magnitude, voltage angle, active power, and reactive power.Since there are only two power equations, the remaining variables must be calculated (Játiva-Ibarra et al., 2014).In (Pranith & Bhatti, 2015), the NR method is used to calculate photovoltaic parameters and carry out the modeling process.The GS method is an iterative strategy in which the number of unknown variables is equal to the number of equations to be solved.It consists of designing a converging succession according to previously defined criteria (Collado & López-Sarmiento, 2010).The convergence values are the solutions of the nodal voltages and powers of the electric system.In (Byun et al., 2009), the GS method is chosen to accelerate the solution of power flows in a high-performance reconfigurable computer.
The NR method converges faster than GS.However, this swiftness is overshadowed by the large amount of memory and computational resources required for the execution of the algorithm (Pravos García, 2017 ).Both methods can lead to convergence problems or incorrect solutions in special cases involving power systems or under low impedances (Remolino & Paredes, 2009).Therefore, it is appropriate to research other methods to solve these types of problems.
The continuous progress achieved in the field of artificial intelligence has enabled the use of different meta-heuristic methodologies to deliver approximations of the power flow algorithms described above.A clear example of this is shown in the work by (Haghrah et al., 2016), where the authors studied a coded genetic algorithm with the improved mutation of Mühlenbein (RCGA-IMM).Thus, This technique mainly focuses on the creation of distinctive bubbles throughout a circle or path.The algorithm operates similarly, seeking the best solution for the target (prey) or the closest one.Hence, in this research, the optimal solution represents the efficiency and viability of WOA and its capacity to obtain better solutions for the load flow convergence in comparison with other optimization techniques regarding operational costs and robust power system implementation.

Materials and Methods
The starting point for obtaining the necessary data to solve a power flow problem is the one-line diagram of the power system.The input data includes information regarding nodes, transmission lines, transformers, and generators.Their values are used to form the bar admittance matrix of the power system.To build this matrix, the equivalent circuit of the power system must be simplified, so that there is a single admittance between two nodes and a single admittance between each node and the ground.
The one-line diagram used in this exercise is based on the IEEE 1250 estandard (IEEE, 2018), given that it represents a general use power system in rural distribution networks of medium-level voltage in Colombia.This power system comprises 10 nodes, where 2 of them are generator nodes.Figure 1 shows the one-line diagram of the power system.
The nodes of the power system are those in which two or more elements are interconnected (Khanacademy, 2018) while maintaining the same voltage level.In Table 1, the types of nodes of the power system are defined.
The load nodes or PQ nodes are those in which the net active and reactive powers are specified, whereas the voltage magnitude and phase angle are still unknown.The stable voltage nodes, or PV nodes, are the ones where the devices (such as synchronous generators) are located.These devices are capable of controlling the voltage magnitude in the terminals through the generation or absorption of the reactive power.In the compensation nodes or SLACK nodes, the known variables are the voltage magnitude in the bar and its phase angle, which serve as a reference for the phase angle in the other bars.In general, the phase angle is set at 0°.
The distribution power lines are in charge of interconnecting the nodes, thus carrying the energy from the generation points up to the load connection points of for final use.The distribution lines in the medium-level voltage are often made of ACSR (Aluminum-Conductor Steel-Reinforced) cables, naked conductors with a steel structure designed for the power level of 13,2 kV.The conductor that meets the power distribution requirements that was chosen to be used for simulation purposes is  Quail (CENTELSA, 2011).Table 2 shows its electric parameters.
The structure that supports the distribution network is from Codensa's LA 204 regulation (2011) (Figure 2).This structure is commonly used in rural distribution networks as a basis for modeling line calculations.
Table 3 includes the length and impedances of the lines that interconnect the nodes.
The loads are the elements of the system that consume energy for its designated end-use.All loads connected to the PQ nodes are modeled in the same way.For this power system, the loads are set with a lagging power factor of 0,6, an active power of 0,3, and a reactive power of 0,4.Traditional methods used to solve power system flows lead to obtaining the values in the nodal voltages that comprise them.Higher potential differences between nodes translate into higher energy losses within the power system.Equation (1) represents the sum of voltage differences between the nodes that are interconnected through a line: where V Lf represents the voltage of the final node of line L, and V Li is the value of the voltage in the initial node of L, beginning from the first distribution line and up to the n th distribution line, where n is the number of lines interconnected in the power system.Source: (CENTELSA, 2011).
The purpose of implementing genetic algorithms and ant colony optimization methods is to minimize the sum of potential differences of all system nodes and, hence, reduce the system losses.

Genetic Algorithms
Genetic Algorithms are systematic methods used to solve search and optimization problems, which are based on biological evolution processes such as population-based selection, sexual reproduction, and mutation (Mora et al., 2016).Figure 3 shows a flow diagram of the genetic algorithm that explains the general operation of the code for the solution of the system in to solve and optimize the solution of power flow.This is carried out for each individual within the population that begins or continues to live in the coded system, starting with random values of the voltage magnitude and phase angle in the bars to be optimized.

Ant Colony Optimization
Solving computational problems by using ACO involves analyzing the behavior of ants and their pheromone-based communication.Pheromones lead ants to find the shortest paths between their nest and possible food sources (Soifer & Loiseau, 2015).Figure 4 shows the flow diagram of the algorithm.
The iterative procedure of ACO is based on the probabilistic methods described below.The k th ant moves from state X to state Y with the probability shown in Equation (2).Source: (CENTELSA, 2011).
where τ xy is the number of pheromones deposited in the transition from state x to y, α ≥ 0 is a parameter used to control the influence of τ , and η is the convenience of state xy (an a priori knowledge commonly defined as 1/dx, where d is the distance and β ≥ 1 is a parameter controlling the influence of η xy ).
The ACO method consists of three phases: 1) parameter initialization, 2) exploration phase, and and 3) exploitation phase.This method was used to solve and optimize the 10-node power system.

Results
This section presents the nodal voltages obtained after the execution of the NR algorithm, GAs and ACO.Then, the errors from GA and ACO are computed based on the data derived from NR.

Execution of the Newton-Raphson algorithm
In order to compare the results between GA and ACO, the power flow is computed for the NR method.These results are then used to establish a comparison.The voltage profiles derived from the simulation of the power system with this method are presented in Table 4, where nodes 3, 4, and 10 remain under the 95 % threshold.Source: Authors.

Execution of the GA
Table 5 shows the execution results of the GA.The voltage values in every node are significantly increased and, hence, optimize the power system.PG and PD are in MW, and QG and QD are in MVAR.
Table 6 shows that the GA can be used to calculate the system power flow and determine the energy distribution in the lines.
The result of the GA was solved within 106 generations, with a population of 300 individuals, and 150 crossing operations in every generation.

Execution of the Ant Colony Optimization
The ant colony algorithm was programmed so that the execution results of the NR method could serve as its input parameters.To this effect, the possible paths where the ant could pass through were defined by stating an analogy between the distances and potential differences within transmis- Hernández., C. Sánchez-Huertas., W. y Gómez., V.
Table 10 shows the results obtained after five iterations of the algorithm.The voltage levels increase in nodes 2, 3, 4, 6, 7, 8, and 10, since there is a compensation in the reactive power generated in each node.Table 11 shows the corrections applied to the Q generated in the nodes after nine iterations of the algorithm.Source: Authors.

Comparison of results
In order to compare which algorithm offers the best optimization, the voltage magnitudes derived from the algorithms are shown in Figure 5, which shows an increase in the voltage of every node within the power system with GA compared to NR and with ACO compared to NR. Genetic  Source: Authors.
algorithms optimize the voltage profiles in the system nodes by 2,46 times more than the ant colony optimization.
Table 12 shows the percentage of errors obtained after running the GA and ACO methods.The GA optimization is more effective, given that no node has a percentage error higher than 1 %.
Table 13 shows the sum of the voltage differences between the system power lines for each algorithm used in the calculation of the power flow.It is evidenced that the sum in NR is 0,775, the sum

Execution times of the algorithms
Table 14 shows the execution times of the discussed algorithms.The ACO method runs in 21,02 s, while the GA takes 7501 s, (54 s faster than ACO).

Number of iterations of the algorithms
Table 15 shows the number of iterations required by the program to converge.The GA converges in 106 iterations, whereas ACO converges in 9 iterations.

Analysis of Results
The GA was originally far from the solution and approached it exponentially as more generations were produced.It solved in 13 generations.The GA optimizes the system nodes outside of the defined range.In this example, it was evidenced that genetic algorithms are capable of solving power flow problems.Although only a few generations were necessary to find a solution with an acceptable tolerance, the solution can change depending on the initial population of the system.
GAs have the advantage of seeking a solution based on a population of 'dots' without the need for the derivatives of the power flow equations.Their disadvantage lies in the fact that they can be relatively slow in delivering a solution.Since the population size is proportionalv to the number of     nodes that obey probabilistic rules, many generations could be required to find a solution.
The ant colony algorithm has various limitations, since the definition of the algorithm used to solve power system flows requires an adjustment of the initial simulation conditions for the results to be coherent.This algorithm rapidly identifies the most unbalanced nodes of the system, yet its optimization process is not effective.

Conclusions
After executing the algorithms, it was determined that the sum of the potential differences in the distribution lines drastically drops with the GA.Nonetheless, the code takes less time to run and has a lower number of iterations compared to the ant colony alternative.Hence, it is concluded that GA requires more memory usage and computational resources.The most efficient optimization is achieved with GAs since the evolution of the population shows better optimization levels in comparison to the ant colony algorithm.The latter presents a low level of optimization in the detection of the paths with a higher potential difference.Genetic algorithms can be used to solve power flow problems, as an alternative to iterative methods such as Newton-Raphson and Gauss-Seidel.
optimization task is solved based on the cost function and the transmission-related losses, thus leading to satisfying results regarding load flow.Furthermore, (Nazari-Heris et al., 2019) studied the optimization of co-generation based on whale optimization algorithms (WOA), which are inspired in the behavior of humpback whales, particularly in their hunting patterns for fish close to the surface.

Figure 5 .
Figure 5. Nodal voltages for Newton Raphson vs ACO vs GA Source: Authors.

Table 1 .
Definition of the nodes of the distribution system Source: Authors.

Table 2 .
Parameter table for the conductor Optimal Power Flow in Electrical Energy Systems through Artificial Intelligence TechniquesHernández., C. Sánchez-Huertas., W. y Gómez., V.

Table 3 .
Distance between nodes and impedances of the lines Optimal Power Flow in Electrical Energy Systems through Artificial Intelligence TechniquesHernández., C. Sánchez-Huertas., W. y Gómez., V.

Table 4 .
Nodal voltages with the Newton-Raphson method

Table 6 .
Power flow with GA Source: Authors.

Table 7 .
Paths found by ant 1

Table 8 .
Paths found by ant 2

Table 9 .
Paths with the largest pheromone trails

Table 11 .
Reactive compensation in the nodes

Table 12 .
Percentage errors after the optimization of GA and ACO Optimal Power Flow in Electrical Energy Systems through Artificial Intelligence TechniquesHernández., C. Sánchez-Huertas., W. y Gómez., V.

Table 13 .
Potential difference between nodes Source: Authors.

Table 14 .
Execution times of the algorithms

Execution time of Newton Raphson (s) Execution time of the Genetic Algorithm (s) Execution time of the Ant Colony method (s)
Source: Authors.

Table 15 .
Number of iterations for each algorithm Source: Authors.