Hybridizing of Whale and Moth-Flame Optimization Algorithms to Solve Diverse Scales of Optimal Power Flow Problem

: The optimal power ﬂow (OPF) is a practical problem in a power system with complex characteristics such as a large number of control parameters and also multi-modal and non-convex objective functions with inequality and nonlinear constraints. Thus, tackling the OPF problem is becoming a major priority for power engineers and researchers. Many metaheuristic algorithms with different search strategies have been developed to solve the OPF problem. Although, the majority of them suffer from stagnation, premature convergence, and local optima trapping during the optimization process, which results in producing low solution qualities, especially for real-world problems. This study is devoted to proposing an effective hybridizing of whale optimization algorithm (WOA) and a modiﬁed moth-ﬂame optimization algorithm (MFO) named WMFO to solve the OPF problem. In the proposed WMFO, the WOA and the modiﬁed MFO cooperate to effectively discover the promising areas and provide high-quality solutions. A randomized boundary handling is used to return the solutions that have violated the permissible boundaries of search space. Moreover, a greedy selection operator is deﬁned to assess the acceptance criteria of new solutions. Ultimately, the performance of the WMFO is scrutinized on single and multi-objective cases of different OPF problems including standard IEEE 14-bus, IEEE 30-bus, IEEE 39-bus, IEEE 57-bus, and IEEE118-bus test systems. The obtained results corroborate that the proposed algorithm outperforms the contender algorithms for solving the OPF problem. the The impact analysis on convergence curves shows that the WMFO explores the search space in the first itera- tions, then it keeps improving the quality of the solution in the course of iterations. This convergence behavior reveals that the WMFO inherits the exploitation of the WOA, while it takes advantage of the explorative movements of the modified MFO. The effectiveness and scalability of the proposed algorithm in solving the OPF problem have been assessed and investigated on the IEEE 14-bus, 30-bus, 39-bus, 57-bus, and 118-bus test systems to optimize the OPF’s single and multi-objective functions within the limits of the system. The obtained results are then compared against five well-known metaheuristic algorithms and two improved variations of the MFO to validate the results. The comparison of results reveals that the proposed WMFO outperforms competitor algorithms in solving single and multi-objective problems in various power system scale sizes by reducing the total cost 38.26% more than the average of the total cost gained by the competitor algorithms. The maximum amount of cost reduction compared to the average value of contender al- gorithms is 14,820.55 ($/h) gained by the WMFO on the IEEE 118-bus test system Case 1. Furthermore, the average amount of reduced cost gained by the WMFO on ten different OPF problems equals 33,722.24 ($/h) or 295 million dollars a year, which shows the eco- nomic viability of the proposed method in solving the OPF problem. In future research, WMFO can be employed to solve various problems in power systems such as FACTS de- vices and electrical load forecasting. Author


Introduction
The most fundamental component of a power system is the ability to provide power demand at the lowest possible operational cost while adhering to various technological, economic, and certain system constraints [1]. The optimal power flow (OPF) plays a vital role as an important tool to discover the optimal decision variables of a power network to minimize intended objectives. Since the introduction of the OPF problem by Carpintier in 1962 [2], many researchers proposed various approaches including quadratic programming [3], nonlinear programming [4], interior point [5], and Newton algorithm [6,7] to solve this nonlinear and non-convex problem. However, these traditional approaches cannot provide competitive results in the case of multi-objective nonlinear functions as they mostly sink into the local optimum. Hence, designing optimizers with effective search

•
Proposing an effective hybridizing of WOA with a modified MFO to solve OPF problems with diverse power system scale sizes. • Proposing a population partitioning mechanism to divide a population between search strategies. • Introducing a modification of the canonical MFO using a self-memory mechanism to preserve the best so far experience. • Applying a randomized boundary handling method to return the solutions that have violated the permissible boundaries. • Applying a greedy selection operator to assess the acceptance criteria of new solutions.

•
The experiments' results prove that the WMFO provides the best results in solving different scales of standard IEEE test systems compared to competitor algorithms.
The paper is organized as follows. A literature overview of the related works is included in Section 2. The formulation and objective functions of the OPF problem are presented in Section 3. The moth-flame and whale optimization algorithms are presented in Section 4. The proposed WMFO algorithm is comprehensively presented in Section 5. A rigorous evaluation of the effectiveness of the WMFO on the OPF problem is provided in Section 6. Statistical analysis is presented in Section 7. Ultimately, Section 8 summarizes the conclusions and suggests future works.

