Control of Reactive Power with Genetic Algorithm in Electrical Power Systems with Photovoltaic Power Plant

: The present paper has as its objective to optimize the reactive power in electric systems that have a photovoltaic power plant connected to it, thus aiming at improving the voltage profile of all system buses, so that they meet the values determined in the standard. For this, it is proposed to accurately determine the ideal amount of reactive power, using the genetic algorithm, in which there is no use of approximate equations, reduction of the active power of the photovoltaic source and, moreover, it allows the regulation of the voltage of all the buses in the system, being able to raise or reduce their voltage level. The proposed methodology is validated through the analysis of the 14-bus electric system from IEEE, into which a photovoltaic power plant was connected. Studies were carried out with six different load scenarios in the literature to observe the performance of the proposed algorithm. Through the analysis of the results, one concludes that the developed genetic algorithm is efficient for determining the reactive power values that result in the reduction or increase of the voltage levels of all buses in the system, allowing them to meet the values determined in the regulatory standards.


-INTRODUCTION 1.-Motivation and incitement
Photovoltaic solar energy is a source of renewable energy with a growing participation on the energy matrix of many countries.This uses panels that are constituted of photovoltaic cells and are responsible for converting solar radiation into direct current.In order that this energy be dispatched to the electric system, it is necessary to convert it into alternating current, since it is in this mode that systems operate (Zhu & Fei 2018).
The conversion of direct current to alternating current is performed by inverters, which when provided with the appropriate control allow the photovoltaic system to inject reactive power onto the grid or even absorb this power (Tsengenes & Adamidis 2011, Yang et al. 2016).The capacity of photovoltaic systems to absorb/inject reactive power has been studied by a number of researchers for the improvement of voltage levels on specific buses of the electric system or by treating these as a whole.

-Literature review
One of the methods employed for controlling the level of voltage on systems with participation from photovoltaic generation consists of reducing the active power generated by this energy source, allied with the injection of reactive power onto the grid (Collins & Ward 2015, Cabrera-Tobar et al. 2019).In reference Dall'Anese et al. (2014), only some inverters present on the electric system are chosen for decreasing the value of active power generated and inject reactive power into the system.In Ghasemi & Parniani (2016), the control is implemented to increase the installation capacity of photovoltaic generation on the distribution network, without causing overvoltages.In this control, the active power is reduced and the quantity of reactive power to be injected onto the system is determined by using the rated power data from the inverter and voltage on the connection bus of the photovoltaic generation.
In order to avoid deviations from the voltage limits, reference (Horowitz et al. 2020) performs the reactive power control of photovoltaic generation.The value of this power is determined according to previously established voltage levels, and should this power not be sufficient for regulating the voltage, the reduction of active power coming from photovoltaic generation is also executed.
The increase in voltage can also be avoided through configurations on the photovoltaic inverter.In the methodology presented by (Bletterie et al. 2012) calculations are performed to specify the factor parameters for minimum power, drop factor, maximum voltage for the linear range and voltage regulation point.
In reference Ali et al. (2018), in order to avoid overvoltages, the quantity of reactive energy that each photovoltaic inverter installed in residencies should supply to the system will depend on its distance regarding the distribution transformer.For voltage regulation, the reactive power can also be calculated through voltage data, which are determined by the bus impedance matrix of positive sequence (Kim 2018, Kim & Harley 2020).
In reference Aghatehrani & Golnas (2012), the proposed control is destined to improving the voltage level only on some specific buses of the system.This control is performed by the analysis of the voltage sensitivity matrix, which is obtained by the calculation the Jacobian matrix of power flow and the linearization of power flow equations around a point of operation.The voltage sensitivity matrix is also used by Samadi et al. (2014) to determine the reactive power necessary to maintain the voltage of some buses to within the pre-established limits.In addition, employed in this calculation are the momentary active power on the bus and the value of active power defined as the limit for the system to start injecting reactive power.In (Krishan et al. 2019), the regulation of voltage at the point of common coupling (PCC) is performed using a dynamic harmony search algorithm, together with the ideal power flow.
In study Howlader et al. (2018), in order to improve the voltage level on the grid, the reactive energy that the inverter will be responsible for is determined by comparing the value of the voltage on the PCC with four previously established voltages.Depending on the voltage on the PCC, there are five possible values for the reactive power.The control method proposed in Kerber et al. (2009) has as its objective to reduce the voltage when this reaches an upper limit, where the quantity of reactive power that the inverter should absorb is calculated from linear functions, as well as from initially established voltages values.
In reference Fawzy et al. (2011), to improve the level of voltage, the reactive power is determined as a function of the voltage in the PCC of the photovoltaic system with the grid.In order to avoid overvoltages, in Demirok et al. (2011) the proposal is made for a combination of two control methods to determine a different power factor for each photovoltaic inverter and to improve the voltage level, where are used the controls with a fixed power factor and reactive power as a function of the voltage on the PCC.
The methodology developed by Alenius et al. (2020) determines the value of the reactive power through the value of the angle of the output current and the transmission inductance estimated by the value of the network impedance.This methodology has as its objective to compensate the unintended reactive energy flow from the photovoltaic inverter to the grid.Reference (Ali et al. 2021) takes as it goal to increase the hosting capacity of photovoltaic generation on the electric system.To reach such, the reactive power of the photovoltaic inverters is calculated through the voltage data on the bus, transformer tap, conductance and line susceptibility.
The study in Turitsyn et al. (2010) proposes regulating the voltage level of a rural radial distribution circuit through control of the reactive power from photovoltaic generation.The value of this power is determined by using simplified equations from power flow.In reference Farivar et al. (2012), the control of reactive power from the photovoltaic inverters has as its objective to reduce the rapid and large voltage fluctuations caused by photovoltaic generation.In this study, reactive power from photovoltaic generation is calculated using line reactance data, bus voltage, reactive power from the load, reactive power from shunt capacitors and active power, where a second order cone program is employed to solve its objective function.

