An Enhanced Approach for Solar PV Hosting Capacity Analysis in Distribution Networks

With the falling cost of Distributed Energy Resources (DERs) and the shift from fossil fuel to renewable energy in many countries, the integration of DERs is expected to grow. This can lead to a wide range of problems in the power system, such as voltage violations, overloading of distribution lines, reverse power flow, etc. Therefore, it is imperative to account for these adverse effects of the integration of DERs on the distribution network and minimize their impact when calculating the Hosting Capacity (HC). Two algorithms are presented in this study derived from a novel modified iterative method and a novel Repeated Particle Swarm Optimization (RPSO) method for determining the HC for multiple DER units simultaneously or a single DER unit integrating into radial or mesh networks. These algorithms calculate the optimal HC based on six scenarios of annual load and DER generation profiles. The developed algorithms were tested on the IEEE 123 bus network, and their results were compared. For a large-scale DER case, the modified iterative method significantly outperforms both the PSO and the normal iterative method in terms of computation time (30 minutes versus 3 hours versus 6 hours, respectively). In the case of multiple DERs, the RPSO method is the only option, as the other two methods cannot simultaneously optimize multiple DERs. As a result, it has been concluded that it is necessary to select HC calculation methods carefully and in accordance with the application, as each method has its own strengths and weaknesses.


