*Article* **A Novel Approach Based on Honey Badger Algorithm for Optimal Allocation of Multiple DG and Capacitor in Radial Distribution Networks Considering Power Loss Sensitivity**

**Mohamed A. Elseify 1, Salah Kamel 2,\*, Hussein Abdel-Mawgoud <sup>2</sup> and Ehab E. Elattar <sup>3</sup>**


**Abstract:** Recently, the integration of distributed generators (DGs) in radial distribution systems (RDS) has been widely evolving due to its sustainability and lack of pollution. This study presents an efficient optimization technique named the honey badger algorithm (HBA) for specifying the optimum size and location of capacitors and different types of DGs to minimize the total active power loss of the network. The Combined Power Loss Sensitivity (CPLS) factor is deployed with the HBA to accelerate the estimation process by specifying the candidate buses for optimal placement of DGs and capacitors in RDS. The performance of the optimization algorithm is demonstrated through the application to the IEEE 69-bus standard RDS with different scenarios: DG Type-I, DG Type-III, and capacitor banks (CBs). Furthermore, the effects of simultaneously integrating single and multiple DG Type-I with DG Type-III are illustrated. The results obtained revealed the effectiveness of the HBA for optimizing the size and location of single and multiple DGs and CBs with a considerable decline in the system's real power losses. Additionally, the results have been compared with those obtained by other known algorithms.

**Keywords:** HBA; radial distribution systems; power loss; sensitivity analysis; optimization; DG optimal allocation; voltage deviation; capacitor banks

**MSC:** 35B05; 35F99; 37N40

#### **1. Introduction**

#### *1.1. Background*

In recent decades, energy demand has undergone rapid growth due to the intricate life cycle of humans and limitations on fossil fuel sources. Therefore, voltage dips and power losses have increased in distribution systems, leading to the significance of the incorporation of distributed generators (DGs), particularly renewable energy resources in radial distribution systems (RDS) [1,2]. Electric power utilities have been initially designed based on unidirectional power flow. As a result, the DGs integrated into the distribution system may change the direction and magnitude of the power flow. The integration of DGs has some positive effects on the operation of the distribution networks, which is represented in system voltage support, reliability improvement, and reduction in power losses and operation costs. Several aspects must be addressed when placing DG units in a distribution system, including the technology with which they are designed, the quantity and capacity of the DG units, the optimal allocation, and the kind of grid connection. The integration of DGs has an influence on several factors, including total system losses,

**Citation:** Elseify, M.A.; Kamel, S.; Abdel-Mawgoud, H.; Elattar, E.E. A Novel Approach Based on Honey Badger Algorithm for Optimal Allocation of Multiple DG and Capacitor in Radial Distribution Networks Considering Power Loss Sensitivity. *Mathematics* **2022**, *10*, 2081. https://doi.org/10.3390/ math10122081

Academic Editor: Jian Dong

Received: 13 April 2022 Accepted: 13 June 2022 Published: 15 June 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

bus voltage level, reliability, and stability, decreased kVA demand from the distribution system, energy-saving possibility, and postponed capacity of distribution transformers. The optimal installation of DGs in the distribution system is critical for maximizing the benefits of DGs in terms of economy and operation. The random installation of distributed generators units in the network may make the losses of the system larger and impair the voltage profile and other characteristics, all of which might contribute to higher costs. Thus, DGs should be installed optimally to maximize network efficiency. The decentralized generators are an electric power source that is directly linked to the radial distribution network and can be divided into four categories as follows [3]:


Additionally, the best size and sites of capacitor banks (CBs) in the RDS require static or switchable capacitors for power factor improvement at strategically recognized places in RDS to handle the power quality performance problems. This also delivers several technical and economic benefits, such as decreased power loss, increased load bus voltage, enhanced power factor, and lower reactive power consumption from the sending end side [4–6]. To deal with the ever-increasing energy demand as well as technical and economic problems in distribution systems, efficient and effective reactive power compensation planning is required [4,6].

#### *1.2. Literature Survey*

Optimization techniques are continuously developed to gain the highest benefits of distributed generators. There are several classifications for optimization algorithms. Metaheuristic optimization techniques are among the best algorithms and are utilized for many optimization problems in a wide range of different disciplines while using less execution time than other optimization techniques. Numerous studies have been conducted to decrease system losses by optimizing the capacity and location of DGs using various methodologies and techniques. The loss sensitivity factor (LSF) was utilized to identify the nominee bus and reduce the search space before applying an algorithm to choose the optimum size and location of the DG [7–13]. Therefore, most researchers have calculated the active power loss as a single objective function [11–16], whether in single or multiple DG placement problems. The new hybrid algorithm based on moth flame optimization (MFO) and sine cosine algorithm (SCA) [11] was employed to provide the best placement and sizing of the DG and capacitor bank in different test cases. Abdel-Mawgoud et al. [12] determined the optimal sites and sizing of DG Type-I and DG Type-III in RDS using the chaotic moth flame optimization technique (CMFO). The proposed technique was applied in IEEE 33-bus RDS, and the results have been compared with other techniques. The BAT optimization algorithm has been utilized to minimize total line losses and obtain the optimal placement and sizing of DG in IEEE 33-bus RDS [13,14]. A comparison study between FPA, GSA, ICA, and BAT novel heuristic techniques used for minimizing active losses in RDS incorporated with renewable DG sources was discussed in [15]. Hybrid GMSA was suggested to minimize the active power loss by optimally determining the best site and size of the synchronous condenser and DG in IEEE 33-bus RDS [16].

In addition, the whale optimization algorithm (WOA) was utilized to provide the optimal integration of one unit from different types of DG in distribution systems [17]. The objective function considered in this work is the minimization of active power losses. The manta ray foraging optimization algorithm (MRFO) was proposed [18] to reduce active power loss by the optimal installation of DG Type-I into RDS. An optimal installation of the

