Optimal Location and Sizing of Renewable Distributed Generators for Improving Voltage Stability and Security Considering Reactive Power Compensation

: The integration of renewable resources into the existing power distribution system is expanding to reduce gas emissions, treat climate change and satisfy the current global need for clean energy. If the location and size of these renewable generators are determined without considering uncontrollable reactive power compensation caused by their intermittent nature, the resultant power system may suffer from system instability and decreased reliability. Therefore, the issue of optimal location and size of renewable resources attracts great attention. In this paper, a methodology is proposed to optimize the locations and capacities of distributed renewable generators installed in conventional power distribution systems. In particular, uncontrollable reactive power compensation of these renewable resources is considered in this paper and managed through the proposed methodology to ensure power system reliability and stability. As a result, the proposed methodology reminds us of the importance of reactive power compensation by performing better in power losses reduction and the robustness of voltage stability against variable reactive power compensation.


Introduction
By considering the depletion of conventional power sources, growing energy demand, the necessity to reduce gas emissions etc., renewable distributed generators (RDGs) have been promoted worldwide [1][2][3]. These energy generators are environmentally friendly and can be used as alternatives to conventional dispatchable generators. The defining characteristics of non-dispatchable RDGs (e.g., Photovoltaic (PV) and Wind Turbine (WT)) are unsteady and non-uniform compared with the conventional dispatchable sources, such as oil, natural gas and coal. Due to their intermittent nature, hybrid mixtures of two or more power generation systems can enhance the power quality, improve system reliability, reduce power losses and increase the efficiency of the power system [4,5]. However, the inappropriate placement of RDGs leads to increasing power losses, and degradation of voltage stability [6][7][8][9].
Optimal location and size of RDGs have attracted numerous studies in recent years. Many researchers have focused on developing methodologies for determining the optimal location and size for minimizing power losses [10][11][12][13][14][15][16][17][18][19] and improving voltage profile [11,13,17]. The authors of [11] developed the Evolution Programming (EP) method which incorporates the correlation between loads and renewable sources and allows the wind power to be dispatched to a certain fraction of system load. The authors of [12] applied the Ant Lion Optimization Algorithm (ALOA) to determine the optimal placement of RDGs resulting in

System Model
Basically, power flows from the slack bus to loads connected to the bus through power lines in a power distribution system. The information concerning power consumption levels, single line diagram, and line impedance is given in the form of an IEEE test distribution system. The information of the maximum levels of power consumption of loads are necessary when maximum power losses and voltage stability are investigated. In this paper, both maximum power generation and power consumption are only considered in a steady state.
The following assumptions are made to develop the mathematical model for optimal placement of RDGs in a power distribution system: 1. The number of RDGs to be installed is given. 2. Since the generated active power is uncontrollable in a steady-state, in order to maintain the voltage at the nominal level, reactive compensation of RDGs is assumed to be consumed depending on their generated active power multiplied by reactive power compensation ratio (RCR). Therefore, the effect of uncontrollable reactive compensation of RDGs associated with their generated power is evaluated using RCR. 3. The impacts of unbalanced load and compensation of both active and reactive power are neglected.

Voltage Stability Index
For determining the optimal location of RDGs, the voltage stability limit dominated by generator reactive consumption is our primary concern. The L-index proposed by [23], which delineates quantitative measurement of a weak bus and forecasting of voltage collapse, is used as one of the measures to evaluate a system. The L index is formulated as shown in Equation (1): wherē V i ,V j -complex voltages of the ith and jth buses, respectively, T -a set of loads, S-a set of generators, F ji -the jth row, ith column element of the hybrid matrix, which is generated from the matrix Y by a partial inversion, described in [23].
Under stable operation, the value of the L-index should be less than 1, and the smaller the value of the L-index from 1, the more stable the system.