I. INTRODUCTION
The growing concerns of climate change have pushed the use of renewable energy-based Distributed Energy Resources (DERs). As a result, the total installed capacity of DERs increased more than 10% in 2021. It is predicted to account for 10% of the total global installed power generation by 2030, with an estimated investment of $846.12 billion in the upcoming decade (2020-2030) [1]. It is observed that the DERs play a vital part in the energy mix due to high energy demand, decreasing costs, and the introduction of The associate editor coordinating the review of this manuscript and approving it for publication was Bin Zhou . complementary environmental regulations [2]. However, the integration of DERs is not straightforward. The mismatch size of DERs poses several power quality issues, such as voltage violations in the busbars, over-currents in power lines, overloading of transformers, reverse power flow, higher voltage, and current harmonics, etc. It is, therefore, crucial to assess the size of DERs that can be integrated into a given distribution network without causing any reliability issues.
The Hosting Capacity (HC) of a distribution network is defined as the maximum amount of DERs that can be added to an existing network without causing the performance to go beyond the acceptable limits [3], [4]. Studies in literature employ various techniques to determine the HC of VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ distribution networks. These techniques generally fall within four distinct categories, (i) deterministic, (ii) stochastic, (iii) streamlined techniques, and (iv) optimization-based [5]. The distribution network's HC of PV and wind turbines have been determined using various deterministic methods in [6] and [7]. A deterministic process involves calculating the HC using known DER generation and load consumption values. Therefore, defining DER production and location information is necessary before starting the HC calculation. Despite the possibility that the stochastic methods described in [8], [9], and [10] could be applied to represent real-life scenarios, it is important to recognize that the stochastic results might not be the most appropriate solution for HC. Due to the fact that implementing a streamlined method from scratch would require a large number of detailed HC studies of feeders with a wide variety of characteristics, the streamlined method has only been applied in a minimal number of studies [11], [12].
The streamlined techniques are based on previous studies' knowledge of PV systems integration trends. However, this method only improves computation time and resources. When the actual HC is high, or there is a high branch diversity in a feeder, the streamlined method is more likely to calculate an inaccurate HC value. Thus, optimizing models seems more suitable for real-time scenarios.
In [19], the PSO algorithm was used to find the optimal HC and locations of one, two, and three DERs. This study implemented two types of DERs: Type I, which injects active power only to the system, and Type II, which injects both active and reactive powers. The maximum allowable penetration of DERs was set to 100%. It was found that Type II DERs lead to higher loss reduction. PSO is a well-suited optimization technique for integrating multiple DERs compared to other methods. The advantages of using PSO include the fact that it is simple to implement, requires fewer parameters to be tuned, can be run with parallel computing, can be robust, has higher probability and efficiency in finding the global optima, can be fast to converge, does not overlap and mutate and can be efficient for solving problems with complicated mathematical models [20]. However, the complexity associated with the larger DERs is challenging using just single execution PSO.
Following [19], the authors in [20] proposed an Improved PSO technique to determine the optimal HC that could escape the local minimum. In addition to the IPSO, a Guided Search Algorithm based on node sensitivity was proposed to determine the optimal locations for integrating DERs.
Further, in [21], the HC is calculated with MOPSO, including Loss reduction and voltage stability improvement. Paretofront non-dominated sorting was done for the multi-objective solutions, and a fuzzy decision model was employed to select the optimal solution. [22] has proposed an artificial intelligence-based Selective PSO (extended version of [21]) to calculate the HC by minimizing the total losses and improving the voltage profile. The authors in [23] have calculated the optimal HC using an Improved Evolutionary PSO, which ensures the minimization of total losses and the improvement of the voltage stability index (VSI).
In [24], DERs and Shunt Capacitor (SC) banks were integrated into the IEEE 33 bus network and a 136-bus Brazilian radial network. The Constriction factor PSO (Cf-PSO) technique was used for the optimal sizing, i.e., optimal HC and siting of two, three, four, and six DERs and SC banks. It was shown that the Cf-PSO makes converging to a solution more stable.
In [25], customer-based random installation of DERs was studied using Monte Carlo simulation, and the utility-aided installation was analyzed using the improved PSO. The objective of the utility-aided installation was to minimize energy losses, voltage deviation, and voltage fluctuations. In the improved PSO, the inertia weight factor was varied such that the particles with lower objective values focused on exploitation while the particles with higher objective values focused on exploration.
The above-discussed literature has been implemented at distribution networks with various DERs, which ensures lower voltage fluctuations, lower power flow losses, optimal power flow, lowered stress at transformers, etc. However, compared to more realistic scenarios, the literature mentioned above possesses multiple limitations; (a) Although some studies calculate the HC of IEEE 123 bus network [30], [31], [32], [33], most studies on the integration of DERs only deal with radial networks, such as the IEEE 33 bus and the IEEE 69 bus networks and don't consider meshed distribution networks. (b) These studies have considered the smaller size of the DERs; the impact of the larger size of the DERs is not considered. Hence, the problem of high dimensionality with integrating a large number of DER for HC calculation needed further investigation. A drawback is the problem of premature convergence in high dimensionality problems (c) Although hybrid algorithms perform better than the individual algorithm, they can be complicated to set up. A disadvantage of hybrid algorithms is that they increase the complexity of the algorithm and the number of initial parameters that must be tuned.
To tackle the challenges mentioned above, this work proposes a repeated PSO (RPSO)-based algorithm to find the HC of distribution networks. In addition to the RPSO-based technique, an improvement to the iterative technique is also presented to find the HC of the distribution network for a single large-scale DER case by modifying the step size throughout the HC calculation to achieve the best tradeoff between the accuracy and computation time. In RPSO, multiple PSO calculations are performed sequentially, decreasing the upper bound of the solution space (the maximum DER capacity) each time to decrease the search space. The main contributions of this paper are as follows: • A novel RPSO-based algorithm is developed and presented in this paper to find the HC of distribution networks. The proposed algorithm is able to overcome the problem of high dimensionality while calculating the HC of meshed distribution networks without any additional computation complexity and with faster convergence time.
• In addition to the RPSO-based technique, an improvement to the iterative technique is also presented to find the HC of the distribution network for a single large-scale DER case by modifying the step size throughout the HC calculation to achieve the best tradeoff between the accuracy and computation time.
The rest of this paper is organized as follows: Section II presents different methodologies dealing with optimal HC. The problem is formulated in Section III. Section IV explains the proposed solution and its implementation. The results and discussions of the study are presented in Section V. The conclusion from the results has been drawn in Section VI.

II. METHODOLOGIES
To accurately determine the HC in the distribution network, the network's operational performance must be investigated under large and multiple DER impacts. There are a few important operating parameters of the distribution network, such as bus voltage profile, average voltage deviation index, and power loss.

A. LOAD PROFILE DATA
Since no official load profiles are provided with the network, load profiles and PV systems' irradiance and temperature data have been created separately. Seasonal load profile data of Kangaroo Island, Australia, is obtained from SA Power Networks' website [34]. The normalized load profile provided by SA Power Networks is shown in Fig. 1. The provided load profiles were half-hourly profiles. These have been converted into hourly load profiles by calculating the average of the consecutive hour and half-hour points, i.e., the value at 9 am was calculated by taking the average of the values at 9 am and 9:30 am, etc. Apart from the four seasonal profiles, two additional load profiles have also created: the yearly average and the worst-case. The yearly average profile is calculated by taking the average of the seasonal profiles at each hour through a complete year. The worst-case scenario is where the load demand is the lowest while the PV system output is the highest. In this case, the lowest demand occurs in the Autumn season; therefore, the Autumn load profile has been chosen as the worst-case load profile. The new load profiles are shown in Fig. 2. Note that the worst-case trendline covers the Autumn trendline. The same normalized load profiles are used for all loads in the network. The demands of the loads are calculated by multiplying the normalized load profiles with the loads' peak active and reactive power values, which vary for all loads.
Therefore, loads have a varying demand at each hour depending on their peak values. Since each network is unique and has its characteristic load profile, using a different load profile can cause violations during some time periods, even when no DER integration has occurred. During the simulation of the network, it was found that voltage violations occurred in various seasonal scenarios. For HC calculation studies, the initial network mustn't have any violation. Otherwise, the integration of DERs might not be possible. To eliminate the voltage violations, the normalized load profiles are scaled down by multiplying them by a constant (0.43). This is the largest value which does not cause a violation in any scenario. It is obtained by multiplying the normalized profiles with a constant, performing load flow calculations, and decreasing the constant value until no violation occurs in the network. The modified load profiles are shown in Fig. 3.

