Optimal Harmonic Mitigation in Distribution Systems with Inverter Based Distributed Generation

In recent years, with the widespread use of non-linear loads power electronic devices associated with the penetration of various renewable energy sources, the distribution system is highly affected by harmonic distortion caused by these sources. Moreover, the inverter-based distributed generation units (DGs) (e.g., photovoltaic (PV) and wind turbine) that are integrated into the distribution systems, are considered as significant harmonic sources of severe harmful effects on the system power quality. To solve these issues, this paper proposes a harmonic mitigation method for improving the power quality problems in distribution systems. Specifically, the proposed optimal planning of the single tuned harmonic filters (STFs) in the presence of inverter-based DGs is developed by the recent Water Cycle Algorithm (WCA). The objectives of this planning problem aim to minimize the total harmonic distortion (THD), power loss, filter investment cost, and improvement of voltage profile considering different constraints to meet the IEEE 519 standard. Further, the impact of the inverter-based DGs on the system harmonics is studied. Two cases are considered to find the effect of the DGs harmonic spectrum on the system distortion and filter planning. The proposed method is tested on the IEEE 69-bus distribution system. The effectiveness of the proposed planning model is demonstrated where significant reductions in the harmonic distortion are accomplished.


Introduction
Nowadays, distribution system power quality is one of the most important challenges, especially after the widespread use of harmonic sources in distribution systems which is considered as one of the most effective factors on power quality [1]. Harmonics presence in the distribution system can result in excessive losses, system equipment's overheating, and damage [2]. Consequently, to keep the distribution system reliable and working at a high performance, harmonics levels should be kept within the allowable limits approved in the international standards [3]. However, due to the widespread of power electronics devices and nonlinear loads in the distribution system, harmonics levels in the distribution system may exceed the standard limits. Therefore, harmonic mitigation becomes more interesting in distribution systems to decrease distortion levels and enhance system performance [4].
On the other hand, huge efforts have been exerted for increasing the penetration of distributed generation units (DGs) in the distribution systems especially the renewable DGs which are inverter-based such as PV and wind generation sources [5]. The presence of DGs in distribution systems provides many technical, environmental, and economic merits [6][7][8][9], but on the other hand, the harmonic content of the inverter-based DGs may increase the harmonic distortion problem in the distribution system [10,11]. To effectively analyze the harmonic distortion in the distribution systems, load-flow and harmonic load flow studies are of prime importance. Therefore, various load flow and harmonic load flow methods are presented for analyzing different topologies of radial distribution systems as in [12][13][14][15].
Further, to solve the harmonic distortion problem, several methods had been proposed [16,17]. In [18], 12-Pulse Rectifiers were used to reduce the amount of generated harmonics, but this technique requires special cooling systems. However, the active filter can be considered as an effective method for harmonic damping in distribution systems [19], it is considered an uneconomic method due to its high cost. Single tuned passive harmonic filters still one of the most common methods for harmonic mitigation due to their effectiveness and economic benefits. The single tuned passive filters are designed to trap the harmonic in the filter-branch depending on the low impedance of the filter-branch at the tuned harmonic order [20]. Various methods were developed for the optimal design of passive harmonic filter based on optimization techniques such as particle swarm optimization [20], simulated annealing [21], and fuzzy linear programming [22].
Such optimization techniques are considered for solving this nonlinear problem which has a very large search space. Therefore, these techniques are considered as a fast, robust, and accurate method to solve this type of problem. Selecting the optimal placement of the harmonic filters in the system has an essential effect on the system harmonic mitigation. Authors in [23] presented a method for single-tuned filter placement in a small distribution system based on a genetic algorithm to reduce the harmonic distortion. In [24], the authors presented a method for determining the optimal allocation of passive filters in an industrial distribution network based on the harmonic similarity metric. In [25], the authors presented two sensitivity indices as a guide for the passive filter placement problem which can determine the sensitive buses for filter placement. In [26], a multi-objective optimization problem was considered for solving the optimal planning problem of passive filter considering specific harmonic orders without considering the harmonic distortion resulted from DG units. In [27], simultaneously planning of both inverter-based DGs and passive filters in the distorted distribution system are considered for minimizing THD and power loss. In [28], the optimal placement and sizing of capacitor banks and inverter-based DGs was employed by biogeography-based optimization (BBO) algorithm considering the harmonic content of the DGs at different load levels. In [29], the authors presented an economic study that approved the economic benefits of using passive filters especially in the case of the nonlinear loads that exceed 1 MVA. In [30], the design of single tuned filters was carried out by using ETAP software in distribution systems with PV systems to eliminate the harmonics and their impact on the system. A comprehensive analysis of the single tuned filter parameters selection and its effect on the harmonic mitigation is presented in [16].
As illustrated in the abovementioned literature review, non-linear loads and renewable energy sources can increase the harmonic distortion in distribution systems, which leads to harmful effects on the system power quality. In this paper, a proposed method is introduced for simultaneously determine the optimal design, number, and placement of single tuned harmonic filters by using the Water Cycle Algorithm (WCA) which is implemented as a multi-objective optimization algorithm. The harmonic spectrums of the inverter-based DGs implement in the distribution system are considered beside the harmonic emissions from the nonlinear loads. This study is considered a multidimensional study as it achieves both technical and economic merits throughout the objectives that include minimizing: the total harmonic distortion, cost of power loss and that of the filter investment cost, and improvement of the voltage profile. Harmonic load flow with and without a filter is implemented for analyzing the systems' harmonics. The effect of harmonic spectrums of the DGs on the harmonic distortion in the system is studied through two cases studied.
The organization of the current paper is ordered as follow: Section 2 presents the problem formulation, Section 3 presents the optimization algorithm and electric scheme representation, Section 4 presents, the proposed filters planning procedure, Section 5 presents the application of the proposed method, Section 6 presents simulation results and discussion, and Section 7 presents the conclusions.

