The Optimization of the Location and Capacity of Reactive Power Generation Units, Using a Hybrid Genetic Algorithm Incorporated by the Bus Impedance Power-Flow Calculation Method

: Dynamic and static reactive power resources have become an important means of maintaining the stability and reliability of power system networks. For example, if reactive power is not appropriately compensated for in transmission and distribution systems, the receiving end voltage may fall dramatically, or the load voltage may increase to a level that trips protection devices. However, none of the previous optimal power-ﬂow studies for reactive power generation (RPG) units have optimized the location and capacity of RPG units by the bus impedance matrix power-ﬂow calculation method. Thus, this study proposes a genetic algorithm that optimizes the location and capacity of RPG units, which is implemented by MATLAB. In addition, this study enhances the algorithm by incorporating bus impedance power-ﬂow calculation method into the algorithm. The proposed hybrid algorithm is shown to be valid when applied to well-known IEEE test systems.


Introduction
Reactive power plays an important role in maintaining the stability and reliability of transmission and distribution power systems. As a consequence, various dynamic (synchronous generators, synchronous condensers, and solid-state devices) and static reactive power sources (capacitive and inductive compensators, as well as inverter-based distributed generators) have been deployed over the past few decades [1]. In particular, reactive power generation (RPG) units have been deployed at the optimal location for voltage control in transmission and distribution systems. If reactive power is not appropriately compensated, receiving ends may experience voltage variations outside ±5% of the rated voltage, possibly leading to automatic tripping of protection devices and low power factors.
As renewable energy deployments increase, the optimal allocation of RPG units should take photovoltaic (PV) systems [23], wind turbine generators (WTGs) [24,25], and microgrids [26] into account. For example, the effect of optimally allocated distributed generation (DG) units on energy Since the case studies included buses, lines, loads, generators, shunt capacitors, tap-changing transformers, P-Q, P-V, and slack buses, the results show that the proposed power-flow calculation method can be used to analyze many different power system configurations. This study integrates the bus impedance power-flow calculation into a GA. As a result, the proposed hybrid GA can be also used for operating, planning, or upgrading transmission systems by optimally allocating RPG units. In particular, PV and WTGs able to control reactive power or with the capability of Volt/Var control management can be optimally allocated by the proposed hybrid GA.

Structure of This Paper
This paper is organized as follows: Section 2 discusses the bus impedance power flow method, Section 3 contains the proposed GA, Section 4 presents case studies, and Section 5 summarizes the paper's major conclusions.

Bus Impedance Power Flow Method
The Newton-Raphson and fast-decoupled power-flow calculation methods that use the admittance matrix require the inverse of the Jacobian matrix. Such an inverse of the matrix can take a long time for a system with thousands or more nodes. Thus, this study proposes a power-flow calculation method that does not require the inverse of the Jacobian matrix, which is the main benefit of the proposed method. The proposed power-flow method evaluates the fitness of population members of the GA when optimally allocating RPG units. The detailed implementation of the GA is presented in the next section. Figure 1 shows a power system network with n nodes. The n × n impedance matrix (Z bus ) can represent the system as driving-point impedances (diagonal elements) and transfer impedances (off-diagonal elements). This study uses the well-known four rules that build the Z bus matrix [39].

Bus Impedance Matrix
Appl. Sci. 2020, 10, x FOR PEER REVIEW 3 of 19 This paper is organized as follows: Section 2 discusses the bus impedance power flow method, Section 3 contains the proposed GA, Section 4 presents case studies, and Section 5 summarizes the paper's major conclusions.

Bus Impedance Power Flow Method
The Newton-Raphson and fast-decoupled power-flow calculation methods that use the admittance matrix require the inverse of the Jacobian matrix. Such an inverse of the matrix can take a long time for a system with thousands or more nodes. Thus, this study proposes a power-flow calculation method that does not require the inverse of the Jacobian matrix, which is the main benefit of the proposed method. The proposed power-flow method evaluates the fitness of population members of the GA when optimally allocating RPG units. The detailed implementation of the GA is presented in the next section. Figure 1 shows a power system network with n nodes. The n × n impedance matrix (Zbus) can represent the system as driving-point impedances (diagonal elements) and transfer impedances (offdiagonal elements). This study uses the well-known four rules that build the Zbus matrix [39].

