A Modiﬁed Rao-2 Algorithm for Optimal Power Flow Incorporating Renewable Energy Sources

: In this paper, a modiﬁed Rao-2 (MRao-2) algorithm is proposed to solve the problem of optimal power ﬂow (OPF) in a power system incorporating renewable energy sources (RES). Quasi-oppositional and Levy ﬂight methods are used to improve the performance of the Rao algorithm. To demonstrate effectiveness of the MRao-2 technique, it is tested on two standard test systems: an IEEE 30-bus system and an IEEE 118-bus system. The objective function of the OPF is the minimization of fuel cost in ﬁve scenarios. The IEEE 30-bus system reﬂects fuel cost minimization in three scenarios (without RES, with RES, and with RES under contingency state), while the IEEE 118-bus system reﬂects fuel cost minimization in two scenarios (without RES and with RES). The achieved results of various scenarios using the suggested MRao-2 technique are compared with those obtained using ﬁve recent techniques: Atom Search Optimization (ASO), Turbulent Flow of Water-based Optimization (TFWO), Marine Predators Algorithm (MPA), Rao-1, Rao-3 algorithms, as well as the conventional Rao-2 algorithm. Those comparisons conﬁrm the superiority of the MRao-2 technique over those other algorithms in solving the OPF problem.


Introduction
In recent decades, the optimal power flow (OPF) problem has had an important role in the operation and planning of electrical systems [1]. OPF aims to adjust the independent control variables parameters of power systems to reach the needed objective function, which are normally reducing the fuel cost, emission, and active power loss, to satisfy the needed demand load, concurrently meeting the boundaries of inequality and equality constraints [2].
The critical necessity to address global warming and climate change have placed renewable energy sources (RES) such as solar energy systems, wind energy systems, and hydropower plants in the center of energy conversion as well as the quickly dropping renewable power generation costs, we need to face the challenges, arising from using a high scale of renewable energy sources in the power system [3]. In recent years, RES contributes to decreasing the power losses of the grid, enhancing the quality and reliability of the electrical grid [4]; furthermore, they affect the electricity market. By increasing the added energy from RES inside the electrical power grid, it is required to set the best energy production for the system to satisfy the objective functions such as minimizing the fuel cost, total emission from the conventional power generation stations, and transmission losses and enhancing the voltage profile [5].
The OPF problem is generally non-convex, non-smooth, and non-differentiable objective functions. Consequently, it is very significant to develop new techniques to reach

•
The proposed MRao-2 technique is used to achieve the accurate values of control variables of the OPF problem without RES, with RES, and with RES under contingency state.

•
The fuel cost is the main objective function in five scenarios for the two IEEE 30 -bus and 118-bus systems to test the validation of the proposed algorithm.

•
To check the robustness of this modified algorithm, its results are compared with five recent algorithms-ASO, TFWO, MPA, Rao-1, and Rao-3-as well as the original Rao-2 which are the strong algorithms in solving the modern power system problems and they are used in many published papers in the last two years so far.
The rest of the paper is organized as follows. The problem formulation is presented in Section 2. Section 3 introduces the proposed MRao-2 algorithm applied to solve the OPF problem with various scenarios. Section 4 gives a discussion and analysis of the simulation results. Section 5 presents the conclusion.

General Structure of OPF
The OPF solution provides the best value of the control variables by minimizing an objective function with satisfying equality and inequality limitations. Commonly, the mathematical formulation of the optimization problem may be expressed as follows [30]: Subject to g i (x, u) = 0 i = 1, 2, 3, . . . , m h j (x, u) ≤ 0 j = 1, 2, 3, . . . , n where F is the objective function; x, u are the state variables (dependent variables) and the control variables (independent variables) vectors, respectively; g i is the equality constraints; m is the number of equality constraints; h j is the number of inequality constraints; and n is the number of inequality constraints.
The state variables are represented in a vector as follows [16]: x = [P G1 , V L1 . . . V LNPQ , Q G1 . . . Q GNPV , S TL1 . . . S TLNTL ] (4) where P G1 refers to the active power generation of slack bus, V L is the voltage magnitude of the load bus, NPQ is the number of load buses, Q G is the generated reactive power, NPV is the number of generation buses, S TL is the loading of transmission line, and NTL is Number of transmission lines. The control variables are represented in a vector as follows [16]: where P G is the generated active power, and NG is the number of generators. V G is the voltage magnitude of the generation bus. Q C is the injected imaginary power by the shunt compensator. NC is the number of shunt compensators. T is the tapping ratio of the transformer. NT is the number of transformers.