Problem Formulation
This study aims to determine the optimal design, number, and placement of single tuned harmonic filters in distorted distribution systems. The harmonic spectrum of the DG units in the system is considered. The proposed method aims to minimize THD, power loss, and filter investment cost, and improve the system voltage through the following objective functions.

Objective Functions
Three objective functions are considered in this optimization problem as follows: 2.1.1. Minimizing the Total Harmonic Distortion (f 1 ) THD of the system should be kept as low as possible according to the following equation [27].
where V 1i is the fundamental bus voltage, V hi is the harmonic order (h) voltage at bus i, and N is the total number of buses.

Improving the Voltage Profile (f 2 )
This objective function can be described as [22]: where V i is the voltage of bus i, V where k p is the annual cost per unit of the real power loss ($/kW/year); C filter is the filter investment cost; P loss is the active power loss which can be described as [31]: where nb is the number of branches and h max is the highest harmonic order of interest. C filter can be calculated as follows [25]: (5) in which nf is the total number of filters, k c , k L , and k R are the cost coefficients of the filter capacitor, inductor, and resistor, respectively, which are equals and equal to 3 $/kVAR [32]. This optimization problem is considered as a multi-objective optimization, which can be implemented using the weighting factors approach. So, the normalized fitness function (FF) can be formulated as: where, k 1 , k 2 , and k 3 are the weighting factors.

Constraints
This optimization problem constitutes the following constraints: (1) Voltage limits: where, (2) Power balance constraints: P L and Q L are active and reactive power losses, respectively. P d and Q d are load demand active and reactive powers. PG i and QG i are active and reactive power at ith DG unit, respectively. (3) Generation operating limits: (4) Harmonic distortion limits: where THD max and IHD max are the maximum allowable total harmonic distortion and individual harmonic distortion at each bus, which have values equal to (5% and 3%), respectively, according to the IEEE-519's standard [3]. Note that the THD as low as possible can be considered as a preventive action to protect the system from any future increase in harmonic sources. If we design the filters to only meet the standard, it needs to redesign the filters with each increase in the harmonic emissions. Added to that, we considered two conflicting objectives (Minimizing the THD and the filter investment cost) to guarantee the optimal economic solution.

Water Cycle Optimization Algorithm
WCA is considered as one of the recent optimization techniques which are used with single and multi-objective optimization problems. In [33], a comparative study has been Appl. Sci. 2021, 11, 774 5 of 16 presented and approved the effectiveness of the WCA over other well-known algorithms in terms of computational effort and accuracy for multi-objective optimization problems. WCA was also applied to optimal planning of DGs and capacitors [8] where its performance was compared with other well-known algorithms and it achieved a better performance in terms of accuracy and convergence speed.
Similar to other metaheuristic algorithms, the WCA algorithm starts with random initialization of a set of solutions. Each solution represents a raindrop. In each iteration for finding better solutions, the best raindrop is selected to be the sea "solution that has the best objective value", the number of good raindrops is chosen to be the rivers and the remainder raindrops are assumed to be streams which flow to the sea or the rivers. the control variables (X) are modified to be close to the sea or the rivers as the following equations [33]: where rand is a random number between 0 and 1, and U is a constant. If the distance between a river and sea is very small, new random solutions are inserted into the set of the solution to avoid getting trapped in the local optimal which is called the evaporation process.