-Contribution and paper organization
It is notorious that, together with the advances in the technologies used for the manufacture of electronic equipment, there is greater sensitivity and less supportability with regard to the supply voltage, thus requiring special attention in order to guarantee their correct functioning.In order for this to be made available to consumers on a continuous and adequate basis, in compliance with previously established standards, there are regulatory standards that agents operating in the electricity sector must follow.In Brazil, the Agência Nacional de Energia Elétrica is responsible for regulating and inspecting the quality of supply of electricity services.In this context, the photovoltaic system, when absorbing/supplying reactive power to the electrical system, can contribute to the regulation of the voltage level of the system's bus and meet the voltage levels considered adequate by the standards.However, for the change in the voltage level to be efficient and contribute to reduce or increase the voltage level in an adequate way, the ideal amount of reactive power that the photovoltaic power plant must supply or absorb must be established.
In this context, the present article has as its objective to regulate the voltage level on the buses of an electric system that has a photovoltaic power plant connected, through the optimization of the reactive power of the system.The proposed methodology differs from the works reported in the literature by the way that determines the ideal quantity of reactive power that the photovoltaic power plant and the synchronous compensators present in the system should supply/absorb.The value of this power is obtained through the development of the genetic algorithm (GA) and for every determined power value a load flow is carried out to obtain the voltage levels of the system and, thus, through the analysis of the voltage values, it is identified the ideal amount of reactive power from the plant and compensators.As such, the proposed method is more precise in determining the best values of reactive power, as the real voltage values are obtained for all the buses of the system through the power flow, without the use of formulas to obtaining reactive power, as is employed by those studies described in the literature.
In the proposed methodology, the genetic algorithm developed, in addition to not using approximate equations to determine the ideal amount of reactive power, also does not need to reduce the active power from the photovoltaic power plant, it regulates the voltage level of all buses in the electrical system and allows the voltage level to be raised or lowered, according to the needs of each bus.
On Table I, a comparison is performed for the reactive power control methods described in the literature and the methodology proposed herein.The comparison is performed regarding the main characteristics that are desired from this control, such as: (a) precise determination of reactive power (without using formulas); (b) active power from photovoltaic generation without reduction; (c) voltage regulation on all system buses; (d) capacity to increase or decrease the level of voltage.Noted is that the only control for power that possesses all the desired features is the methodology proposed in this study.
For the validation of the proposed methodology computer simulations were performed that considered the electric system from IEEE of 14 buses, onto which was connected a photovoltaic power plant of 10.62 MW of active power, where the power of this plant is considerably higher than those values presented in the literature.Different load scenarios were considered on the electric system, with the aim of representing various levels of voltage on the system.
The following sections present the methodology proposed in this study.In section 2, details are provided of the development of the genetic algorithm destined to the optimization of the reactive power.Section 3, describes the electric system and the modelling for the photovoltaic power plant.Section 4 presents the control adopted for the photovoltaic inverter.The results obtained in this study are presented and discussed in section 5. Finally, section 6 presents the conclusions of this study.