Quadratic Total Fuel Cost
The total fuel cost of all thermal generation units is represented based on the polynomial quadratic function as the following equation [2]: where a i , b, and c i are the cost coefficients of ith generator.

Total Emission
Various types of noxious emissions are emitted from those plants because of using several types of fossil fuels in thermal power plants. Newly, one of the principal goals of the OPF problem is reducing these emissions without affecting the generated power to satisfy the load demands in the electrical power system. This emission is calculated from the following equation: [31]: where α i , β i , and γ i represent the emission coefficients for the ith unit.

Power Loss Function
The total active power losses in the system can be expressed as follows [32]: where nl is the number of network nodes; V i and V j are the voltage magnitudes for the i-th and j-th nodes, respectively; δ i and δ j are the node voltage angles of the i-th-j-th branch; and G k refers to the conductivity between node i and node j.

Voltage Deviation (VD) Function (Voltage Profile Improvement)
One of the effective methods is the voltage magnitude fluctuation from 1.0 per unit at each load bus which is defined as follows [32]: where V L p is the ith voltage of load buses.

Equality Constraints
The balanced load flow equations represent the equality constraints. The following equations express the active and reactive power constraints that fulfill the load demands requirements and also the power losses of the transmission line [33]: where P G is the generated real power, Q G is the reactive power generation, NB is the number of buses, and P D and Q D are the real and imaginary load demands, respectively. G ij and B ij are the conductance and substance between buses i and j. δ i and δ j are the voltage angles bus i and j.

Inequality Constraints
The inequality constraints are described as follows [34]: (a) Generator constraints (thermal or renewable as applicable): (b) Security constraints (c) Shunt VAR compensator constraints: (d) Transformer constraints: The mathematical formulation of the fitness function combined with the quadratic penalty is as follows: (24) where λ p ,λ v ,λ Q , λ s are the Penalty factors.

Power Balance Considering RES
Adding the RES to the power system has different shapes in the studying of the OPF problem. In this article, the RES is employed as a negative load [35,36]. This implies that all RES (such as solar, wind, hydro, and biomass) that are added to the system will be utilized first to produce the part of the required power to loads then the remainder of the loads and power losses will be covered from the thermal power plants.

Rao Algorithm
Rao algorithms have recently been implemented in [37]. The key benefit of these algorithms is that they do not need any complex control parameters, only ordinary parameters such as population size and the number of iterations are required. Rao-1, Rao-2, and Rao-3 are three algorithms that have been developed in [37]. The Rao-2 algorithm is used in this study as it has a high convergence rate.
The following equation can be used to describe the mathematical formulation of the Rao-2 algorithm: X j,kp,i = X j,kp,i + Rd 1,j,i X j,best,i − X j,worst,i + Rd 2,j,i X j,kp,i or X j,lm,i − X j,lm,i or X j,kp,i (25) where X j,kp,i denotes the value of jth variable design for kpth candidate solution after the ith iteration, and X j,kp,i denotes the updated value of the next iteration. X j,best,i and X j,worst,i are the values of the j for the best and worst candidate solutions during the ith iteration, respectively. Rd 1,j,i and Rd 2,j,i are random numbers in the range [0, 1] for the jth variable during the ith iteration. The terminology (X j,kp,i or X j,lm,i and X j,lm,i or X j,kp,i ) are used to compare the fitness values of a candidate solution k and a randomly chosen candidate solution.
The following are the key steps of the Rao-2 algorithm.