Electric Scheme and Single Tuned Filter Representation
Considering a simple radial distribution system consists of six buses and has two nonlinear loads in buses 3 and 5 as shown in Figure 1. The nonlinear loads inject harmonic currents into the system. For each harmonic order, backward/forward load flow calculation is done with the same sequence of fundamental load flow, with considering the Substation voltage to be zero, all loads are considered to be constant impedance load, its impedance is calculated at the specified harmonic frequency. The imaginary part of the line section impedances between buses will be multiplied with the harmonic order, and every nonlinear load is represented by a constant impedance load in parallel with a current source. This current source injects current equals to the load current at normal frequency multiplied with harmonic ratio of this harmonic order as shown in Figure 2. Where r and x are the resistance and reactance of the line, r L and x L are the resistance and reactance of the loads, VS is the source voltage.
increase in harmonic sources. If we design the filters to only meet the standard, it needs to redesign the filters with each increase in the harmonic emissions. Added to that, we considered two conflicting objectives (Minimizing the THD and the filter investment cost) to guarantee the optimal economic solution.

Water Cycle Optimization Algorithm
WCA is considered as one of the recent optimization techniques which are used with single and multi-objective optimization problems. In [33], a comparative study has been presented and approved the effectiveness of the WCA over other well-known algorithms in terms of computational effort and accuracy for multi-objective optimization problems. WCA was also applied to optimal planning of DGs and capacitors [8] where its performance was compared with other well-known algorithms and it achieved a better performance in terms of accuracy and convergence speed.
Similar to other metaheuristic algorithms, the WCA algorithm starts with random initialization of a set of solutions. Each solution represents a raindrop. In each iteration for finding better solutions, the best raindrop is selected to be the sea "solution that has the best objective value", the number of good raindrops is chosen to be the rivers and the remainder raindrops are assumed to be streams which flow to the sea or the rivers. the control variables (X) are modified to be close to the sea or the rivers as the following equations [33]: where rand is a random number between 0 and 1, and U is a constant. If the distance between a river and sea is very small, new random solutions are inserted into the set of the solution to avoid getting trapped in the local optimal which is called the evaporation process.

