1 Introduction

Since the initiation of the concept—the optimal power flow by Carpentier (1962) in 1962, the OPF worth has been increasingly recognized, and in the present time, it has developed to be the most critical and essential instrument to determine the most cost-effective and secure state of planning and operation of power system. Diverse models have been established and adopted to form numerous types of OPF problems, objectives, set of state/control variables and limitations.

The OPF is an optimization problem which aims to fine-tune continuous and discrete control variables to enhance a predefined objective function while accomplishing operational equality and inequality limitations. Conventionally, the persistence of the OPF was to minimize the overall generating cost, i.e., economic dispatch. However, difficulties and restrictions like multifuels, valve-point effect, security constraint, prohibited zones must be incorporated to examine the more realistic OPF problem covering optimization of emission, voltage deviation and stability, active and reactive power loss, etc. The presence of these complexities makes the OPF problem an extremely constrained, mixed-integer, nonlinear and non-convex problem.

Primarily, numerous deterministic techniques were employed to solve the OPF problem. Such methods are found suitable for convex, smooth, continuous and differentiable objective functions. The optimal power flow (OPF) is a nonlinear, non-convex, intermittent problem owing to the presence of multifuels, valve-point effect, and prohibited zones, etc., and hence, gradient-based approaches fail to solve the OPF problem. Authors can find a thorough survey of deterministic methods in Pandya and Joshi (2005).

The evolutionary methods, i.e., metaheuristics, have witnessed tremendous development in the past decade. These techniques optimize a problem by attempting to improve a candidate solution iteratively about the given measure of quality. Metaheuristics make almost no assumptions regarding the problem being solved and are derivative free. The benefit of metaheuristics is that objective function can be discontinuous and differentiable as they do not employ a gradient search or Hessian matrix. Nevertheless, metaheuristics never ensure the optimal solution. Also, as suggested by no free lunch theorem (Wolpert and Macready 1997), if an algorithm works well on a particular category of problems, then it necessarily works degraded for another type of problem. It implies that the average rank of all the algorithms is same. This aspect has motivated the development of new and the enhancement of current approaches leading to a new form of metaheuristics.

As already stated, a specific metaheuristic may produce very efficient outcomes on a set of problems, but the same algorithm may show poor performance on another set of problems. This limitation has led to the application of different methods to solve an issue like the OPF problem. Various techniques such as genetic algorithm (GA) (Paranjothi and Anburaja 2002; Lai et al. 1997), particle swarm optimization (PSO) (Abido 2002a), tabu search algorithm (TS) (Abido 2002b), Simulated Annealing (SA) (Roa-Sepulveda and Pavez-Lazo 2001), differential evolution (DE) (Abou El Ela et al. 2010), imperialist competitive algorithm (ICO) (Ghanizadeh et al. 2011), harmony search algorithm (HAS) (Sinsuphan et al. 2013), black hole (BH) (Bouchekara 2014), teaching–learning-based algorithm (TLBO) (Bouchekara et al. 2014a), moth flame optimization algorithm (MFO) (Trivedi et al. 2016a; Buch et al. 2017), artificial bee colony algorithm (ABC), moth swarm algorithm (MSA) (Mohamed et al. 2017), league championship algorithm (LCA) (Bouchekara et al. 2014b), backtracking search algorithm (BSA) (Chaib et al. 2016), improved colliding bodies algorithm (ICBO) (Bouchekara et al. 2016), hybrid genetic-teaching–learning-based algorithm (H-TLBO) (Güçyetmez and Çam 2016), glowworm swarm optimization algorithm (GSA) (Surender Reddy et al. 2014), Krill Herd Algorithm (KHA) (Mukherjee and Mukherjee 2015), multi-verse optimizer (MVO) (Trivedi et al. 2016b), bat algorithm (BA) (Trivedi et al. 2016a) and many others are employed to solve the OPF problem. A comprehensive study of various metaheuristics applied to solve the OPF problem is presented in Niu et al. (2014), AlRashidi and El-Hawary (2009) and Frank et al. (2012).

In Buch and Trivedi (2018), eight different algorithms are compared to optimize the OPF problem. However, due to the complex kind of objectives included in the OPF problem, there is a continual need to apply a new and enhanced algorithm that can optimize the OPF problem reasonably. This fact has motivated us to develop and present an enhanced version of the moth flame optimization algorithm, i.e., adaptive moth flame optimization. The objective of this paper is to evaluate the performance of AMFO with MFO (Mirjalili 2015a) for optimizing the benchmark functions and also to implement AMFO for solving OPF on medium size test system, and compare its results with MFO (Mirjalili 2015a), GWO (Mirjalili et al. 2014), DA (Mirjalili 2016), SCA (Mirjalili 2015b), ALO (Mirjalili 2015c), MVO (Mirjalili et al. 2016), GOA (Saremi et al. 2017) and IMO (Javidy et al. 2015).