Related Works
The optimal power flow (OPF) problem is formulated as a complex nonlinear nonconvex constrained optimization problem with different objectives and a variety of IEEE bus test systems [78]. Many traditional methods, such as quadratic programming [79], linear and nonlinear programming [4,80], and Newton algorithm [6] have been applied to solve the OPF problem. Although, these methods are not suitable for solving practical systems due to the characteristics of nonlinear functions such as value-point effect and prohibited operating zones. Moreover, increasing the number of system buses intensifies the mentioned complexities and leads the algorithm toward sinking in local minimum solutions [81,82].
Sivasubramani et al. [100] proposed a multi-objective harmony search (MOHS) algorithm to solve the OPF problem. To identify the Pareto optimum front, the MOHS algorithm uses a rapid elitist non-dominated sorting and crowding distance. Then, a fuzzy-based mechanism is performed for selecting a compromise solution from the Pareto set. Improved Electronics 2022, 11, 831 4 of 35 particle swarm optimization (IPSO) [101] proposed a pseudo-gradient and the constriction factor to direct the particle's velocity. The purpose of the pseudo-gradient is to identify the particle's orientation so that they may swiftly converge to the best solution. Sinsuphan et al. [102] presented the improved harmony search method (IHS) by proposing a modification of the pitch adjustment rate to solve OPF problems with five standard IEEE test systems including 6-bus, 14-bus, 30-bus, 57-bus, and 118-bus. A hybrid algorithm based on a modified imperialistic competitive algorithm and teaching-learning algorithm named MICA-TLA [103] is proposed for solving the OPF problem. The results of the simulation were tested on the IEEE 30-bus and IEEE 57-bus test systems with various objective functions. In another study, Ghasemi et al. [78] introduced three modified techniques of the imperialistic competitive algorithm (ICA) based on three new actions that may occur to any colony for solving the OPF problem. The introduced techniques were justified in different cases of the IEEE 57-bus test system. Radosavljevic et al. [104] proposed a hybridization of particle swarm optimization and gravitational search algorithms (PSOGSA) to find a proper solution in power systems. The PSOGSA takes advantage of the social thinking of the PSO and the local search ability of the GSA.
An improved artificial bee colony (IABC) [105] optimizer is developed by orthogonal learning (OL) to empower the exploitation ability of the canonical ABC in solving the OPF problem. Fatima Daqaq et al. [106] brought up a multi-objective backtracking search algorithm (MOBSA) to solve the OPF problem. The MOBSA can solve the highly constrained objectives and find the best solution from all Pareto optimal solution set using a fuzzy membership technique integrated into the BSA algorithm. Li et al. [107] proposed a boosted adaptive differential evolution (JADE) with a self-adaptive penalty constraint management approach (EJADE-SP) to find the best solution to the OPF issue. The EJADE-SP algorithm used the crossover rate sorting mechanism to let individuals inherit more good genes, and re-randomizing parameters to sustain the population diversity and the effectiveness of the search. Furthermore, to speed up convergence, the EJADE-SP employs a dynamic population reduction method and a self-adaptive penalty constraint management technique to cope with various constraints. Nadimi et al. [108] brought up the improved grey wolf optimizer (I-GWO) using dimension learning-based hunting (DLH) search strategy. The DLH strategy maintains the diversity and equilibriums between local and global searches by constructing a neighborhood for each wolf. In [109], the slime mold algorithm (SMA) is used to solve the multi-objective OPF. The SMA mimics the oscillation mode of slime mold in nature and utilizes adaptive weights to mimic the process of providing positive and negative feedback in slime mold propagation waves.
Meng et al. [110] introduced a crisscross search-based grey wolf optimizer (CS-GWO) to solve IEEE test systems including 30-bus and 118-bus. The CS-GWO algorithm improved the hunting operation in GWO by incorporating a greedy operator and the horizontal crossover operator was then used to refine the positions of the top three wolves. Moreover, to preserve population variety and prevent premature convergence, the vertical crossover operator is used. Abd el-Sattar et al. [111] proposed an improved salp swarm algorithm (ISSA) for improving the movement strategies in canonical SSA to solve different OPF problems including 30, 57, and 118-bus test systems. ISSA utilizes a random mutation strategy to improve the exploration process and an adaptive process to enhance the exploitation process. In [112], a boosted whale optimization algorithm named EWOA-OPF is developed to boost the global search capability of the WOA in solving the OPF problem by employing Levy motion in the encircling phase and utilizing Brownian motion to work with a canonical bubble-net attack. Kahraman et al. [113] proposed an effective method by introducing a crowding distance-based Pareto archiving strategy to solve the multi-objective OPF problem. Akdag et al. [98] introduced the improved Archimedes optimization algorithm (IAOA) using the dimension learning-based strategy to build a neighborhood and spread the information flow between search agents.