B. PHOTOVOLTAIC (PV) GENERATION DATA
The PV system element from OpenDSS is used in this study to simulate the PV systems. It is assumed that the PV systems only supply active power. Therefore, the power factor of the  PV systems is set as 1.0. The active power output of the PV panel is dependent upon three variables, the solar irradiance, the temperature, and the rated power at MPP.
Annual solar irradiance and temperature data for Kangaroo Island are obtained from [35]. According to the Bureau of Meteorology Australia, December, January, and February comprise the Summer season; March, April, and May comprise the Autumn season; June, July, and August comprise the Winter season and September, October and November comprise the Spring season [36]. Seasonal irradiance and temperature profiles are created by calculating the averages for these sets of months at each hour. The yearly average is created by calculating the hourly average for the complete year. The worst-case profile for the irradiance is generated by obtaining the maximum hourly values from the complete year, while the worst-case temperature profile is created by taking the minimum temperature values from the complete year. This combination of maximum irradiance and minimum temperature results in PV systems generating the maximum power output -this makes it best for evaluating the worst-case scenario. The solar irradiance profiles are shown in Fig. 4, and the temperature profiles are in Fig. 5. Eq. (1) shows the PV output power in terms of solar radiation (kW/m 2 ) incident on the panels (G IS ), and the panels' operation temperature (T • C C), PV array efficiency (i.e., 15.7%), and PV module surface area (i.e., 1 m 2 ).
In this study, Photovoltaic (PV) systems are chosen as the DERs, and the HC percentage is defined relative to the distribution network's maximum active power demand, i.e., the total HC is given by (2).
where HC N is the network's hosting capacity. P t PV and L p,ap,d are peak PV active power rating and peak active power demand. The HC percentage of a single bus is also defined relative to the maximum active power demand of the distribution network, as in (3).
where P t PV ,bus is the peak PV system's active power rating on a bus. The summation of the individual buses' HCs equals the distribution network's total HC.

D. VOLTAGE STABILITY
Power and energy industries have been concerned about severe voltage collapses associated with distribution network voltage stability. Under normal operating conditions and external disturbances, the distribution network's capability to maintain a fixed acceptable voltage at every bus node should be considered. An uncontrollable decline in bus voltage is indicated by voltage instability. There are many reasons for voltage instability, including sudden load increases, faults, single or multiple contingencies, larger DERs, etc. A voltage stability criterion has been applied to the various stability studies, which ensures that the bus voltage does not exceed acceptable limits. This manuscript analyzes voltage stability using bus voltage profiles, average voltage deviation indices, and power losses. An accurate voltage profile ensures the minimum voltage deviation by determining actual and nominal voltage differences. In order to calculate the voltage deviation index, the sum of the squared value of the voltage difference between the actual voltage and the nominal voltage is multiplied by the square root of the difference. Therefore, the average voltage deviation index (AVDI) would be as indicated in (4).
For a comprehensive insight, an illustration of a 2-bus system as given in Fig. 6, with V a δ a and V b δ b voltages at buses a and b, is explored.
In the presence of resistance (r) and impedance (x), the current (I ) flowing through the branch line can be expressed as (5). Therefore, Eq. (6) illustrates the relationship between various parameters at bus b. The value of I can be inserted into (6), and a further simplification leads to (7). In accordance with (7), the transferable active and reactive power may be expressed as (8) and (9). Accordingly, the transferrable active and reactive power will be governed by the condition of (10). The inequality in (10) may also be reduced to VSI by reducing it to (11). VSI is inversely proportional to active power, meaning that VSI decreases as active power increases. However, the increase in active power beyond a certain point collapses the system.
One major characteristic of the integration of DERs is that with the increase in size or number of the DER units, the overall network losses first decrease and then increase again [37], [38], [39]. This is because with a small number or size of DER units, power produced by the DER units is consumed locally, and the total power supplied by the distribution network is reduced. Since the power does not have to travel long distances along the power lines, losses in the lines are decreased. However, there is a point where the losses are minimal, and a further increase in the integration of DER units results in increased losses. This is because generated power from DERs is not consumed locally and must travel long distances back within the distribution network, leading to increased losses in the power lines. A graphical representation of this phenomenon is shown in Fig. 7. In a distribution network, I 2 r is a measure of the power loss associated with branch resistance (r). For a 2-bus system, the power loss can be calculated as (12). As a result, the total power loss for the larger bus system can be expressed as the sum of power losses experienced by each branch of the network, which is shown in (13). In the following example, g i,j represents the conductance of the branch from i to j.