The key contributions of this work are summarized below:

  1. 1.

    Development of improved version of MFO, i.e., adaptive MFO and its implementation on standard benchmark functions.

  2. 2.

    A solution of the realistic OPF problem embedded with practical restraints like prohibited zones (POZ), valve-point effect (VP) and multifuels (MF) on a 118-bus test system.

  3. 3.

    Implementation of a complete set of tests to assess AMFO using different OPF problems on 118-bus test systems with different objective functions and limitations.

  4. 4.

    Utilization of nonparametric statistical assessments like Quade test (Quade 1979), Friedman (1937) and Friedman aligned test (Friedman 1940) for confirmation of results.

The structure of the rest of the paper is as follows: In Sect. 2, the OPF problem is framed. In Sect. 3, standard MFO is described in brief. Section 4 focuses on newly introduced adaptive MFO and its performance assessment on standard benchmark functions. In Section 5, the applications and results for solving the 118-bus OPF problem are discussed. Section 6 deals with the evaluation of AMFO based on the statistical test while the conclusion is drawn in the last section.

1.1 Devising the Optimal Power Flow (OPF) Problem

The optimal power flow is a problem which offers the best possible settings of the control variables for a specified set of the load by curtailing a predefined objective function such as the cost of power generation, voltage deviation, voltage stability index or transmission line losses. The majority of optimal power flow formulations may be characterized using the following standard equations:

$${\text{Minimize}}\quad J(x,u)$$
(1)
$${\text{Subject}}\;{\text{to}}\;g(x,u) = 0$$
(2)
$${\text{and}}\;h(x,u) \le 0$$
(3)

Here \(u\) represents the vector of independent variables or control variables. \(x\) represents the vector of dependent variables or state variables. \(J(x,u)\) represents the system’s optimization goal or objective function. \(g(x,u)\) represents the set of equality constraints. \(h(x,u)\) represents the set of inequality limitations.

1.2 Control Variables

These variables are adjusted to meet the load flow equations. The collection of control variables in the optimal power flow is as follows:

  • \(P_{G}\) symbolizes active power generation at the PV buses except for the slack bus

  • \(V_{G}\) symbolizes the voltage magnitude at PV buses

  • \(T\) represents the tap setting of the transformer

  • \(Q_{c}\) signifies the shunt VAR compensation

Hence, u can be expressed as:

$$u^{T} = \left[ {P_{{G_{2} }} \ldots P_{{G_{NG} }} ,V_{{G_{1} }} \ldots V_{{G_{NG} }} ,Q_{{C_{1} }} \ldots Q_{{C_{NC} }} ,T_{1} \ldots T_{NT} } \right]$$
(4)

where NG, NT and NC represent the number of generators, regulating transformers and VAR compensators, respectively.

1.3 State Variables

State variables represent the electrical state of systems. State variables are given as follows:

  • \(P_{G1}\) is active power output at slack bus

  • \(V_{L}\) symbolizes the voltage magnitude at PQ buses, load buses

  • \(Q_{G}\) is the reactive power output of all generator units

  • \(S_{l}\) is the transmission line loading (or line flow)

Hence, x can be expressed as:

$$x^{T} = \left[ {P_{{G_{1} }} ,V_{{L_{1} }} \ldots V_{{L_{NL} }} ,Q_{{G_{1} }} \ldots Q_{{G_{NG} }} ,S_{{l_{1} }} \ldots S_{{l_{nl} }} } \right]$$
(5)

where \(NL\) and \(nl\) are the numbers of load buses and the number of transmission lines, respectively.

1.4 Constraints

The OPF constraints can be classified into equality and inequality constraints, which are described in the following subsections:

1.5 Equality Limits

The equality constraints reflect the behavior of the power system. The equality constraints are as follows:

  • Real power limits

$$P_{Gi} - P_{Di} - V_{i} \sum\limits_{j = 1}^{NB} {V_{j} \left[ {G_{ij} \cos (\theta_{ij} ) + B_{ij} \sin (\theta_{ij} )} \right]} = 0$$
(6)
  • Reactive power limits

$$Q_{Gi} - Q_{Di} - V_{i} \sum\limits_{j = 1}^{NB} {V_{j} \left[ {G_{ij} \sin (\theta_{ij} ) - B_{ij} \cos (\theta_{ij} )} \right]} = 0$$
(7)

where \(\theta_{ij}\) is the bus voltage angle difference between bus \(i\) and \(j\), i.e., \(\theta_{ij} = \theta_{i} - \theta_{j}\), NB is the number of buses, \(P_{G}\) is the active power generation, \(Q_{G}\) is the reactive power generation, \(P_{D}\) and \(Q_{D}\) are active and reactive power demand, respectively, and \(G_{ij}\) and \(B_{ij}\) are elements of the admittance matrix representing conductance and susceptance between bus i and j, respectively.

1.6 Inequality Constraints

The inequality constraints represent the restrictions on physical gadgets present in the power system. These constraints also present the limits created to guarantee system security. These inequality constraints are as follows.