Optimal Power Flow Problem
The optimal power flow (OPF) is considered a strategic instrument for designing and operating of power networks. The primary objective of OPF is to minimize a predefined objective function, such as the active power generation cost while satisfying the inequality and equality requirements of the system within the specified limitations. The OPF issue is shown mathematically in the following.

OPF Problem Formulation
The OPF is a non-convex and nonlinear problem that can be represented mathematically as follows: MinF(x, u) where u is a vector that represents the independent (control) variables, F is the objective function to be optimized, x is the vector of dependent (state) variables, g and h are the equality and inequality constraints, m and j indicate the number of equality constraints and the number of inequality constraints, respectively. Moreover, the state variables of OPF represented in Equation (2) consist of slack bus power P G1 , load bus voltage V L , transmission line loading S l , and generator reactive power output Q G , where NL indicates the number of load buses, NTL and NG are the number of transmission lines and generators, respectively. The control variables represented in Equation (3) are the independent variables including generator active power outputs P G (except at the slack bus P G1 ), generator voltages V G , transformer tap settings T, and shunt VAR compensations Q C . NT indicates the number of the regulating transformer and NC denotes the number of VAR compensator units.

Constraints
The OPF problem has equality and inequality constraints that are handled during the optimization process. The representations of both constraints are expressed as follows.

Equality Constraints
The balance between active and reactive power flow is maintained by the equality constraints consisting of a set of nonlinear power flow formulations represented in Equations (4) and (5).
where NB denotes the number of buses, P Gi and P Di are the generator active power and demand active power. Q Gi and Q Di are the generator reactive power and demand reactive power. B ij and G ij represent susceptance and conductance. Moreover, δ ij represents the phase difference of voltages between bus i and bus j.

Inequality Constraints
The inequality constraints which are the operating limits for OPF problem limited by the lower and upper bounds are represented as follows: • Transformer tap setting constraints • Shunt VAR compensator constraints • Line power flow constraints

Inequality Constraints Handling
Although the control variables are constrained by themselves, the dependent variables' inequality constraints including Sl, V L , P G1 , and Q G are appended to the objective function as a quadratic penalty term to maintain the dependent variables in their acceptable limits and to reject any impracticable solution. The expanded objective function may be represented mathematically as follows [114]: (12) where λ V , λ P , λ S , and λ Q are the penalty factors. The initially specified factors are 10 6 for both load bus voltage (λ V ) and power generation output at the slack bus (λ P ), 10 3 for line loading (λ S ), and 10 4 for generator reactive power (λ Q ). In this paper, the limit of the variable x is denoted by the symbol x lim , which can be defined using Equation (13), where r is a random number in the intervals 0 and 1.

OPF Objective Functions
In this work, two objectives are investigated to address the OPF problem: an economic problem, which refers to the reduction of overall fuel costs in power production, and a practical challenge of minimizing the voltage deviation.

Case 1: Minimization of Total Fuel Cost
Total fuel cost is formulated as a minimization problem with the single-objective function. The quadratic function approximates the relationship between fuel expense ($/h) and produced electricity (MW), based on Equation (14), where f 1 refers to the total cost of Electronics 2022, 11, 831 7 of 35 generation ($/h). a i , b i , and c i are the cost coefficients of the i-th generator. All load buses are confined to 0.95 to 1.05 p.u. voltage range 3.3.2. Case 2: Total Fuel Cost and Voltage Deviation Minimization The goal of this objective function is to minimize both the cost of fuel and the voltage deviation simultaneously. This objective function's mathematical expression is as follows: where W v = 200 represents the weighting factor. To effectively address the multi-objective issue, Equation (15) is a single equation that incorporates two weighted objectives.