-GENETIC ALGORITHM
The genetic algorithm was developed by John Holland in 1975 and it aims to find the best solution to a problem.Its development was based on the Theory of Evolution by Charles Darwin, in which the fittest individuals have greater probability of survival in that environment and to generate offspring (Goldberg 1989, Rosa et al. 2016).
The genetic algorithm was applied in this research because it is an algorithm destined to optimize complex problems, allowing to work with multiple variables, operate with a broad search space, be more resistant to local optimal, it admits using different restrictions for each variable and its code can be changed in a simple way to contemplate different configurations of the electrical system.
The genetic algorithm is composed of a population made up of individuals, that represent the possible solutions of the problem.These solutions are denominated as chromosomes and are made The algorithm is also constituted of generations, where each generation is responsible for creating new chromosomes and for the evolution of the algorithm.In addition, to assess the degree to which an individual satisfies the problem and whether this is the solution to it, the objective function is employed which evaluates the chromosomes and attributes a corresponding value to these (Souza et al. 2006).
The development of the genetic algorithm for the optimization of reactive power follows the steps presented in the flowchart in Fig. 1, details of which will be provided below.

-Initialization of the population
The first step of the genetic algorithm consists of generating the population at random.The individuals that make up the population were represented by real numbers, which were formed by column vectors.Onto these, each column stores the amount of reactive power that the photovoltaic power plant and the synchronous compensators present on the electric system can supply or absorb.
Since the 14-bus IEEE test system has three synchronous compensators, individuals need four columns to store the amounts of reactive power in the following sequence: first column for the photovoltaic plant and the other three columns for the synchronous compensators connected to buses 3, 6 and 8.
In the formation of each gene, the photovoltaic plant and the synchronous compensators must obey the maximum and minimum reactive power values, according to equation (1).Power limits for photovoltaic plant will be described in the next section and those for the synchronous compensators were taken from the literature (Milano 2010).
where Q PV is the reactive power of the photovoltaic plant and Q 3 , Q 6 and Q 8 are the reactive power of the synchronous compensators on buses 3, 6 and 8, respectively.

-Evaluation of individuals
The individuals are evaluated through the objective function that assigns a value, which is also called fitness.The objective function used in the algorithm is described in equation ( 2).This function determines the sum of the voltage deviations on the system buses, in terms of the desired voltage value on the buses (1.0pu).
where of is the objective function, i is an electric system bus, n is the number of system buses and V i is the voltage module at bus i in pu.
In order to use the objective function, it is initially necessary to establish voltage values on all electric system buses, while considering the quantity of reactive power that is supplied or absorbed by the photovoltaic power plant and by the synchronous compensators.These values are specified on each chromosome.For this, the load flow was calculated using the Newton-Raphson method for each individual under analysis and the voltage magnitudes were obtained.

-Selection
The selection method used in the algorithm was the tournament.In this technique, to determine each father, three individuals were chosen at random from the population to create a temporary subpopulation.Following this, the objective function is used to classify which is the best and the worst individual from this temporary subpopulation (Manzoni et al. 2020).The father will be best individual from the temporary subpopulation, if a random number is less than the tournament probability.If the probability is higher than the random number, the father will be the worst individual from this subpopulation.

-Crossover
Initially, to perform the crossover, a randomly generated number should be lower than the crossover probability (Maiti & Maiti 2008).The crossover used in the algorithm was arithmetic.In this crossover, the individual sons are results from a linear combination of individual fathers (Yalcinoz et al. 2001).
Each gene from the new chromosomes is obtained through a combination with the genes from the ancestral chromosomes, as described in equation (3).
where S 1 is son 1, S 2 is son 2,  is the multiplication constant, F 1 is father 1 and F 2 is father 2.