1.7 Generator Limits

For all generators comprising a slack bus, voltage, active and reactive outputs should be restricted by their upper and lower boundaries as follows:

$$\begin{aligned} V_{{G_{i} }}^{\rm {min} } \le V_{{G_{i} }} \le V_{{G_{i} }}^{\rm {max} } \quad i = 1, \ldots ,NG \hfill \\ P_{{G_{i} }}^{\rm {min} } \le P_{{G_{i} }} \le P_{{G_{i} }}^{\rm {max} } \quad i = 1, \ldots ,NG \hfill \\ Q_{{G_{i} }}^{\rm {min} } \le Q_{{G_{i} }} \le Q_{{G_{i} }}^{\rm {max} } \quad i = 1, \ldots ,NG \hfill \\ \end{aligned}$$
(8)

\(V_{{G_{i} }}^{{\text{min}}}\) and \(V_{{G_{i} }}^{{\text{max}}}\) are the minimum and maximum bus voltage limits, \(P_{{G_{i} }}^{{\text{min}}}\) and \(P_{{G_{i} }}^{{\text{max}}}\) are the minimum and maximum active power generation limits, while \(Q_{{G_{i} }}^{{\text{min}}}\) and \(Q_{{G_{i} }}^{{\text{max}}}\) are the minimum and maximum reactive power generation limits.

1.8 Transformer Constraints

Transformer tap settings should be confined within their specified lower and upper limits as follows:

$$T_{i}^{\rm {min} } \le T_{i} \le T_{i}^{\rm {max} } \quad i = 1,2, \ldots ,NT$$
(9)

\(T_{i}^{{\text{min}}}\) and \(T_{i}^{{\text{max}}}\) are the minimum and maximum transformer tap setting limits.

1.9 Shunt VAR Compensator Constraints

Shunt VAR Compensator settings are to be confined within their specified lower and upper bounds as follows:

$$Q_{{C_{i} }}^{\rm {min} } \le Q_{{C_{i} }} \le Q_{{C_{i} }}^{\rm {max} } \quad i = 1, \ldots ,NC$$
(10)

\(Q_{{c_{i} }}^{{\text{min}}}\) and \(Q_{{c_{i} }}^{{\text{max}}}\) are the minimum and maximum shunt reactive power compensation limits.

1.10 Security Constraints

Transmission line loadings and voltage magnitude at load buses are part of this category. The voltage of each load bus \(V_{{L_{i} }}\) must be confined within its lower and upper operating limits, i.e., \(V_{{L_{i} }}^{{\text{min}}}\) and \(V_{{L_{i} }}^{{\text{max}}}\). Line flow \(S_{{l_{i} }}\) through every transmission line is restricted by its capacity limits \(S_{{l_{i} }}^{{\text{max}}}\). These constraints can be mathematically formulated as follows:

$$\begin{aligned} V_{{L_{i} }}^{\rm {min} } \le V_{{L_{i} }} \le V_{{L_{i} }}^{\rm {max} } \quad i = 1, \ldots ,NL \hfill \\ S_{{l_{i} }} \le S_{{l_{i} }}^{\rm {max} } \quad i = 1, \ldots ,nl \hfill \\ \end{aligned}$$
(11)

1.11 Adaptive Moth Flame Optimization Algorithm

1.11.1 Inspiration

Moths are tiny insects quite like the family of butterflies. The sheer motivating fact about moths is their distinct steering approaches during the night. They maintain a fixed angle concerning the moon to travel long expanses over a straight line. Due to the more considerable distance among the moth and the moon, such mechanism guarantees flying in a straight line. Artificial lights trick moths, and hence, moths fly spirally around the human-made lights. Moths try to retain a similar tilt for artificial light to fly in a straight line. As artificial lights are incredibly close to the moth, keeping a similar angle triggers a dangerous spiral route for moths. In result, the moth ultimately converges on the artificial light. Figure 1a, b presents movement of moths about the moon and an artificial light, respectively.

Fig. 1
figure 1

Movement of moth with respect to moon and artificial light (Mirjalili 2015a)

1.12 MFO Algorithm

MFO algorithm articulates the spiral movement of moth toward the flame (light). In the present algorithm, moths and position of moths represent candidate solutions and problem’s variables, respectively. The set of moths M is represented in the following matrix:

$$M = \left( {\begin{array}{lll} {m_{11} } &\quad \ldots &\quad {m_{1d} } \\ \vdots &\quad \ddots &\quad \vdots \\ {m_{n1} } &\quad \cdots &\quad {m_{nd} } \\ \end{array} } \right)$$
(12)

where \(n\) is the number of moths and \(d\) is the number of variables, respectively.

The following array presents sorted fitness values.

$$OM = \left[ {\begin{array}{l} {OM_{1} } \hfill \\ {OM_{2} } \hfill \\ \vdots \hfill \\ {OM_{n} } \hfill \\ \end{array} } \right]$$
(13)