Preliminaries
This section presents the concepts and mathematical models of moth-flame optimization and whale optimization algorithm in detail.

Moth-Flame Optimization (MFO)
The MFO is a prominent algorithm that mimics the spiral motion of moths around light sources at night. This behavior comes from a navigation mechanism called transverse orientation which helps moths to fly a long distance in a straight path by preserving a constant angular relationship with the moon. For far light sources like the moon, the transverse orientation plays a navigation role for moths. However, when it comes to relatively closer artificial light sources, the transverse orientation causes the moths to follow a deadly spiral path around the light source. The MFO algorithm is a simulation of this behavior of moths facing artificial lights. Hence, moths and flames are two fundamental concepts used in the MFO algorithm. In this algorithm, the moths are the main search agents which can be represented by matrix M(t) as follows.
where m id is the value of d-dimension of i-th moth, N indicates the total number of moths that explore the D-dimensional search space in each iteration. Additionally, it is expected that there is a vector containing the corresponding fitness of each moth, as shown below.
As mentioned earlier, flames are the second basic concept of the MFO algorithm, which leads the moths toward promising areas discovered in the previous iterations. Theoretically, the moths fly around their corresponding flames in a spiral path, which can be formulated in Equation (18), where M i (t) represents the position of i-th moth in iteration t, the D i denotes the linear distance between M i and its corresponding flame (F c ) which is formulated in Equation (19), b indicates the logarithmic helix shape constant defined spiral, k is a random value in [−1, 1], and F j is the j-th flame's position. Considering a unique flame for each moth ensures that the algorithm does not sink into the local optimum during the early iterations. Whereas the algorithm converges toward the promising zones by decreasing the number of flames using Equation (20), where t denotes the current iterations, N represents the total number of population and MaxIt determines the maximum number of iterations. Hence, in this algorithm j equals to Flam Num .

Whale Optimization Algorithm (WOA)
The humpback whales' hunting behavior in nature is mathematically modeled in the WOA [67]. Humpback whales are mainly considered to be predators that surround and capture their prey using the bubble-net hunting strategy. In this algorithm, the best position discovered so far is designated as the prey position X* that guides other search agents toward a promising area during the exploitation phase. Encircling prey, spiral bubble-net attacking to enhance local search, and searching for prey to enhance global search are the three techniques of whales that are formulated in the WOA algorithm based on the following definitions [115].
Encircling prey: Humpback whales can detect and surround the position of prey. The WOA considers the current best whale X* is close to the target prey since it is impossible to determine the location of the global optimum solution a priori. In the next phase, the positions of other whales are changed toward the X* based on Equations (21) and (22), where, Dis (X*, X i ) specifies the distance between the prey and the i-th whale in the current iteration, A and C indicate coefficient values computed based on Equations (23) and (24).
where a decreases from 2 to 0 throughout the iterations using Equation (25). Moreover, r generates a random value in the intervals 0 and 1.
Bubble-net attacking: A mathematical model of humpback whale bubble-net strategy (exploitation) has been developed using two methodologies named shrinking encircling mechanism and spiral updating position which are formulated in Equation (26), where p denotes a random value generated in [0, 1]. If the value of p is found to be smaller than 0.5, the position of X i changes using a shrinking encircling mechanism. On the other hand, a spiral updating technique is used if the value of p is found to be greater than or equal to 0.5. A denotes a random variable generated in [−a, a], where a decreases from 2 to 0 throughout the iterations. Dis (X*, X i ) denotes the distance of i-th search agent and the prey in the spiral updating position, b denotes a constant value, and l denotes a random value in the range [−1, 1]. Searching for prey: To emphasize the exploration ability of the algorithm (when |A| ≥ 1), a whale's location is updated using Equation (27), in which a random whale is chosen rather than the best whale discovered so far.
where, X r (t) represents the position of a randomly chosen whale in the current iteration and Dis (X r , X i ) indicates the distance between i-th whale and X r .