•
Step 1: Randomly distribute the population within the vector ranges.

•
Step 2: Determine the objective value for each variable.

•
Step 3: Define the worst and best solutions depending on the objective function's values.

•
Step 5: If any of the updated values fall outside of the range, they should be returned.

•
Step 6: Evaluate the value of each search agent's objective function.

•
Step 7: Increase the number of iterations of the new one it = it + 1 • Step 8: If the iteration has reached its end, return the best value so far. If not, go on to Step 3. Figure 1 illustrates the main flowchart for the Rao-2.

Modified Rao Algorithm
The quasi-oppositional and Levy flight methods are used to enhance the conventional Rao technique in this paper.

Quasi-Oppositional
Opposition-based learning (OBL) [38] is a commonly used way to enhance several optimization algorithms such as Quasi-oppositional swine influenza model-based optimization with quarantine (QOSIMBO-Q) [39], quasi-oppositional teaching-learning (QOTLBO) [40], quasi oppositional bonobo optimizer (QOBO) [41], and Oppositional Jaya Algorithm [42]. The OBL can be improved by simultaneously using the candidate solution and the opposite. Therefore, this work will express the opposite solution of X i B in the Rao algorithm as where r 1 is a random number between [0, 1], and C is a middle point between X i min and X i max , which can be calculated as follows:

Levy Flight
The delivery of levy flight is used to boost the exploration phase using the following equation: where D is the problem dimension, and S is a vector of random values with size 1 × D. The LF is the levy flight function, which is calculated by the following equations: where µ and v are random values inside (0,1), β is a default constantset to 1.5, and Γ is a gamma function. The updated Rao positions will then be chosen based on the value of the objective function where if the objective function of the updated Rao position using levy F X j,kp,i levy is lower than the objective function of the conventional Rao position F X j,kp,i then the new position will be the X j,kp,i levy otherwise the position will not be updated. Therefore, the following equation can be used to update the modified Rao:

Test Systems
In this paper, the IEEE 30-bus and IEEE 118-bus systems are used to prove the efficient performance of the proposed MRao-2. The data of lines and buses for the IEEE 30-bus system can be found in [43], while the data of lines and buses for the IEEE 118-bus system can be found in [28,44]. The IEEE 30-bus system has 41 transmission lines and 6 generating units. Bus 1 is selected as the slack bus and the load demand is 283.4 MW. Table 1 displays the upper and lower limits of the control variables in 30-bus system. The IEEE 118-bus system has 54 generation units and 186 transmission lines. Bus 69 is chosen as the slack bus and the total load of the network is 3733.07 MW [45]. The upper and lower limits of the control variables in 118-bus systems are also displayed in Table 1 [4]. The emission coefficients of the generators are taken from [46]. The modification to the IEEE 30-bus system is by adding the RES. The selection of the proper location of these RES in the test system is based on the power loss sensitivity and generation cost to each real and imaginary power as stated in [47]. The results in [47] presented that the optimum location is bus 30 and the value chosen of RES is 20MW. Figure 2 shows a single line diagram of the modified IEEE 30-bus system.
The modification to the standard IEEE 118-bus test system is by adding RES based on that in [48]. The location and values of the RES in the IEEE 118-bus test systems are tabulated in Table 2. A single line diagram of the modified IEEE 118-bus system is presented in Figure 3.
In this article, the numerical simulations studies have been run on an Intel ®® core TM i5-7200U CPU with 8 GB of RAM using MATLAB 2016a. The proposed MRao-2 technique is employed to find the best solution for the OPF problem in different cases considering the fuel cost, emission, transmission loss, and improvement of the voltage profile. The results of MRao-2 are compared with the ASO Algorithm [49], TFWO [50], MPA [51], and Rao algorithms: Three metaphor-less simple algorithms (Rao-1, Rao-2, and Rao-3) [37]. The parameters settings of the different optimization techniques are shown in Table 3.