All moths are passed through the fitness function, and their return value is the fitness value of objective function. OM array is identical to the fitness function output. Flames represent an underlying matrix of MFO. Flames matrix can be presented as follows:

$$F = \left( {\begin{array}{lll} {f_{11} } &\quad \ldots &\quad {f_{1d} } \\ \vdots &\quad \ddots &\quad \vdots \\ {f_{n1} } &\quad \cdots &\quad {f_{nd} } \\ \end{array} } \right)$$
(14)

The dimension of the flame’s matrix and moth’s matrix is equal. Flames are sorted as per the following array based on the fitness values.

$$OF = \left[ {\begin{array}{*{20}l} {OF_{1} } \hfill \\ {OF_{2} } \hfill \\ \vdots \hfill \\ {OF_{n} } \hfill \\ \end{array} } \right]$$
(15)

Another critical component in the suggested approach is flames, which present the best position of moths. Hence, every moth searches about the flame and revises itself in the case of obtaining a superior solution. Such mechanism assures that moth never loses its best position.

The position of each moth with respect to flame is updated using the following expression:

$$M_{i} = S\left( {M_{i} ,F_{i} } \right)$$
(16)

where \(M_{i}\) indicates the ith moth, \(F_{j}\) presents the jth flame, and \(S\) is the spiral function. The spiral function is defined as:

$$S\left( {M_{i} ,F_{j} } \right) = D_{i} e^{bt} \cos (2\pi t) + F_{j}$$
(17)

Here \(D_{i}\) shows the distance between ith moth and jth flame, \(b\) is a constant identifying the shape of spiral, and \(t\) is a random number between \(\left[ { - 1,1} \right]\).

$$D_{i} = \left| {F_{j} - M_{i} } \right|$$
(18)

Equation (17) represents spiral search path of the flying moths while updating their position with respect to flames. Parameter \(t\) presents closeness of moth with flame. When \(t = - 1\), the moth is closest to the flame, while when \(t = 1\), the moth is furthest from the flame. Flames are considered as best solutions to enhance the search around the better solutions. Moths update their positions with respect to flames according to Eqs. (16) and (17).

The position updating in Eq. (17) necessitates the moths to move toward a flame, yet it causes the MFO algorithm to be stuck in local optima rapidly. To avoid this, each moth revises its position utilizing only one of the flames in Eq (17). Another worry here is that the position updating of moths with respect to the number of different flames in the search space may damage the exploitation of the best capable results. To solve this concern, an adaptive mechanism is devised for the number of flames. With the increasing the number of iterations, the number of flames decreases as per Eq. (19).

$${\text{Flame no}} .= N - l * \left( {\frac{N - 1}{T}} \right)$$
(19)

where \(l\) is the current iteration, \(N\) is a maximum number of flames, and \(T\) is the maximum number of iterations. The progressive reduction in the number of flames throughout iterations balances among exploration and exploitation within the search space.

1.13 Adaptive MFO

In stochastic metaheuristics methods, introducing randomization plays a vital role. Authors in Bhesdadiya et al. (2017), Li et al. (2016) and Soliman et al. (2016) presented different variants of MFO using Levy flight and Cauchy operators. With the standard scenario, the MFO updates its agents toward the candidate solution based on Eq. (17). The efficacy of the standard MFO (Mirjalili 2015a) is undeniable, meaning that when assumed adequate computation period, it is sure to converge to the optimum answers ultimately. However, the search process may be sluggish. To improve the convergence rate while upholding the noticeable physiognomies of the MFO, an enhanced searching procedure which is, likewise to the adaptive cuckoo search algorithm (Ong 2014; Kumar et al. 2015) is presented here. Figure 2 shows a flowchart of the adaptive MFO approach.

Fig. 2
figure 2

Flowchart of AMFO

The standard MFO algorithm updates the moth position based on the distance of moth with respect to the flame. Here, we attempt to include the step size based on the best and worst moth position as well as current moth position. The step size determines how far a new moth position is located from the current position. As presented in Eq. (20), step size varies inversely with generation, i.e., with an increase in the iteration, step size reduces. As shown in Eq. (21), the calculated step size is added to the current moth position to obtain a new moth position.

$$X_{i}^{t + 1} = \left( {\frac{1}{t}} \right)^{{\left| {\frac{{\left( {\text{best} \, f(t) - f_{i} (t)} \right)}}{{\text{best} \, f(t) - \text{worst} \, f(t)}}} \right|}}$$
(20)
$${\text{Moth\_pos(}}t{\text{ + 1) = Moth\_pos(}}t ) +p*X_{i}^{t + 1}$$
(21)

In Eq. (21), is a random number between [0, 1] introducing arbitrary component in position update equation. Next subsection presents performance assessment of AMFO on various standard single-objective benchmark functions.

1.14 Results on Benchmark Test Functions