Electric Scheme and Single Tuned Filter Representation
Considering a simple radial distribution system consists of six buses and has two nonlinear loads in buses 3 and 5 as shown in Figure 1. The nonlinear loads inject harmonic currents into the system. For each harmonic order, backward/forward load flow calculation is done with the same sequence of fundamental load flow, with considering the Substation voltage to be zero, all loads are considered to be constant impedance load, its impedance is calculated at the specified harmonic frequency. The imaginary part of the line section impedances between buses will be multiplied with the harmonic order, and every nonlinear load is represented by a constant impedance load in parallel with a current source. This current source injects current equals to the load current at normal frequency multiplied with harmonic ratio of this harmonic order as shown in Figure 2.
Where r and x are the resistance and reactance of the line, rL and xL are the resistance and reactance of the loads, VS is the source voltage.  The resonance that may occur after installing the filter may represent a problem while doing harmonic load flow due to the very low impedance (short circuit) of the filterbranch, especially at the tuned harmonic order. If the filter impedance is high, the filter will be modelled as a constant impedance load as shown in Figure 2. While, if the filter is in resonance case, it will be modelled as a constant current source with negative polarity (absorb constant current) as shown in Figure 3. The value of this current is calculated from The resonance that may occur after installing the filter may represent a problem while doing harmonic load flow due to the very low impedance (short circuit) of the filter-branch, especially at the tuned harmonic order. If the filter impedance is high, the filter will be modelled as a constant impedance load as shown in Figure 2. While, if the filter is in resonance case, it will be modelled as a constant current source with negative polarity (absorb constant current) as shown in Figure 3. The value of this current is calculated from the Thevenin equivalent circuit shown in Figure 4 as follow: where v th is Thevenin voltage and Z th is Thevenin equivalent impedance. The Thevenin equivalent phase impedance will be the sum of the phase impedance of each device between the system voltage source node and the point of the short circuit [34]. The resonance that may occur after installing the filter may represent a problem while doing harmonic load flow due to the very low impedance (short circuit) of the filterbranch, especially at the tuned harmonic order. If the filter impedance is high, the filter will be modelled as a constant impedance load as shown in Figure 2. While, if the filter is in resonance case, it will be modelled as a constant current source with negative polarity (absorb constant current) as shown in Figure 3. The value of this current is calculated from the Thevenin equivalent circuit shown in Figure 4 as follow: where vth is Thevenin voltage and Zth is Thevenin equivalent impedance. The Thevenin equivalent phase impedance will be the sum of the phase impedance of each device between the system voltage source node and the point of the short circuit [34].    The resonance that may occur after installing the filter may represent a problem while doing harmonic load flow due to the very low impedance (short circuit) of the filterbranch, especially at the tuned harmonic order. If the filter impedance is high, the filter will be modelled as a constant impedance load as shown in Figure 2. While, if the filter is in resonance case, it will be modelled as a constant current source with negative polarity (absorb constant current) as shown in Figure 3. The value of this current is calculated from the Thevenin equivalent circuit shown in Figure 4 as follow: where vth is Thevenin voltage and Zth is Thevenin equivalent impedance. The Thevenin equivalent phase impedance will be the sum of the phase impedance of each device between the system voltage source node and the point of the short circuit [34].   The pass_band practical criteria presented in [16] is applied in determining if the filter in resonance mode or high impedance not. This pass_band practical criterion studied the effect of the single tuned filter parameters such as filter size (Q C ), quality factor (Q f ), and tuned frequency (t f ) on the filter performance. The analysis showed that the Q f has a less significant effect than the Q C and t f on the impedance-frequency characteristics curve. Increasing t f or Q C makes the curve be flatter as shown in Figure 5. So the pass_band is defined as the band which contains the frequencies at which the filter impedance is very low compared with the system minimum impedance load "if the filter impedance is lower than 1/10 of the system minimum impedance load" [16]. This declares the concept shown in Figure 5 that the filter passband increases with increasing the filter capacitive reactive power and increasing the order of tuned frequency. For example, the 7th order harmonic filter has more flatten impedance characteristics curve rather than that of the 5th order filter, as shown in Figure 5a.
Appl. Sci. 2021, 11, 774 7 of 16 than 1/10 of the system minimum impedance load" [16]. This declares the concept sho in Figure 5 that the filter passband increases with increasing the filter capacitive react power and increasing the order of tuned frequency. For example, the 7th order harmo filter has more flatten impedance characteristics curve rather than that of the 5th or filter, as shown in Figure 5a.    Figure 6 shows the flowchart that describes the planning procedure of the STF. Where, the proposed filter planning procedure for harmonic mitigation has the following steps: = (25)

Proposed Filters Planning Procedure
Step 5: Applying the WCA to generate a new set of solutions.
Step 6: Repeating steps from 2 to 5 till reaching the maximum iterations number. Figure 6. Flowchart of the planning procedure.

Applications
The proposed method is applied according to two cases studied as follows: Case 1: Optimal planning of single-tuned filters without considering the harmonic spectrum of the DG units.
Case 2: Optimal planning of single tuned filters with considering the harmonic spectrum of the DG units. Step 1: Randomly initialize the initial set of raindrops that has a size of N pop .  Step 2: Checking the following constraints: where f t is the tuned harmonic order.
Step 3: Evaluate the fitness of each raindrop by the following steps: Calculating filter parameters which consist of (series of R, L, and C) where X c is the capacitive reactance and Q C F is the capacitor reactive power rating in kVAr.
where X L is the inductive reactance.
where Q F is the quality factor of the filter, and f 0 is the fundamental harmonic frequency.
(1) Carrying out harmonic power flow calculation based on the backward/forward sweep power flow for balanced radial distribution feeders [35], Power flow analyses are carried before and after adding the filters into the system. (2) Calculating fitness function using the harmonic power flow results.
(3) Checking the buses' voltage, THD, and IHD constraints. If any solution doesn't satisfy any of the constraints, putting the value of its fitness function equals infinity. So, it will not be selected as a minimum solution.
Step 4: Getting the personal best data and storing its controlled variables data as: Step 5: Applying the WCA to generate a new set of solutions.
Step 6: Repeating steps from 2 to 5 till reaching the maximum iterations number.