Iterative Current Injection Method
The iterative bus impedance power-flow calculation method was originally presented in [40]. The Zbus matrix power-flow calculation method uses the following matrix form of Ohm's law for current that flows in each node and voltage induced to each node: In Figure 2, the currents that flow to the constant power load are calculated by The current that flow to the constant current load are calculated by The currents that flow to the constant impedance load are calculated by

Iterative Current Injection Method
The iterative bus impedance power-flow calculation method was originally presented in [40]. The Z bus matrix power-flow calculation method uses the following matrix form of Ohm's law for current that flows in each node and voltage induced to each node: In Figure 2, the currents that flow to the constant power load are calculated by The current that flow to the constant current load are calculated by The currents that flow to the constant impedance load are calculated by The currents that flow to the ground through parallel elements are also calculated by The currents flowing to loads and the ground are added by Appl. Sci. 2020, 10, 1034 The currents are also iteratively used in Equation (1). However, the currents in Equation (6) are estimated from the initial nominal voltage. That is, they do not take the voltage variation caused by loads, generators, shunt capacitors, and transformers into account. Therefore, Equations (1) and (6) are repeated until the following convergence: Appl. Sci. 2020, 10, x FOR PEER REVIEW 4 of 19 The currents that flow to the ground through parallel elements are also calculated by The currents flowing to loads and the ground are added by The currents are also iteratively used in Equation (1). However, the currents in Equation (6) are estimated from the initial nominal voltage. That is, they do not take the voltage variation caused by loads, generators, shunt capacitors, and transformers into account. Therefore, Equations (1) and (6) are repeated until the following convergence:

Tap-Changing Transformer Model
The bus impedance power-flow calculation method, originally presented in [40], is usually not used in power-flow studies, or the method is used in analyzing a system without transformers because the method cannot analyze tap-changing transformers. However, most transmission and distribution systems include tap-changing transformers to change the secondary-side voltage. Therefore, such a transformer should not be ignored in a power-flow calculation algorithm.
If a tap-changer with a turns ratio of a is on the low-voltage (or secondary) side in Figure 3, the admittance matrix, Ybus, is Where Ym0 and Yn0 are the line capacitances beside the transformer. To model the tap-changing transformer depicted in Figure 3 in the proposed method, this study proposes decomposing the transformer model into two parts: the series and parallel elements in Figure 4.

Tap-Changing Transformer Model
The bus impedance power-flow calculation method, originally presented in [40], is usually not used in power-flow studies, or the method is used in analyzing a system without transformers because the method cannot analyze tap-changing transformers. However, most transmission and distribution systems include tap-changing transformers to change the secondary-side voltage. Therefore, such a transformer should not be ignored in a power-flow calculation algorithm.
If a tap-changer with a turns ratio of a is on the low-voltage (or secondary) side in Figure 3, the admittance matrix, Y bus , is where Y m0 and Y n0 are the line capacitances beside the transformer. The currents that flow to the ground through parallel elements are also calculated by The currents flowing to loads and the ground are added by The currents are also iteratively used in Equation (1). However, the currents in Equation (6) are estimated from the initial nominal voltage. That is, they do not take the voltage variation caused by loads, generators, shunt capacitors, and transformers into account. Therefore, Equations (1) and (6) are repeated until the following convergence:

Tap-Changing Transformer Model
The bus impedance power-flow calculation method, originally presented in [40], is usually not used in power-flow studies, or the method is used in analyzing a system without transformers because the method cannot analyze tap-changing transformers. However, most transmission and distribution systems include tap-changing transformers to change the secondary-side voltage. Therefore, such a transformer should not be ignored in a power-flow calculation algorithm.
If a tap-changer with a turns ratio of a is on the low-voltage (or secondary) side in Figure 3, the admittance matrix, Ybus, is Where Ym0 and Yn0 are the line capacitances beside the transformer. To model the tap-changing transformer depicted in Figure 3 in the proposed method, this study proposes decomposing the transformer model into two parts: the series and parallel elements in     To model the tap-changing transformer depicted in Figure 3 in the proposed method, this study proposes decomposing the transformer model into two parts: the series and parallel elements in Figure 4.  The proposed method builds the Zbus matrix of the series elements in Figure 4. The matrix also includes lines without transformers. The final Zbus matrix is used in (1) during iterations. Additionally, the proposed method builds the Ybus matrix of the parallel elements in Figure 4, calculates

