A Dynamic Optimal Power Flow of a Power System Based on Genetic Algorithm

• Genetic Algorithm and Newton Raphson (NR) based approach to Optimal Power Flow problem has been presented. • Both algorithms were tested on a 14-bus IEEE test system. • The Genetic Algorithm Optimization (GAs) is very efficient in solving the OPF problem. The traditional concepts and practices of power systems are superimposed by economic market management. So OPF has become complex, and classical optimization methods were used to solve OPF effectively. But, in recent years, Artificial Intelligence methods (GA, etc.) have emerged that can solve highly complex OPF problems. In this work two algorithms, were used for the solution of dynamic optimal power flow (OPF) problem taking the transmission losses and the cost of generation as the main constraints. Both algorithms were tested on a 14-bus IEEE test system. The contingency analysis was considered in the application of the algorithms. Additionally, a comparison was made between the two algorithms. The obtained results showed the effectiveness of the GA algorithm over the traditional algorithm. A R T I C L E I N F O Handling editor: Ivan A. Hashim


H I G H L I G H T S A B S T R A C T
• Genetic Algorithm and Newton Raphson (NR) based approach to Optimal Power Flow problem has been presented. • Both algorithms were tested on a 14-bus IEEE test system. • The Genetic Algorithm Optimization (GAs) is very efficient in solving the OPF problem.
The traditional concepts and practices of power systems are superimposed by economic market management. So OPF has become complex, and classical optimization methods were used to solve OPF effectively. But, in recent years, Artificial Intelligence methods (GA, etc.) have emerged that can solve highly complex OPF problems. In this work two algorithms, were used for the solution of dynamic optimal power flow (OPF) problem taking the transmission losses and the cost of generation as the main constraints. Both algorithms were tested on a 14-bus IEEE test system. The contingency analysis was considered in the application of the algorithms. Additionally, a comparison was made between the two algorithms. The obtained results showed the effectiveness of the GA algorithm over the traditional algorithm.

Introduction
The Optimal Power Flow (OPF) problem is the most complicated and challenging problem in power system analysis and design, it is a nonlinear optimization problem. The objective of the OPF is to minimize the total operating cost and total losses, subjected to many constraints such as total generation must equal to total load plus total losses, and the voltage profile must be within their limits. The OPF problem is a combination between economic dispatch and the power flow [1]. Optimal power flow solution methods have been developed over the years to meet this efficient requirement of power system operation. Because the OPF is a vast, non-linear mathematical programming problem, it has taken decades to develop efficient algorithms for its solution. Many different mathematical techniques have been employed for its solution [2]. SURESH [3] developed an online method for unified OPF that maximizes the system voltage stability margin while minimizing system generation costs and system transmission loss using a Back propagation memory model (BPN) based neural network. Verma [4] used genetic algorithm, optimize particle swarm and the ABC methods to solve the optimal power flow (OPF) problem. Rahul and Sharma [5] presented A Genetic Algorithm (GA) for solving optimal power flow problems. The objective function was reducing transmission losses. Ajenikoko [6] used the shunt capacitor as an interactive compensation placed at specific generating stations to reduce generating cost and transmission loss. Attia [7] used the modified genetic algorithm with a population size adjustment on a 30-Bus test system to solve the optimal energy flow problem based on different objective functions. Duman. [8] represented a novel modified MSA with an arithmetic crossover (MSA-AC) to improve the search for a global optimum. Andreas Venzke [9] proposed a semidefinite relaxation of a chance-constrained AC-OPF, which guarantees global optimality. Shima Rahmani [10] proposed an enhanced natural restriction method (NNC) to improve optimal power flow (OPF), which was formulated as a multipurpose problem. Singh and Singh [11] presented a genetic algorithm to solve the problem of optimal energy flow. The goal is to reduce fuel cost and maintain energy returns for generators, transformers, capacitors/reactors, volts. Davoodi [12] proposed a novel equivalent convex optimization formulation for the Optimal Reactive Power Dispatch (ORPD) problem and presents a new framework for finding the global optimum. Kardos [13] used a security-constrained optimal power flow (SCOPF) that aims for the long-term operating state, such as in the event of any contingency. Deng [14] used two algorithms -a genetic algorithm with 291 the help of Krieging (KAGA) and the improvement of Krieging Auxiliary Creams (KAPSO). This work proposes a dynamic algorithm for solving optimal power flow problems using a Genetic algorithm by reducing the cost of power generation and transmitter losses.

Newton Raphson's method
The power flow study is a non-linear study used to estimate electrical quantities for network components. These quantities include real power, reactive power, voltage magnitude, and voltage angle. For large power systems, the Newton-Raphson (NR) method is the most efficient and practical. A more functional evaluation is required for each iteration to obtain a solution depending on the system size and the number of iterations.