III. PROBLEM FORMULATION
In order to optimize DER HC in distribution networks, it is necessary to justify the multiple objective functions, such as the minimum power loss and the acceptable voltage profile under different constraints.

A. OBJECTIVE FUNCTION
As discussed above, in addition to total network losses, other factors affect the integration of DERs into distribution networks. These are bus voltages, line capacity, etc. These factors limit the amount of DER integrated into the distribution VOLUME 10, 2022 networks. The limiting factors selected for this study are node voltages, line currents, transformer apparent power rating, and reverse power flow. Depending on the characteristics of the network, one of these factors will be the critical limiting factor. Inside a network, the factor that limits the integration of DER can vary from location to location. This means that at one bus, the critical limiting factor may be the bus voltage, while at another, the critical limiting factor may be the line capacity. Furthermore, the critical limiting factor can occur anywhere on the curve of network losses vs. DER integration, as shown in Fig. 7.
In case 1, the critical limiting factor limits DER integration to a point before the point of minimum losses, while in case 2, the DER can be integrated beyond the point of minimum losses. In case 1, the point before the critical limit can be taken as the maximum HC, while in case 2, the point of minimum losses can be taken as the maximum HC.
The relationship between the network losses, DER integration, and the limiting factors can be formulated into an optimization problem to find the optimal DER HC of the distribution network. The optimization problem is formulated as (14).
where, f HC , f P Loss and f AVDI are the functions of HC, power loss, and AVDI. The total network losses are obtained from the load flow calculation and set as the PSO's cost function. f HC is the sum of the individual PV systems' rated active power generation, i.e., the DER penetration level. It is assumed that each objective function is given equal priority. This indicates that the weighting coefficient (w i ) for each objective function is as follows; w 1 = w 2 = w 3 = 1/3.

B. SYSTEM CONSTRAINTS
It is imperative to recognize that the objective function defined in (14) must meet multiple system constraints, including the permissible limits for voltages and line currents.
To operate, the voltage at node t and time t(V i,t ) must remain within the range of the maximum (V max = 1.05pu) and minimum voltages (V min = 0.95pu) and defined in (16)-(17).
The thermal limit will begin to increase as the number of DERs increases on the distribution network. Therefore, the following constraint is to ensure that the thermal limit of the line conductors is not exceeded. For this reason, the optimizer will follow (18) to make sure that the power flow (P j,t ) through line section j at time interval t must be less than or equal to the maximum predefined limit (P j,max ). Furthermore, the constraint in (19) must be satisfied by the total DER size at each node i of the distribution network. As a result of this constraint, DER at each node should be smaller than its aggregated maximum capacity in terms of grid-tie capacity Eq. (20)-(21) illustrate the power flow constraints where P di , and Q di are active and reactive power demands while P gi and Q gi , are active and reactive power generation for the i th bus, respectively. Y i,j θ i,j represents the (i.j) th admittance while V i δ i and V j δ i are voltages at respective buses. The system voltage stability index is determined using the lowest value among all buses when placing the DER on that bus for reliable, stable, and secure operation. Therefore, it follows the constraint stated in (22).
Besides, the intended approach will adhere to the multiple additional constraints, such as active and reactive power following through the transformer (23) in which P Tr and Q Tr are the active and reactive power flowing through the transformer, while S Tr,rated is the rated apparent power of the transformer. The power balance constraint (24) states that the total power consumption, which includes the load (P t Load ) and excess power flow reverse in the considered network (P t PV 2N ), must be equal to the total power generated by solar panels (P t PV ) and the power received from the grid (P t G ) at any given time t.
Lastly, (25) explains the point of connection constraint, i.e., the interconnection between the DERs and the considered network. Where ∂ is the binary function, at ∂ = 1 enables the power obtaining mode from the grid P t TLD . On the other hand, ∂ = 0 ensures the excess PV power reverse flow mode (P t PV 2N ), under the grid-tie capacity (P t Gtc ) constraint.
All these constraints must meet by the proposed optimization methodology at every network element (bus, line, and transformer).
The number of DERs in the network determines the dimensions of the problem. Upper and lower bounds of the search space can be set to confine the particles within a reasonable search space. The bounds determine the maximum and minimum value a single DER can take. In this study, the lower bound is fixed as 0 since the size of the DER cannot be negative. The Upper bound can vary depending on the distribution network characteristics.
Since the PSO does not support the implementation of constraints, these are built into the cost function by defining a penalty function. When a constraint is violated, the penalty function converts a constrained problem into an unconstrained problem by adding a value to the cost function.
The new cost function is as (26).
where σ is the penalty value, and v is an integer number between 0 and 5. The value of v depends on the number of constraints that have been violated. For HC calculation, the initial power losses without DER integration are chosen as the penalty value. This ensures that if a violation occurs, the value of the cost function is always above the value for 0% DER integration, and hence it cannot be selected as the optimal value. The penalty function ensures that the minimum value of the objective function always occurs below the critical limit.