Total Power Losses
Due to electrical resistance in power lines, power losses occur. Several studies demonstrated that the location and size of distributed generators (DGs) play an essential role in the reduction of total power losses. The power losses can be expressed as Equation (2) [24]. where V m ,V n -voltage magnitudes of the mth and nth buses, respectively, δ m ,δ n -voltage angles of the mth and nth buses, respectively, r mn , x mn -resistance and reactance of the mth row, nth column element of the impedance matrix Z bus , P m ,P n -active power injections at the mth and nth buses, respectively, Q m , Q n -reactive power injections at the mth and nth buses, respectively, N-the number of buses.

Loading Margin
The loading margin, a fundamental measure of closeness to voltage collapse [25], is used to estimate the limitation of the increment of load. In this paper, the loading margin is also used to evaluate a system in the proximity to voltage collapse blackouts. Furthermore, to guarantee safety from voltage collapse, the minimum loading margin is demonstrated for every optimal RDG placement.

Voltage Stability and Security
To support the installation of renewable energy sources and their uncontrollable reactive power compensation, the enhancement of voltage stability and security from voltage collapse are considered. In the following section, first, the basic idea of voltage stability assessment is described. Then, mathematical functions are introduced for describing system characteristics. Next, voltage collapse caused by the reactive compensation is investigated. Finally, a mathematical function of voltage stability and security is formulated, which can be used as the objective function for the optimal placement of RDGs.

Basic Idea of Voltage Stability Assessment
Voltage stability is defined as the ability to maintain the voltage level of each bus in an acceptable range during normal operation as well as after any contingency events [26]. The voltage stability can be described by the relationship between reactive support (Q c ) at a given bus and the voltage at that bus using the VQ curve. The positive value of Q c means the system requires external reactive power injection to system operability. The negative value of Q c indicates that the system sufficiently provides reactive power margins for compensations of an operating point. Figure 1 shows an example of reactive support in the VQ curve of the kth bus on a test distribution system. Under stable operation, the summation of Q c and external reactive power must be equal to zero. Therefore, one factor controlling the voltage stability is the value of Q c . Therefore, one factor controlling the voltage stability is the value of Q c . In the VQ curve, the critical point, known as the saddle nodal bifurcation (SNB), is the loading point at the voltage collapse [26,27]. The operating point must be kept away from the voltage collapse. Since voltage collapse, which is a system instability, can be caused by uncontrollable reactive power compensation of RDG. Therefore, the voltage stability assessment function considering the voltage collapse needs to be made for the determination of optimal placement of RDGs.
To maintain voltage stability, not only must the reactive power Q c sufficiently provide reactive power margins for compensation of an operating point, but the distance between the SNB point and operating point must be increased for preventing voltage collapses.

Mathematical Key Functions
To develop the fundamental complex power equation,S * =V * Ī , into non-complex functions form, the mathematical key functions are introduced, which is to be used for forming the voltage stability indicator. For any kth bus,S * The voltage product (v-p) function (ψ k ) at the kth bus is defined as wherē V n the complex voltage at the nth bus, Y mn the mth row, the nth column complex element of the admittance matrix Y bus , N the number of buses.
Then, by substitution ofψ k , Equation (3) can be rewritten as; Likewise, Equation (5) takes the form where ψ k and ζ k are the v-p magnitude, the v-p angle of the kth bus, respectively. Separating Equation (6) into real and imaginary parts, we have where ∆ k = ζ k − δ k . For simplification, ψ P.k and ψ Q.k are used for ψ P.k (V k , ∆ k ) and ψ Q.k (V k , ∆ k ) if the augments are clear from the context. In the following, ψ P.k and ψ Q.k are called active v-p function and reactive v-p function, respectively. For calculating the magnitude of the voltage at the kth bus using ψ Q.k and ψ k , first we substitute Equations (7) and (8) into Equation (6) to obtain the bus voltage equation as