-Mutation
The mutation stage also occurs only if a randomly generated number is less than the probability of mutation (Maiti & Maiti 2008).Mutation was performed using the uniform method in which a gene, randomly chosen, is substituted by a random value, provided that this value belongs to the range permitted for the respective gene (Maiti & Maiti 2008).Thus, the reactive power values that the photovoltaic plant and the synchronous compensators can supply or absorb are chosen, as described in equation ( 1).

-Elitism
Elitism aims to keep the best individuals of the current generation in the next generation.This step affords that the best next-generation solution to be at least equal to the best current generation result (Yalcinoz et al. 2001).

-Updating the population
The individual sons substitute the fathers in the population.Following this, the fitness of all the individuals from the population is calculated using the objective function and the best individual of this generation is determined.

-Stop criterion
The stop criterion used was that of convergence.The genetic algorithm stops when there are no further alterations on the best-fitness value in the last 150 generations (Greenhalgh & Marshall 2000).

-ELECTRIC SYSTEM
In order to validate the proposed methodology, the electric system of 14 buses from the IEEE was used, and which is illustrated in Fig. 2.This system is composed of two generators, three synchronous compensators, eleven loads, a capacitor bank, three transformers and seventeen lines.The data for these components are described in (Milano 2010).The photovoltaic power plant was connected onto bus 14 of the electric system presented herein.This plant possesses a maximum power of 10.62 MW, with its modelling carried out for a power of 212.4 kW and, subsequently, the representation of 50 units is used to achieve the desired power.
The components of each photovoltaic unit are illustrated in Fig. 3 and for which details will be given in the following.

-Photovoltaic panels
For the present study, the photovoltaic module SPR-415E-WHT-D from the manufacturer SunPower was employed.This module presents a maximum power of 414.801W, maximum power voltage of 72.9 V and a maximum power current of 5.69 A (Solar Hub 2019).In order to reach 212.4 kW of power from each photovoltaic unit, eight modules were used connected in series and sixty-four modules in parallel.

-Boost converter
The boost converter was employed to increase the voltage value coming from the photovoltaic panels of 583.2 V to the voltage input level of the three-phase inverter, for which the value is 1000 V.The value of the boost converter components was established using the following equations: where L b is the value of the inductance, V in is the input voltage of the converter, D is the duty cycle of the converter, f d is the switching frequency, ΔI is the input current ripple, C in is the value of the input capacitor, I in is the boost input current, ΔV in is the input ripple voltage, C out is the value of the output capacitance, V dc is the voltage output of the converter, η is the boost efficiency, P in is the boost input power, f is the network frequency, and ΔV dc is the ripple of the converter output voltage.
In the boost converter, the silicon carbide MOSFET (SiC) was considered as key, because it has lower energy losses by switching and allows working with high frequency (Abbatelli et al. 2014, Golzar et al. 2017).Therefore, a switching frequency of 50 kHz was used in the boost converter.
Considering the input voltage of 583.2 V, the duty cycle of 0.4168, the input current ripple of 10%, the input current of 364.2 A, the input ripple voltage of 1%, the output voltage of 1000 V, the output voltage ripple of 1%, the frequency network at 60 Hz and efficiency of 96%, the inductor presented a value of 0.1335 mH, the input capacitor possesses 0.521 mF and the output capacitor 10.489 mF.
The control of the boost converter was performed using the maximum power point tracking technique (MPPT) denominated as Perturb and Observe (P&O) (Silva 2019).

-Three-phase inverter
The purpose of the inverter is to convert the continuous voltage supplied at its input terminals to an alternating output voltage.In this research, the three-phase inverter with bridge configuration was used.
The inverter also defines the quantity of reactive power that the photovoltaic system is capable of supplying or absorbing, in accordance with equation ( 7) (Su et al. 2014).
where S is the apparent power of the inverter, P is the active power of the inverter and Q is the limit of reactive power.
To determine the limit of the reactive power, the data from the three-phase inverter SIW700 was used from the manufacturer Weg (2021), for which the active power is of 275 kW and the power factor is 0.9.This inverter was chosen, as it has the Brazilian commercial value immediately higher than the active power of each photovoltaic unit.As such, the maximum limit of reactive power for each photovoltaic unit is of 133.2 kVAr and the minimum limit is of -133.2 kVAr.Considering the representation of 50 units, the reactive power of the photovoltaic power plant has a maximum limit of 6.6 MVAr and a minimum limit of -6.6 MVAr.

-Filter
The LCL (inductor-capacitor-inductor) filter was used to connect the three-phase inverter to the electric network, with the aim of minimizing the harmonic distortions present in the output current of the inverter.The values of the filter components (Reznik et al. 2014) were obtained with the following equations: where L 1 is the value of the first inductance of the filter, V DC is the voltage of the dc-link, f SW is the switching frequency of the inverter, P n is the nominal power of the photovoltaic system, V ph is the phase voltage on the output of the inverter, c f is the filter capacitance, ω g is the angular velocity of the network, E n is the line-to-line RMS voltage at the inverter output, L 2 is the value of the second filter inductance, k a is the attenuation factor, and r f is the resistance in series with the capacitor.
In this study, 1000 V dc-link voltage was considered, the switching frequency of the inverter at 10 kHz, the power of the photovoltaic system at 212.4 kW, the phase voltage on the inverter output at 219.39 V, the angular velocity of the grid at 377 rad/s, the line-to-line RMS voltage on the inverter output at 380 V and the attenuation factor of 0.2.Therefore, the first inductance presented a value of 0.3652 mH, the second inductance of 7.77 μH, the capacitance of 0.1955 mF and the resistance of 65.7 mΩ.

-Transformer
The transformer was used to connect the photovoltaic system to the IEEE electric system of 14 buses, with a voltage level of 380/13800 V.

-THREE-PHASE INVERTER CONTROL
The control of the three-phase inverter allows it to operate properly to convert the direct voltage at its input terminal into alternating current, through the opening and closing of its switches.In addition, in this study, the control implemented into the inverter also allows the photovoltaic power plant to supply reactive power to the electric system or absorb it.
The control used in the three-phase inverter is denominated as Synchronous Reference Frame.In this control, there is a loop for controlling reactive power, a loop designated to the control of the voltage on the dc-link and a loop responsible for generating the command pulses of the inverter switches.
To carry out the control, the voltage and current values represented in the three-phase system "abc" are converted to the synchronous coordinate system "dq0", using the Park Transform, as described in equation ( 12).This transform allows the components from the three-phase system, voltage or current, with values that vary sinusoidally over time to be represented on a system with components that present constant values in steady state and with the same speed of the original system (Teodorescu et al. 2011).
where V d , V q and V 0 are the voltages on the direct-axis, quadrature-axis and zero-axis, respectively.V a , V b and V c are the voltages of phase a, b and c, respectively, and  is the angular position of the direct-axis in relation to phase axis a (considered as the reference).The control of reactive power is performed in closed loop.Initially, it is necessary to convert the voltage and current values from the common coupling point to the synchronous coordinate system.To this end, the angular position of the voltage on the grid is established, using a phase locked loop (PLL).Following this, the value of the instantaneous reactive power is calculated, as in equation ( 13).
where Q inst is the instantaneous reactive power, V q is the quadrature-axis voltage, I d is the direct-axis current, V d is the direct-axis voltage, and I q is the quadrature-axis current.
The difference in the instantaneous reactive power and the value of power determined by the developed genetic algorithm, which corresponds to the amount of reactive power that the photovoltaic system must absorb or supply to the electrical system, (Q * ) is submitted to an integrated proportional controller.The proportional gain is of 0.08 and the integral gain is of 8.0.
The dc-link voltage control loop has as its objective to carry out the control of the direct voltage on the terminals of the inverter input.For this, the control performs the difference of the link-dc voltage monitored at the inverter terminals (v dc ) and the reference value of this quantity (V * dc ), which corresponds to 1000 V, since this is the value used by commercial inverters.The error from these signals is sent to an integral proportional controller, with a proportional gain of 15.0 and integral gain of 0.0015.The signal coming from the controller is multiplied by the measured dc-link voltage, producing the active power value.
Following this, the voltages of the common coupling point converted to the synchronous coordinate system are also used to calculate the direct axis and quadrature axis reference currents, according to equation ( 14).
where i * d and i * q are the reference currents of the direct-axis and quadrature-axis, respectively.v d and v q are the direct-axis and quadrature-axis voltages, respectively, P is the active power, and Q is the reactive power coming from the reactive power control loop.
The current loop control is responsible for controlling the current coming from the grid and provides the command pulses to the inverter switches.Firstly, the current from the common coupling point is transformed over to the synchronous coordinate system.Following this, the current of the direct axis is compared to its previously obtained reference (i * d ).The error is submitted to an integral controller with a proportional gain of 0.1 and integral gain of 1.0.Next, the signal is added to the voltage value of the direct axis and the decoupling component, which has as its objective to accelerate the control, and can be calculated through equation ( 15).This sum results in the direct-axis reference voltage.
where L is the decoupling component,  is the angular velocity of the grid, L 1 and L 2 are the first and second inductance of the filter, respectively.The same procedure is applied to the quadrature axis current, including the same controller gains, thus resulting in the reference voltage of the quadrature axis.The references voltages are submitted to the Inverse Park Transform to obtain the three-phase voltage that will be used as the reference signal in pulse width modulation (PWM).Therefore, the PWM is responsible for generating the operation command pulses for the opening and closing operation on the six switches of the three-phase inverter.
The block diagram of the photovoltaic inverter control is presented in Fig. 4.

-RESULTS AND DISCUSSION
In order to validate the proposed optimization methodology for reactive power, simulations were performed considering six distinct scenarios of the electric system.In each scenario, the value of the loads of the 14-bus IEEE system was altered to obtain different bus voltage levels.As such, simulations with load increases of 30%, 40% and 50% and reductions in loads of 20%, 30% and 40% were all considered.
The genetic algorithm code was developed on the software MATLAB, the electric system, together with the photovoltaic power plant, was implemented on Simulink/MATLAB and the load flow used to calculate the objective function was performed with Matpower.
The genetic algorithm was designed taking into account a population made up of 200 individuals, a tournament probability of 0.8, a crossover probability of 0.7 and a mutation probability of 0.01.The result presented by the genetic algorithm for each load scenario is given on Table II.With a 30% increase in loads, without considering the data determined by the algorithm in the simulation, the average voltage value on the buses was 1.023 pu, bus 3 presented the lowest voltage value, being 0.998 pu, and bus 8 the highest level of voltage, with 1.038 pu.After the configuration of the photovoltaic power plant and the synchronous compensators to the supplying of reactive power, as determined by the GA, the average for the voltage value reduced to 1.008 pu, bus 3 presented 0.999 pu and bus 8 was 1.006 pu.The comparison of the voltage levels before and after the application of the genetic algorithm is presented in Fig. 5.
The voltage levels on buses 1 and 2 do not present alteration, since bus 1 is considered as the reference bus and bus 2 is a PV type bus.The voltage values on these buses were taken from the literature, with 1.06 pu for bus 1 and 1.045 pu for bus 2.
In addition, although the increase of 30% on the loads resulting in a small alteration in the voltage level, with the result from the algorithm, all the buses on the electric system presented voltage levels closer to 1.0 pu.The data established by the GA allow not only for a reduction in the voltage level, but also an increase on some buses, thus contributing toward the whole electric system as having a voltage closer to the ideal (1.0 pu).
In the scenario with an increase of 40% in loads, initially without the algorithm data, the average value of the voltage on the buses was of 0.991 pu, bus 14 presented the lowest voltage value at 0.952 pu, and bus 8 the highest voltage value at 1.037 pu.Through use of the parameters supplied by the GA, the average for the voltages was altered to 1.005 pu, bus 14 presented 0.994 pu, and bus 8 reduced to 1.012 pu.
Figure 6 presents the voltage level on buses before and after the application of data from the algorithm.It is observed that with AG the levels in all buses were closer to 1.0 pu.Considering a 50% increase in loads, without use of power data established by the GA, one notes a lower level of voltage on the buses of the electric system, as shown in Fig. 7.For this situation, the average voltage value was of 0.958 pu, bus 14 presented the lowest level of voltage at 0.905 pu, and bus 8 the highest voltage value at 1.008 pu.Through the application of the data established by the developed algorithm, the average value of the voltages showed an expressive increase to 1.002 pu, bus 14 presented 0.989 pu and bus 8 was altered to 1.001 pu.
Considering the scenario with a 20% reduction in the loads, before the use of the GA data, the average for voltage on the system buses was of 1.052 pu, with the highest voltage level on bus 8 at 1.090 pu, and the lowest voltage on bus 3 at 1.010 pu.Through use of the parameters supplied by the code, the average voltage was altered to1.009 pu, bus 8 passed to 0.997 pu and bus 3 presented 0.999 pu.The voltage level on the buses is presented in Fig. 8. Noted here is that after the application of the GA data, there was a significant reduction to the voltage level on all buses of the electric system, where these went on to express voltages close to 1.0 pu.With the reduction of 30% on the system loads, before the implementation of the data established by the GA, the average voltage value of all buses was of 1.055 pu, bus 8 presented the highest voltage level at 1.090 pu, and bus 3 had the lowest voltage value at 1.010 pu.After the parametrization with the data from the code, the average voltage passed to 1.017 pu, the voltage on bus 8 decreased to 1.008 pu and bus 3 passed to 0.995 pu.The voltages for this load quantity are shown in Fig. 9.
Note that for this scenario, the difference in the voltage average was lower than that presented by previous cases, since the reactive powers from the photovoltaic power plant and the synchronous compensators are already close to their lower limits.Thus, it is observed that the algorithm sought the best result for this system condition, on which to approximate the maximum possible for the voltages of 1.0 pu, the code established the lowest values of reactive power.
Considering the scenario with 40% reduction on the loads, firstly without the parameters established by the algorithm, the average voltage values on the buses of the electric system was 1.058 pu, bus 8 also presented the highest voltage level at 1.090 pu, and bus 3 the lowest level at 1.015 pu.Through the implementation of the data supplied by the GA, the average voltage value was reduced to 1.028 pu, bus 8 passed to 1.02 pu and bus 3 presented 1.004 pu.For this load value on the electric system, once again the algorithm established the lowest quantity possible of reactive power, within the limits allowed for photovoltaic power plant and the synchronous compensators.The voltage level for this scenario is shown in Fig. 10.