To assess the proposed adaptive moth flame optimization (MFO) algorithm, we carried out the performance study on 14 well-known benchmark functions (Yao et al. 1999). The benchmark functions used are of two types: unimodal and multimodal with flexible dimension. Unimodal functions are those which have only one local minimum, while multimodal ones have multiple local minima. Table 1 presents details of benchmark functions, their mathematical depiction, the range of search and theoretical ideal values.

Table 1 Benchmark functions used

Function F1 is continuous, convex and unimodal having \(n\) global minima except the global one. The second function, i.e., Schwefel’s function 2.22, is a continuous, convex, unimodal, non-differentiable and separable function. Function F3 is Schwefel’s function 1.2, an extension of the axis parallel hyper-ellipsoids. This function is also continuous, convex and unimodal. Function F4 is also continuous, convex, unimodal, non-differentiable and separable function like F2. The fifth function, i.e., Rosenbrock function, is non-convex function. The global minimum is inside a long, narrow parabolic-shaped valley. Step function is the demonstrative of the problem of flat surfaces. Flat surfaces do not guide algorithms about search in favorable directions. Unless the algorithm has variable step size, the algorithm is likely to get stuck at one of the plateaus. Thus, the step function makes the search process more difficult by injecting small plateaus in continuous function. The quartic function, i.e., F7, is continuous, non-convex, multimodal, differentiable and separable function. Schwefel’s function is somewhat easier than Rastrigin’s function and is characterized by a second-best minimum which is far away from the global optimum. In optimization studies, Rastrigin function (F9) is a fairly difficult problem to optimize because of its large search space and large number of local minima. It is a typical example of nonlinear multimodal non-convex problem. The Ackley function (F10) is extensively applied for analysis of optimization algorithms. It has a nearly flat outer region and a large hole at the center. The function presents a threat for optimization algorithms to be trapped in one of its various local minima. The generalized Griewank function (F11) has many widespread regularly distributed local minima. The generalized penalized function is a multimodal non-convex benchmark test function. The fourteenth function, i.e., De Jong (Shekel’s Foxholes) (F14), is multimodal benchmark function with very sharp drops on a primarily even surface. Table 1 presents each benchmark function, their associated variables and applicable limits.

Our primary focus is to augment the basic moth flame search algorithm for improved searchability. Table 2 compares the results of AMFO with MFO. The comparison criteria are the average value, best value, standard deviation and average simulation time. The best results are bold faced. Figure 3 presents the convergence curve of AMFO and MFO for each test function. For almost all test functions, AMFO presents smooth convergence characteristics.

Table 2 Results obtained by AMFO and MFO on standard benchmark test functions
Fig. 3
figure 3figure 3

Convergence curve for benchmark test functions (F1–F14)

Figure 4 presents a comparison between AMFO and MFO for optimizing standard benchmark functions. Average simulation time presents a calculated central value of a set of numbers, while the standard deviation is a measure stating by how much the elements of a group vary from the mean value of a group. Standard deviation is a measure of the distribution of data, while the average value presents the “center of mass” of data. Higher standard deviation represents a higher deviation from the mean value. The algorithm having lower average value may not have lower standard deviation also. In this study, both algorithms are independently compared for average value and standard deviation values, respectively, to assess the overall performance of both the algorithms. It is observable that AMFO provides better results for majority criteria. Thus, to sum up, global searchability of the MFO algorithm is enhanced using an adaptive approach. AMFO provides more efficient outcomes mainly for unimodal and multimodal benchmark functions.

Fig. 4
figure 4

Comparison between AMFO and MFO on standard benchmark functions

1.15 Solving OPF Using the AMFO Algorithm

To test the performance of AMFO on complex and larger dimensional system AMFO along with other contemporary algorithms such as moth flame optimization algorithm (MFO) (Mirjalili 2015a), grey wolf optimization algorithm (GWO) (Mirjalili et al. 2014), Dragonfly algorithm (DA) (Mirjalili 2016), sine–cosine algorithm (SCA) (Mirjalili 2015b), ant lion optimizer (ALO) (Mirjalili 2015c), multi-verse optimizer (MVO) (Mirjalili et al. 2016), Grasshopper optimization algorithm (GOA) (Saremi et al. 2017), ion motion optimization algorithm (IMO) (Javidy et al. 2015) are implemented to solve the OPF problem on standard IEEE 118-bus test system. Total of 13 different objective functions test cases are considered as presented in Table 3. In this work, the population size is selected to be 25, and each algorithm is analyzed for thirty independent runs with 500 iterations per run.

Table 3 Summary of case studies for IEEE 118-bus test systems

1.16 IEEE 118-Bus Test System

As shown in Table 4, the system includes fifty-four thermal units, 118 buses, 177 branches and nine transformers (Fig. 5). Table 4 also presents upper and lower bounds of voltage and transformer tap settings.

Table 4 Characteristics of the IEEE 118-bus test system
Fig. 5
figure 5

Single-line diagram of IEEE 118-bus test system

