Optimal Location and Sizing of Distributed Generators in Power System Network with Power Quality Enhancement Using Fuzzy Logic Controlled D-STATCOM

: This article presents the selection of location and sizing of multiple distributed generators (DGs) for boosting performance of the radial distribution system in the case of constant power load ﬂow and constant impedance load ﬂow. The consideration of placing and sizing of DGs is to meet the load demand. This article tries to overcome the limitations of existing techniques for determining the appropriate location and size of DGs. The selection of DG location is decided in terms of real power losses, accuracy, and sensitivity. The size of DG is measured in terms of real and reactive power. Both positioning and sizing of DG are analyzed with the genetic algorithm and the heuristic probability distribution method. The results are compared with other existing methods such as ant-lion optimization algorithm, coyote optimizer, modiﬁed sine-cosine algorithm, and particle swarm optimization. Further, the power quality improvement of the network is assessed by positioning D-STATCOM, and its location is decided on the basis of the nearby bus having poor voltage proﬁle and high total harmonic distortion (THD). The switching and controlling of D-STATCOM are assessed with fuzzy logic controller (FLC) for improving the performance parameters such as voltage proﬁle and THD at that particular bus. The proposed analytical approach for the system is tested on the IEEE 33 bus system. It is observed that the performance of the system with the genetic algorithm gives a better solution in comparison to heuristic PDF and other existing methods for determining the optimal location and size of DG. The introduction of D-STATCOM into the system with FLC shows better performance in terms of improved voltage proﬁle and THD in comparison to existing techniques.