Case 1: The OPF without RES for the IEEE 30-Bus System
The proposed MRao-2 is used in this case to achieve the best solution for the OPF problem without RES and considering the fuel cost, power loss, emission, and voltage profile improvement. Table 4 presents the results of the MRao-2 algorithm in comparison with other techniques. These results confirm that the MRao-2 technique outperforms other algorithms. Its objective function (Fuel Cost = 800.4412 $/h) is better than all other algorithms and it performs without any violation of the constraints. The voltage profile of the proposed MRao-2 is displayed in Figure 4. It can be observed from this figure that all voltage magnitudes at all buses of the power system are within the boundaries presented in Table 1. Given the convergence characteristics of all algorithms for the optimal solutions that have been achieved by the ASO, TFWO, MPA, Rao algorithms, and MRao-2 in this case, the proposed MRao-2 has a smooth convergence characteristics curve to the best solution with a rapid convergence rate and without oscillations in comparison with all other techniques as displayed in Figure 5. It is shown in Figure 5 that the supremacy of the MRao-2 over the recent other techniques is proven in the last iterations as it converges to the best solution.
Furthermore, Figure 6 shows graphic comparisons for 20 individual runs (i.e., fuel cost) obtained from the proposed algorithm compared with the other six algorithms in the form of a boxplot graph. These boxplots present the mean performance of techniques that can be compared visually. There are five elements that can be defined from each boxplot as follows: first quartile, minimum, third quartile, maximum, and median. The median value is the line inside the box. These boxplots are drawn after 20 individual runs for each technique, and they display the classification precision. It can be seen that the MRao-2 algorithm has a lower boxplot compared to the other well-known techniques. Furthermore, the median of the proposed MRao-2 has a minimum value compared to the other techniques. It can be observed from this figure that the proposed MRao-2 is competitive and often superior to the other recent algorithms. Furthermore, the proposed MRao-2 technique delivers the optimal results in terms of precision and reliability compared to the other techniques. The optimal fuel cost listed in Table 5 shows that the proposed MRao-2 technique is more effective than other approaches in obtaining the best solutions as its fuel cost is less than those of others.

Case 2: OPF Incorporating RES for the IEEE 30-Bus System
The proposed MRao-2 technique is employed in the second case to reach the optimum solution for the OPF problem incorporating RES, considering the generation cost, transmission loss, emission, and improvement of voltage profile. Next, the obtained results using the proposed MRao-2 algorithm are compared with ASO, TFWO, MPA, Rao-1, Rao-2, and Rao-3 algorithms. The results of all the techniques for this case are listed in Table 6. It is seen from these results that the MRao-2 technique is also more effective than other techniques in reaching the best solution for the OPF problem with fuel cost and RES. Its fitness function (Fuel cost = 729.3429 $/h) is less than all other algorithms and it does not violate the constraints. Furthermore, the objective function of the MRao-2 technique is reduced from 800.4412 $/h (case 1) to 729.3429 $/h (case 2) by 8.88% after incorporating the RES as expected. By entering the RES as a negative load, the total load of the power system is decreased, which reduces the generation cost of the conventional thermal generators.
Furthermore, as in the previous case, the voltage magnitude of all buses is within their boundaries as shown in Figure 7. After incorporating the RES, the proposed MRao-2 has also smooth and speedy convergence curves in comparison with other algorithms as presented in Figure 8. The Boxplot graph of best Fuel cost in 20 runs of the proposed MRao-2 and other recent algorithms for case 2 is presented in Figure 9.