Mathematical Formulation:
Considered as Newton Raphson Method, which is all inclusive of solving the non-square and nonlinear problems. The study also aims to compare the convergence rate of performance [15]. A general framework is presented to apply the Newton -Raphson method to solve power flow problems, using power functions, current mismatch in polar coordinates, Cartesian and complex form [16]. Complex power is needed to define the typical bus system at any bus in Figure (1) [17]. For the typical system shown in Figure (1). The current entering bus i is given by: Expressing this Equation in polar form gives The complex power at bus i is Substituting from Equation (2.13) in Equation (2.14) yields Separating the real and imaginary parts gives The two equations had for each load bus given by Equation (5) and Equation (6), and one equation for each voltage-controlled bus given by Equation (5). The terms ∆ ( ) and ∆ ( ) are the difference between the scheduled and calculated values known as the power residuals, given by: The new estimates for bus voltages are If the line security constraints are neglected, the optimal power flow problem with real and reactive power variables can be represented as below: such that Where: : The real power output of the generator connected to bus i.
: The reactive power output of the generator connected to bus i.
: The real power load connected to bus i.
: The reactive power load connected to bus i.
: The real power injection at bus i.
: The reactive power injection at bus i.
: The voltage magnitude at bus i. F: The total generator fuel cost function. The subscripts "min" and "max" in the equations represent the lower and upper limits of the constraint, respectively.

The structure of the Newton Raphson (NR) program:
Step 1. Read the input data: [Bus data, (Number of buses, Bus voltage, Voltage angle, Power generated and Load power)]; [Line data: (Line resistance, Line impedance, and Line capacitance].
Step 2. From the bus admittance matrix.
Step 3. Run the Newton-Raphson load flow.
Step 4. Obtains the loss formula coefficients.
Step 5. Compute the total cost $/h of generation.
Step 6. Obtain the optimum power flow of generation.
Step 7. If DP slack is greater than 0.05, then run the new OPF and go to step 8.
Step 8. Update the loss coefficients.
Step 9. Optimum power flow of generation with new B-coefficients.
Step 11. If DP slack is smaller or equal to 0.05, then go to step 12.
Step 12. Print the results.
Step 13. End the programs.

Genetic Algorithm Optimization Method:
The basic idea is to maintain a population of knowledge structures that represent candidate solutions for the current problem. The population evolves through competition (survival of the fittest) and controlled variation (recombination and mutation). in this way, the best elements of the current population are used to form the new population. If this is done correctly, the new population will be better than the old population [18]. The Genetic algorithms are powerful stochastic search algorithms based on the natural selection and natural genetics. A genetic algorithm works with a population of strings, searching many peaks in parallel. By employing genetic operators, they exchange information between the peaks, reducing the possibility of ending at a local optimum. Many optimization methods require derivative information, or worse yet, complete knowledge of the problem structure and parameters [19]. In contrast, genetic algorithms are more flexible than most search methods because they require only information concerning the quality of the solution produced by each parameter set (objective function values).

Mathematical Formulation:
It can be said that power generation cost and transmission losses are the most popular objective function in OPF studies, where the thermal generation unit costs are generally represented by a nonlinear, second-order function [18 & 19].
where F k is the fuel cost of unit k, P gk is the active power generated by unit k, and n g is the number of generators in the system, including the slack-bus generator. More specifically, where ak, bk, and ck are the cost coefficients of unit k.
While the objective function for total power transmission loss can be expressed as follows, [15] Where; =total transmission losses. = the voltage angle at bus i. =loading of plant m. , , =B-coefficients of the transmission loss formula. = the voltage magnitude at bus i. = the total number of transmission lines. , = the conductance of line i-j.

Application of GA on Optimal Power Flow:
Artificial intelligence (AI) technology, Fuzzy theory, and artificial neural network are being applied to solve various power systems. Genetic algorithms are becoming popular to solve optimization problems mainly because of their robustness in finding optimal solutions close to global minima.
GA has been applied to the power system to solve load flow problems, optimize reactive power transmission, economic dispatching, optimum power flow, etc.
In this work, a Genetic Algorithm program was written in the MATLAB environment. Taking into consideration fuel cost minimization and transmission line loss minimization. The structure of the proposed program is summarized as shown below: Step 1. Read Network Data (Such as Bus Loads, Lines parameters), Generator Data (Such active and reactive power limits, generation cost parameters), and initialize GA algorithm parameters (number of iterations, number of the initial population, best cost value,….).
Step 2. Generate random of (n) chromosomes population as an initial population (initial solutions for the active power generated in PV buses).
Step 3. Solve power flow based on the PV bus generated values (according to the current chromosome values) and calculate the slack bus power to satisfy the power balance equality constraint.
Step 4. Calculate the objective function (generation cost) value for this chromosome.
Step 5. If the objective function value is lower than the best cost value (G best), set G best equal to the generation cost and return the best solution in the current population; otherwise, go to step 6.
Step 6. If all populations are evaluated, go to step 7; otherwise, go to step 3.
Step 7. If the GA convergence criterion is satisfied and all iterations are done, go to step 9; otherwise, go to step 8.
Step 8. Improve populations' fitness by GA operators such as select, Cross over, and Mutations, then create new offspring and go to step 3.
Step 9. G's best value and its related chromosome are optimal for the generation cost and active power generation for PV buses, respectively.
Step 10. The end.

Case Study:
The IEEE 14-bus standard system contains (14)  The conventional power flow problem for the IEEE 14-Bus Standard System was solved using the Newton-Raphson method. The results were compared with reference [2]. Table (1) shows the voltage magnitude results at each bus from applying the Newton-Raphson method. Note that buses (1 to 5) are generator bus, so the voltage magnitude of these buses are left unchanged. Table (2) gives the production cost of the active and reactive power loss when applying the Newton-Raphson method on the 14-Bus system.   The genetic algorithm (GA) method has been applied to IEEE 14-Bus standard system. The active power production cost is considered an objective function to minimize the total production cost. Table (3) shows the voltage magnitude, active power, reactive power generation, active and reactive load at each bus from applying the Genetic Algorithm Optimization method. It also shows the voltage magnitude obtained from applying the Genetic Algorithm (GA) method, where buses (1 to 5) are generator bus so that the voltage magnitude of these buses is left unchanged. In contrast, the other buses (6 to 11) are load buses. As shown in Table (3), all the voltage magnitudes of these buses are attained within limits. Table (4) gives the production cost and active and reactive power loss when applying the GA algorithm method on the 14-Bus system.   (7) shows the values of voltage magnitude, active power, reactive power generation, active and reactive load at each bus from the applications of the Genetic Algorithm Optimization method, the Newton-Raphson method, on the 14-Bus system. Table (8) shows the cost values and the active and reactive losses.

Case C: Separate one of the transmission lines:
Upon Removal of the transmission line (12)(13), we get the following results

Newton Raphsonaplication:
Table (9) shows the values of voltage magnitude, Active Power, Reactive Power Generation, Active and Reactive Load at each bus from the application of the Newton-Raphson method. Table (10) gives the production cost, the active and reactive power loss when applying the Newton-R

Genetic Algorithm Optimization Application:
Table (11) shows the values of voltage magnitude, active power, reactive power generation, active and reactive load at each bus from applying the Genetic Algorithm Optimization method. Aphson method on the 14-Bus system. Table (12) gives the production cost and active and reactive power loss when applying the GA method on the 14-Bus system.

Case D: Separation of a bus bar power (active and reactive)
This study considers the separation of bus 2 power generation.

Newton Raphson Plication:
Table (13) shows the values of voltage magnitude, Active Power, Reactive Power Generation, Active and Reactive Load at each bus from the application of the Newton-Raphson method. Table (14) gives the production cost and active and reactive power loss when applying the Newton-Raphson method on the 14-Bus system.

Genetic Algorithm Optimization Application:
Table (15) shows the values of voltage magnitude, active power, reactive power generation, active and reactive load at each bus from applying the Genetic Algorithm Optimization method. Table (16) gives the production cost and active and reactive power loss when applying the GA method on the 14-Bus system.

Comparison between the two methods concerning the four cases:
This section will compare the results obtained from applying Newton-Raphson (NR) and Genetic Algorithm Optimization (GA) from the optimal power flow point of view. Table (17) shows the comparison between the application of Newton-Raphson (NR) and Genetic A. Comparing the cost production values and the power losses between both methods indicates that the GA is more accurate and efficient than the conventional Newton-Raphson Algorithm. Algorithm Optimization (GA) methods were applied to the 14-bus system.

Conclusions
In this work, a Genetic Algorithm (GA) and Newton Raphson (NR) based approach to the Optimal Power Flow (OPF) problem has been presented, considering the minimization of production cost and transmission loss. The effectiveness of the proposed algorithms has been tested on the 14-bus network. In case (A), all the voltages magnitudes of these buses are attained within limits. In case (B), the values of voltage magnitude, active power, reactive power generation, active and reactive load at each bus from the application of the Genetic Algorithm Optimization method. In case (C), the values of voltage magnitude, active power, reactive power generation, active and reactive load at each bus from the application. Finally, in case (D), the values of voltage magnitude, Active Power, Reactive Power Generation, Active and Reactive Load at each bus from the application of Newton-Raphson method. From the obtained results, the Genetic Algorithm Optimization (GAs) is very efficient in solving the OPF problem by minimizing the transmission losses and the generating cost while maintaining system security (voltage levels and minimum and maximum power limits).