Applications
The proposed method is applied according to two cases studied as follows: Case 1: Optimal planning of single-tuned filters without considering the harmonic spectrum of the DG units.
Case 2: Optimal planning of single tuned filters with considering the harmonic spectrum of the DG units.
The type of nonlinear load is assumed to be a six-pulse inverter that has a harmonic spectrum as shown in Table 1 [30]. The harmonic spectrum of the inverter-based DGs is also considered as shown in Table 2 [28]. DGs are placed nearby the heavy loads to reduce the power losses and improve the voltage profile [9]. For considering a high penetration of DGs, the total capacity of the DGs is assumed to be 40% of the total demand and divided equally into four units. The proposed method considered all the odd harmonic orders from 3rd up to the 25th harmonic order. The weighting factors k 1 , k 2 , and k 3 are considered equal to 0.5, 0.3, and 0.2, respectively. The WCA is implemented in MATLAB software using m-file code taking the total initial number of raindrops equals to 100 (one sea, 9 rivers, and 90 streamers). The evaporation condition d max is considered to be 1 × 10 −4 , and the iterations number is 50.

Test Distribution Systems
The proposed method is applied to the modified IEEE 69-bus distribution system [9]. The total active and reactive loads of the original system are 3.802 MW and 2.694 MVAR, respectively. Six nonlinear loads are added and located at buses (12,26,27,28,43,49, 53, and 63) in the system shown in Figure 7. Four DG units are also considered to be installed at buses (28,44,47, and 53) each one has a capacity equals to (190.1 + j 134.7) kVA. spectrum as shown in Table 1 [30]. The harmonic spectrum of the inverter-based DGs is also considered as shown in Table 2 [28]. DGs are placed nearby the heavy loads to reduce the power losses and improve the voltage profile [9]. For considering a high penetration of DGs, the total capacity of the DGs is assumed to be 40% of the total demand and divided equally into four units. The proposed method considered all the odd harmonic orders from 3rd up to the 25th harmonic order. The weighting factors k1, k2, and k3 are considered equal to 0.5, 0.3, and 0.2, respectively. The WCA is implemented in MATLAB software using m-file code taking the total initial number of raindrops equals to 100 (one sea, 9 rivers, and 90 streamers). The evaporation condition dmax is considered to be 1 × 10 −4 , and the iterations number is 50.

Test Distribution Systems
The proposed method is applied to the modified IEEE 69-bus distribution system [9]. The total active and reactive loads of the original system are 3.802 MW and 2.694 MVAR, respectively. Six nonlinear loads are added and located at buses (12,26,27,28,43,49, 53, and 63) in the system shown in Figure 7. Four DG units are also considered to be installed at buses (28,44,47, and 53) each one has a capacity equals to (190.1 + j 134.7) kVA.

Simulation Results of Case 1
The results of the filter planning in the first case are shown in Tables 3 and 4. The results show that the proposed method reduced effectively the maximum THD from 7.87% to 2% to meet the IEEE-519 standard. As obtained in Table 3, the 7th order harmonic filter with a large size (Q c ) was chosen for solving the system harmonic distortion problem. Based on the concept shown in Figure 5, the filter passband increases with increasing the filter capacitive reactive power and increasing the order of tuned frequency. Therefore, the 7th order harmonic filter has more flatten impedance characteristics curve rather than the 5th order filter. Furthermore, the capacity of the selected filter is 2.33 MVAR, which indicates a very flat characteristics curve. Therefore, only one filter tuned at the 7th order can mitigate both 5th, 7th , and other harmonic orders and keep the THD within the permissible limits. The objective functions' values, which are obtained in Table 4, show that the system minimum voltage has improved from 0.93 PU to 0.98 PU. The system power loss has also reduced from 51.5 to 29.8 kW. Moreover, the three considered objective functions have minimized using the proposed algorithm, which approves the ability of the proposed method to achieve multi-dimensional goals (technical and economic).
The convergence curve of the WCA is shown in Figure 8. It shows the convergence speed of the WCA, and how it can reach the personal best within a few iterations. The THD of the system buses before and after using the filters are shown in Figure 9. Where the maximum THD decreased significantly from about 8% to 2% to not only meet the standard limit but also, considered as a preventive action to keep the system harmonic within limits during any future increase in the system harmonics.     Figure 10 shows that the installed filters can improve the system voltage profile and keep all the buses' voltages within the permissible limits. As it can be seen that many bus voltages (bus 40-bus 47) were out of limits before installing the filter.  Figure 10 shows that the installed filters can improve the system voltage profile and keep all the buses' voltages within the permissible limits. As it can be seen that many bus voltages (bus 40-bus 47) were out of limits before installing the filter.  Tables 5 and 6 show the filter planning results for Case 2 considering the harmonic spectrum of DGs. The results show that two single tuned filters are optimally designed and planned to eliminate the third harmonic order. Table 5 shows the characteristics and parameters of the proposed filters. Table 6 illustrates the effect of the proposed filter planning in enhancing system performance (reducing the voltage deviation, power loss, and THD). Where these filters can reduce the maximum THD from 9% to 3.87% to meet the IEEE-519 standard. The power loss is also reduced from 54 to 32 kW.