Reactive Support Q c
Voltage solutions which are obtained from Equation (9) are the feasible power flow solution. Once the solution is investigated using the VQ curve, the reactive support Q C is obtained from Equation (9) as where ψ Q.k is obtained from Equation (8). and Q k -the magnitude of reactive power injection at the kth bus, Q C.k -the magnitude of reactive support at the kth bus, φ k -the angle of the phasor of complex power injectionS k at the kth bus, Y kk -the magnitude of the kth row, the kth column complex element of the admittance matrix Y bus , θ kk -the angle of the kth row, the kth column complex element of the admittance matrix Y bus .
Please note that the negative solution of Q C.k means stable in voltage without requiring external reactive power injection and the positive solution of Q C.k means stable in voltage with requiring external reactive power injection to maintain the voltage level within an acceptable range. Therefore, Q c is the key to indicating the ability of voltage stability.

Identification of Voltage Collapse
As the discussion in [22,23,28], the power flow Jacobian matrix becomes singular at the point of voltage collapse or the saddle node bifurcation (SNB). From Equation (7) and (8), the singularity of Jacobian matrix can be written as The SNB condition using Equation (11) can be written as By considering the feasible solution of the voltage from Equation (9) with substituting Equations (7) and (8) and the SNB condition of Equation (12), the voltage V SNB k at the SNB point is obtained as Likewise, by solving Equation (9) with the SNB condition of Equation (12), the solution of the reactive v-p function ψ SNB Q.k at the SNB point is obtained as Eventually, by substituting ψ SNB Q.k into Equation (10), the reactive power at the SNB point (Q SNB C.k ) is obtained as

Voltage-Reactive Power Margin with Respect to Voltage Collapse
To estimate the most vulnerable bus of voltage collapse, i.e., the highest risk of voltage collapse, the distance between coordinates of the operating point (V, Q C ) and the SNB point (V SNB , Q SNB C ) in the VQ curve is used. In this paper, the distance is called "the voltage-reactive power margin with respect to voltage collapse," denoted by Γ. At the kth bus, Γ(V k ) is obtained as For simplification, Γ is used for Γ(V k ) if the augments are clear from the context. Under security operation, the value of Γ should be greater than 0. The voltage collapse occurs if Γ is equal to 0. Therefore, the greater than 0 the value of Γ, the more safe the system.
To demonstrate the voltage collapse risk assessment of systems, IEEE 5-bus and IEEE 33-bus test distribution systems where the information of them are given in Table A1-A4, are used. Then, the most vulnerable bus of voltage collapse is investigated on these test distribution systems using the minimum Γ and the loading margin, as in Tables 1. By comparing the minimum Γ to the loading margin, these results show that the minimum of Γ include the bus with the highest possibility of voltage collapse of IEEE 5-bus and IEEE 33-bus systems.

Effect of Reactive Power Compensation
The uncontrollable reactive compensation of RDGs may cause voltage collapse. First, this phenomenon is demonstrated on IEEE 5-bus and IEEE 33-bus test distribution systems, where reactive compensation of generators are assumed. Then, the most vulnerable bus of voltage collapse is investigated.
To demonstrate the effect of reactive compensations of RDGs, the reactive compensation is increasingly applied −0.10 pu and −0.20 pu to the IEEE 5-bus system, and −0.0001 pu and −0.0002 pu to the IEEE 33-bus system. Using the voltage stability indicator, L-index, proposed by [23], the results show that the 5th and 22nd buses of IEEE 5-bus and IEEE 33-bus systems, respectively, are the weakest bus in voltage stability. Next, loading margins show that the 5th bus of IEEE 5-bus and 17th and 18th buses of IEEE 33-bus are the most vulnerable buses of voltage collapse, as shown in Tables 2 and 3. As a result, the first two weakest buses with the highest possibility of voltage collapse, which are obtained using the minimum value of Γ and the loading margin, are almost the same. For the IEEE 5-bus system, the weakest bus in voltage stability is the same with the most vulnerable bus of voltage collapse, as in Table 2. However, by comparing the results from the loading margin and L-index as given in Table 3, the weakest bus of voltage stability using L-index is not the same with the most vulnerable bus of voltage collapse by the loading margin for the IEEE 33-bus system. After that, one of the first two weakest buses using Γ is verified with loading margin levels of the IEEE 5-bus and 33-bus systems, as shown in Tables 2 and 3, respectively. The results show that Γ can be used for approximating the most vulnerable bus of voltage collapse by considering the different reactive compensation levels. In the following, the Γ will be used to formulate the objective function of the optimal placement determination beneficial for keeping voltage stability and safety and being available to consider the reactive power compensated for by generators.
Moreover, we found that reactive compensation increases the voltage collapse risk by considering Γ, as shown in Figures 2 and 3. Therefore, uncontrollable reactive compensation of RDGs may cause degraded system operation reliability and voltage collapse.