IV. PROPOSED SOLUTIONS
Various researchers have already explored the optimal HC evaluation using computational techniques, including classical optimization algorithms, GA, EA, ACO, PSO, flower pollination algorithm, sequential quadratic programming, etc. A drawback of algorithms such as PSO is the problem of premature convergence in high dimensionality problems [40], [41]. The author in [40] has demonstrated that the PSO performs poorly when the optimization problem has high dimensionality. It was shown that with high dimensionality, the PSO could not get to the optimal value. Furthermore, it was revealed that increasing the number of particles also proved to be futile because the hyper-volume increased exponentially with increasing dimensions. Another drawback of dealing with high dimensionality is that the swarm may not converge to a single point. This means that the optimal value may not be found by the end of the final iteration, and the particle with the lowest value is chosen as the final answer, even though it may not necessarily be the optimal value.
From the literature, it has been observed that most studies integrate a small number of DERs. Hence, the problem of high dimensionality with integrating a large number of DER for HC calculation has not been addressed.
To address all of these concerns and literature gaps, this work proposes an RPSO-based algorithm to find the HC of distribution networks. In addition to the RPSO-based technique, an improvement to the iterative technique (Improved integrative technique) is also presented to find the HC of the distribution network for a single large-scale DER case by modifying the step size throughout the HC calculation to achieve the best tradeoff between the accuracy and computation time.

A. PROPOSED RPSO
To overcome the problem of the HC algorithm converging to a high HC value, the RPSO algorithm is constructed.
The flowchart of the RPSO algorithm is shown in Fig. 8. The algorithm starts by asking the user to select whether the DERs should be placed on all buses in the network or whether they should be placed only on the load buses. Next, the algorithm calculates the initial losses of the network without any DER integration. The initial losses are saved in the PSO as the penalty value and as the ''Previous losses'' for the first iteration of the PSO loop. Then the algorithm places the DERs on the network and keeps performing the PSO until two conditions are met: (1) The losses in the current iteration are more than the losses in the previous iteration (2) The losses in the current iteration are less than the initial losses. The first condition ensures that the optimization is stopped when the losses increase again due to low HC value. The second condition ensures that there are no violations in the network. The methodology of the RPSO loop is shown in Fig. 9.
In the RPSO algorithm, multiple PSOs are performed sequentially, decreasing the upper bound of the solution space (the maximum DER capacity) by 10% in each iteration. Reducing the upper bound by a higher percentage increases the step size and overshoots the minimum point. Decreasing the upper bound by a lower percentage increases the computation time; therefore, 10% is found to be the best tradeoff value.
Once the value of the upper bound becomes smaller, and no violations occur in the network, the second condition is met. This is iteration 4 in case 1 and iteration 3 in case 2.  The loop continues to iteration 5 in case 1 and iteration 4 in case 2 because the first condition has not yet been fulfilled. The algorithm continues to decrease the upper bound value and perform the PSO. If it is found that this now leads to higher losses (as in iteration 5 in both cases), the first condition is now also fulfilled, so the algorithm exits the loop. The DER values of the previous loop (iteration 4 in both cases) are saved as the optimal values.
A disadvantage of decreasing the upper bound value is that it limits the maximum size an individual DER can have. However, the overall efficiency of the complete network increases since the total power losses decrease.