Table 5 represents cost and emission coefficients of IEEE-118 bus test system. Tables 6 and 7 present cost coefficients considering multifuel and prohibited operating zone.

Table 5 Cost and emission coefficients of IEEE 118-bus test system
Table 6 Cost coefficients for multifuel
Table 7 Power generation boundaries for IEEE 118-bus system

1.17 Cast Studies

As previously mentioned, 13 test cases are considered in this article. These cases are listed in Table 3.

2 Results and Discussion

All algorithms have been applied to the investigated cases, and the optimal results are given in Tables 8, 9 and 10. In these tables, the best results are bold faced while the worst results are bold underlined. A detailed study of each objective function is described in the following subsections.

Table 8 Best value obtained by different algorithms for case 1 to case 13

2.1 Minimization of Quadratic Fuel Cost

The objective function, in this issue, is to optimize the fuel cost as formulated by Eq. (22)

$$f = \left( {\sum\limits_{i = 1}^{NG} {a_{i} P_{Gi}^{2}} + b_{i} P_{Gi} + c_{i} } \right)$$
(22)

where \(a_{i}\), \(b_{i}\) and \(c_{i}\) are the cost coefficients of ith generator. For this case, the AMFO produces the best fuel cost solution as compared to other algorithms, whereas fuel cost obtained by SCA is the highest among the rest of the algorithms. AMFO has smooth and speedy convergence rate as compared to other algorithms as shown in Fig. 6a. Tables 8 and 9 present a comparison of algorithms in terms of the best and average objective function value. For both the cases, AMFO obtains the least value proving its superiority. MFO has least simulation time.

Fig. 6
figure 6

Convergence curve for case 1 and case 2

Table 9 Average value obtained by different algorithms for case 1 to case 13

2.2 Minimization of Quadratic Fuel Cost with Valve-Point Loadings

In this case, valve-point loading is modeled as an absolute sinusoidal function added to the cost characteristics.

$$f = \left( {\sum\limits_{i = 1}^{NG} {a_{i} P_{Gi}^{2} + } b_{i} P_{Gi} + c_{i} } \right) + \left| {d_{i} \sin (e_{i} (P_{Gi}^{\rm {min} } - P_{Gi} ))} \right|\quad \forall i = 1\;{\text{to}}\;NG$$
(23)

where \(a_{i}\), \(b_{i}\), \(c_{i}\), \(d_{i}\) and \(e_{i}\) are the cost coefficients of ith generator. Due to valve-point loading effect, the optimum value of fuel cost increases as shown in Table 8. In this case, AMFO provides the best solution, while SCA provides the worst solution. Concerning simulation speed, IMO outperform the rest of the algorithms. Figure 6b presents the convergence trend of all algorithms.

2.3 Minimization of Quadratic Fuel Cost with Multifuel

From a practical point of view, thermal generating plants may have multifuel sources like coal, natural gas and oil. Hence, the following piecewise quadratic function expresses fuel cost function:

$$f = \sum\limits_{i = 1}^{n} {(a_{ik} P_{i}^{2} + b_{ik} P_{i} + c_{ik} ) + {\text{Penalty}}\;} {\text{if}}\;P_{ik}^{\rm {min} } \le P_{i} \le P_{ik}^{\rm {max} }$$
(24)

where \(a_{ik}\), \(b_{ik}\) and \(c_{ik}\) represent the cost coefficients of the ith generator for fuel type \(k\). The optimal cost obtained by AMFO among all algorithms for this case is 64,970.59 $/h, while SCA provides the worst solution. Minimum average simulation time and the standard deviation are offered by AMFO and GWO, respectively, while maximum average simulation time and the standard deviation are provided by GOA and DA, respectively. Figure 7a presents convergence characteristics for optimum fuel cost value with multifuel. It is evident that AMFO approaches final solution smoothly, while SCA highlights maximum tendency of stagnation throughout iterations.

Fig. 7
figure 7

Convergence curve for case 3 and case 4

2.4 Minimization of Quadratic Fuel Cost with the Prohibited Operating Zone (POZ)

In practical systems, the entire unit operating range is not forever accessible for operation. Some of the online units may have prohibited operating zones due to physical operating limitations. Units can have prohibited zones due to intensified vibrations in a shaft bearing in an operating region, faults in the machines themselves or the associated auxiliaries, such as boilers, feed pumps. The use of units in these regions leads to volatilities, leaving them incapable of holding any load for any considerable time. Hence, the avoidance of operation in these zones will improve the economic condition and performance.

The POZ is accounted for by the insertion of penalty to decrease the fitness of the fuel cost function. As presented in Table 8, AMFO provides the best solution as compared to the rest of the algorithms with smooth convergence characteristics, whereas fuel cost obtained by SCA is worst among all algorithms with stagnant convergence characteristics.

2.5 Minimization of Fuel Cost with Combined Valve-Point Effect and Multifuel