Reactive Power Compensation Support Margin for Voltage Stability Improvement
According to the previous results, the possibility of voltage collapse of each bus is controlled by the available reactive support Q C , which can be estimated using the proposed formulation of Γ. The minimum value of Γ can be adopted for estimating the most vulnerable bus of voltage collapse. Therefore, the objective function, which is named Reactive Power Compensation Support Margin for Voltage Stability Improvement (QSVS), is proposed subject to the condition of V k > V SNB k as QSVS k = min At the kth bus, QSVS k indicates the voltage stability limit with respect to voltage collapse. Therefore, QSVS k > 0 means no voltage collapse, and QSVS k = 0 means voltage collapse. Estimating the voltage stability limit of overall systems, the minimum value of QSVS k over all buses, which indicates the highest possibility of voltage collapse, is used.
In system operations, the value of the QSVS should be greater than 0 for stable operation. The more the value of the QSVS from 0, the more stable the system and safe from voltage collapse. On the other hand, if the value of QSVS is equal to 0, the voltage collapse will occur and should be avoided for safety in operating.

Reactive Power Compensation of RDGs
Different types of generators convert natural energy into electricity resulting in nonuniform reactive power compensation. Basically, the reactive compensation of generators is described using the power factor, which is the cosine of the difference between voltage and current phase angles. For simplification, reactive power compensation and active generated power of a RDG are represented using a ratio named reactive power compensation rate (RCR), as follows.
where Q RDG comp and P RDG are reactive power compensation of generators and the active power generated by a generator, respectively.
In this paper, the RCR is used for distinguishing the type of RDGs. We assume that for dispatchable-RDG (DP-RDG), the generator is not compensated any reactive power from the system, and RCR is zero. On the other hand, for non-dispatchable RDG (NDP-RDG), the generator's level of compensated reactive power is assumed to be equal to the generated active power times RCR.

Optimal Location of RDGs Considering Reactive Power Compensation
The goal of determining locations of RDGs in distribution systems is to improve voltage stability against uncontrollable reactive compensation. This paper determines the most proper location or the weakest bus by removing load from one bus to another. To specify the buses for which loads are disconnected, we use a vector (c 2 , c 3 , ..., c N ) where c k = 0 means that the load of kth bus is disconnected and c k = 1 means otherwise. In addition to the specification of buses whose loads are removed, we treat the peak load factor (l f ) and the reactive power compensation ratio (RCR) as parameters, and we consider QSVS as a function of these parameters. Finally, the optimal location of RDGs are considered to be the maximization of QSVS((c 2 , c 3 , · · · , c N ), l f , RCR) over possible choices of vector (c 2 , c 3 , · · · , c N ) as, arg max where C is a set of all possible binary vectors having the size N − 1 and the number of 1 s is no smaller than N − 1 − N RDG . The optimization problem given in Equation (20) should be solved being subjected to the following voltage constraint; where V min , V max and V k are the lower voltage limit, the upper voltage limit, and the voltage of kth bus, respectively. The algorithm of the RDGs optimal location is given as Algorithm 1.

Methodology for Optimal Size of RDGs
After the optimal location(s) (X from Algorithm 1) of the buses of RDGs is obtained, the optimal sizes of RDGs is determined so as to minimize the power losses (P loss ), which can be calculated using Equation (2).
The minimization is given in Equation (22) should be solved with being subjected to the following inequality and equality constraints.