DG in RDS using the hybrid gray wolf optimization (HGWO) algorithm [19] was developed to minimize the system power loss. This technique was simulated with different types of DGs through the application to IEEE 33-, IEEE 69-, and Indian 85-bus distribution networks, and the results obtained are the global optimum. The simultaneous integration of shunt capacitors and renewable DGs was addressed in [20] using the Gbest-guided artificial bee colony (GABC) optimization technique for minimizing active power losses. This algorithm was applied to IEEE 33-bus and IEEE 85-bus RDS, and the numerical solutions obtained validated the effectiveness for optimal allocation of DGs and CBs. A recent multileader particle swarm optimization (MLPSO) algorithm was proposed [21] for specifying the best size and location of DGs with the objective of minimizing real power losses. However, it has slow convergence characteristics with the increasing number of state variables of the problem.

On the other hand, several techniques were utilized to provide the optimal incorporation of DGs and CBs in radial distribution networks using multi-objective functions [22–28] regardless of the algorithms utilized for solving these objective functions. An efficient cuckoo search algorithm was proposed [22] to provide the optimal size and location of capacitors in RDS. The objective function was expressed to minimize the total active loss and improve the voltage profile of the distribution network. In [9], the authors developed an ant lion optimization (ALO) algorithm for optimal placement and sizing of single and multiple renewable DGs in RDS. The weighted objective function utilized in this method minimized power loss and enhanced the voltage stability index and the voltage level of the distribution system. The gray wolf optimizer (GWO) was suggested [23] for multiple allocations of the DG in the distribution system. The multi-objective function was converted into a single objective function using the weighted sum method for minimizing the reactive system losses and voltage deviation index. The slap swarm algorithm (SSA) was introduced [24] for simultaneous allocation of distributed generators and capacitor banks in RDS to accomplish environmental, technical, and economic benefits. An intersect mutation differential evolution (IMDE) algorithm for simultaneous installment and sizing of the capacitor banks and DGs in IEEE 33-bus and IEEE 69-bus RDS was proposed [25]. In this technique, the loss expense and power loss were utilized as a minimized objective function. The authors in [26] developed an improved decomposition-based evolutionary algorithm (I-DBEA) for the selection of optimum number, size, and location of DG Type-I and DG Type-III with specified power factor to increase the voltage stability index and reduce active power losses and voltage dips in RDS. The obtained numerical solutions proved the robustness of the I-DBEA algorithm for the optimal installation of DGs in RDS. Further, a two-stage robust optimum allocation model of the DG was also suggested [27], taking into account the capacity curve and real-time price-based demand response. The objective taken in this technique was the system income, investment cost of equipment, and operation cost of the system. The problem was solved using the column and constraint generation algorithm, and the results proved that the suggested model was effective in enhancing the total annual profit and the usage of renewable sources. The optimal allocation of DGs and CBs based on the hybrid ALO and PSO with the fuzzy logic controller was proposed [28] to minimize the active losses, voltage deviation index, and operation cost and improve the voltage stability index. The proposed hybrid technique was tested on IEEE 33-bus RDS, and the numerical solutions demonstrated its effectiveness for the optimal allocation of the DG in RDS. However, it may take more computational time because the hybrid technique is executed for each objective function obtained using the fuzzy logic controller.

In the above literature review, very few researchers addressed the simultaneous integration of single and multiple DG Type-I and DG Type-III, which is outlined in the present study using a new metaheuristic optimization named the honey badger algorithm (HBA). The HBA was proposed by Hashim et al. [29] in 2022, and it is based on the honey badger's intelligent foraging behavior to establish a mathematically efficient search technique for addressing the different optimization problems. In the HBA, the honey badger's dynamic search behavior with digging and honey finding tactics is structured into exploration and exploitation stages. In addition, most metaheuristic algorithms have an effective exploration rate to explore the promising area in the search space and have low exploitation rate to obtain the local solutions in the promising area. The HBA includes high exploration rate and maintains sufficient population variety even during the exploitation phase because of controlled randomized mechanisms to obtain the best global solutions and avoid the local solutions in the promising area. The comparative study proved that the HBA is better than other efficient algorithms at determining the preferable allocation of DGs and capacitors in RDS.

#### *1.3. Paper Contribution and Organization*

This paper proposes a novel honey badger optimization technique for optimal allocation of single and multiple different types of DGs and capacitors on RDS. Three different types of DGs were successfully employed with four scenarios through the application to the IEEE 69-bus RDS. For single and multiple integrations of DGs and capacitors in the IEEE 69-bus radial distribution network, the total active power loss was utilized as a single objective function in the present work. The proposed HBA optimization algorithm was simulated with four different scenarios as follows:

Scenario 1: the DG is generating real power only (DG Type-I). Scenario 2: the Capacitor Bank is generating only reactive power (CBs). Scenario 3: the DG is producing both reactive and active power (DG Type-III). Scenario 4: simultaneous installation of DG Type-I with DG Type-III.

Additionally, combined power loss sensitivity (CLPS) was utilized to assess the bus system's sensitivity and identify the best vulnerable nodes for incorporating the single and multiple DGs and capacitors in RDS. Further, CPLS lowers both the search agents of the proposed algorithm and the total computational burden of the simulation process. The effectiveness of the HBA was validated by comparing the acquired results to those of other well-known hybrid techniques such as the hybrid algorithm based on the analytical algorithm with the PSO technique [30].

The remainder of this article is organized as follows: The next section explains the mathematical model of the system and its constraints. Section 3 depicts the combined power loss sensitivity. The proposed HBA is presented in Section 4. The obtained simulation results and discussion are represented in Section 5. The last section concludes the work and recommends potential directions for further research studies.

#### **2. Problem Formulation**

#### *2.1. Principles of Forward–Backward Power Flow Algorithm*