B. CALCULATION OF OPTIMAL HC USING RPSO
To obtain the optimal HC of the network, it is important to test the HC in various seasonal scenarios. Therefore, based on the RPSO algorithm, a separate algorithm is created to find the most optimal HC. The flowchart for the algorithm is shown in Fig. 10. The algorithm starts by calculating the HC for the seasonal average, yearly average, and worst-case scenarios. This is done through the RPSO-based algorithm. If a violation is detected for an HC value, that value is marked as red. If no violation is detected for an HC value in any scenario, that value is marked as green. Finally, all the HC values are displayed, and the individual DER values are saved in a dictionary and returned to the user.

C. PROPOSED IMPROVED ITERATIVE ALGORITHM
In the multiple DERs integration case, the PSO-based method calculates the sizes of all DERs simultaneously. A certain number of iterations of the PSO returns the sizes of all DERs simultaneously. In the single large-scale DER integration case, the sizes of the DERs must be calculated individually. Therefore, the same number of iterations of the PSO will only return the size of one DER at a time, and the PSO calculation will have to be repeated for all the potential DER locations in the network. Due to the requirement of performing PSO for each potential location of the DER in the distribution network, the modified iterative method is faster than the PSObased method for the single large-scale DER case.
In the iterative method, a single DER is placed in the network. Its size is increased iteratively, and a load flow calculation is performed at each iteration. If a violation occurs for a specific DER size, the process of increasing the DER size is stopped, and the previous size of the DER is selected as the HC value. The DER is removed from the previous location and placed in a new location, and the process is repeated for each bus/load bus of the network. This method is time-consuming since it calculates the value of a single DER at any moment and takes several iterations. The flowchart of the modified iterative method is shown in Fig. 11. The algorithm starts by assigning a size of 1000 kVA to the first DER. This is the initial step size of the DER sizes. Next, it performs load flow calculation for the size of DER, which is slightly less and higher than 1000 kVA, i.e., ±1.5%. The losses at this point are assigned to ''network losses1 for slightly lower and network losses2 for slighter higher value''. This is to check where the point of minimum losses occurs. If the ''network losses2'' is greater than the ''network losses1,'' then the point of minimum losses is below the size of 1000 kVA. In this case, the algorithm subtracts 1000 kVA from the size and adds 500 kVA.
Similarly, if a violation occurs at 1000 kVA, then the optimal size of DER is below 1000 kVA, and the algorithm decreases the step size to 500 kVA. The algorithm proceeds similarly until the step size is 1 kVA. The final size of the DER is accurate to 1 kVA. The complete process is repeated until the size of all DERs has been calculated. Finally, the algorithm displays the PV system with the largest size and the PV system with the lowest total network losses.
The calculation time depends on the number of buses in the network and the step size chosen for the DER size. Since it is not a stochastic method, this method gives accurate results for the individual DER size. It is best suited for the single large-scale DER system case and not for the multiple DERs case because it calculates the size of the DER at a specific location while assuming that there are no DERs at other locations. Hence, multiple DERs cannot be sized using this method.
The performance of the iterative method dramatically depends on the step size chosen for the iterations. Selecting a smaller step size gives an accurate result at the cost of computation time while choosing a larger step size results in a shorter computation time at the cost of accuracy. In this study, an algorithm was created to modify the step size throughout the HC calculation to optimize the accuracy and computation time of the iterative method. The result is a modified iterative method.

D. CALCULATION OF OPTIMAL HC USING AN IMPROVED ITERATIVE ALGORITHM
The algorithm in Fig. 11 is used as a base to create an algorithm that calculates the optimal size of a single large-scale PV system for all scenarios. The flowchart is in Fig. 12. The algorithm starts by finding the HC of all DERs in all scenarios. Next, the DER values of all scenarios are compared against the worst-case scenario. Generally, it is stated that the values obtained from the worst-case scenario are the largest values that do not result in a violation in the other scenarios. However, it is found that in both PSO-based multiple DERs and iterative-based single large-scale DER cases, some worstcase DER sizes result in violations in the other scenarios. This might be because the combination of load demands and DER output powers creates a situation where a larger DER size is possible in the worst-case scenario but not in the other scenarios. Another reason might be the presence of voltage regulation devices in the network, such as voltage regulators and capacitor banks. The effect of capacitor banks on the HC is shown below.
Once the minimum values of DER sizes have been obtained from all scenarios, they are arranged in descending order. This arrangement ensures that the largest DER is tested first in the next stage of the algorithm. In the next step, the largest DER is tested in the other scenarios using the check function explained below. If no violation occurs, the size of this DER is chosen as the HC of the network for the single large-scale DER case. If a violation occurs, the next DER in the arrangement is tested in the other scenarios. This process is repeated until a DER is found that does not cause a violation in any scenario.