Voltage constraint
The minimum and the maximum voltage constraints given in Equation (21) 2. RDG size constraint The active power produced by RDGs should be no larger than the system's total active power demand because the violation of this constraint results in a reverse power flow in the system. This constraint is expressed as follows.

Voltage collapse constraint
The voltage magnitude at each bus must be grater than its voltage stability limit (V SNB k ), since the violation of the constraint results in voltage collapse and system blackout. This constraint is expressed as follows.
For solving RDG sizing problem, we have adopted a simple exhaustive search with discritizing possible size of RDG as integer multiples of P t N s , where P t is the maximum possible size P t = ∑ N k=1 P k due to the constraint (23), and N s is an integral parameter which control the quartization step P t N s .

Overall Design Procedure
In summary, the proposed system design process is described. First, the number of the RDGs and the set of the peak load factors are given. For representing the reactive compensation of RDGs, RCR is given as another input. After the inputs are prepared, the candidate locations of RDGs are determined using Algorithm 1. Then, the optimal sizes of RDGs are determined from the candidate locations by using Algorithm 2. Finally, the optimal solution is chosen by considering the minimum power losses. The flowchart of the proposed system design is shown in Figure 4.

Algorithm 2: Optimal size of RDGs
Input: X -{k 1 , k 2 , ..., k N RDG } location(s) of RDG(s), RCR -a common RCR for all RDGs, P t -the limitation of RDGs' generating capacity design, Equation (23), N s -number of samples Data: A distribution system Initialize:  (21) and (24) and if fails, then skip (5) (5) P tmp loss is compared with P min loss , and if P tmp loss is smaller than P min loss , then the temporary best size and P min loss are updated as; P RDG k ← P tmp k for k ∈ X P min loss ← P tmp loss end Output: P RDG k for k ∈ X