Proposed Algorithm
The ability to strike a balance between exploitation and exploration abilities is a crucial feature for any SI algorithm. As discussed earlier, the concept of the flame introduced in the MFO algorithm is regarded as an effective approach for maintaining the balance between exploration and exploitation by linearly decreasing the number of flames throughout the iterations. However, MFO inherently suffers from inefficient exploitation ability which results in stagnating in far from promising areas or premature convergence into local optima. On the other hand, the experimental results [116] reveal that the WOA benefits from efficient exploitation ability, while its exploration and the balance between search strategies are not sufficient to handle complex real-world problems, especially in the OPF problem. Therefore, this study is devoted to proposing a hybridization of whale and moth-flame optimization (WMFO) to effectively solve the OPF problem. The proposed WMFO introduces a population partitioning mechanism, movement strategies, randomized boundary handling, and a greedy selection operator. In the first iteration, the matrix X ND (t) is initiated using Equation (28), where x id is the value of d-dimension, rand d is a random number between intervals 0 and 1, and ub d and lb d are the upper bound and lower bound for d-dimension. For the rest of the iterations, the matrix X ND (t) is updated using movement search strategies in the proposed WMFO algorithm. Algorithm 1 presents the WMFO pseudo-code. Constructing two subpopulations Pop MFO and Pop WOA using Definition 1.
Constricting the matrix flames by ascending ordered the fitness values. 10.
Updating F(t) and OF(t) by the sorted search agents from matrices F(t) and X(t). 12.
If i ∈ Pop MFO then 15.
Updating the new position of X i (t + 1) using Equations (30).
Updating the new position of X i (t + 1) using Equation (22).
Computing the fitness values, and updating Xbest i based on Definition 2.
Updating the global best solution. 39.

40.
End while WOA movement strategies: The WMFO employs the canonical WOA's movement strategies to update the positions of subpopulation Pop WOA using Equation (29), where X i (t + 1) represents the next position of i-th search agent and i ∈ Pop WOA .
Encircling prey defined in Equation (12) p i <||A|< 1 Search for prey defined in Equation (17) p i <||A|≥ 1 Bubble-net attacking defined in Equation (16) Modified MFO movement strategy: The proposed WMFO evolves the subpopulation Pop MFO using Equation (30), where b is the constant value, k is a random value between intervals [−1, 1], and F j denotes the j-th flame such that index j is computed using Equation (20). δ i (t) is computed using Equation (31), where Xbest i is the position of the self-memory mechanism defined using Definition 2.
Definition 2 (Self-Memory mechanism). Let SM = {SM 1 . . . SM i . . . SM N } is a finite set of N search agents' memories. The SM i is denoted by SM i = (Xbest i , Fbest i ), where Xbest i represents the best position of X i so far acquired, and Fbest i denotes the fitness of Xbest i . In the first iteration, Xbest i (t = 1) ← X i (t = 1) and Fbest i (t = 1) ← OX i (t = 1). For the remaining iterations (t > 1), X i and Fbest i are updated based on the best so far solution obtained by each X i .
Randomized boundary handling: The canonical MFO and WOA use a simple mechanism for boundary limiting which assigns a value equal to its corresponding lower bound (lb d ) if the d-th dimension of a search agent is less than the value of lb d . Conversely, a value equal to the corresponding upper bound (ub d ) is given to the d-th dimension of a search agent if it is found to be greater than ub d . Although this boundary limiting method works efficiently for linear and convex problems, it leads the algorithm toward stagnation in the case of multi-objective nonlinear functions such as the OPF problem. Hence, to avoid stagnation, a randomized-based variable boundary limiting is introduced in the proposed WMFO based on Equation (32), where x id denotes the value of d-th dimension of i-th search agent, and r is a random value between intervals 0 and 1.
Greedy selection operator: WMFO employs the selection operator to evaluate the acceptance criteria of new solutions by comparing the fitness of new solutions OX(t + 1) with the fitness of previous population OX(t) using Equation (33).