Genetic Algorithm
Optimal allocation of the capacity and location of RPG units can be treated as an optimization problem. Thus, this study presents a GA that includes the proposed power-flow calculation method. The GA finds one or more RPG units and their capacities to minimize the following objective function.

Objective Function
The proposed GA defines, as its objective function, the minimizing of the weighted sum of three parameters: variation in voltage to a set value (e.g., 1.0 p.u.), the installation cost of RPG units, and total losses. , , , subject to The proposed method builds the Z bus matrix of the series elements in Figure 4. The matrix also includes lines without transformers. The final Z bus matrix is used in (1) during iterations. Additionally, the proposed method builds the Y bus matrix of the parallel elements in Figure 4, calculates I m 0 and I n 0 by (5), and adds them to Equation (6). As a result of this compensation (I m 0 and I n 0 ), the proposed method can solve the problem of applying the conventional bus impedance, matrix power-flow calculation method to tap-changing transformers.

Genetic Algorithm
Optimal allocation of the capacity and location of RPG units can be treated as an optimization problem. Thus, this study presents a GA that includes the proposed power-flow calculation method. The GA finds one or more RPG units and their capacities to minimize the following objective function.

Objective Function
The proposed GA defines, as its objective function, the minimizing of the weighted sum of three parameters: variation in voltage to a set value (e.g., 1.0 p.u.), the installation cost of RPG units, and total losses.
subject to

Optimization Variables
To optimally allocate the capacity and location of RPG units, the following optimization variables are defined.
(1) Capacity: the capacity of an RPG unit is optimally determined with the following constraint.
(2) Location: RPG units can be connected to any bus, except the slack bus.
(3) Demand: the optimization of RPG units should take continuously varying demands into account during the optimization period. Thus, this study collected the typical load profile data in Figure 5 from [41]. The data show a peak demand of 1.0 p.u. at 15:00, and a load factor of 0.68. These data are used as input for GA.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 6 of 19 To optimally allocate the capacity and location of RPG units, the following optimization variables are defined.
(1) Capacity: the capacity of an RPG unit is optimally determined with the following constraint.
(2) Location: RPG units can be connected to any bus, except the slack bus.
(3) Demand: the optimization of RPG units should take continuously varying demands into account during the optimization period. Thus, this study collected the typical load profile data in Figure  5Error! Reference source not found. from [41]. The data show a peak demand of 1.0 p.u. at 15:00, and a load factor of 0.68. These data are used as input for GA.

Genetic Algorithm
(1) Initialization: the GA initializes offspring members of the first generation with uniform random numbers. The offspring, O, is defined by where A = { ai | ai is a bus, excluding a slack bus } and Smax represents maximum capacity. (2) Fitness and reproduction: the objective function (14) calculates a fitness score for each offspring member. A normalized geometric ranking selection scheme is used [42]. A lower geometric rank (Ri) means a lower objective function value. Each slot size of a scaled roulette wheel is calculated by where p is the probability that produces the fittest offspring, and Pi is the probability of the slot size of the scaled roulette wheel. Subsequently, the GA distributes random numbers to the scaled roulette wheel's slots, according to slot size (probability), and reproduces offspring members according to the number of random numbers that belong to each slot. This means that offspring with higher fitness in their objective function have a higher selection probability.