Introduction
The current activities of the advanced power system have become very complicated, which needs to necessarily satisfy the increasing energy needs in an efficient manner [1,2]. The civil, fiscal, and other substantial considerations warrant the site of generation centers being placed at places distant from load centers. The reorganization and deregulation of power companies have led to making system governance unpredictable. The factors which are to be considered while carrying out extension of the transmission system are the following: cutback stability margins, chances of tripping outages, and rising power cuts. The distributed generator (DG) installation would be of the utmost benefit where the installation of new transmission lines and setting up of new power-generating units are not feasible [3][4][5]. It is also reasonable to believe that the selection of the right DG technology, including the optimal location and scale of the DG, would help in decreasing the losses in such a system. The purpose of optimally placing DG in a power system network is for achieving correct operation of the network with system error minimization and voltage profile enhancement inclusive of improved stability, reliability, and load ability [6,7]. In contrast to the classical approach, smart techniques for optimal DG sizing and positioning are simple and have good convergence characteristics for application to composite power system networks [8][9][10]. DG is also capable of significantly mitigating harmonics and improving the voltage profile along with acquiesced transmission and distribution investment [11][12][13]. DG is flexible enough to locate anywhere in the system as per requirement of minimum transmission losses [14][15][16]. There have been many techniques proposed to perform such activities as load durability test, exact loss formula, Newton-Raphson, Gauss-Seidal method etc., [17][18][19]. At present, in the era of soft computing technique, every system is trying to obtain fast convergence region so as to reduce the minimum losses with lesser component involved [20,21].
The biggest challenge is to find the optimal size of DG to fulfil the load requirements. It is observed that there are four types of DG given as: For example: synchronous condenser, capacitor bank. (d) DG4: It absorbs the real power, giving the reactive power to the system at 0.8-0.85 power factor lagging. For example: doubly-fed induction generator [22][23][24].
Recent work has found that there are many advantages to the installation of DGs within the power system; namely raising the efficiency of the output and lowering energy deficit on the electrical grid [25][26][27][28]. In this article, only DG2 is used as per system requirements. The size and location of DG were proposed in many articles by using different techniques such as crow bar search method, neural network, evolutionary algorithm, intelligent water droplet, swarm optimization, etc. [29][30][31][32][33]. The advanced algorithms [34,35] or other existing techniques for identifying the size and location of DG have the biggest challenge of improper total harmonic distortion (THD), sensitivity, and accuracy. It is observed in literature that the THD value obtained was in the range of 15-18%, accuracy and sensitivity are also in the range of 10-15% which are quite high and inadequate, due to which voltage profile is distorted. Such issues with existing techniques create the motivation to overcome these problems. These issues are satisfactorily resolved with the proposed scheme. The genetic algorithm (GA) is proposed to determine the sizing and location of DG with improved THD, accuracy, sensitivity, and voltage profile. GA tends to be more highly permissible than heuristic optimization strategies in order to find the optimal results with less effort than absolute search. In this paper, heuristic optimization strategy which is a combination of two methods, namely, Poisson distribution method and normal distribution method, is also utilized to find the performance of the radial distribution system and show the effectiveness of GA in its comparison. Such a heuristic method requires more effort for providing detailed solutions in terms of accuracy, sensitivity, realism, and power loss. In order to have better results with minimal efforts, GA is applied. It is also observed that the proposed technique gives better results in comparison to existing techniques presented in literature [4,9,12,15,17,20,28,30,32,[35][36][37][38][39][40][41][42][43][44][45]. However, to analyze the efficacy of the proposed work in this paper, the results achieved are compared with the existing techniques such as ant-lion optimization algorithm [42], coyote optimizer [43], modified sine-cosine algorithm [44], and particle swarm optimization [45]. The GA seems to have the main advantage of utilizing entity definition, i.e., strings, instead of handling such entities themselves. Multiple problems in electricity grid optimization are manifestations in numerical optimization but linear and other nonlinear methods in programming consider them difficult to address. In this article, the heuristic probability distribution method and GA are applied for finding the best location and sizing of DG in the IEEE 33 bus system for the constant power load model (CPLF) and the constant impedance load model (CILF). The performance parameters show the superiority of GA over the heuristic probability distribution method and other existing methods such as ant- J is an operator of heuristic probability distribution method for minimization of power losses shown in Equation (2) and λ is the difference between measured and reference power.
S loss is the complex power loss between two buses and S load is the power consumed by the load.
Putting the value of Equation (2) into Equation (1), Equation (3) is obtained as: where the measured (S i ) and reference value (S ref ) of complex power are given by Equations (4) and (5), respectively: S re f = P re f + jQ re f X i is the design factor given by Equation (6) to improve the accuracy such that minimum power loss can be attained.
The probability distribution factor in Equation (3) is given by Equation (7): where λ = S i − S re f = difference factor between measured and reference value of power. As per standard expression of normal distribution and comparing with Equation (7), Equation (8) is obtained: where S ref is the mean, σ is the standard deviation, and its corresponding variance is given as σ 2 .
Putting the value of Equations (6)-(8) into Equation (3), Equation (9) is obtained: where, C 1 is the accuracy measured in terms of real power measurement. Its range lies between 0.02 and 0.04. The mathematical representation of C 1 is given as (∆P i /P i ). C 2 is the accuracy measured in terms of reactive power measurement. Its range lies between 0.03 and 0.05. The mathematical representation of C 2 is given as (∆Q i /Q i ).
Power flow at bus 'i' is given by Equations (10) and (11) as: where, P i and Q i are real and reactive power flow between two buses and their reference values are given as P ref and Q ref as shown in Equations (12) and (13): where conductance (G ij ) and susceptance (B ij ) are given by Equations (14) and (15), respectively: The best performance index can be measured by differentiating Equation (9) to obtain the minimal optimal solution as shown in Equation (16) J is the function of variable S i which employs J(S i ). For checking the convergence nature, Taylor series expansion for second order is used for 'k' iteration as shown in Equation (17): Using the condition of Equation (16) in Equation (17), Equation (18) is obtained: Rearranging Equation (18), Equation (19) is obtained: where h = S k+1 i − S k i . In order to obtain Equation (19), there is a constraint limit to attain the convergence level, which is shown in Equation (20): The complete iterative process under the heuristic PDF method is shown using Figure 1.
The load representations for CPLF and CILF are given by Equations (21)-(23): where V o is rated voltage of a particular bus while x and y are constant load parameter and its values are shown in Table 1. The constant values of x and y are taken for power load and impedance load; that is why they are called constant power load and constant impedance load.
The sensitivity and accuracy can be represented as ∂(J) ∂(S i ) in pu and S i − S re f in pu, respectively. The constant values of x and y are taken for power load and impedance load; that is why they are called constant power load and constant impedance load. Start Select impedance value from Table 1 Set iteration count k=0 Estimate the values of Si and losses using Equation (1) and Equation (2) Evaluate PDF (λ) using Equation (7) and Equation (8) Use Taylor Figure 1. Flowchart of heuristic PDF method.

Performance Evaluation for Standard IEEE Tested 33 Bus Systems Using Heuristic PDF
The effectiveness of the proposed scheme using the conventional method is being tested initially on the standard IEEE 33 bus test system for CPLF and CILF [36,37]. The typical diagram of the IEEE 33 bus test system is shown in Figure 2

Performance Evaluation for Standard IEEE Tested 33 Bus Systems Using Heuristic PDF
The effectiveness of the proposed scheme using the conventional method is being tested initially on the standard IEEE 33 bus test system for CPLF and CILF [36,37]. The typical diagram of the IEEE 33 bus test system is shown in Figure 2 [37].
The IEEE 33 bus test system is modelled in MATLAB with location of fault from 0-90 km. This system consists of 33 buses and 32 lines and has 12.66 kV, 3.715 MW, and 2.3 MVar load size. Thirty percent of the entire load is the size of the source unit used. The source unit voltage is 12.66 kV and the system's lower and upper voltage is set between 0.95 pu and 1.05 pu with standard internal parameters as given in [37]. Bus 1 is considered as the slack bus or main substation. The internal parameters of the IEEE 33 bus test system are shown in [36].
The proposed design illustrated from Equations (1)-(23) is applied on the standard IEEE 33 bus test system for estimation of location of DG using the heuristic PDF method. By using these equations, the parameters such as real power loss, accuracy, and sensitivity are estimated as shown in Table 2. The design part has already been discussed in the previous section. The IEEE 33 bus test system is modelled in MATLAB with location of fault from 0-90 km. This system consists of 33 buses and 32 lines and has 12.66 kV, 3.715 MW, and 2.3 MVar load size. Thirty percent of the entire load is the size of the source unit used. The source unit voltage is 12.66 kV and the system's lower and upper voltage is set between 0.95 pu and 1.05 pu with standard internal parameters as given in [37]. Bus 1 is considered as the slack bus or main substation. The internal parameters of the IEEE 33 bus test system are shown in [36].
The proposed design illustrated from Equations (1)-(23) is applied on the standard IEEE 33 bus test system for estimation of location of DG using the heuristic PDF method. By using these equations, the parameters such as real power loss, accuracy, and sensitivity are estimated as shown in Table 2. The design part has already been discussed in the previous section.

Genetic Algorithm
GA is used to find the best location of DG in the IEEE 33 bus system. It involves reproduction, crossover, and mutation. Its procedure can be illustrated by the flowchart as shown in Figure 3. The process begins with selection of a binary string as shown by Equation (24), the parameters for which are assumed as follows:  Figure 3. Flowchart representing the GA.  Population size: 6, length of the complete string: 8, crossover probability, P c = 0.9, mutation probability, P m = 0.02. where r is the iteration count. The application of iteration in Equation (24) results in Equations (25) and (26): Figures 4 and 5 show real power loss at bus 17 for CPLF and CILF using GA. The performance parameter for finding the DG location can be analyzed from Tables 2 and 3 at different DG locations in the IEEE 33 bus system using heuristic PDF and GA methods for both CPLF and CILF. Figures 6 and 7 provide the performance parameter comparison of GA with the heuristic method at different buses for CPLF and CILF. Moreover, in order to have comprehensive analysis and comparison for the DG location with GA and heuristic pdf, the results are compared with those obtained with the ant-lion optimization algorithm [42], coyote optimizer [43], modified sine-cosine algorithm [44], and particle swarm optimization [45]. The performance parameter evaluation for the estimation of DG location by using the ant-lion optimization algorithm [42], coyote optimizer [43], modified sine-cosine algorithm [44], and particle swarm optimization [45] is shown in Tables 4-7 for CPLF and CILF type of load.
From Tables 2-7, it is observed that the selection of DGs location is better found under GA for CPLF and CILF in comparison to other methods. By comparing the real power loss, sensitivity, and accuracy, it can be concluded that bus 17 is the best location for the placement of DG for both CPLF and CILF. In the sequence manner, bus 3 and bus 4 are the second and third position of placing the next two DGs. The comparative results for positioning of three DGs with different methods are shown in Table 8.

GA method
Heuristic pdf method Ant-lion optimization [42] coyote optimizer [43] Modified sine-cosine algorithm [44] Particle swarm optimization [45]  From Tables 2-7, it is observed that the selection of DGs location is better found under GA for CPLF and CILF in comparison to other methods. By comparing the real power loss, sensitivity, and accuracy, it can be concluded that bus 17 is the best location for the placement of DG for both CPLF and CILF. In the sequence manner, bus 3 and bus 4 are the second and third position of placing the next two DGs. The comparative results

Optimal Sizing of DG
After deciding the optimal location of three DGs, it is also required to check the DG size to confirm its placement at bus 17. DG size is estimated from Tables 9-11 by using heuristic pdf, GA, ant-lion optimization algorithm [42], coyote optimizer [43], modified sine-cosine algorithm [44], and particle swarm optimization [45] for both CPLF and CILF type of load. It is observed that the size of DG when placed at bus 17 is found to be the minimum. The relative comparison of DG size for bus 17, 4, and 3 is shown in Table 12. The minimal size of DG is obtained under GA as compared to the heuristic method. Figures 8-10 illustrate the real power and Figure 11 illustrates the reactive power at bus 17 for both CPLF and CILF. From the results, it is confirmed that bus 17 is the best choice for the location and optimum sizing of DG is also obtained here. Subsequently, bus 3 and bus 4 have the appropriate size of DGs, which assures the confirmation of the DG location. The location and size of three DGs at the allotted location in the IEEE 33 bus system are shown in Figure 12.

Optimal Sizing of DG
After deciding the optimal location of three DGs, it is also required to check the DG size to confirm its placement at bus 17. DG size is estimated from Tables 9-11 by using heuristic pdf, GA, ant-lion optimization algorithm [42], coyote optimizer [43], modified sine-cosine algorithm [44], and particle swarm optimization [45] for both CPLF and CILF type of load. It is observed that the size of DG when placed at bus 17 is found to be the minimum. The relative comparison of DG size for bus 17, 4, and 3 is shown in Table 12. The minimal size of DG is obtained under GA as compared to the heuristic method. Figures 8-10 illustrate the real power and Figure 11 illustrates the reactive power at bus 17 for both CPLF and CILF. From the results, it is confirmed that bus 17 is the best choice for the location and optimum sizing of DG is also obtained here. Subsequently, bus 3 and bus 4 have the appropriate size of DGs, which assures the confirmation of the DG location. The location and size of three DGs at the allotted location in the IEEE 33 bus system are shown in Figure 12.

Optimal Sizing of DG
After deciding the optimal location of three DGs, it is also required to check the DG size to confirm its placement at bus 17. DG size is estimated from Tables 9-11 by using heuristic pdf, GA, ant-lion optimization algorithm [42], coyote optimizer [43], modified sine-cosine algorithm [44], and particle swarm optimization [45] for both CPLF and CILF type of load. It is observed that the size of DG when placed at bus 17 is found to be the minimum. The relative comparison of DG size for bus 17, 4, and 3 is shown in Table 12. The minimal size of DG is obtained under GA as compared to the heuristic method. Figures 8-10 illustrate the real power and Figure 11 illustrates the reactive power at bus 17 for both CPLF and CILF. From the results, it is confirmed that bus 17 is the best choice for the location and optimum sizing of DG is also obtained here. Subsequently, bus 3 and bus 4 have the appropriate size of DGs, which assures the confirmation of the DG location. The location and size of three DGs at the allotted location in the IEEE 33 bus system are shown in Figure 12.         Figure 10. Real power at bus 17 after 155 iterations using GA for CILF. Figure 11. Reactive power at bus 17 after 155 iterations using GA for CILF. Figure 11. Reactive power at bus 17 after 155 iterations using GA for CILF.

Positioning and Impact of D-STATCOM
The positioning and impact of D-STATCOM in the IEEE-33 bus system have to be assessed for improving the power quality performance parameters such as THD and voltage profile. The rating of D-STATCOM is 1 pu reactive power. In order to improve power quality performance, control of D-STATCOM is decided by using the fuzzy logic controller. In this article, only one D-STATCOM is used, so it has to be connected at that bus where large distortions are present. In order to define the inputs and output of FLC, Equation (9) is further used. Now, we differentiate Equation (9) to obtain the optimal solution.
By arranging the terms in Equation (29) and by taking log on both sides, the value of E is obtained as given by Equation (30).
Equation (30) gives the optimal solution. Now, the inputs to FLC are error (E) and change in error (∆E) which are shown in Equation (31) as: The detailed structure of the D-STATCOM-based FLC controller is shown in Figures 13 and 14. In Figure 13, distorted real and reactive power is measured and passes through the PID controller which generates the measured complex power. The measured complex power is compared with its reference value which produces error. The error and derivative of error act as inputs to FLC. The actual design of FLC for D-STATCOM switching is shown in Figure 14. The output of FLC is reference voltage which is compared with reference value and generates pulses for switching the D-STATCOM. In the same pattern, ∆E can be expressed in standard form.
In order to design rules of the fuzzy set, a 7 × 7 matrix is taken so that the model will have more precise and better results. This means both inputs have seven membership functions. Using Cramer's product rule, FLC rule is designed as shown in Figure 15 and its surface view is shown in Figure 16. Tables 13 and 14 show the notification of membership function for first input, as initial error E is around 0.12 and mapping of input with output, respectively.    In order to design rules of the fuzzy set, a 7 × 7 matrix is taken so that the model wi have more precise and better results. This means both inputs have seven membershi functions. Using Cramer's product rule, FLC rule is designed as shown in Figure 15 an its surface view is shown in Figure 16. Tables 13 and 14 show the notification of mem bership function for first input, as initial error E is around 0.12 and mapping of inpu with output, respectively.        From Tables 13 and 14, it can be demonstrated that, under certain parameters, a precise control of objectives can be achieved using fuzzy observations, mapping, and control, if the observations become sufficiently accurate as the goal is approached.
The seven membership functions corresponding to the first input are shown in Equation (32) and these seven membership functions are taken from x 1 to x 7 . The seven membership functions are chosen in order to have better and more precise results. The nature of the membership function is triangular and input is split into seven membership functions. Each membership function from x 1 to x 7 is assigned with values in the numerator as shown in Equation (32).
Dividing Equation (32) by 0.12, Equation (33) is obtained as: Notification of membership function for the second input is given in Equation (34): From the Cartesian product rule: Further membership function is taken as: Table 15 gives the comparative analysis of voltage profile at different buses with different existing techniques and D-STATCOM-based FLC for both CPLF and CILF load; whereas computational expression of THD is given by Equation (35). Table 16 gives the comparative analysis of THD (%) of real power different buses with different existing techniques and D-STATCOM-based FLC for both CPLF and CILF load.
where 'g' is distortion factor which is defined as ratio of rms fundamental harmonic value to rms value of voltage. Now, a suitable location for D-STATCOM at a particular bus has to be decided. From Figures 9 and 10, it can be inferred that voltage profile and THD (%) of the real power at bus 10 are found to be worst with existing methods such as harmony search algorithm [4], ant colony algorithm [9], and big-bang-crunch method [30] for both CPLF and CILF. Therefore, D-STATCOM is placed at bus 10. Figures 17 and 18 show the voltage (pu) comparisons at bus 10 for CPLF and CILF. It is also observed that switching of D-STATCOM with FLC improves its voltage profile and THD (%). This means that switching of D-STATCOM with FLC helps to improve the performance parameters in comparison to existing methods. The comparison of voltage profile and THD (%) of real power at bus 10 with existing techniques and D-STATCOM-based FLC is shown in Tables 17 and 18

Result Summary
This article shows location and sizing of three DGs for CPLF and CILF types of load using GA and heuristic PDF method. The location of the DGs was obtained based on three different parameters such as line power losses, accuracy, and sensitivity. The application of GA method shows that all three parameters of DG placement are improved in comparison with the heuristic PDF method as well as existing methods such as ant-lion optimization algorithm, coyote optimizer, modified sine-cosine algorithm, and particle swarm optimization. It is also observed that after obtaining optimal location for DG placement at bus 17, optimal sizing for DG has been determined among all buses and the most optimal solution turns out to be at bus 17 in terms of minimum real and reactive power. It is found that determination of size of DG is quite satisfactorily observed under GA in comparison to the heuristic PDF method, ant-lion optimization algorithm, coyote optimizer, modified sine-cosine algorithm, and particle swarm optimization. Subsequently, bus 3 and bus 4 are the second and third best locations for placement of DGs with optimal size. Now, positioning of D-STATCOM on the IEEE 33 bus system is assessed in such a way that the bus with the worst performance in terms of THD and voltage profile has to be detected. On the basis of the analysis performed, bus 10 is found to be most suitable for locating the D-STATCOM. Afterwards, in order to improve the THD and voltage profile, switching of D-STATCOM is performed through FLC, consequently showing superiority over other existing methods. The current research will provide considerable expertise and also acts as a guide for researchers, including utility engineers, regarding problems to be addressed in order to optimize the

Result Summary
This article shows location and sizing of three DGs for CPLF and CILF types of load using GA and heuristic PDF method. The location of the DGs was obtained based on three different parameters such as line power losses, accuracy, and sensitivity. The application of GA method shows that all three parameters of DG placement are improved in comparison with the heuristic PDF method as well as existing methods such as ant-lion optimization algorithm, coyote optimizer, modified sine-cosine algorithm, and particle swarm optimization. It is also observed that after obtaining optimal location for DG placement at bus 17, optimal sizing for DG has been determined among all buses and the most optimal solution turns out to be at bus 17 in terms of minimum real and reactive power. It is found that determination of size of DG is quite satisfactorily observed under GA in comparison to the heuristic PDF method, ant-lion optimization algorithm, coyote optimizer, modified sine-cosine algorithm, and particle swarm optimization. Subsequently, bus 3 and bus 4 are the second and third best locations for placement of DGs with optimal size. Now, positioning of D-STATCOM on the IEEE 33 bus system is assessed in such a way that the bus with the worst performance in terms of THD and voltage profile has to be detected. On the basis of the analysis performed, bus 10 is found to be most suitable for locating the D-STATCOM. Afterwards, in order to improve the THD and voltage profile, switching of D-STATCOM is performed through FLC, consequently showing superiority over other existing methods. The current research will provide considerable expertise and also acts as a guide for researchers, including utility engineers, regarding problems to be addressed in order to optimize the size and position of DG units within electrical power systems. The metaheuristic computation approaches recently unveiled could be implemented for optimal design and fitting of DG in network delivery in future.

Conclusions
This article presents the optimal location and sizing of three DGs in the IEEE 33 bus test system by using the heuristic PDF method and GA for CPLF and CILF. Associated bus locations are examined for analysis of the impact of optimal placement and size of DG. The optimal locations of DGs are selected in terms of performance parameters such as line power losses, sensitivity, and accuracy while sizing of DG is obtained in terms of real and reactive power. It is evident that the parameters such as voltage profile, line power loss, accuracy, sensitivity, THD, etc. are improved with the GA method as compared to the heuristic PDF method and other existing methods such as the ant-lion optimization algorithm, coyote optimizer, modified sine-cosine algorithm, and particle swarm optimization. It is also confirmed that determining DG size is resolved quite satisfactorily with the GA method in terms of real power and reactive power, rather than heuristic PDF and other existing methods. Further positioning of D-STATCOM is being decided on the basis of bus having the worst voltage profile and THD (%) of real power. The D-STATCOM is controlled with FLC which gives improved voltage and less THD of real power in comparison to existing techniques. Funding: This research was funded by TAIF UNIVERSITY RESEARCHERS SUPPORTING PROJECT, grant number TURSP-2020/34", Taif University, Taif, Saudi Arabia, and "The APC was funded by SHERIF GHONEIM". Data Availability Statement: All data generated or analysed during this study are included in this research article and any relevant information related to the current study are available from the corresponding author on reasonable request.

Acknowledgments:
The authors would like to acknowledge the financial support received from Taif University Researchers Supporting Project Number (TURSP-2020/34), Taif University, Taif, Saudi Arabia.

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