RDS include some specific characteristics, for instance, unbalanced loads, radial construction, and a high ratio of R/X. Due to the mentioned properties above, the Newton– Raphson (NR), fast decoupled (FD), and Gauss–Seidel (GS) techniques are inadequate in RDS analysis. Consequently, a forward–backward load flow algorithm [31] was utilized in this study to solve the load flow problem of RDS, which can be partitioned into two phases: forward sweep and backward sweep. In the backward sweep, the power flow is determined from the receiving end to the sending end, whereas the voltage is calculated from the sending end to the receiving end in the forward sweep. Figure 1 displays a portion of two buses in RDS; the active and reactive power flow from bus m to bus n is evaluated using backward sweep by the following expressions.

$$\mathbf{P\_m} = \mathbf{P\_n} + \mathbf{P\_{L\_n}} + \mathbf{R\_{m,n}} \left( \frac{(\mathbf{P\_n} + \mathbf{P\_{L\_n}})^2 + (\mathbf{Q\_n} + \mathbf{Q\_{L\_n}})^2}{\left|\mathbf{V\_n}\right|^2} \right), \tag{1}$$

$$\mathbf{Q\_m} = \mathbf{Q\_n} + \mathbf{Q\_{L\_n}} + \chi\_{\mathbf{m,n}} \left( \frac{(\mathbf{P\_n} + \mathbf{P\_{L\_n}})^2 + (\mathbf{Q\_n} + \mathbf{Q\_{L\_n}})^2}{\left|\mathbf{V\_n}\right|^2} \right), \tag{2}$$

and the voltage and phase angle of each bus can be evaluated in the forward sweep as given in (3) and (4), respectively.

$$\mathbf{V\_n} = \left(\mathbf{V\_m^2} - \mathbf{2}(\mathbf{R\_{m,n}}\mathbf{P\_m} + \chi\_{\mathbf{m,n}}\mathbf{Q\_m}) + \left(\mathbf{R\_{m,n}}^2 + \chi\_{\mathbf{m,n}}\mathbf{2}\right) \left(\frac{\mathbf{P\_m^2} + \mathbf{Q\_m^2}}{\left|\mathbf{V\_m}\right|^2}\right)\right)^{1/2},\tag{3}$$

$$\theta\_{\rm m} = \theta\_{\rm m} + \tan^{-1}\left(\frac{\mathbf{Q\_{m}R\_{\rm m,n}} - P\_{\rm m}\mathbf{X\_{m,n}}}{\mathbf{V\_{m}^{2}} - (\mathbf{P\_{m}R\_{\rm m,n}} + \mathbf{Q\_{m}X\_{\rm m,n}})}\right),\tag{4}$$

**Figure 1.** Portion of two nodes in radial distribution system.

The line between busses m and n has a reactance and resistance Xm,n and Rm,n. The active and reactive power delivered across the line between bus m and bus n is denoted by Pm and Qm, respectively. The voltages of buses m and n are Vm and Vn, respectively.

Installation of photovoltaic systems (PVs), capacitor banks (CBs), and DFIG-based wind turbines (WTs) changes the line power flow. Therefore, the active and reactive line flow between buses m and n after installation of DG at bus n in RDS is modified as follows:

• **DG Type-I**

$$\mathbf{P\_m} = \mathbf{P\_n} + \mathbf{P\_{L\_n}} + \mathbf{R\_{m,n}} \left( \frac{(\mathbf{P\_n} + \mathbf{P\_{L\_n}})^2 + (\mathbf{Q\_n} + \mathbf{Q\_{L\_n}})^2}{\left|\mathbf{V\_n}\right|^2} \right) - \mathbf{P\_{DC\_{n'}}} \tag{5}$$

• **Capacitor Bank**

$$\mathbf{Q\_m} = \mathbf{Q\_n} + \mathbf{Q\_{L\_n}} + \mathbf{X\_{m,n}} \left( \frac{(\mathbf{P\_n} + \mathbf{P\_{L\_n}})^2 + (\mathbf{Q\_n} + \mathbf{Q\_{L\_n}})^2}{\left|\mathbf{V\_n}\right|^2} \right) - \mathbf{Q\_{CB\_{n'}}} \tag{6}$$

• **DG Type-III**

$$\mathbf{P\_m} = \mathbf{P\_n} + \mathbf{P\_{L\_n}} + \mathbf{R\_{m,n}} \left( \frac{\left(\mathbf{P\_n} + \mathbf{P\_{L\_n}}\right)^2 + \left(\mathbf{Q\_n} + \mathbf{Q\_{L\_n}}\right)^2}{\left|\mathbf{V\_n}\right|^2} \right) - \mathbf{P\_{DC\_{n'}}} \tag{7}$$

$$\mathbf{Q\_m} = \mathbf{Q\_n} + \mathbf{Q\_{l\_n}} + \lambda\_{\mathbf{m,n}} \left( \frac{(\mathbf{P\_n} + \mathbf{P\_{l\_n}})^2 + (\mathbf{Q\_n} + \mathbf{Q\_{l\_n}})^2}{\left|\mathbf{V\_n}\right|^2} \right) - \mathbf{Q\_{D\bar{G}\_n\prime}}\tag{8}$$

Thus, the active Ploss(m,n) and reactive Qloss(m,n) power losses in the line between buses n and m are evaluated by (9) and (10), respectively.

$$\mathbf{P}\_{\rm loss(m,n)} = \mathbf{R}\_{\rm m,n} \left( \frac{\left( \mathbf{P}\_{\rm m}^2 + \mathbf{Q}\_{\rm m}^2 \right)}{\left| \mathbf{V}\_{\rm n} \right|^2} \right), \tag{9}$$

$$\mathbf{Q}\_{\rm loss(m,n)} = \chi\_{\rm m,n} \left( \frac{(\mathbf{P}\_{\rm m}^2 + \mathbf{Q}\_{\rm m}^2)}{\left| \mathbf{V}\_{\rm n} \right|^2} \right), \tag{10}$$

#### *2.2. Objective Function and Operation Constraints*

Generally, including DGs in RDS minimizes the system power losses by decreasing the amount of current flowing through the branches; it can also increase the network efficiency by enhancing the voltage profile. Therefore, in this study, the total active power loss was chosen as the optimization structure's objective function, and it may be calculated as follows:

$$F\_{\text{obj}} = P\_{\text{total-loss}} = \sum\_{\mathbf{t}=1}^{\mathbf{r}\_{\text{bv}}} P\_{\text{loss}(\mathbf{m}, \mathbf{n})\_{\mathbf{t}}} \tag{11}$$

where nbr and Ptotal-loss denote the active power loss of the nbr th branch and the number of lines in the network, respectively. The objective function expressed in (11) is minimized and subjected to the following equality and inequality constraints.

#### 2.2.1. Equality Constraints

The equality constraints are the balanced reactive and active power flow in RDS, and they are given as follows:

$$\mathbf{P}\_{\text{slack}} + \sum\_{\mathbf{i}=1}^{\text{n}\_{\text{DC}}} \mathbf{P}\_{\text{DG}}(\mathbf{i}) = \sum\_{\mathbf{k}=1}^{\text{n}\_{\text{br}}} \mathbf{P}\_{\text{loss}}(\mathbf{k}) + \sum\_{\mathbf{l}=1}^{\text{n}} \mathbf{P}\_{\text{L}}(\mathbf{l}),\tag{12}$$

$$\mathbf{Q\_{slack}} + \sum\_{\mathbf{i}=1}^{\text{nJC}} \mathbf{Q\_{DC}}(\mathbf{i}) = \sum\_{\mathbf{k}=1}^{\text{n}\_{\text{br}}} \mathbf{Q\_{loss}}(\mathbf{k}) + \sum\_{\mathbf{l}=1}^{\text{n}} \mathbf{Q\_{L}}(\mathbf{l}), \tag{13}$$

where Qslack and Pslack are the generated reactive and active power from the swing bus in RDS, respectively. QL(l) and PL(l) denote the reactive and active load demand at bus l, while the active and reactive power losses in branch (k) are represented, respectively, by Ploss(k) and Qloss(k). QDG(i) and PDG(i) illustrate the injected reactive and real power from DGs to RDS at bus i. nDG, nbr, and n denote the number of DGs, the number of branches, and the number of buses in RDS, respectively.

#### 2.2.2. Inequality Constraints

The upper and lower bounds of the estimated state variables of the RDS can be represented as follows:

• Bus voltage constraints

Each bus of the RDS must have a voltage between the minimum voltage (V min) and maximum voltage (V max).

$$\mathbf{V}\_{\min} \le \mathbf{V}\_{\mathbf{i}} \le \mathbf{V}\_{\max} \tag{14}$$

### • DG capacity limits

The total active power (P DG) generated by DGs should be greater than (P DGmin ) and less than (P DGmax ). Further, the operating power factor (PF DG) of DGs should be lie in the interval [PFDGmin , PFDGmax ]. These constraints are given by (15)–(17).

$$\sum\_{\mathbf{i}=1}^{\text{nDG}} \mathbf{P}\_{\text{DG}}(\mathbf{i}) \le 0.75 \left( \sum\_{\mathbf{k}=1}^{\text{n}\_{\text{b}\mathbf{r}}} \mathbf{P}\_{\text{loss}}(\mathbf{k}) + \sum\_{\mathbf{l}=1}^{\text{n}} \mathbf{P}\_{\text{L}}(\mathbf{l}) \right), \tag{15}$$

PDGmin ≤ PDG ≤ PDGmax (16)

$$\text{PF}\_{\text{DG}\_{\text{min}}} \le \text{PF}\_{\text{DG}} \le \text{PF}\_{\text{DG}\_{\text{max}}} \tag{17}$$

### • Thermal capacity constraints

In this paper, the line current (I <sup>d</sup>) of the simulated IEEE 69-bus RDS must satisfy the following constraint [32]:

$$\mathbf{I}\_{\mathbf{d}} \le \mathbf{I}\_{\text{max,d}} \text{ for } \mathbf{d} = 1, \text{ 2, 3, ..., } \mathbf{n}\_{\text{br}} \tag{18}$$

where Imax,d depicts the highest allowable value of the d-th line current.

#### *2.3. Loss Sensitivity Factor*

Combined power loss sensitivity factors (CPLSF) were used in this study to specify the best placement for renewable DG and capacitors in RDS. They are able to indicate which bus has the highest loss reduction when a DG is installed. Consequently, these vulnerable buses might be considered candidates for DG incorporation in RDS. Therefore, the optimization algorithm's search space and simulation time are reduced, as only a few buses can be candidate buses for compensation. CPLSF mainly depend on the variation of apparent power losses to apparent power injection from the DG [33], as given in (19).

$$\text{CPLS} = \frac{\partial \mathbf{P\_{loss(m,n)}}}{\partial \mathbf{P\_n}} + \mathbf{j} \frac{\partial \mathbf{Q\_{loss(m,n)}}}{\partial \mathbf{Q\_n}} = \mathbf{R\_{m,n}} \left(\frac{2\mathbf{P\_n}}{\left|\mathbf{V\_n}\right|^2}\right) + \mathbf{X\_{m,n}} \left(\frac{2\mathbf{Q\_n}}{\left|\mathbf{V\_n}\right|^2}\right), \tag{19}$$

It can be observed from Figure 2 that the buses which have high CPLS values can be defined as candidate buses for DG installation. These candidate buses which comprise up to 50% of the system buses are 57, 58, 7, 6, 61, 60, 10, 59, 55, 56, 12, 13, 14, 54, 15, 53, 8, 64, 49, 11, 9, 17, 65, 16, 5, 48, 21, 19, 41, 63, 68, 34, 20, and 62.

**Figure 2.** The value of CPLS factors for IEEE 69-bus RDS.

#### **3. Optimization Algorithm**

*3.1. Honey Badger Optimization Algorithm*

Honey badgers are mammals with white and black fluffy fur that are usually located in semi-arid and African rainforests, the Asian Southwest, and the Indian subcontinent. They are approximately 7 to 13 kg in bodyweight and 60 to 77 cm in body length, and it is a bold forager which preys on 60 different species including deadly snakes. They are clever mammals that can utilize tools and enjoys honey. They live alone in self-dug tunnels and only interact with other badgers for mating. Honey badgers are divided into 12 subspecies. Honey badgers do not have a set mating season because cubs are born all year. They are strong animals due to their courageous nature, and they never hesitate to attack even much larger predators when they cannot flee. Further, these mammals can efficiently climb trees to access food sources such as bird nests and beehives [34,35]. The following sections

discuss the mathematical model of the HBA and its inspiration, which resembles honey badger (HB) behavior in nature.

#### 3.1.1. Inspiration

The honey badger algorithm mimics the honey badger's foraging behavior. The HB either smells and digs for food sources or tracks the honeyguide bird. The first situation is referred to as the digging mode, while the other is referred to as the honey mode. In the previous phase, it utilizes its sniffing skills to estimate the position of the prey; once there, it wanders around it to find the best spot for digging and grabbing it. In the last mode, the honey badger uses the honeyguide bird as a guide to locate the beehive directly.

#### 3.1.2. Mathematical Model

The mathematical models of the HBA are explained in these subsections. The HBA is a global optimization method in theory since it includes both exploration and exploitation stages. Mathematically, the population of candidate solutions (X) in the HBA is expressed as:

$$\mathbf{X} = \begin{bmatrix} \mathbf{x}\_{11} & \mathbf{x}\_{12} & \mathbf{x}\_{13} & \dots & \mathbf{x}\_{1d} \\ \mathbf{x}\_{21} & \mathbf{x}\_{22} & \mathbf{x}\_{23} & \dots & \mathbf{x}\_{2d} \\ \vdots & \dots & \dots & \ddots & \dots \\ \mathbf{x}\_{n1} & \mathbf{x}\_{n2} & \mathbf{x}\_{n3} & \dots & \mathbf{x}\_{nd} \end{bmatrix}' \tag{20}$$

j-th honey badger position xj = x1 <sup>j</sup> x2 <sup>j</sup> ... x<sup>d</sup> j , (21)

**Step 1: Initialization phase:** The respective positions of honey badgers with n population can be initialized using the following expression:

$$\mathbf{x}\_{\mathbf{i}} = \mathbf{L}\mathbf{B}\_{\mathbf{i}} + \mathbf{r}\_{1}(\mathbf{U}\mathbf{B}\_{\mathbf{i}} - \mathbf{L}\mathbf{B}\_{\mathbf{i}}), \ \mathbf{r}\_{1} \in [0, 1], \tag{22}$$

where UBi, and LBi represent the upper and lower bounds of the search space, respectively, while xj is the j-th honey badger position and refers to a nominee solution in a population with size n.

**Step 2: Intensity Definition:** Intensity (I) depends mainly on the prey concentration strength and the distance between it and the j-th honey badger. Ij is the scent intensity of the prey; if the scent is low, the motion becomes slow and vice versa. It is provided by inverse square law (ISL) [36], as represented in Figure 3 and described by (23) as:

$$\mathbf{I}\_{\mathbf{j}} = \frac{\mathbf{r}\_2 \mathbf{S}}{4\pi \mathbf{c} \mathbf{d}\_{\mathbf{j}}^2}, \ \mathbf{r}\_2 \in [0, 1], \tag{23}$$

$$\mathbf{S} = \left(\mathbf{x}\_{\mathbf{j}} - \mathbf{x}\_{\mathbf{j}+1}\right)^{2} \tag{24}$$

$$\mathbf{d}\_{\mathbf{j}} = \mathbf{x}\_{\text{prey}} - \mathbf{x}\_{\mathbf{j}} \tag{25}$$

where S represents the source intensity or concentration intensity (prey position, as depicted in Figure 3). dj is the distance between the j-th badger and prey.

**Step 3: Density factor update:** To guarantee a seamless transition from exploration to exploitation, the density factor (α) governs time-varying randomness. Using (26), the updated decreasing factor (α) is decreased with iterations to reduce randomization over time:

$$\alpha = \mathbb{C} \times \exp\left(\frac{-\text{iter}}{\text{max}\_{\text{iter}}}\right),\tag{26}$$

where (C) is a constant number more than 1 (the default value is 2), and maxiter denotes the maximum number of iterations.

**Figure 3.** ISL. I is smell intensity, S is prey position, and r ∈ [0, 1] [29].

**Step 4: Fleeing from local solution:** The current step and the two next ones are applied in the HBA to flee from the local solution area. In this scenario, the HBA optimization algorithm makes use of a flag (F) that changes the search direction, giving agents more chances to scan the search area precisely.

**Step 5: Updating the locations of the agents:** As previously stated, the HBA position update process (x new) is split into two phases: "digging phase" and "honey phase". The following is a more detailed description:

• **Digging phase.** A honey badger digs in a cardioid shape [37] during the digging phase, as seen in Figure 4. Equation (27) simulates the approximate cardioid motion as:

$$\mathbf{x\_{new}} = \mathbf{x\_{prev}} + \mathbf{F} \boldsymbol{\beta} \mathbf{I} \mathbf{x\_{prev}} + \mathbf{F} \mathbf{r\_3} \boldsymbol{\alpha} \mathbf{d\_j} |\cos(2\pi \mathbf{r\_4}) [1 - \cos(2\pi \mathbf{r\_5})]|\,,\tag{27}$$

where xprey denotes the best position of the prey obtained so far, in other words the global optimum. β ≥ 1 represents the ability of the honey badger to find food (default = 6). r3, r4, and r5 are three different generated random numbers within the interval [0,1]. F is a flag that changes the search direction, and it is determined by (28):

> F = 1 if r6 ≤ 1/2 <sup>−</sup>1 otherwise r6 <sup>∈</sup> [0, 1], (28)

**Figure 4.** Digging phase: the red outline indicates the strength of the smell, while the blue circular line indicates the position of the prey [29].

In the digging phase, a honey badger is highly influenced by three different factors: the scent intensity (I) of the prey (xprey), the distance between honey badger and prey (dj ), and the decreasing operator (α). Furthermore, a badger may sense any disruption (F) while digging, allowing it to detect even the best prey position (see Figure 4).

• **Honey phase.** Equation (29) simulates the case when the HB tracks the honeyguide bird to a beehive.

$$\mathbf{x\_{new}} = \mathbf{x\_{prev}} + \mathbf{a} \mathbf{d\_{j}r} \mathbf{y} \mathbf{F}, \ \mathbf{r\_{7}} \in [0, 1], \tag{29}$$

Equations (26) and (28) determine the value of (α) and (F), respectively, whereas xnew, and xprey show the HB's new position and prey location, respectively. It can be observed from (29) that the HB proceeds to search near the optimized prey position xprey, depending on the distance information (dj ). At this point, search behavior that changes over time (α) influences the search. A honey badger may also face a perturbation (F).

Because of the exploration and exploitation stages, the HBA is considered a global optimization method in theory. The number of operators that must be modified is kept to a minimum to make the HBA simple to implement and comprehend. In general, the HBA mainly depends on three parameters, i.e., the number of state variables (d), the maximum number of iterations (maxiter), and the number of populations (n) or the number of solutions. The HBA optimization technique guarantees strong local search ability via honey attraction and guides the individuals in the population to approach the optimal individuals. Furthermore, the density factor achieves the algorithm's global search capabilities and preserves the divergent population to guarantee that the local optimal solutions are avoided. The pseudocode of the HBA optimization algorithm is represented in Algorithm 1. Figure 5 shows the complete flowchart of the HBA optimization algorithm implemented for specifying the optimal sizing and placement of DGs and CBs in distribution systems.

**Algorithm 1:** Pseudocode of HBA

**Set parameters:** n: population size. d: no. of state variables. maxiter: maximum number of iterations. β, and C: constant numbers with initial values 6, and 2 respectively. LB, and UB : state variable lower and upper limits. **Using Equation (22) for random initialization of initial population positions.** Compute the fitness of every honey badger position *xj* using *Fobj* and assign to Fj, j ∈ [1, 2, . . . , n]. Select initial best position xprey and related best fitness fprey. Set iter = 1 **while iter** ≤ **maxiter do** Modernize the decreasing operator ∝ by (26). Evaluate the intensity (I) using (23) for each position. Set j = 1 while j ≤ n do while i ≤ d do Determine the distance given in (23). if rand < 0.5 **(Digging Phase)** Update each element xnew(j, i) in each position using (27) else **(Honey Phase)** Update each element xnew(j, i) in each position using (29) end if end while Determine the fitness fnew of the current position xnew (j) if fnew ≤ fj Update the xj = xnew (j) and fj = fnew end if end while if fnew ≤ fprey Set fprey = fnew and xprey = xnew end if **end while (main loop)** Print the best solution: fprey and xprey

**Figure 5.** Implementation process of HBA optimization algorithm.

#### **4. Simulation Results**

As previously stated, the HBA was simulated on IEEE 69-bus standard test systems to find the best sizing and location of the capacitor and renewable DG in such systems while minimizing power loss using the forward–backward sweep load flow algorithm. The CPLS factor was utilized to limit the search space of the optimization algorithm by identifying the best candidate buses for installing single and multiple DGs and CBs in distribution systems. The proposed method was implemented using MATLAB 2020a M-file on a system with a 64-bit Core i5 CPU and 8GB RAM. This work studied the optimal allocation of single or multi-units of DG Type-I, CBs, DG Type-III, and simultaneous integration of DG Type-I and

DG Type-III. Further, the effectiveness of the HBA optimization algorithm was validated by comparing the acquired solutions to those of other well-known hybrid techniques reported in the literature. Eventually, the optimal allocation of three PVs considering uncertainty was used as a difficult optimization problem to measure the performance of the HBA. The modeling of PV and system load are given in [38]. Table 1 depicts the constraints of the system state variables in p.u. and the tuning parameters for the optimization algorithm.

**Table 1.** Operating limits and tuning parameters of the presented technique.


The bus system voltage, which is a security metric that exhibits power quality, was utilized to measure the performance of the HBA optimization technique. In other words, any change in voltage profile affects the performance of the power system. It is computed by the summation of voltage deviation (SVD) as given in (30) where Vk, and Vslack represent the k-th bus voltage magnitude and the reference bus voltage equal to 1 p.u.

$$\text{SVD} = \sum\_{\mathbf{k}=1}^{\text{n\_b}} (|\mathbf{V}\_{\mathbf{k}} - \mathbf{V}\_{\text{slack}}|)\_{\prime} \tag{30}$$

Further, for measuring the performance of the HBA, the voltage stability index (VSI) was employed to identify the distribution system's sensitivity level. Equation (31) is used to provide the sensitivity of each bus to voltage collapse [39]. The bus becomes more stable, and the chances of voltage collapse are low if it has a high value of VSI. VSI for every bus in the distribution system is increased by the appropriate arrangement of DGs in RDS. The overall value of VSI for all buses in RDS is the voltage stability index summation (TVSI) as expressed in (32).

$$\text{VSI}\_{\text{n}} = \left| \text{V}\_{\text{m}} \right|^{4} - 4 \left( (\text{P}\_{\text{n}} + \text{P}\_{\text{L}\_{\text{n}}}) \text{X}\_{\text{m},\text{n}} - (\text{Q}\_{\text{n}} + \text{Q}\_{\text{L}\_{\text{n}}}) \text{R}\_{\text{m},\text{n}} \right)^{2} - 4 \left( (\text{P}\_{\text{n}} + \text{P}\_{\text{L}\_{\text{n}}}) \text{X}\_{\text{m},\text{n}} + (\text{P}\_{\text{n}} + \text{P}\_{\text{L}\_{\text{n}}}) \text{R}\_{\text{m},\text{n}} \right) \left| \text{V}\_{\text{m}} \right|^{2} \tag{31}$$

$$\text{TVSI} = \sum\_{\text{i}}^{n\_{\text{b}}} \text{VSI}\_{\text{i}} \tag{32}$$

where VSIn, and V <sup>m</sup> denote the VSI at the bus n and voltage at bus n, respectively, while Xm,n and Rm,n indicate, respectively, the reactance and resistance of branch between buses m, and n, as illustrated in Section 2. nb represents the total number of nodes.

Figure 6 shows the IEEE 69-bus radial distribution system, which comprises 69 buses and 68 lines with load demands of 2694.6 KVAR and 3801.49 KW. Moreover, the testing system also uses a 12.66 KV standard base voltage and a 10 MVA standard base power. Without installing DGs, the system's real power loss is 224.999 KW; bus 65 has the lowest voltage, i.e., 0.90919, and the maximum deviation 0.0908; the summation of VSI is 61.2181; the minimum VSI is 0.6833; and the voltage deviation summation is 1.8374 p.u. The suggested hybrid technique is studied with the following different scenarios:

**Figure 6.** IEEE 69-bus RDS single line diagram [32].

#### *4.1. Scenario 1: DG Type-I Installation on RDS*

This form of DG has recently become very popular for injecting real power only into RDS such as solar systems (PVs). Figures 7–9 represent the voltage profile, voltage stability index, and voltage deviation for the IEEE 69-bus distribution system using the HBA with one, two, and three PV-based DGs installed. By single unit, the overall active power loss is reduced from the base case to 83.2224 KW with a 63.01 percent reduction in power loss, as depicted in Table 2. It is depicted in Figures 7 and 8 that bus 27 has a minimum voltage of 0.9683 p.u., with a minimal voltage stability index of typically 0.8791 p.u. It has a maximum voltage deviation of approximately 0.0317 p.u., as shown in Figure 9. On the other hand, combining numerous DGs produces more efficient outcomes than using one DG. By installing two and three PV-based DGs in the present test system, the minimum voltage profile found at bus 65 is improved to 0.97893 and 0.9790 p.u., respectively, compared to the base case. Furthermore, it enhances the minimum VSI found at bus 65 (approximately 0.9183 and 0.9185) and decreases the maximum voltage deviation at the same bus to 0.0211 and 0.0210, respectively. Table 2 represents the optimal locations and sizing of the PV-based DG by the proposed method for IEEE 69-bus RDS. It can be observed from Table 2 that the HBA provides the optimal allocation of single and multiple DG Type-I on RDS compared with other techniques. The HBA was compared with the modified MRFO algorithm by installing three PVs in RDS considering uncertainty as shown in Table 3. Figure 10 illustrates the output power for three PVs for 24 h considering uncertainty, which demonstrates the robustness of the HBA while considering uncertainty.

**Figure 7.** Bus voltage magnitude comparison with and without DG Type-I for IEEE 69-bus RDS for scenario 1.

**Figure 8.** Bus voltage stability index after compensation on IEEE 69-bus RDS for scenario 1.

**Figure 9.** Bus voltage deviation after compensation on IEEE 69-bus RDS for scenario 1.


**Table 2.** Optimal results of single and multiple DG Type-I on an IEEE 69-bus using HBA compared with other algorithms for scenario 1.

**Table 3.** Results for installing three-DG Type-I in RDS considering uncertainty.


#### *4.2. Scenario 2: Capacitor Bank Installation on RDS*

Figures 11–13 show the voltage profile, voltage stability index, and voltage deviation for the IEEE 69-bus distribution system using the HBA with single and multiple CBs installed. It can be demonstrated from these figures that increasing the number of capacitor units and their total installed KVAR improves the voltage profile of the RDS, increase the stability index at all buses, and decreases the estimated voltage deviation. The optimal sizing and location of one, two, and three capacitors reduce the total real losses to 152.0348, 146.435, and 45.109KVAR, respectively, with percent loss reductions of 32.422, 34.91, and 35.5, as depicted in Table 4 which reveals that the CB does not considerably minimize the active losses as compared to DG Type-I. However, the proposed algorithm provides the optimal placement of CBs compared with other approaches for scenario 2 for IEEE 69-bus RDS.

**Figure 11.** Bus voltage magnitude comparison with and without CBs for IEEE 69-bus RDS for scenario 2.

**Figure 12.** Bus voltage stability index after compensation on IEEE 69-bus RDS for scenario 2.

**Figure 13.** Bus voltage deviation after compensation on IEEE 69-bus RDS for scenario 2.

**Table 4.** Optimal results of single and multiple CBs on an IEEE 69-bus using HBA compared with other algorithms for scenario 2.


#### *4.3. Scenario 3: DG Type-III Installation on RDS*

Similarly, as demonstrated in Figures 14–16, the DG Type-III has better results than DG Type-I because it supplies apparent power to the RDS. The best location and sizing of one-, two-, and three-DG Type-III decreases the total real losses to 23.1688, 7.2013, and 4.2664 KW, respectively, with percent loss reductions of 89.7, 96.8, and 98.1. This mode of DG integration also enhances the minimum VSI (Figure 14) to 0.8943, 0.9772, and 0.9773, respectively, compared to the base case (0.6833 at bus 64). Regarding the minimum bus voltage profile (Figure 15), a single DG Type-III improves it to 0.97247 found at bus 27, while the two and three units improve the 50th bus voltage profile to 0.99426 and 0.99427 p.u., respectively. When employing a single DG Type-III, the maximum voltage deviation

(Figure 16) is improved to 0.0275 (0.0908 at bus 65 for the base case). Nonetheless, the maximum VD at bus 50 is approximately 0.0057 p.u. for both two and three units of DGs Type-III. Consequently, the suggested HBA method gives the best allocation of single and multiple DGs Type-III on RDS compared with other algorithms, as shown in Table 5.


**Table 5.** Optimal results of single and multiple DG Type-III on an IEEE 69-bus using HBA compared with other algorithms for scenario 3.

#### *4.4. Scenario 4: Simultaneous Installation of DG Type-I with DG Type-III on RDS*

The hybridization of renewable energy sources is a prominent concern. PV and WT are the most common types of renewable distributed generators in RDS. In this scenario, the simultaneous combining of DG Type-I and Type-III on the present test system yielded superior results to the two last scenarios. It can be seen from Table 6 that the optimized simultaneous distribution of one PV with one WT, two PVs with two WTs, and three PVs with three WTs on the distribution network decrease the summation of the line's power losses to 12.1068, 4.4567, and 3.6741 KW, respectively. This type of DG integration increases the voltage stability index at all buses, as shown in Figure 17, and decreases the bus voltage deviation as depicted in Figure 18. From Figure 19, it also improves the voltage profile, where the minimum voltage is found at bus 69 (i.e., 0.9921 p.u.) for one PV with one WT, and bus 50 and 65 (0.9950 p.u., and 0.9968 p.u., respectively) for two PVs with two WTs and three PVs with three WTs, respectively. As a result, compared to the EA-OPF algorithm, the HBA method provides the optimal simultaneous distribution of the DG based on Type-I with Type-III on RDS, as depicted in Table 6.

**Figure 14.** Bus voltage stability index after compensation on IEEE 69-bus RDS for scenario 3.

**Figure 15.** Bus voltage magnitude comparison with and without DG Type-III for IEEE 69-bus RDS for scenario 3.

**Figure 16.** Bus voltage deviation after compensation on IEEE 69-bus RDS for scenario 3.

**Figure 17.** Bus voltage stability index after compensation on IEEE 69-bus RDS for scenario 4.

**Figure 18.** Bus voltage deviation after compensation on IEEE 69-bus RDS for scenario 4.

**Figure 19.** Bus voltage magnitude comparison with and without DG Type-I and DG Type-III for IEEE 69-bus RDS for scenario 4.


**Table 6.** Optimal results of single and multiple DG Type-I and Type-III on IEEE 69-bus using HBA compared with other algorithms for scenario 4.

#### **5. Discussion**

As discussed in the previous section, the HBA provides the optimal allocation of single and multiple DGs and capacitors on IEEE 69-bus RDS. Figure 20 illustrates the total active power loss obtained using the suggested HBA for the four test scenarios. It can be seen from this figure that the HBA gives the best solution in all test cases. Regarding the summation of voltage deviation (SVD) (shown in Figure 21), the three units of DG Type-III give the minimum SVD, while the maximum SVD is obtained using one capacitor. Figure 22 shows the total voltage stability index for the HBA on IEEE 69-bus RDS in different scenarios. This figure proves that the proposed algorithm increases the TVSI for the studied cases.

On the other hand, the convergence characteristics of the HBA for scenario one are represented in Figure 23, which illustrates that the suggested algorithm gives the optimum solution in fewer iterations. Figures 24 and 25 illustrate the high conversion rate obtained by the proposed algorithm for scenarios two and three, respectively. Additionally, Figure 26 illustrates the high convergence characteristics of the HBA for specifying the best sizing and location on the IEEE 69-bus standard test system in scenario 4.

**Figure 20.** Summary of total active power losses after compensation for IEEE 69-bus RDS.

**Figure 21.** Summary of voltage deviation summation after compensation for IEEE 69-bus RDS.

**Figure 22.** Summary of TVSI after compensation for IEEE 69-bus RDS.

**Figure 23.** Convergence curves for scenario 1 in IEEE 69-bus RDS. (**a**) One unit, (**b**) two units, and (**c**) three units.

**Figure 24.** Convergence curves for scenario 2 in IEEE 69-bus RDS. (**a**) One unit, (**b**) two units, and (**c**) three units.

**Figure 25.** Convergence curves for scenario 3 in IEEE 69-bus RDS. (**a**) One unit, (**b**) two units, and (**c**) three units.

**Figure 26.** Convergence curves for scenario 4 in IEEE 69-bus RDS. (**a**) One unit, (**b**) two units, and (**c**) three units.

#### **6. Conclusions**

In this paper, a new efficient HBA optimization algorithm is applied for the first time to specify the optimal size and location of different types of DGs and capacitors in RDS. To prove the effectiveness of the suggested algorithm, the simulation results were compared with those of other recent optimization techniques. The convergence characteristics of the HBA were introduced for all studied test cases, which show high performance, even increasing the number of state variables. Additionally, the voltage profile, voltage stability index, and voltage deviation of the IEEE 69-bus are discussed and given in figures. From simulation results, the integration of multiple DGs or capacitors is found to be superior to the integration of a single DG or capacitor alone. Investigating the four test scenarios, integration of CBs seems to be the worst scenario in reducing the total active power loss at roughly 145.10916 KVAR. However, simultaneous integration of DG Type-I and DG Type-III provides the lowest total active power losses, approximately 3.6741 KW, and improves both the voltage profile and voltage stability index in the IEEE 69-bus distribution system. The high accuracy obtained from the proposed algorithm will motivate future researchers to utilize this algorithm in large-scale optimization problems.

**Author Contributions:** Conceptualization, M.A.E.; Investigation, S.K.; Methodology, H.A.-M.; Validation, E.E.E. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported by Taif University Researchers Supporting Project number (TURSP-2020/86): Taif University, Taif, Saudi Arabia.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

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

#### **References**