Simulations
The proposed methodology was implemented using Python programming with a library called PYPSA [29], and simulations were conducted. Simulation 1: optimal location and size without reactive compensation of one and two RDGs. Simulation 2: reactive power compensation test.
The proposed methodology is applied to the IEEE 33-bus test distribution system, which is shown in Figure 5. The complete system data at the peak load demand are taken from [30]. The details of the system parameters are given in Tables A3 and A4. This system is supplied from one substation with a total peak load of 3.715 MW and 2.30 MVAr. The total power losses at the peak demand without RDGs integration is 212.95 kW. Considering the requirements of the IEEE standard [31], the lower and upper voltages, V min and V max , at the kth bus are set to be 0.95 pu and 1.05 pu, respectively, and the power generating limits of RDGs are equal to total power demand.  For single RDG installation, first, the candidate location is determined using Algorithm 1. Figure 6 describes the variation of QSVS for load removal from each bus and for each peak load factor. The radius represents the value of QSVS, and the sector represents the individual bus of which load is disconnected. By considering the maximum increment of QSVS with peak load factor 80%, 100% and 120%, the 15th bus is detected as the most vulnerable bus of voltage collapse, and it is the candidate location for a single RDG installation. Table  4 shows the maximum increment of QSVS achieved by disconnecting the load from the 15th bus.  From the minimization of power losses, the optimal size of RDG at the 15th bus is determined using Algorithm 2, the result 1040.20 kW has been obtained as Figure 7 and Table 5 show the power losses are decreased to 134.71 kW which corresponds to loss reduction 0.0752 per 1kW generated power of RDG. In addition, in order to check that the result will not distract the supply ability to support demand, the minimum loading margin is demonstrated. The result of the optimal location and size of the single RDG is compared with [10,12,13,19,[32][33][34][35] as shown in Table 6. As a result, the proposed methodology shows the best power loss reduction per 1 kW generated power of the single RDG with voltages stability improvement. Figure 7. Variation of power losses with a single RDG for the IEEE 33-bus test distribution system.

Locations and Sizes of 2 RDGs
For two RDGs' installation, first, the candidate locations are determined using Algorithm 1. Figure 8 describes the variation of QSVS for load removal from pair of buses and for each peak load factor. The colors represent the values of QSVS. By considering the maximum increment of QSVS with l f 80% 100% and 120%, buses 15th and 17th are detected as the most vulnerable buses of voltage collapse in Table 7 and are considered to be the candidate locations for two RDGs installations.   By considering the minimization of power losses in Algorithm 2, the 15th and 17th buses are chosen with sizes of 866.83 and 123.83 kW, respectively, as given in Figure 9 and Table 8. The power losses are decreased down from 212.95 to 134.42 kW which corresponds to loss reduction 0.0793 per 1kW generated power of two RDGs. The optimal location and size of two RDGs are compared with [10,12,19,[32][33][34] in Table 9, and it is shown the proposed methodology shows the best power loss reduction per 1 kW generated power of the two RDGs with voltages stability improvement.

Simulation 2: Reactive Power Compensation Test
Uncontrollable reactive power compensation of RDGs is a hypothetical factor as for the voltage stability degradation. To simulate this effect, the reactive power compensation ratio (RCR) has been introduced with sample values, i.e., RCR = 0 for DP-RDGs, RCR = ±0.25 and ±0.5 for NDP-RDGs, and maximum L-index has been compared among different installations of RDG(s) with individual RCR value. Table 10 and Figure 10 show the comparison result for one RDG installation, and Table 11 and Figure 11 show the result for the case of two RDGs installation.  Figure 10. Variation of voltage stability with reactive compensations of 1 RDG using maximum L-index.
By considering the variation of voltage stability from Table 10 and Figure 10, we found that the proposed methodology provides the best result in the robustness of voltage stability against the uncontrollable reactive compensation.  Similarly, by considering the variation of voltage stability from Table 11 and Figure 11, we found that the proposed methodology provides the best result in the robustness of voltage stability against the uncontrollable reactive compensation.

•
By considering the voltage stability and the power losses reduction individually, we found that the maximum power losses reduction does not provide maximum voltage stability, especially when reactive compensations occur. • The simulations show the best result in improving voltage stability by maximizing the increment of QSVS which estimates the voltage collapse margin. Therefore, the voltage stability is dependent on the voltage collapse margin. However, the most vulnerable bus of voltage collapse can not be indicated directly by using voltage stability indicators such as the L-index. • The results clearly show that the reactive compensation affects the voltage stability of the distribution systems. Therefore, generators' uncontrollable reactive compensation and reactive support's ability need to be accountable for considering voltage stability. • The vulnerable bus of voltage collapse in peak load situations is more apparent than the lower peak demand.

Concluding Remarks
In this paper, the voltage-reactive power margin with respect to voltage collapse (Γ) and the optimal location of RDG installation, which maximize the minimum Γ, have been proposed. The proposed methodology for determining locations and sizes of RDGs emphasizes the voltage stability against uncontrollable reactive power compensation. The effectiveness of the suggested approach is verified by using the different possible ratios of reactive power compensation (RCR) on the IEEE 33-bus test distribution system. The results were compared with those obtained using other algorithms to investigate the effectiveness in terms of voltage stability. It is obvious from the comparison that the proposed approach provides a notable performance in terms of maximum power losses reduction. Moreover, our results maintain the robustness of voltage stability against variable reactive power compensation.
Funding: This research received no external funding.
Informed Consent Statement: Informed consent was obtained from all subjects involved in the study.
Data Availability Statement: All materials have been gathered from thirtieth and thirty-sixth reference of this paper Acknowledgments: This research is financially supported by Japan Advanced Institute of Science and Technology (JAIST), National Science and Technology Development Agency (NSTDA), Sirindhorn International Institute of Technology (SIIT), Thammasat University (TU) under the JAIST-SIIT dualdegree doctoral program. Likewise, thanks to support from Provincial Electricity Authority (PEA), the utility section of Thailand. Furthermore, thanks to Dr.Siriya Skolthanarat for supporting the fundamental knowledge.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. The Test Distribution Systems' Parameters
Appendix A. 1