-CONCLUSIONS
This work proposed a methodology to optimize the reactive power of electric systems with a photovoltaic plant in order to obtain the best voltage levels on the system buses.The methodology consists of using a genetic algorithm to determine the best reactive power values that the photovoltaic power plant and the synchronous compensators should supply/absorb to reach bus voltage levels as close to 1.0 pu as possible.
The proposed methodology was validated through the analysis of six loads scenarios in the 14-bus IEEE electric system.By using the data from the genetic algorithm, the average voltage values on the buses for the six scenarios were 1.008 pu, 1.005 pu, 1.002 pu, 1.009 pu, 1.0017 pu and 1.028 pu.
The scenario with a 50% increase in loads presented the largest difference in voltage averages, when using the data supplied by the algorithm, where the average increased by 4.59%.Analyzing the voltage values on the buses, the largest percentage difference was on bus 14, with an increase of 9.28%, also in the scenario with the 50% increase on the loads.
Through the analysis of the results presented herein, one reaches the conclusion that the developed genetic algorithm is efficient for optimizing reactive powers, across all load scenarios, the data from the GA permitted the voltage levels to arrive as close as possible to that defined as the objective value (1.0 pu).All voltage levels considered precarious and critical by the Agência Nacional de Energia Elétrica, present in the electrical system before the use of the AG data, with the use of ideal reactive powers, they started to have levels considered adequate, in compliance with the established by Module 8 of PRODIST.Therefore, the proposed methodology determines, with precision, the quantity of reactive power necessary to increase or reduce the voltage levels of all electric system buses, depending on its condition.Furthermore, there is no need to reduce the active power from the photovoltaic plant to reach this goal.

Figure 1 .
Figure 1.Flowchart of the genetic algorithm.

Figure 4 .
Figure 4. Block diagram of the three-phase inverter control.

Figure 5 .
Figure 5. Voltage levels with a 30% increase on the loads.

Figure 6 .
Figure 6.Voltage levels with a 40% increase on the loads.

Figure 7 .
Figure 7. Voltage levels with a 50% increase on the loads.

Figure 8 .
Figure 8. Voltage levels with a 20% reduction on the loads.

Figure 9 .
Figure 9. Voltage levels with a 30% reduction on the loads.

Figure 10 .
Figure10.Voltage level with a 40% reduction on the loads.

Table I .
Comparison of the Control Methods.
¨¨¨ü p of genes.With the aim of increasing the diversity of the individuals contained in the population, crossover and mutation steps are used.

Table II .
Results for the Genetic Algorithm.