V. RESULTS AND DISCUSSION
In this section, results obtained from the execution of the novel developed algorithms are reported. Furthermore, a detailed discussion is presented, and a comparison is made between the algorithms. The results presented in this section are obtained from a 64-bit Microsoft Windows 10-based computer with a 2.20 GHz intel core i7+ 8th generation processor, 8GB RAM, and a 4GB NVIDIA GeForce GTX 1050 Ti graphics card.

A. RPSO-BASED MULTIPLE DERs HC ALGORITHM (SINGLE SCENARIO)
The RPSO-based HC of the IEEE 123 bus network for a single scenario is presented here. The worst-case scenario is shown in Fig. 13. The total time taken for the algorithm to calculate the HC for the scenario is 10 minutes and 42.9 seconds. The HC of the distribution network for this scenario is 44.99% of the peak active power demand. The total sum of all PV system sizes (kVA), the peak active power of the network for the current scenario (kW), the initial losses of the network for the scenarios without any DER integration (kW), the total losses after DER integration (kW) and the losses reduction (%) are shown in Table 2. Dividing the sum of PV systems' sizes by the network peak active and multiplying by 100% gives the HC of the network. Integration of this amount of PV systems decreases about 15.6% of active power losses throughout the day. The values of the PV system sizes were checked for violations using the check function. The check function checks the DER values obtained for one scenario in the other. This is done by passing the obtained PV system sizes along with the PV and load profiles of the different scenarios to the check function and simulating the network. ''False'' represents no violations, and ''True'' means single or multiple violations. This is also shown in Table 1.

B. MULTIPLE DERs OPTIMAL HC ALGORITHM
The RPSO-based optimal HC calculation algorithm is used to find the HC of the IEEE 123 bus network. The algorithm  The points in the graph indicate the HC values of various scenarios. The x-axis indicates the HC percentage, while the y-axis shows the sum of losses of all scenarios for a specific HC value. The cross is the HC value for which the total active power losses are minimum. The color of the point indicates whether that HC value is viable. Green indicates viable HC values, and red suggests nonviable HC values. The graph above shows that none of the found HC values are viable, including the HC value of the worst-case scenario. It was found that a voltage violation occurred on phase 3 of bus 83. This bus has a 600 kVA three-phase capacitor bank and a single-phase spot load. Because of the spot load, a single-phase PV system was connected to phase 3 of this bus. The worst-case size of this PV system caused a voltage violation in the yearly average profile. This is because the capacitor bank's reactive power injection, combined with the  yearly average load and PV profiles, causes an overvoltage in phase 3 of the bus. The optimal HC calculation is repeated after removing all capacitor banks from the network. The result is shown in Fig. 15. After removing capacitor banks, the worst-case HC becomes a viable option.
The optimal HC calculation was repeated without removing the capacitor banks. This time the worst-case values of PV systems' sizes did not cause a violation in any of the other scenarios, even when the capacitor banks were connected to the network. Results are shown in Table 2 and Fig. 16. This is due to the stochastic nature of PSO. Every time the HC calculations are repeated, new values for individual PV systems sizes are calculated that optimize the network. However, even with the varying individual PV system sizes, the overall HC of the network remains largely unchanged.

C. PSO-BASED SINGLE LARGE-SCALE DER HC ALGORITHM (SINGLE SCENARIO)
The PSO can be used to find the single large-scale PV system HC of the distribution network. In this case each VOLUME 10, 2022   PSO calculation determines the size of one PV system in the network. In the single large-scale case the dimension of the PSO is one. Therefore, very accurate results are obtained. However, due to the large number of PV systems in the network, the total time taken to calculate the sizes of all PV systems is quite large. Fig. 17 shows the result of the PSObased single large-scale DER HC calculation for the worstcase scenario.
The total calculation time is just under 3 hours for only one scenario. Fig. 18 shows the corresponding losses for the single large-scale PV systems. The PV systems sizes and the related losses are compared to the values obtained from the iterative-based algorithm below.  The iterative-based algorithm utilizes a dynamic step size method. Initially, the step size is large so that the algorithm does not spend a large amount of time testing smaller sizes of PV systems if no violations are detected at larger PV system sizes. As the algorithm gets closer to the maximum possible size of the PV system, the step size decreases to produce accurate results. The iterative method results for the worst-case scenario are shown in Fig. 19.
The total time to calculate the sizes of all PV systems for one scenario is less than 30 minutes. Compared to the PSObased method, this method is much faster. Furthermore, it is estimated that calculating the sizes of all PV systems using the iterative method with a constant step size of 10 kVA would result in a computation time of over 6 hours. The corresponding network losses for the PV systems sizes are shown in Fig. 20.
Comparing Fig. 18 and Fig. 20, the iterative method produces similar results to the PSO method. It should be noted that the results obtained from the iterative method are very accurate for a relatively lower computation time. The method is very effective in finding the sizes of PV systems that reduce the active power losses in the network.