Genetic Algorithm
(1) Initialization: the GA initializes offspring members of the first generation with uniform random numbers. The offspring, O, is defined by where A = { a i | a i is a bus, excluding a slack bus } and S max represents maximum capacity. (2) Fitness and reproduction: the objective function (14) calculates a fitness score for each offspring member. A normalized geometric ranking selection scheme is used [42]. A lower geometric rank (R i ) means a lower objective function value. Each slot size of a scaled roulette wheel is calculated by where p is the probability that produces the fittest offspring, and P i is the probability of the slot size of the scaled roulette wheel.
Subsequently, the GA distributes random numbers to the scaled roulette wheel's slots, according to slot size (probability), and reproduces offspring members according to the number of random numbers that belong to each slot. This means that offspring with higher fitness in their objective function have a higher selection probability.
(3) Crossover and mutation: an arithmetic crossover operation that combines two offsprings (O i and O j ) is performed in Figure 6, so it produces new offsprings: O i ' and O j '. To avoid convergence to a local minimum, a new offspring member, O k ', is also generated by single-position uniform mutation in Figure 7.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 7 of 19 (3) Crossover and mutation: an arithmetic crossover operation that combines two offsprings (Oi and Oj) is performed in Figure 6, so it produces new offsprings: Oi' and Oj'. To avoid convergence to a local minimum, a new offspring member, Ok', is also generated by single-position uniform mutation in Figure 7.   Figure 8 shows the detailed workflow of the proposed algorithms. The proposed GA calculates the probability of each slot of the scaled roulette wheel, generates random numbers on the wheel, counts the number of random numbers that belong to each slot, and reproduces offspring members. The detailed parameters for the proposed GA are presented in the following case studies.  (3) Crossover and mutation: an arithmetic crossover operation that combines two offsprings (Oi and Oj) is performed in Figure 6, so it produces new offsprings: Oi' and Oj'. To avoid convergence to a local minimum, a new offspring member, Ok', is also generated by single-position uniform mutation in Figure 7.   Figure 8 shows the detailed workflow of the proposed algorithms. The proposed GA calculates the probability of each slot of the scaled roulette wheel, generates random numbers on the wheel, counts the number of random numbers that belong to each slot, and reproduces offspring members. The detailed parameters for the proposed GA are presented in the following case studies.
The results produced by the proposed bus impedance, Newton-Raphson, Gauss-Seidel, and decoupled power-flow calculation methods implemented in MATLAB show consistency with one another. The detailed voltage profile data are presented in the Appendix A. For example, a tapchanging transformer between buses 4 and 7 (with a transformer turns ratio of 0.978) modeled by the proposed power-flow method increases the primary side voltage of 0.95433∠−11.645° p.u. to the secondary side voltage of 0.98343∠−15.117° p.u. Figure 10 presents a convergence curve of the Start Build the impedance matrix (Z bus ) of the test system.
Read the data related to the objective function: 1) Weighting factors, RPG unit installation costs, and worst case costs. 2) Constraints: V min , V max , P min , P max , Q min , and Q max . 3) GA parameters: p, P c , P m , and the number of populations and generations. 4) Read load profile data.
Initialize the 1 st generation offspring members (with uniform random numbers) that include the location and capacity of RPG units.
Calculate the power flow of the system with each offspring member during the total simulation period (e.g., one day in hourly intervals).
All offspring members converge to a single offspring member?
Calculate the fitness on offspring members.

Crossover of offspring members
Reproduction of offspring members