Experimental Evaluation
In this section, first, a sensitivity analysis is conducted on the modified MFO, WOA, and the proposed WMFO to investigate the exploration and exploitation abilities. Then, the numerical efficiency of the proposed WMFO is scrutinized using simulation studies carried out on two scenarios based on five IEEE bus test systems consisting of IEEE 14-bus, IEEE 30-bus, IEEE 39-bus, IEEE 57-bus, and IEEE 118-bus test systems, where MATPOWER [117] is used for load flow calculation. The acquired results are then compared with five wellknown metaheuristic algorithms including particle swarm optimization (PSO) [46], grey wolf optimizer (GWO) [49], moth-flame optimization (MFO) [52], whale optimization algorithm (WOA) [67], chimp optimization algorithm (ChOA) [50], and two enhanced variants of MFO, Levy-flight moth-flame optimization (LMFO) [76], and synthesis of MFO with sine cosine mechanisms (SMFO) [77]. The parameters of the competitor algorithms were set the same as the recommended settings in their works, which are reported in Table 1.
The proposed WMFO and other comparative algorithms were run 20 times separately on Intel Core i7 (2.60 GHz) and 24 GB of RAM using MATLAB R2020 to ensure that all comparisons are fair. The maximum number of iterations (MaxIt) and population size were set to (D × 10 4 )/N for the sensitivity analysis tests, where D and N are dimensions of the problem and 100, respectively. For the IEEE bus test systems, the MaxIt and N are set to 200 and 50, respectively. The best values of control variables (DVs) and objective variables are tabulated in Tables 2-11, Tables A1 and A2.

Impact Analysis of Hybridizing WOA and Modified MFO
The exploration and exploitation abilities of the WOA, modified MFO, WMFO are investigated on several test functions selected from the CEC 2018 benchmark suite [118]. The first function F 1 is a unimodal function, which can be employed to assess the exploitation ability of the algorithms. The test function F 9 is a multimodal function with many local optima, that is employed to investigate the exploration ability. Test functions 12, 14, and 19 are hybrid and 22, 25, 28, and 30 are composition functions that are suitable for evaluating the algorithms' ability to prevent local optima and to strike balance between exploration and exploitation. The plotted convergence of these functions is presented in Figure 1. exploration and exploitation. The plotted convergence of these functions is presented in Figure 1.
Analyzing convergence behavior of the test function F1 shows that the convergence trend of the modified MFO is hampered by local optimum after the initial iterations, while the WOA maintained its descent slope till the half of iterations, which shows its better exploitation ability compared to the modified MFO. On the contrary, the proposed WMFO converges toward the global solution by effectively exploiting the search space in the early iterations. The test function F9 shows that the modified MFO has better exploration than the WOA, and the proposed hybridization of WOA and modified MFO achieves superior results by effectively exploring the search space. The convergence behavior of hybrid and composition functions reveals that although WOA and modified MFO cannot maintain the balance between their search strategies, the proposed hybridization of them maintains the balance between exploitation and exploration and bypasses the local optimum effectively.

IEEE Bus Test Systems
The IEEE 14-bus, IEEE 30-bus, IEEE 39-bus, IEEE 57-bus, and the IEEE 118-bus test systems are employed to test the simulation effect of the WMFO for solving the OPF prob- Analyzing convergence behavior of the test function F 1 shows that the convergence trend of the modified MFO is hampered by local optimum after the initial iterations, while the WOA maintained its descent slope till the half of iterations, which shows its better exploitation ability compared to the modified MFO. On the contrary, the proposed WMFO converges toward the global solution by effectively exploiting the search space in the early iterations. The test function F 9 shows that the modified MFO has better exploration than the WOA, and the proposed hybridization of WOA and modified MFO achieves superior results by effectively exploring the search space. The convergence behavior of hybrid and composition functions reveals that although WOA and modified MFO cannot maintain the balance between their search strategies, the proposed hybridization of them maintains the balance between exploitation and exploration and bypasses the local optimum effectively.

IEEE Bus Test Systems
The IEEE 14-bus, IEEE 30-bus, IEEE 39-bus, IEEE 57-bus, and the IEEE 118-bus test systems are employed to test the simulation effect of the WMFO for solving the OPF problem in two different Cases of single and multi-objective.