Simulation Results of Case 2
The THD of the system buses before and after applying the proposed method is shown in Figure 11. This figure shows that; the DG units' harmonics have a considerable effect in increasing the THD of the system. Where the system max. THD has increased by 13.9% due to considering the DGs harmonic spectrum. Moreover, the system voltage profile is improved due to the installation of the proposed filters as shown in Figure 12. Where all the buses' voltages become within the permissible limits and the under-voltage   Tables 5 and 6 show the filter planning results for Case 2 considering the harmonic spectrum of DGs. The results show that two single tuned filters are optimally designed and planned to eliminate the third harmonic order. Table 5 shows the characteristics and parameters of the proposed filters. Table 6 illustrates the effect of the proposed filter planning in enhancing system performance (reducing the voltage deviation, power loss, and THD). Where these filters can reduce the maximum THD from 9% to 3.87% to meet the IEEE-519 standard. The power loss is also reduced from 54 to 32 kW. The THD of the system buses before and after applying the proposed method is shown in Figure 11. This figure shows that; the DG units' harmonics have a considerable effect in increasing the THD of the system. Where the system max. THD has increased by 13.9% due to considering the DGs harmonic spectrum. Moreover, the system voltage profile is improved due to the installation of the proposed filters as shown in Figure 12. Where all the buses' voltages become within the permissible limits and the under-voltage issue is solved.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 14 of 16 Figure 11. THD of the 69-bus system buses with and without filters in case 2. Figure 11. THD of the 69-bus system buses with and without filters in case 2. Figure 11. THD of the 69-bus system buses with and without filters in case 2.

Conclusions
The optimal planning of passive single tuned harmonic filter in distorted distribution systems has been proposed in this paper. The proposed method considers the harmonic content resulted from the inverter-based DG units in the distribution system. The optimal planning problem has been solved using WCA with the aid of fundamental and harmonic backward/forward sweep power flow. The simulation results approved the effectiveness of the proposed method in determining the optimal design, number, and placement of the single tuned filter in the radial distribution system. The results also indicate that the harmonic spectrum of the DG units should be considered while designing the harmonic filters in the system to prevent increasing harmonic distortion in the system.

Conclusions
The optimal planning of passive single tuned harmonic filter in distorted distribution systems has been proposed in this paper. The proposed method considers the harmonic content resulted from the inverter-based DG units in the distribution system. The optimal planning problem has been solved using WCA with the aid of fundamental and harmonic backward/forward sweep power flow. The simulation results approved the effectiveness of the proposed method in determining the optimal design, number, and placement of the single tuned filter in the radial distribution system. The results also indicate that the harmonic spectrum of the DG units should be considered while designing the harmonic filters in the system to prevent increasing harmonic distortion in the system.
The noticeable findings of this paper are: • The effectiveness of the proposed filter planning method in achieving multi-dimensional objectives with the aid of WCA.

•
The WCA is efficient with good convergence characteristics in simultaneously determining the optimal design, placement, and the number of the STF.

•
The proposed method not only reduces the THD and improves the voltage profile but also reduces the power loss and filter costs. • Inverter-based DGs have shown a considerable effect on the harmonic distortion in distribution systems which increases the THD by about 14%. • By using the proposed method, THD in a 69-bus system has reduced by 75% without considering the harmonic distortion of the DGs, and reduced by 56.5% without considering the harmonic distortion of the DGs.
The future work will be directed to consider passive filter overcurrent and overvoltage, besides considering different renewable energy sources.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author.

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