Validation of Power-Flow Calculation Method
To verify the proposed power-flow calculation algorithm, this case study calculates the power flow of the IEEE 14-bus system in Figure 9 [43,44]. The system includes 14 buses, 1 slack bus (1.0∠0 • ), 4 P-V buses (a magnitude of voltage of 1.0 p.u.), 11 loads (in total: P + jQ = 259 + j73.5 MVA), 1 shunt capacitor (j0.19 p.u.), 1 generator (with 40 MW), and three tap-changing transformers (buses 4-7, 4-9, and 5-6). The other detailed system data are available in [43,44] Figure 11 shows the IEEE 30-bus test system [44,45]. The system includes a slack bus, five P-V buses, two shunt capacitors, twenty-one loads, and four tap-changing transformers. The detailed system data are available in [44,45]. Tables A1 and A2, presented in the Appendix A compare the power-flow calculation results determined by the proposed method to those produced by the Newton-Raphson, Gauss-Seidel, and decoupled power-flow calculation methods implemented in MATLAB. The results show good consistency with each other. As the third validation, Figure 12 shows the power-flow calculation results of the IEEE 57-bus test system, determined by the proposed method, to those produced by the Newton-Raphson and Gauss-Seidel methods. The detailed system data are available in [44,46]. The results show consistency with each other.
Since the test systems contains typical transmission system elements (i.e., loads, slack, P-V, P-Q buses, shunt capacitors, generators, and tap-changing transformers), the proposed power-flow method can be integrated into the proposed GA.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 10 of 19 Figure 11 shows the IEEE 30-bus test system [44,45]. The system includes a slack bus, five P-V buses, two shunt capacitors, twenty-one loads, and four tap-changing transformers. The detailed system data are available in [44,45]. Table 3 presented in the Appendix A, compares the power-flow calculation results determined by the proposed method to those produced by the Newton-Raphson, Gauss-Seidel, and decoupled power-flow calculation methods implemented in MATLAB. The results show good consistency with each other. As the third validation, Figure 12 shows the power-flow calculation results of the IEEE 57-bus test system, determined by the proposed method, to those produced by the Newton-Raphson and Gauss-Seidel methods. The detailed system data are available in [44,46]. The results show consistency with each other.
Since the test systems contains typical transmission system elements (i.e., loads, slack, P-V, P-Q buses, shunt capacitors, generators, and tap-changing transformers), the proposed power-flow method can be integrated into the proposed GA.

Validation of the Genetic Algorithm
To find the optimal location and capacity of RPG units, this case study was run with the following assumptions: (1) The maximum capacity of an RPG unit is 100% of the base MVA of the system (i.e., 100 MVA); (2) RPG units can be connected to all buses except the slack bus; (3) The weighting factors in the objective function are equal; (4) The nominal voltage of the slack and P-V buses is set to 1∠0° p.u. Table 1 presents the parameters of the GA. The parameters are determined by trial and error optimization [34,[47][48][49]. To validate the proposed GA implemented in MATLAB, this case study was configured to optimally allocate RPG units in the IEEE 14-and 30-bus systems [43][44][45][46].

IEEE 30-Bus System
As the first case study, this study optimally allocates RPG units in the IEEE 30-bus system in Figure 11.

Validation of the Genetic Algorithm
To find the optimal location and capacity of RPG units, this case study was run with the following assumptions: (1) The maximum capacity of an RPG unit is 100% of the base MVA of the system (i.e., 100 MVA); (2) RPG units can be connected to all buses except the slack bus; (3) The weighting factors in the objective function are equal; (4) The nominal voltage of the slack and P-V buses is set to 1∠0 • p.u. Table 1 presents the parameters of the GA. The parameters are determined by trial and error optimization [34,[47][48][49]. To validate the proposed GA implemented in MATLAB, this case study was configured to optimally allocate RPG units in the IEEE 14-and 30-bus systems [43][44][45][46]. Table 1. Parameters of the genetic algorithm (GA).

IEEE 30-Bus System
As the first case study, this study optimally allocates RPG units in the IEEE 30-bus system in Figure 11.  Figure 13 depicts the standard deviation of the objective function for offspring members over multiple generations. Since the variation converges to zero, the proposed GA determines the fittest single offspring member (i.e., a solution to the optimization problem). Figures 14 and 15 examine the effect of optimally allocated RPG units in the IEEE 30-bus system on voltage magnitude ( Figure 14) and losses ( Figure 15). The PRG units optimally allocated by the proposed hybrid GA provide less variation in voltage than the case that is not optimized, and reduce losses.
Appl. Sci. 2020, 10, x FOR PEER REVIEW  12 of 19 13 depicts the standard deviation of the objective function for offspring members over multiple generations. Since the variation converges to zero, the proposed GA determines the fittest single offspring member (i.e., a solution to the optimization problem). Figures 14 and 15 examine the effect of optimally allocated RPG units in the IEEE 30-bus system on voltage magnitude ( Figure 14) and losses ( Figure 15). The PRG units optimally allocated by the proposed hybrid GA provide less variation in voltage than the case that is not optimized, and reduce losses.   13 depicts the standard deviation of the objective function for offspring members over multiple generations. Since the variation converges to zero, the proposed GA determines the fittest single offspring member (i.e., a solution to the optimization problem). Figures 14 and 15 examine the effect of optimally allocated RPG units in the IEEE 30-bus system on voltage magnitude ( Figure 14) and losses ( Figure 15). The PRG units optimally allocated by the proposed hybrid GA provide less variation in voltage than the case that is not optimized, and reduce losses.

IEEE 14-Bus System
This study optimizes the capacity and location of RPG units in the IEEE 14-bus system in Figure  9. For the IEEE 14-bus system, the proposed GA optimally allocates six RPG units, with a total capacity of 90 MVA (53 MVA in bus 3, 11 MVA in bus 7, 8 MVA in bus 10, 2 MVA bus 12, 7 MVA in bus 13, and 9 MVA in bus 14), in order to minimize variation in voltage, the installation cost of RPG units, and losses. Figure 16 depicts the objective function's standard deviation for offspring members over multiple generations when the proposed GA finds a solution with an objective function of 0.07735. Since the variation converges to zero, the proposed GA determines the fitter single offspring member (i.e., a solution to the optimization problem). Figures 17 and 18 present the effect of optimally allocated RPG units in the test system on voltage magnitude and losses. The PRG units optimally allocated by the proposed hybrid GA provide less variation in voltage than the case that is not optimized, and reduce losses.

IEEE 14-Bus System
This study optimizes the capacity and location of RPG units in the IEEE 14-bus system in Figure 9. For the IEEE 14-bus system, the proposed GA optimally allocates six RPG units, with a total capacity of 90 MVA (53 MVA in bus 3, 11 MVA in bus 7, 8 MVA in bus 10, 2 MVA bus 12, 7 MVA in bus 13, and 9 MVA in bus 14), in order to minimize variation in voltage, the installation cost of RPG units, and losses. Figure 16 depicts the objective function's standard deviation for offspring members over multiple generations when the proposed GA finds a solution with an objective function of 0.07735. Since the variation converges to zero, the proposed GA determines the fitter single offspring member (i.e., a solution to the optimization problem). Figures 17 and 18 present the effect of optimally allocated RPG units in the test system on voltage magnitude and losses. The PRG units optimally allocated by the proposed hybrid GA provide less variation in voltage than the case that is not optimized, and reduce losses.

IEEE 14-Bus System
This study optimizes the capacity and location of RPG units in the IEEE 14-bus system in Figure  9. For the IEEE 14-bus system, the proposed GA optimally allocates six RPG units, with a total capacity of 90 MVA (53 MVA in bus 3, 11 MVA in bus 7, 8 MVA in bus 10, 2 MVA bus 12, 7 MVA in bus 13, and 9 MVA in bus 14), in order to minimize variation in voltage, the installation cost of RPG units, and losses. Figure 16 depicts the objective function's standard deviation for offspring members over multiple generations when the proposed GA finds a solution with an objective function of 0.07735. Since the variation converges to zero, the proposed GA determines the fitter single offspring member (i.e., a solution to the optimization problem). Figures 17 and 18 present the effect of optimally allocated RPG units in the test system on voltage magnitude and losses. The PRG units optimally allocated by the proposed hybrid GA provide less variation in voltage than the case that is not optimized, and reduce losses.

Conclusions
The objective of this study was to propose a hybrid algorithm that can model tap-changing transformers and optimize the location and capacity of RPG units for systems having these transformers. To achieve this objective, the study proposed a hybrid GA that incorporates bus impedance power-flow calculation. The proposed hybrid algorithm successfully calculated power flow in the well-known IEEE test systems (i.e., IEEE 14-, 30-, and 57-bus systems), and optimized the location and capacity of RPG units in the IEEE 14-and 30-bus systems.
Since the IEEE test systems include various power system elements (e.g., loads, slack, P-V, P-Q buses, shunt capacitors, generators, and tap-changing transformers), the proposed power-flow method can calculate the power flow of a variety of system configurations. The proposed hybrid algorithm can be also used for operating, planning, or upgrading transmission systems by optimally adding RPG units. PV and WTGs able to control reactive power can be optimally allocated by the

Conclusions
The objective of this study was to propose a hybrid algorithm that can model tap-changing transformers and optimize the location and capacity of RPG units for systems having these transformers. To achieve this objective, the study proposed a hybrid GA that incorporates bus impedance power-flow calculation. The proposed hybrid algorithm successfully calculated power flow in the well-known IEEE test systems (i.e., IEEE 14-, 30-, and 57-bus systems), and optimized the location and capacity of RPG units in the IEEE 14-and 30-bus systems.
Since the IEEE test systems include various power system elements (e.g., loads, slack, P-V, P-Q buses, shunt capacitors, generators, and tap-changing transformers), the proposed power-flow method can calculate the power flow of a variety of system configurations. The proposed hybrid algorithm can be also used for operating, planning, or upgrading transmission systems by optimally adding RPG units. PV and WTGs able to control reactive power can be optimally allocated by the proposed hybrid GA. However, the proposed algorithm is based on per-phase analysis, because

Conclusions
The objective of this study was to propose a hybrid algorithm that can model tap-changing transformers and optimize the location and capacity of RPG units for systems having these transformers. To achieve this objective, the study proposed a hybrid GA that incorporates bus impedance power-flow calculation. The proposed hybrid algorithm successfully calculated power flow in the well-known IEEE test systems (i.e., IEEE 14-, 30-, and 57-bus systems), and optimized the location and capacity of RPG units in the IEEE 14-and 30-bus systems.
Since the IEEE test systems include various power system elements (e.g., loads, slack, P-V, P-Q buses, shunt capacitors, generators, and tap-changing transformers), the proposed power-flow method can calculate the power flow of a variety of system configurations. The proposed hybrid algorithm can be also used for operating, planning, or upgrading transmission systems by optimally adding RPG units. PV and WTGs able to control reactive power can be optimally allocated by the proposed hybrid GA. However, the proposed algorithm is based on per-phase analysis, because transmission systems are usually assumed to be balanced. The algorithm could be extended to three-phase systems in future work. RPG,max,i : minimum and maximum outputs of reactive power generator i at iteration k p: probability that produces the fittest offspring P i : probability of the slot size of the scaled roulette wheel R: the number of reactive power generators R i : geometric rank of offspring member i from 1 to M S i : nameplate capacity of a reactive power generation unit i S min,i : minimum nameplate capacity of a reactive power generation unit i S max,i : maximum nameplate capacity of a reactive power generation unit i S Loss,i,h : losses of transmission line (or branch) i at period h S load : complex power of loads connected to each node: P + jQ:|S|∠δ s T: the number of tap-changing transformers Tap i : tap position of transformer i Tap min and Tap max : minimum and maximum tap positions Tap min and Tap max : minimum and maximum tap positions V (k) : voltages induced in each node at iteration k V (k) i,h : voltage (magnitude) of bus i at period h and iteration k V m and V n : voltages of buses m and n V nom : magnitude of the nominal (or rated) voltage V set : set voltage magnitude of a reactive power generation unit x i : location to which a reactive power generation unit can be connected W Loss , W RPG , and W V : weighting factors for losses, reactive power generator installation cost, and voltage variation, respectively Y bus : bus admittance matrix Y eq : series admittance of a tap-changing transformer Y ex : excitation admittance of a tap-changing transformer y i : capacity of a reactive power generation unit Y m0 and Y n0 : admittances of buses m and n connected the ground Y parallel : admittance matrix of parallel elements connected to the ground Z bus or Z bus : bus impedance matrix Appendix A Table A1 compares power-flow calculation results determined by the proposed Z bus method to those produced by the Newton-Raphson, Gauss-Seidel, and decoupled power-flow calculation methods implemented in MATLAB.