E. SINGLE LARGE-SCALE DER OPTIMAL HC ALGORITHM
The optimal HC algorithm for the single large-scale DER case utilizes the iterative method to find the PV systems' sizes in all scenarios. Then it compares the PV systems' sizes of all scenarios against the worst-case scenario and saves the smallest of them in a dictionary. Generally, the largest PV system size produces the minimum losses in the network. Therefore, the algorithm arranges the dictionary in descending order and tests the individual PV systems in all scenarios starting from the largest PV system. If no violation is detected for that PV system in any scenario, the size of that PV system is selected as the HC of the network. The result of the optimal HC algorithm is shown in Table 3. The total calculation time is slightly over 3 hours.
It should be noted that the loss reduction is greater in the multiple DERs optimal HC compared to the single large-scale DER optimal HC. This is in line with [42] which found that the loss reduction is considerably higher for the multiple DERs case compared to the single large-scale DER case. This is because power is being generated closer to the point of consumption in the multiple DERs case.

VI. FINAL REMARK
In this section, we provide a few challenges that require further investigation and the concluding remark explaining the key finding of this study.

A. CHALLENGES AND FUTURE WORK
Multiple methods of distribution network HC calculation exist. However, it is important to carefully select the method according to the application needs since each method has its own advantages and disadvantages, and one method cannot be efficiently utilized for all applications. Software programs that only provide the iterative method cannot be used to calculate the maximum HC of the distribution network for multiple PV systems. Similarly, programs that only employ stochastic methods will be inefficient in finding the best size and location for a single large-scale PV system. The best performance is achieved when multiple HC methods are used in tandem and the pros of the other rectify the cons of one method.
While this work studies the effects of integrating DERs on the HC of a distribution network, future research may include the effects of integrating Battery Energy Storage Systems (BESS) on the single large-scale DER and multiple DERs HC using algorithms developed in this work. It would also be worth studying the impact of voltage regulation devices on the HC since they were found to be limiting the integration of DERs in some cases.

B. CONCLUSION
This study has proposed and implemented two modified algorithms, RPSO and modified iterative based, in IEEE 123 bus network to calculate the HC of the distribution network for single large-scale and multiple PV systems integration. The study concludes that for the single large-scale DER HC, the modified iterative-based method was found to outperform the PSO-based method in terms of the computation time which only required 30 minutes to produce comparable results.
As for the multiple PV systems case, the RPSO-based method is exceptionally viable because it can concurrently size multiple PV systems in order to optimize the whole distribution network losses. Moreover, it has a much lower computational time, taking about 6-12 minutes to calculate the HC for one scenario. In 2016, he joined Iberdrola Innovation Middle East, as the Research and Development Director to lead various research, development and innovation projects under various topics focusing on transforming the current electric grid into a smart grid and integrating renewable energies and energy storage systems interfaced by power electronics converters as microgrids penetrating the distribution networks. In addition to, improving and optimizing building energy management systems. In 2020, he joined CSA Catapult as Principal Power Electronics Engineer to lead different project focusing on Compound Semiconductors application in different sectors. He is currently a Senior Researcher and a Creative Manger with more than 22 years of combined experiences (teaching, research, industrial experience, consulting services and project management) between academia, research institutes, industry and power utility companies in various fields. He is conducting and leading many research projects in different areas, such as power electronics, electric vehicles, automatic control, motor drive, energy management, grid control, renewable energy, energy storage devices, distributed energy systems, and their integration into the smart grid. He has authored more than 75 journals and conference papers, one book chapter, two books entitled, Impedance Source Power Electronic Converters, in 2016, and Smart Grid Enabling Technologies, in 2021, and many international conference tutorials. His current research interests include renewable energies, grid control, smart grid, automatic control, motor drives, power electronics, and electric vehicles.
Dr. Ellabban is a member of IET and a fellow of the Institution of Engineering and Technology (FIET). He currently serves as an Associate Editor for the IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS.