1 Introduction

Recently, numerous optimization algorithms have been introduced based on different natural events like biological, physical, and chemical phenomena (Xing and Gao 2014; Baroudi et al. 2018; You and Lu 2018; Mohanty 2019). These algorithms have always interested the researchers active in optimization fields. Due to the increasing complexity, environmental limitations, increasing demand with higher quality, and several other challenges, the power system problems have never been apart from the investigations for optimally solving their problems. In a deregulated power network, optimal power flow (OPF), as one of the most important problems, is the chief avenue for providing high-quality electrical energy at desired objectives (Mohamed et al. 2017; Sharma and Ghosh 2019; Yin et al. 2019; Sattarpour et al. 2018). As an optimization problem, the OPF is a multi-dimensional, non-linear, large-scale, non-convex, and constrained problem (Ghaedi et al. 2020).

Up to now, different metaheuristic optimization methods have been utilized to solve the OPF problem by determining the optimized parameters in the power networks. In Sivasubramani and Swarup (2011) a multi-objective harmony search (HS) algorithm for the OPF problem has been presented. In Kumar and Premalatha (2015) the authors have used an adaptive real coded biogeography-based optimization for solving the OPF in a deregulated power system. In El-Fergany and Hasanien (2015) single and multi-objective OPF has been investigated using grey wolf optimizer and differential evolution algorithms. A modified Gaussian bare-bones imperialist competitive algorithm has been employed in Ghasemi et al. (2015) for multi-objective optimal electric power planning in the power system. In Adaryani and Karami (2013) an artificial bee colony algorithm for solving multi-objective OPF problem have been studied. In Singh et al. (2016) the authors have presented the particle swarm optimization (PSO) algorithm with an aging leader and challenger algorithm for the solution of optimal power. In another article (Shargh et al. 2016), a biogeography based optimization algorithm, a strong algorithm in solving problems with both continuous and discrete variables, has been used for solving a probabilistic multi-objective OPF problem. In Abraham and Kulkarni (2018) the authors have addressed the DC-OPF problem solving by considering transmission losses in a large electricity network. In this research work, a new alternating directions method of multipliers (ADMM) has been presented by introducing two relaxations to the OPF problem called the regularization and the modified penalization. Some other optimization algorithms used for solving the OPF problem can be listed as the differential-search algorithm, efficient-evolutionary algorithm, multi-objective forced initialized differential-evolution algorithm, fuzzy-harmony search algorithm, improved colliding bodies algorithm, hybrid-PSO, and gravitational-search algorithm (Abaci and Yamacli 2016; El-Hana Bouchekara et al. 2016 et al. 2016; Shaheen et al. 2016; Pandiarajan and Babulal 2016; Bouchekara et al. 2016; Radosavljevíc et al. 2015; Davoodi et al. 2018).

In this paper, a new differential evolution harmony search (DH/best) algorithm is proposed for solving the optimal power flow in power systems including three objectives of voltage profile improvement, real power loss minimization and reduction in active power of generation units which are formulated in the form of single and multi-objective functions. In comparison to the other algorithms like NSGAII, PSO, and HS, the proposed algorithm has many benefits which can be listed as follows:

  • A more effective initialization method instead of conventional random initialization.

  • An effective and better searching ability due to its effective updating procedure.

The performance of the proposed algorithm has been validated by comprehensive simulations using MATLAB software in which IEEE 118-bus and 57-bus systems are considered as the test systems. By defining eight scenarios, the proposed algorithm has been compared with NSGAII, PSO, and HS algorithms, which are three of the most well-known optimization algorithms in solving power system problems. As proved by the results, the proposed DH/best algorithm is the superior one since it has the best and highest efficiency and robustness among the compared algorithms.

The paper is organized as follows. The optimal power flow formulation is presented in Sect. 2. Then, Sect. 3 presents the proposed DH/best algorithm. In Sect. 4, simulation results based on DH/best algorithm for several single-/multi-objective functions are given and compared with other algorithms. Finally, we have the conclusion in Sect. 5.

2 Formulating optimal power flow problem

In general, an OPF is an optimization problem that is non-linear and non-convex. The OPF generally decreases given objectives of a power network, which are subjected to various equality and inequality constraints, by specifying the most desirable control variables for certain settings of the load. The OPF problem can be generally described as given below:

$${\text{Minimize}}:f(x,u)$$
(1)
$${\text{Subject to}}:g(x,u) = 0$$
(2)
$$h(x,u) \le 0$$
(3)

In the above equations, x and u respectively are the vectors of system state/dependent variables and control/independent variables. Moreover, f(x,u) presents the objective function that should be minimized. Also, the equality and inequality constraints are presented by g(x, u) and h(x, u) respectively. In the following, both the control and the state variables of the OPF problem are given.

2.1 State-variables

The variables set describing the power system state are defined as below:

$$x = \left[ {P_{{G_{1} }} ,V_{{L_{1} }} ,...,V_{{L_{NL} }} ,Q_{{G_{1} }} ,....,Q_{{G_{NG} }} ,S_{{l_{1} }} ,...,S_{{l_{n1} }} } \right]$$
(4)

in which, PG1 presents the active power generation at the slack-bus. Also, generators’ reactive power outputs are shown by QG. Moreover, the load-bus voltage magnitude and the apparent power flow are presented by VL and Sl, respectively. Additionally, NG, NL, and nl respectively show the number of the P–Q buses (load buses), the P–V buses (generators buses), and the transmission lines.

2.2 Control-variables

The parameters set, able to control the equations of power flow, are given in terms of the decision vector as:

$$u = \left[ {P_{{G_{2} }} ,....,P_{{G_{NG} }} ,T_{1} ,...,T_{NG} } \right]$$
(5)

where T and PG respectively are the transformer tap and generator active power.

2.3 Constraints

In total, constraints are classified into two types: equality and inequality constraints. The equality constraints are the constraints of power balance, and the inequality constraints are defined as the system components operating limits. As a rule, both of these constraints must be fulfilled by the OPF problem.

2.3.1 Equality-constraints

By using the active and reactive power balance, the typical equations of load flow can be represented by equality constraints as follows:

$$P_{Gi} - P_{Di} - V_{i} \sum\limits_{j = 1}^{nb} {V_{j} } \left[ {G_{ij} \cos (\delta_{i} - \delta_{j} ) + B_{ij} \sin (\delta_{i} - \delta_{j} )} \right] = 0\begin{array}{*{20}c} {\begin{array}{*{20}c} {} & {} \\ \end{array} } & {\forall i \in nb} \\ \end{array}$$
(6)
$$Q_{Gi} - Q_{Di} - V_{i} \sum\limits_{j = 1}^{nb} {V_{j} } \left[ {G_{ij} \cos (\delta_{i} - \delta_{j} ) + B_{ij} \sin (\delta_{i} - \delta_{j} )} \right] = 0\begin{array}{*{20}c} {\begin{array}{*{20}c} {} & {} \\ \end{array} } & {\forall i \in nb} \\ \end{array}$$
(7)

where, nb, QG, PD, and QD present the buses total number, reactive power of the generator, and the active and reactive load demands. Additionally, the transfer susceptance and conductance between buses i and j are respectively presented by Bij and Gij. During the procedure of load flow, the aforementioned constraints are strongly enforced which in turn guarantees that the searched optimal solution is feasible.

2.3.2 Inequality-constraints

The inequality-constraints present the operating limits of the power system as listed at the following.

2.3.2.1 Constraints of generation

For having stable operation, the voltages and real and reactive powers of the generators should be restricted by the lower and upper limits as given below:

$$P_{Gi}^{\min } \le P_{Gi}^{{}} \le P_{Gi}^{\max } \begin{array}{*{20}c} {} & {} & {\forall \in NG} \\ \end{array}_{i}$$
(8)
$$\begin{aligned} & Q_{Gi} - Q_{Di} - V_{i} \sum\limits_{j = 1}^{nb} {V_{j} } \left[ {G_{ij} \cos (\delta_{i} - \delta_{j} ) + B_{ij} \sin (\delta_{i} - \delta_{j} )} \right] = 0\\&\quad {\forall i \in nb} \end{aligned}$$
(9)
$$V_{Gi}^{\min } \le V_{Gi}^{{}} \le V_{Gi}^{\max } \begin{array}{*{20}c} {} & {} & {\forall \in NG} \\ \end{array}_{i}$$
(10)
2.3.2.2 Constraints of transformers

The transformers tap settings should be restricted by their limits (upper and lower limits) as given below:

$$T_{i}^{\min } \le T_{i}^{{}} \le T_{i}^{\max } \begin{array}{*{20}c} {} & {} & {\forall \in NT_{i} } \\ \end{array}$$
(11)
2.3.2.3 Security constraints

Both load-buses voltage magnitudes constraints and transmission-line loadings constraints should be restricted within their limits as presented at the following:

$$V_{Bi}^{\min } \le V_{Bi}^{{}} \le V_{Bi}^{\max } \begin{array}{*{20}c} {} & {} & {\forall \in NL} \\ \end{array}_{i}$$
(12)
$$S_{Li}^{{}} \le S_{Li}^{\max } \begin{array}{*{20}c} {} & {} & {\forall \in nl} \\ \end{array}_{i}$$
(13)
2.3.2.4 Constraints of Shunt VAR compensators

These compensators are restricted by their limits as below:

$$Q_{Ci}^{\min } \le Q_{Ci}^{{}} \le Q_{Ci}^{\max } \begin{array}{*{20}c} {} & {} & {\forall \in NC} \\ \end{array}_{i}$$
(14)

3 The differential-based harmony search algorithm

Heuristic algorithms and their improved versions detect optimum points in optimization problems by generating random numbers. These algorithms start with randomly generated solution samples and then improve the solutions. This random generation can cause defective sample generation procedure and lead to premature convergence.

In this paper, DH/best algorithm is proposed to solve the OPF problem. In this algorithm, the random initialization of solutions is replaced by an effective initialization procedure. This process could eliminate probable premature convergence. The algorithm also improves the Harmony Search (HS) updating method which described in (Abedinpourshotorban et al. 2016). In the following, both the original HS and the proposed DH/best algorithms are explained.

3.1 The original harmony search (HS) algorithm

The HS algorithm is an evolutionary algorithm introduced by Zong Woo Geem and Joong Hoon Kim (Geem et al. 2001). HS algorithm is inspired by the improvisation of harmonies in musical performance. Every possible solution vector in HS is a harmony, and the population of solution vectors is presented as Harmony memory (HM). To find the best possible harmony, HS follows the next four steps:

3.1.1 First step: initializing the harmony memory

In the HS algorithm, the solution vectors in HM is initialized randomly by using the below statement:

$$x_{ij} = L_{j} + (U_{j} - L_{j} ) \times rand(0,1)\quad {\text{for}} i = \left( {1,2, \ldots , \, HMS} \right) {\text{ and }} j = \left( {1,2, \ldots , \, D} \right)$$
(15)

where i and j respectively denote the number of harmonies in HM and the number of variables in a harmony. Also, \(U\) and \(L\) are the upper and lower boundaries of variables. rand(0,1) declares a random value between 0 and 1. After HM initialization, all harmonies are evaluated.

3.1.2 Second step: improvisation procedure

Harmony memory consideration rate (HMCR) and pitch adjustment ratio (PAR) are two important controlling parameters that profoundly affect the convergence and efficiency of HS. In improvisation procedure, new harmony vector (\({x}^{^{\prime}}\)) is generated considering these two parameters as follows:

3.1.2.1 HMCR

The jth variable of new harmony (\({x}_{j}^{^{\prime}}\)) considering HMCR predefined value (\(0\le HMCR\le 1\)) is improvised as follows:

$$x^{\prime}_{j} = \left\{ {\begin{array}{*{20}l} {x_{ij} } & {if} & {rand(0,1) \le HMCR} \\ {L_{j} + (U_{j} - L_{j} ) \times rand(0,1)} & {if} & {rand(0,1) > HMCR} \\ \end{array} } \right.$$
(16)

where i is a random integer from 1 to HMS. From (16) to improvise \({x}_{j}^{^{\prime}}\), the existing value of \({x}_{ij}\) in HM is used for \(rand \left(\mathrm{0,1}\right) \le HMCR\). Otherwise, a new value of \({x}_{j}^{^{\prime}}\) is improvised.

3.1.2.2 PAR

The improvised \({x}_{j}^{^{\prime}}\) variable is pitch adjusted to its neighboring values considering PAR predefined value (\(0 \le PAR \le 1\)) according to the below statement:

$$x^{\prime}_{j} = \left\{ {\begin{array}{*{20}l} {x^{\prime}_{j} } & {if} & {rand(0,1) > PAR} \\ {x^{\prime}_{j} \pm bw \times rand( - 1,1)} & {if} & {rand(0,1) \le PAR} \\ \end{array} } \right.$$
(17)

where bandwidth (bw) dynamically control pitch adjustment range of improvised \({x}_{j}^{^{\prime}}\).

3.1.3 Third step: updating the harmony memory

Improvised new harmony (\({x}^{^{\prime}}\)) is evaluated and compared to the worst harmony existing in HM. If it is better, it would be replaced with the worst one.

3.1.4 Fourth step: terminating HS algorithm

Improvisation and updating procedure continues until the stopping criteria of the algorithm is satisfied.

3.2 The proposed DH/best algorithm

As mentioned, the HS and also other optimization algorithms randomly initialize solution vectors. This initialization method can cause an incomplete search of decision variables variation range in a solution vector and lead algorithm to local minima. Unlike these algorithms, the DH/best uses a different initialization method. In this method, the variation range of decision variables is divided into ordered spans, and algorithm search all of these spans. This ordered strategy helps the algorithm to effectively search all variation range of decision variables and avoid premature convergence. Moreover, DH/best algorithm uses DE/best/1 mutation strategy described in (Abedinpourshotorban et al. 2016) to eliminate the need of the bw parameter for pitch adjustment in the conventional HS algorithm. DH/best in improvisation procedure for a new harmony selects pitches from the HM and adjust the pitches based on the distance between the pitches in the HM. In this paper, the OPF problem is solved by using DH/best algorithm in four main steps explained in the following.

3.2.1 First step: HM initialization

In the OPF problem, the decision variables are the active power of generators and the transformers’ taps which form the harmonies. Thus, ith memory can be expressed as follows:

$$M_{i} = \left[ {P_{{G_{2} }} ,....,P_{{G_{NG} }} ,T_{1} ,...,T_{NG} } \right]$$
(18)

Instead of horizontal initialization, the proposed DH/best initializes all of HM decision variables vertically by using the below statement:

$$e_{i} = \left( {\frac{i - 0.5}{{HMS}}} \right)\left( {U_{j} - L_{j} } \right) + L_{j}$$
(19)

where i = 1,2,…,HMS and j = 1,2,…,D. It means \(e_{j} = \left[ {e_{1} ,e_{2} ,...,e_{HMS} } \right]^{T}\) is an array of possible solutions for the jth decision variable that these solutions are orderly scattered in variation range. Then, \({e}_{j}\) is shuffled and used for the initialization of the jth decision variable in all harmonies.

3.2.2 Second step: fitness evaluation

As already mentioned, the main objectives of the OPF problem in this paper are voltage profile improvement, real power loss minimization, and reduction in the active power of generation units which are described in Sect. 4. The mentioned objective functions are used to evaluate the fitness of harmonies. Then, harmonies in HM are sorted according to evaluated value.

3.2.3 Third step: improvisation procedure

First, a new harmony (x’) is improvised using HMCR parameters according to (16) and then, the pitch is adjusted for this harmony using (20).

$$x^{\prime}_{j} = \left\{ {\begin{array}{*{20}l} {rand(L_{j} ,U_{j} )} & {if} & {rand(0,1) > PAR} \\ {x_{best,j} + (x_{r1,j} - x_{r1,j} ) \times rand(0,1)} & {if} & {rand(0,1) < PAR} \\ \end{array} } \right.$$
(20)

where xbest is the best harmony stored in HM and r1 and r2 are random integer 1 to HMS.

3.2.4 Fourth step: updating the harmony memory

For new harmony, the fitness function is evaluated. If its value is lower than the value of the worst harmony in HM, then new harmony is replaced with the worst harmony in HM.

Improvisation procedure continues until the maximum number of iterations is reached. Figure 1 presents the flow chart of the general optimization procedure of the DH/best algorithm.

Fig. 1
figure 1

DH/best algorithm implementation

4 Discussions and simulation results

The IEEE 57-bus and 118-bus systems are used for testing the simulation effect of the proposed DH/best algorithm to solve the OPF problem. For this aim, eight different case studies are defined and investigated in three load levels (i.e. Load Level 1 = 1 pu, Load Level 2 = 1.17 pu, and Load Level 3 = 1.3 pu). The case studies are summarized in Table 1. Table 2 shows a summary of the major attributions of the case studies. The DH/best algorithm is tested and compared with three algorithms, namely PSO, NSGA-II, and HS using the setting of the control-parameters given in Table 3. All simulations were implemented in MATLAB. It should be noted that after comparing the proposed algorithm with other algorithms, the results obtained by the proposed algorithm are also compared with the base systems results (i.e. without any optimization).

Table 1 Various case-studies investigated in this article
Table 2 Main characteristics and attributions of the test systems
Table 3 Control parameters for different algorithms

4.1 Case 1: Power loss minimization on IEEE 118-bus system

In this section, the simulation results for solving optimal power flow on IEEE 118-bus with the objective function of minimization of transmission lines real power losses are presented. This single-objective function can be expressed as shown below:

$$F_{1} = min\left( {PF + \sum\limits_{i = 1}^{3} {\sum\limits_{j = 1}^{186} {T_{i} \times P_{(loss)ij} } \,} } \right)$$
(21)

where P(loss)i is the active power loss of all lines in ith load level. As already mentioned, there are three load levels that are presented by i. Moreover, PF is the penalty function in the above equation which can be written as below:

$$PF = \left\{ {\begin{array}{*{20}l} {100 \times e^{{0.2 \times \frac{{\left( {P_{loss} - P_{loss\,(base)} } \right)}}{{P_{loss\,(base)} }}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,}} if\,\,P_{loss} > P_{loss\,(base)} } \\ {0\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,if\,\,\,\,P_{loss} < P_{loss\,(base)} } \\ \end{array} } \right.$$
(22)

where Ploss is the active power loss and Ploss(based) is the base active power loss. Table 4 presents the simulation results obtained by all four algorithms for this case. As seen, the proposed DH/best algorithm has the best performance in case of minimizing active power losses of the lines. For better visualization, the results of different algorithms are compared in Fig. 2a which shows the remarkable capability of the proposed algorithm over others. Moreover, Fig. 3 presents the objective function values of different algorithms per iteration. Besides, optimal solutions obtained by DH-best on IEEE 118-bus system for Cases 1–4 are shown in Table 5.

Table 4 Optimization results of IEEE 118-bus system of Case 1
Fig. 2
figure 2

Comparing the results of all algorithms on IEEE 118 system for a Case 1, b Case 2, c Case 3

Fig. 3
figure 3

Objective function values of different algorithms per iteration for Case 1

Table 5 Optimal solutions obtained by DH/best on IEEE 118-bus system for Cases 1–4

4.2 Case 2: Voltage profile improvement on IEEE 118-bus system

In this case, the simulation results for solving optimal power flow with objective function of voltage profile improvement on IEEE 118-bus system are presented. Generally, the mentioned objective function is founded on bus voltages deviation minimization, which can be written as follows:

$$F_{2} = \min \left( {PF + \sum\limits_{i = 1}^{3} {VD_{i} } } \right)$$
(23)

where, VDi is the total voltage deviation of all buses in ith load level. In addition, PF is penalty function which is calculated as expressed below:

$$PF = \left\{ {\begin{array}{*{20}l} {10 \times e^{{0.2 \times \left( {1 - V_{j} \,} \right)\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,}} if\,\,V_{j} \notin \left[ {V_{j - \min } ,V_{j - \max } } \right]} \\ {0\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,if\,\,\,V_{j} \in \left[ {V_{j - \min } ,V_{j - \max } } \right]} \\ \end{array} } \right.$$
(24)

where, Vj, Vj-min and Vj-max are bus voltage, minimum and maximum permissible bus voltage, respectively.

In addition, in Eq. (23), the total voltage deviation is obtained as below:

$$VD_{i} = \sum\limits_{j = 1}^{{}} {V_{D - j} }$$
(25)

In which, VD-j is the voltage deviation of jth bus voltage which can be written as presented below:

$$V_{D - j}^{^{\prime}} = \left\{ {\begin{array}{*{20}l} {\frac{{U_{2} }}{{V_{j} }}} & \quad{if} & {V_{j} > V_{j - \max } } \\ 0 & \quad {if} & {V_{j - \min } \le V_{j} \le V_{j - \max } } \\ {\frac{{U_{1} }}{{V_{j} }}} & \quad{if} & {\,V_{j} < V_{j - \min } } \\ \end{array} } \right.$$
(26)

In addition, U1 and U2 are voltage deviations obtained from minimum and maximum permissible bus voltage as below:

$$U_{1} = V_{j - \min } - V_{j}$$
(27)
$$U_{2} = V_{j} - V_{j - \max }$$
(28)

Table 6 presents the simulation results obtained by all four algorithms for this case. As seen, the proposed DH/best algorithm can obtain the best value of voltage deviation for all three levels of loads. For better visualization, the average voltage deviations of these algorithms are compared in Fig. 2b indicating the remarkable performance of the proposed one over others. Moreover, the voltage profiles of PQ buses are presented in Fig. 4a. As shown, the DH/best has the best performance. Also, Fig. 4b presents the objective function values of different algorithms per iteration.

Table 6 Optimization results of IEEE 118-bus system of Case 2
Fig. 4
figure 4

For Case 2, a voltage profile of PQ buses of IEEE 118-bus system, b objective function values of different algorithms per iteration

4.3 Case 3: Minimization of total active power generation on IEEE 118-bus system

In this case, the simulation results for solving optimal power flow with the objective function of minimizing the generated power by the generation units are presented on IEEE 118-bus system. This single-objective function is formulated as given below:

$$F_{3} = min\left( {\sum\limits_{i = 1}^{3} {\sum\limits_{j = 1}^{54} {P_{(G)ij} } \,} } \right)$$
(29)

where P(G)ij is the power generation of the jth unit in ith load level. Table 7 presents the simulation results obtained by all four algorithms for this case. As clearly seen, compared to other algorithms, the proposed DH/best algorithm offers the best results in this case. For better understanding, Fig. 2c compares these algorithms with each other demonstrating superiority of the proposed one over others. In Fig. 5, the objective function values of different algorithms per iteration are presented.

Fig. 5
figure 5

Objective function values of different algorithms per iteration for Case 3

Table 7 Optimization results of IEEE 118-bus system of Case 3

4.4 Case 4: Power loss minimization, voltage profile improvement and generation power minimization on IEEE 118-bus system

In this step, active power loss minimization, the total generation power minimization, and bus voltages profile improvement are considered as the objective functions. This multi-objective function is defined as follows:

$$F_{4} = \min \left( {\frac{{F_{1} + F_{3} }}{{P_{tot} }} + F_{2} } \right)$$
(30)

where Ptot is the sum of the based real power generation and base real power losses. Table 8 presents the simulation results obtained by the algorithms for this case. As clearly shown, compared to other algorithms, the proposed DH/best algorithm is the most effective one for optimizing the mentioned multi-objective cost function. For better understanding, Fig. 6a compares these algorithms with each other within this case for all of the considered three objectives demonstrating the superiority of the proposed one over others. In Fig. 6b, the voltage profiles of PQ buses for different algorithms are shown proving that the proposed algorithm is the best one. Besides, the objective function values of the algorithms per iteration are presented in Fig. 6c.

Table 8 Optimization results of IEEE 118-bus system of Case 4
Fig. 6
figure 6

Comparing results of algorithms on IEEE 118-bus system for Case 4. a Three objectives of the functions. b Voltage profile of PQ buses. c Objective function values vs iteration

4.5 Case 5: Power losses minimization on IEEE 57-bus system

By using (21) and (22), the simulation results for solving optimal power flow on IEEE 57-bus system with the objective function of minimization of transmission lines power losses are presented in this section. Table 9 presents the simulation results obtained by all four algorithms for this case. As seen, the proposed DH/best algorithm has the best performance. For better visualization, the results of different algorithms are compared in Fig. 7a which shows the superiority of the proposed algorithm over others. Besides, optimal solutions obtained by DH-best on IEEE 57-bus system for Cases 5–8 are listed in Table 10. Moreover, Fig. 8 presents the cost function values of different algorithms per iteration.

Table 9 Optimization results of IEEE 57-bus system of Case 5
Fig. 7
figure 7

Comparing results of all algorithms on IEEE 57-bus for a Case 5, b Case 6, c Case 7

Table 10 Optimal solutions obtained by DH/best on IEEE 57-bus system for Cases 5–8
Fig. 8
figure 8

Objective function values of different algorithms per iteration for Case 5

4.6 Case 6: Voltage profile improvement on IEEE 57-bus system

Based on (23)–(28), in this case, the simulation results for solving optimal power flow with the objective function of voltage profile improvement on IEEE 57-bus system are presented. Table 11 presents the simulation results obtained by all four algorithms for this case. As seen, the proposed DH/best algorithm can obtain the best value of voltage deviation for all three levels of loads. For better visualization, the average voltage deviations of these algorithms are compared in Fig. 7b indicating the performance of the proposed algorithm as the best one. Moreover, the voltage profiles of PQ buses are presented in Fig. 9a. As shown, the DH/best has the best performance. Also, Fig. 9b presents the cost function values of different algorithms per iteration for this case.

Table 11 Optimization results of IEEE 57-bus system of Case 6
Fig. 9
figure 9

For Case 6. a Voltage profile of PQ buses of IEEE 57-bus system, b objective function values of different algorithms per iteration

4.7 Case 7: Minimization of total power generation on IEEE 57-bus system

In this case, according to (29), the simulation results for solving optimal power flow with the objective function of minimizing the generated power by the generation units are presented on IEEE 57-bus system. Table 12 presents the simulation results obtained by the algorithms for this case. It is obvious that in comparison with other algorithms, the proposed DH/best algorithm has better performance. For better understanding, Fig. 7c compares these algorithms with each other demonstrating superiority of the proposed one over others. In Fig. 10, the objective function values of the algorithms per iteration are presented for this case.

Table 12 Optimization results of IEEE 57-bus system of Case 7
Fig. 10
figure 10

Objective function values of different algorithms per iteration for Case 7

4.8 Case 8: Power loss minimization, voltage profile improvement and generators active power minimization on IEEE 57-bus system

In this step, according to (30), minimization of active power loss along with minimization of total generation power and bus voltage improvement are investigated on IEEE 57-bus system. Table 13 presents the simulation results obtained by all algorithms for this case. As seen, the proposed DH/best algorithm is the most effective one for optimizing the mentioned multi-objective cost function. For better understanding, Fig. 11a compares these algorithms with each other within this case for all of the considered three objective functions demonstrating the superiority of the proposed one over others. In Fig. 11b, voltage profile of PQ buses are shown proving that the proposed algorithm is the most effective one. Besides, the objective function values of the algorithms per iteration are presented in Fig. 11c.

Table 13 Optimization results of IEEE 57-bus system of Case 8
Fig. 11
figure 11

Comparing results of algorithms on IEEE 57-bus system for Case 8, a three objectives of the function, b voltage profile of PQ buses, c objective function values vs iteration

4.9 Comparing simulation results of IEEE 57-bus and 118-bus systems with and without optimizing by DH/best algorithm

Tables 14 and 15 respectively list the simulation results for IEEE 118- and 57-bus standard systems with and without using DH/best algorithm for optimizing the base system. As seen in Fig. 12, the proposed DH/best algorithm can show remarkable improvements for all of the scenarios in both IEEE 118 and 57 test systems in comparison to the base systems.

Table 14 Simulation results of IEEE 118 system with and without optimization by DH/best algorithm
Table 15 Simulation results of IEEE 57 system with and without optimization by DH/best algorithm
Fig. 12
figure 12

Comparison between the results of the base system and optimized systems within different Cases based on a IEEE 118 system, b IEEE 57 system

5 Conclusion

In this paper, the DH/best algorithm is proposed to solve the optimal power flow (OPF) problem. This algorithm possesses an effective initialization method and a better updating procedure compared to other algorithms. For proving the effectiveness of the proposed algorithm, different single and multi-objective functions have been defined including minimizing real power losses, improving voltage profile, and minimizing active power of generation units in eight cases on both IEEE 57- and 118-bus systems. The proposed algorithm has been compared with other well-known algorithms like PSO, NSGAII, and harmony search in three load levels proving the higher efficiency and robustness of the proposed algorithm over others.