IEEE 14-Bus Test System
The IEEE 14-bus test system is regarded as the first test system for evaluating the performance of the WMFO. Figure 2 illustrates the IEEE 14-bus test system, which consists of five generator buses, three transformers, nine load buses, and 20 transmission lines. The bus data, limitations, and cost coefficients are presented in [119]. The transformer tap's minimum and maximum boundaries are set to 0.9 and 1.1 p.u. The lower and upper limit voltages for all generator buses have been set at 0.94 and 1.06 p.u.  To establish an effective comparison, Tables 2 and 3 present the detailed outcomes of the objective functions, transmission losses, and active and reactive power outputs of generators for both Cases 1 and 2. Moreover, Figure 3 illustrates the convergence behavior of the obtained fitness of the algorithms over the course of iterations on the IEEE 14-bus standard test system. As illustrated in Table 2, in terms of overall cost, both MFO and WMFO provide superior outcomes than other algorithms. For Case 2, Table 3 shows that the WMFO's results are superior to those of other algorithms.  To establish an effective comparison, Tables 2 and 3 present the detailed outcomes of the objective functions, transmission losses, and active and reactive power outputs of generators for both Cases 1 and 2. Moreover, Figure 3 illustrates the convergence behavior of the obtained fitness of the algorithms over the course of iterations on the IEEE 14-bus standard test system. As illustrated in Table 2, in terms of overall cost, both MFO and WMFO provide superior outcomes than other algorithms. For Case 2, Table 3 shows that the WMFO's results are superior to those of other algorithms.         12-11, 12-13, 6-31, 10-32, 19-33, 20-34, 22-35, 23-36, 25-37, 2-30, 29-38, and 19-20, as shown in Figure 6. The bus data, branch data, and cost coefficients are taken from MATPOWER [117]. For all generator buses, the lower and upper limit voltages are considered to be 1.06 and 0.94. The minimum and maximum limits of the transformer tap are adjusted to 0.9 and 1.1 p.u. The tabulated results in Tables 6  and 7

IEEE 57-Bus Test System
The IEEE 57-bus test system is depicted in Figure 8, and it has seven generators at the buses 1, 2, 3, 6,8,9,12 Tables 8 and 9 indicate that the best fuel cost values gained using the proposed WMFO are 39,359.123 ($/h) for Case 1 and 41,811.734 ($/h) for Case 2, which are significantly lower than the best fuel cost results obtained by comparative algorithms. The convergence traits of the best fuel cost acquired by the algorithms for this test system are illustrated in Figure 9.

IEEE 57-Bus Test System
The IEEE 57-bus test system is depicted in Figure 8, and it has seven generators at the buses 1, 2, 3, 6,8,9,12 Tables 8 and 9 indicate that the best fuel cost values gained using the proposed WMFO are 39,359.123 ($/h) for Case 1 and 41,811.734 ($/h) for Case 2, which are significantly lower than the best fuel cost results obtained by comparative algorithms. The convergence traits of the best fuel cost acquired by the algorithms for this test system are illustrated in Figure 9.

IEEE 118-Bus Test System
The ability of the proposed WMFO in solving a larger power system is evaluated by the IEEE 118-bus test system. The cost coefficients, branch, and bus data are taken from MATPOWER [117]. This bus test system contains 54 generators, 186 branches, 9 transformers, 2 reactors, and 12 capacitors. This system contains 129 control variables in total, as follows: there are 54 generator active powers and bus voltages are available, as well as nine transformer tap settings and twelve shunt capacitors reactive power injections. The voltage limit for all buses is 0.94 to 1.06 p.u. Transformer tap settings are tested in the range of 0.90-1.10 p.u. Shunt capacitors' available reactive powers vary from 0 to 30 MVAR. As Cases 1 and 2 in this experiment include too many design factors, the summary of the results is reported in Tables 10 and 11, while the detailed results of MFO, WMFO, Figure 9. Convergence curves for the IEEE 57-bus test system.

IEEE 118-Bus Test System
The ability of the proposed WMFO in solving a larger power system is evaluated by the IEEE 118-bus test system. The cost coefficients, branch, and bus data are taken from MATPOWER [117]. This bus test system contains 54 generators, 186 branches, 9 transformers, 2 reactors, and 12 capacitors. This system contains 129 control variables in total, as follows: there are 54 generator active powers and bus voltages are available, as well as nine transformer tap settings and twelve shunt capacitors reactive power injections. The voltage limit for all buses is 0.94 to 1.06 p.u. Transformer tap settings are tested in the range of 0.90-1.10 p.u. Shunt capacitors' available reactive powers vary from 0 to 30 MVAR. As Cases 1 and 2 in this experiment include too many design factors, the summary of the results is reported in Tables 10 and 11 Figure 10. The one-line diagram for IEEE 118-bus test system. Figure 10. The one-line diagram for IEEE 118-bus test system.
Electronics 2022, 11, x FOR PEER REVIEW 24 of 33 Figure 11. Convergence curves for the IEEE 118-bus test system.