This case is a combination of case 2 and case 3. In this case, best-optimized fuel cost value obtained is 65,241.5878 $/h which is higher than 64,636.9307 $/h due to the introduction of valve-point loading effect. This case presents a combination of non-sinusoidal objective function superimposed on a piecewise quadratic fuel cost function. Figure 8a shows a convergence trend for this case. It is observable that AMFO converges to its final solution smoothly contrary to SCA which follows stepwise convergence behavior.

Fig. 8
figure 8

Convergence curve for case 5 and case 6

2.6 Minimization of the Quadratic Fuel Cost Function with Prohibited Operating Zone and Valve-Point Loading Effect

In this case, the objective function is a mixture of cases 2 and 4 resulting in non-convex and nonlinear objective function. For such a complex objective function, AMFO provides the best solution among all algorithms, while SCA provides the worst solution. Figure 8b illustrates that AMFO reaches the best solution smoothly, while the convergence curve of SCA presents the poor search of solution space.

2.7 Minimization of Fuel Cost Considering Prohibited Operating Zone and Multifuel

Combining case 3 and 4 results in this case, i.e., optimal power flow with a disjoint and piecewise quadratic fuel cost function. Tables 8 and 9 present the best values and average values. For both values, AMFO and SCA provide the best and worst results, respectively. As presented in Table 10, GWO optimizes the objective function in minimum simulation time. Figure 8a presents the convergence curve of all the algorithms. AMFO and MFO present smooth convergence, while SCA presents poor convergence characteristics.

Table 10 Average simulation time for case 1 to case 13

2.8 Minimization of Fuel Cost Combining Valve-Point Loading Effect, Prohibited Operating Zone and Multifuel

Combining cases 2, 3 and 4 results in this case, i.e., optimal power flow with a nonlinear, discontinuous, disjoint and piecewise quadratic fuel cost function. Observing Table 8 suggests that MFO provides the optimum fuel cost closely followed by AMFO as compared to the rest of the algorithms, while SCA provides the worst solution. GWO and AMFO prove to be best contenders regarding standard deviation and average simulation speed, while GOA and DA stand last regarding simulation speed and standard deviation, respectively. Figure 9b highlights the convergence trend of all algorithms for this case. It reflects that MFO and AMFO present smooth convergence trend, while SCA and MVO highlight stepwise convergence.

Fig. 9
figure 9

Convergence curve for case 7 and case 8

2.9 Minimization of Emission

In the present case, the objective is to lessen the emission level of pollutants. The objective function can be written as:

$$f = \sum\limits_{i = 1}^{NG} {\gamma_{i} P_{Gi}^{2} + \beta_{i} P_{Gi} + \alpha_{i} + \zeta_{i} e^{{(\lambda_{i} P_{Gi} )}} {\text{ (ton/h)}}}$$
(25)

where \(\gamma_{\text{i}}\), \(\beta_{\text{i}}\), \(\alpha_{\text{i}}\), \(\varsigma_{\text{i}}\) and \(\lambda_{\text{i}}\) are the emission coefficients of ith unit. In this case, AMFO provides the best solution of emission, i.e., 6.7791 ton/h. SCA provides the highest emission value of 8.7803 ton/h. GWO and GOA are the top and worst performers in terms of average simulation time. GOA presented the worst performance in terms of simulation speed. Figure 10a shows the sketch of convergence behavior of all the algorithms.

Fig. 10
figure 10

Convergence curve for case 9 and case 10

2.10 Voltage Stability Enhancement

The voltage stability is an essential index for verification of power system ability to preserve the voltage continually at each power system bus within a suitable level under nominal operating conditions. A disturbance, any change in system configuration, and a rise in load demand are the main reasons for the voltage instability state in the power system, which may lead to a progressive reduction in voltage. Therefore, the minimization of voltage stability indicator, called L-index (Kessel and Glavitsch 1986), is a significant objective function for power system planning and operation. The degree of voltage collapse of jth bus can be expressed, based on local indicators \(L_{j}\) as follows:

$$L_{j} = \left| {1 - \sum\limits_{i = 1}^{NG} {F_{ji} \frac{{V_{i} }}{{V_{j} }}} } \right|\quad \forall j = 1,2, \ldots NL$$
(26)

From Table 8, AMFO, MFO, GWO, MVO and GOA achieve the best solution, while SCA provides the worst solution. IMO optimizes in minimum average simulation time, while AMFO and GWO attain best average function values. Figure 10b presents the convergence trend of all the algorithms. Most of the algorithms reach final solution quite smoothly and speedily.

2.11 Voltage Deviation Minimization

It is necessary to continuously retain load bus voltages inside stipulated deviation boundaries typically within ± 5% of the nominal value. In this case, control variables are adjusted to curtail voltage deviation. Voltage deviation can be described as:

$$f = \sum\limits_{i = 1}^{NG} {|V_{i} - 1.0|}$$
(27)