Case 3: OPF Incorporating RES under Contingency State for IEEE 30-Bus System
In this case, a contingency state is simulated by the outage of two lines. These lines are line (10)(11)(12)(13)(14)(15)(16)(17) and line (10)(11)(12)(13)(14)(15)(16)(17)(18)(19)(20)(21). Table 7 tabulates the obtained results using the proposed MRao-2 and other algorithms. According to these results, the proposed MRao-2 technique provides the best solution for the fitness function in comparison with other algorithms including RES during the contingency state and without any violation of the constraints. Figure 10 displays the voltage profile of the MRao-2 technique, while Figure 11 shows the convergence characteristics of all algorithms. From these figures, it is clear that all voltage magnitudes are within the constraints and the proposed MRao-2 has smooth convergence features with speedy convergence in comparison with other techniques. Furthermore, Figure 12 displays the Boxplot graph of best Fuel cost in individual 20 runs of the proposed MRao-2 and other recent algorithms for this case.     The statistical results of the proposed MRao-2 and the other recently algorithms for 20 individual runs for each case are presented in Table 8. Most researchers choose the minimum, mean, median, maximum, and standard deviation (STD) values to demonstrate the superiority and effectiveness of a technique. Table 8 shows the minimum, average, median, maximum, and STD values of the fuel cost as the objective function for all cases. These results confirm the supremacy of the proposed algorithm on the other algorithms.

Case 4: OPF without RES for the IEEE 118-Bus System
In this case, the MRao-2 is utilized to find the optimum solution for the OPF problem for the IEEE 118-bus system considering the fuel cost, transmission loss, and improvement of the voltage profile and without considering the RES. In this paper, this system is chosen to test the scalability of the MRao-2 technique and demonstrate its robustness to apply it to solve the OPF for large-scale systems. Table 9 presents the obtained results using the proposed MRao-2 algorithm. These results are compared with ASO, TFWO, MPA, Rao-1, Rao-2, and Rao-3, and this comparison is listed in Table 10. These results confirm the supremacy of the MRao-2 algorithm over other techniques in achieving the best solution for the OPF problem with the Fuel cost as an objective function for the large-scale electrical power system without considering the RES.
The MRao-2's objective function (Fuel cost = 131,457.8 $/h) is less than the fitness function of other algorithms without any violation of the restraints. Figure 13 displays the magnitudes of the voltages of all buses are within the limits. Moreover, the MRao-2 has smooth and speedy convergence curves in comparison with other algorithms as shown in Figure 14.

Case 5: OPF Incorporating RES for the IEEE 118-Bus System
In this case, the proposed MRao-2 technique is applied to the IEEE 118-bus system to check the ability of the proposed algorithm to solve the OPF for the large-scale system considering the RES. Table 11 tabulates the obtained results using the proposed MRao-2 algorithm. Furthermore, the results of the MRao-2 technique and other algorithms for this case are presented in Table 12 These results show that the proposed MRao-2 achieves a better solution than other algorithms in solving the OPF considering RES using the large-scale system and without any violation of the limits. Furthermore, adding RES to the IEEE 118-bus system decreases the fuel cost as an objective function of the MRao-2 by 23.4%. Figure 15 displays the magnitudes of the voltage of all buses of the MRao-2 are within the limits. Figure 16 shows that the proposed MRao-2 has smooth and speedy convergence curves in comparison with other techniques even for large-scale systems.

Conclusions
In this article, a new technique has been proposed for finding the optimum solution to the OPF problem incorporating renewable energy sources considering the fuel cost, transmission loss, emission, and improvement of the voltage profile. To overcome the shortcomings of the original Rao-2, the MRao-2 algorithm has been proposed using the quasi-oppositional and levy methods. The superiority and effectiveness of MRao-2 have been checked based on two standard test systems (IEEE 30-bus system and IEEE 118-bus system) with or without RES. It is obvious from the results that the MRao-2 provided a better solution of the objective function for all cases over other algorithms employed in the comparison. The obtained results using MRao-2 in comparison with those obtained using other recent techniques show that the proposed MRao-2 is superior to these algorithms for normal, contingency states and with incorporating RES whatsoever the scale of the power system which shows the strength of the MRao-2 to solve the real-life application.