Statistical Analysis
The algorithms are ranked based on their performance in minimizing the cost function of different OPF problems for both cases 1 and 2. The results are illustrated in the radar graph in Figure 12.

Statistical Analysis
The algorithms are ranked based on their performance in minimizing the cost function of different OPF problems for both cases 1 and 2. The results are illustrated in the radar graph in Figure 12.

Statistical Analysis
The algorithms are ranked based on their performance in minimizing the cost function of different OPF problems for both cases 1 and 2. The results are illustrated in the radar graph in Figure 12. The percentage of fuel cost reduction gained by the proposed and comparative algorithms for each bus test system is illustrated in Figure 13 in comparison with the average cost for the bus test systems. It shows that the WMFO can reduce the total cost of all problems by 38.26% more than the average of competitor algorithms. The percentage of fuel cost reduction gained by the proposed and comparative algorithms for each bus test system is illustrated in Figure 13 in comparison with the average cost for the bus test systems. It shows that the WMFO can reduce the total cost of all problems by 38.26% more than the average of competitor algorithms.

Conclusions and Future Works
This paper proposed an effective hybridizing of whale and moth-flame optimization algorithms (WMFO) to solve the optimal power flow (OPF) problem. The population is equally partitioned among two algorithms using the population partitioning mechanism. A self-memory mechanism is defined for each search agent to preserve their best experiences and update their positions based on the average best-experienced position of the whole population. Moreover, randomized boundary handling is introduced to effectively apply the boundary limiting conditions. Furthermore, the WMFO employs a greedy selection operator to evaluate the acceptance criteria of new positions. The impact analysis

Conclusions and Future Works
This paper proposed an effective hybridizing of whale and moth-flame optimization algorithms (WMFO) to solve the optimal power flow (OPF) problem. The population is equally partitioned among two algorithms using the population partitioning mechanism. A self-memory mechanism is defined for each search agent to preserve their best experiences and update their positions based on the average best-experienced position of the whole population. Moreover, randomized boundary handling is introduced to effectively apply the boundary limiting conditions. Furthermore, the WMFO employs a greedy selection operator to evaluate the acceptance criteria of new positions. The impact analysis on convergence curves shows that the WMFO explores the search space in the first iterations, then it keeps improving the quality of the solution in the course of iterations. This convergence behavior reveals that the WMFO inherits the exploitation of the WOA, while it takes advantage of the explorative movements of the modified MFO. The effectiveness and scalability of the proposed algorithm in solving the OPF problem have been assessed and investigated on the IEEE 14-bus, 30-bus, 39-bus, 57-bus, and 118-bus test systems to optimize the OPF's single and multi-objective functions within the limits of the system. The obtained results are then compared against five well-known metaheuristic algorithms and two improved variations of the MFO to validate the results. The comparison of results reveals that the proposed WMFO outperforms competitor algorithms in solving single and multi-objective problems in various power system scale sizes by reducing the total cost 38.26% more than the average of the total cost gained by the competitor algorithms. The maximum amount of cost reduction compared to the average value of contender algorithms is 14,820.55 ($/h) gained by the WMFO on the IEEE 118-bus test system Case 1. Furthermore, the average amount of reduced cost gained by the WMFO on ten different OPF problems equals 33,722.24 ($/h) or 295 million dollars a year, which shows the economic viability of the proposed method in solving the OPF problem. In future research, WMFO can be employed to solve various problems in power systems such as FACTS devices and electrical load forecasting.

Data Availability Statement:
The data and code used in the research may be obtained from the corresponding author upon request.

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

Appendix A
Tables A1 and A2 present the complete results of the total fuel cost (cost), power losses (ploss), and voltage deviation (VD) for Cases 1 and 2 on the IEEE-118 bus test system.