From Table 8, MFO achieves the best solution closely followed by AMFO, while SCA provides the worst solution of voltage deviation minimization. ALO and MFO provide minimum average value and simulation time, respectively. Figure 11a presents convergence trend of all the algorithms suggesting that MVO, GWO and SCA have flat convergence profile for a maximum number of iterations, whereas AMFO, IMO and MFO reach the optimized value quite smoothly.

Fig. 11
figure 11

Convergence curve for case 11 and case 12

2.12 Active Power Loss Minimization

In this case, the goal is to reduce the power losses, which can be indicated as follows:

$$f = \sum\limits_{i = 1}^{NB} {P_{i} = } \sum\limits_{i = 1}^{NB} {P_{Gi} } - \sum\limits_{i = 1}^{NB} {P_{Di} }$$
(28)

Analyzing results obtained, it is found that AMFO performs the best regarding the best solution and average solution, while SCA provides the worst solutions. GWO and GOA are the fastest and slowest algorithms, respectively. Figure 11b presents that SCA fails to find global optimum due to flat convergence profile. AMFO, MFO, IMO and GOA present the continuous variation in objective function values throughout the iterations.

2.13 Minimization of Reactive Power Losses

Transportation of real power from the source to sink depends upon the availability of reactive power support. Voltage stability margin also hinges on reactive power support or accessibility. Based on the idea, the reactive power losses are reduced employing the following equation:

$$f = \sum\limits_{i = 1}^{NB} {Q_{i} = } \sum\limits_{i = 1}^{NB} {Q_{Gi}} - \sum\limits_{i = 1}^{NB} {Q_{Di} }$$
(29)

It is noticeable that reactive power losses are negative. As derived from Table 8, AMFO achieves the best solution, while SCA lands into the worst solution. GWO and GOA provide the lowest and highest simulation time. Figure 12 presents a convergence trend of all the algorithms. AMFO exhibits smooth convergence, while SCA, GWO and MVO present partially stagnant characteristics.

Fig. 12
figure 12

Convergence curve for case 13

2.14 Robustness Test

To assess the performance of an optimization algorithm, most of the approaches focus only on best values achieved for each case to voice their verdicts. This approach is not correct considering the stochastic nature of algorithms. In this article, the evaluation of the algorithm is based on ranking achieved by the Friedman test, Quade test and Friedman aligned test to detect whether any significant statistical differences occur. Moreover, these methods rank the algorithms from the best in performance to the poorest one.

The Friedman test (Friedman 1937) aims to decide whether there are noteworthy variances between the algorithms considered over given sets of information. The test determines the positions of the algorithms for each discrete data set, i.e., the best performing algorithm is ranked 1, the second best 2, etc.; in the case of ties, average rank is assigned. This test equates the average ranks of algorithms, and the null hypothesis asserts that all the algorithms perform equally, and hence, ranks of all algorithms should be equal.

Friedman rank test permits only intra-set comparisons. Therefore, this may become a drawback when the number of algorithms for comparison is small, as inter-set correlations may not be meaningful. In Friedman aligned test (Friedman 1940), a value of location is calculated as the average performance attained by all metaheuristics in each problem. Then, the alteration amid the performance achieved by an algorithm and the value of location is acquired. This step is replicated for each blend of metaheuristics and problems.

The Quade test (Quade 1979) in contrast to Friedman’s test (Friedman test assumes that all problems are equally hard) takes into consideration the datum that a few problems are harder or that the changes recorded on the run of numerous algorithms over them are higher. Moreover, the ranking calculated for each problem relies on the changes noted in the algorithms’ behavior.

All three statistical tests are done for each objective function, and the average rank for a given test system is found. Algorithms are positioned according to their average ranking from lowest to highest. Table 11 compares different algorithms based on various statistical tests. It is visible that AMFO stands first in all statistical analyses as well demonstrating its effectiveness to solve the OPF problem.

Table 11 Comparison of various algorithms based on a statistical test on the IEEE 118-bus test system

3 Conclusion

As a first contribution, an enhanced version of basic MFO, i.e., adaptive MFO, is proposed. The suggested method is employed on thirteen different benchmark functions. Performance of AMFO is equated with MFO for different attributes on these single-objective benchmark functions. As discussed, for majority attributes AMFO performed better than MFO. After validating the performance of AMFO on benchmark functions, nine different algorithms including AMFO are implemented to optimize the OPF problem. To generalize the assessment of the performance of all the algorithms, thirteen different test cases are optimized having complex and practical restraints. Evaluation is done established on the best solution, average simulation time and average solution. It can be inferred that AMFO, MFO, GWO and MVO perform well as compared to the remaining algorithms on most attributes. To validate the results, three statistical checks are performed on results obtained by each algorithm. We can conclude from the results of statistical tests that AMFO performs the best irrespective of the complexity of the objective function.

As a future work, enhanced variants of MFO and other contemporary algorithms can be proposed and applied to solve complex real-world problems. Moreover, design, development and application of multi-objective versions of enhanced algorithms can also be a promising field.