Developing a Marine Predator Algorithm for Optimal Power Flow Analysis considering Uncertainty of Renewable Energy Sources

Optimal power ﬂow (OPF) is a crucial issue to maintain the reliable operation of power systems. However, achieving this objective is not easy, especially when renewable energy sources (RESs) are penetrated into the power system due to their uncertainty nature. This paper provides an optimal solution for the power ﬂow problem including two diﬀerent types of RESs based on a marine predator algorithm (MPA). The OPF model used in this paper has three diﬀerent types of energy resources (thermal, wind, and solar). The output power from wind or solar generator has two probabilities either underestimation or overestimation con-sequently. These two probabilities have been translated into the objective function by two extra costs, penalty cost, and reserve cost, respectively. To check the validity of the proposed algorithm, it is applied to a modiﬁed IEEE-30 and IEEE-57 bus systems. The obtained results are compared with some recent optimization methods. The results show the eﬀectiveness of marine predator algorithm in providing the optimal solution for the power ﬂow problem with maintaining the power system constraints inviolate.


Introduction
OPF has verified its validity for providing the secure and efficient operation of various power systems since 1962, the date of its inception [1]. OPF has the main goal represents in finding the optimal settings related to the control variables of the power system with definite objective functions taking into consideration maintaining the system constraints within the predefined limits. e control variables of the power system consist of active power, generator buses voltage, and transformer tap settings. e system constraints have to be maintained, such as the capacity of transmission lines, the balance of power flow, the voltage of all system buses, and the capability of power generators. Many conventional optimization algorithms have been utilized for solving the OPF problem. ese algorithms are classified as mixed-integer linear programming, quadratic programming, interior-point algorithms, and nonlinear programming [2]. However, these conventional algorithms need to linearize the objective function first. us, they are suitable only for nondifferentiable, nonconvex, and non-smooth objective functions. To avoid this problem, many metaheuristic optimization algorithms have been provided to solve the OPF problem that will be discussed later in the related work section. In this paper, a recent metaheuristic optimization algorithm, the marine predator algorithm (MPA), is applied for solving the OPF problem considering the uncertainty of wind and solar PV production. e MPA is chosen for this study due to its effectiveness in solving complicated problems in many different fields [3,4]. e main work of this paper is as follows: (i) Modifying the IEEE-30 bus system to include two types of renewable energy generators by replacing the two TPGs connected at bus 5 and bus 11 with two wind power generators (WPGs) and replacing the TPG connected at bus 13 with solar photovoltaic generator (SPG).
(ii) Forming the stochastic models of the WPGs and the SPG. (iii) Applying the proposed MPA to solve the OPF problem for the modified IEEE-30 bus power system. (iv) Analyzing the results obtained by MPA with the results obtained by other three recent optimization algorithm, particle swarm optimization (PSO) [5], modified particle swarm optimization (MPSO) [6], and genetic algorithm (GA) [7], in addition to the results of SHADE-SF algorithm provided in [8] to verify its validity for solving the OPF problem. (v) Studying the impact of varying the penalty and reserve cost coefficients of WPGs and SPGs on the optimal scheduled powers and their costs of production. (vi) Modifying the IEEE-57 bus system by replacing the two TPGs connected at bus 2 and bus 6 with two wind power generators (WPGs) and replacing the TPG connected at bus 9 with solar photovoltaic generator (SPG). (vii) Applying the proposed MPA to solve the OPF problem for the modified IEEE-57 bus power system, and analyzing the results obtained by MPA with the results of GA.
e other parts of this paper are ordered as follows: Section 2 presents the related work. en, Section 3 illustrates the formulation of the OPF problem. Section 4 shows the stochastic models of both WPGs and SPG. en, Section 5 presents the proposed optimization algorithm. e simulation results are provided in Section 6. Finally, Section 7 provides the conclusions of this study.

Related Work
In recent literature, traditional OPF that deals with thermal power generators (TPGs) has been extensively studied. In [9], the authors have presented a method for solving the alternating current optimal power flow (ACOPF) problem based on combination between various tuning methods and a sequential linear programming approach. e authors in [10] have proposed an effective whale optimization algorithm for solving optimal power flow problems (EWOA-OPF) with application on four different standard IEEE bus test systems to optimize single-and multiobjective functions under the system constraints. In [11], a novel fuzzy adaptive hybrid configuration oriented to a joint self-adaptive particle swarm optimization (SPSO) and differential evolution algorithms (FAHSPSO-DE) has been proposed to address the multiobjective OPF (MOOPF) problem. In [12], a modified grasshopper optimization algorithm (MGOA) is proposed to solve the optimal power flow (OPF) problem. An improved gray wolf optimization algorithm (I-GWO) based on the dimension learning-based hunting (DLH) search strategy has been presented in [13] for solving the OPF problem. However, the OPF problem considering both TPGs and RESs became an attractive topic for many researchers due to the challenges caused by RESs in the planning and operation of power systems. In [14], the authors developed a new golden ratio optimization method (GROM) algorithm to provide a solution for the OPF problem in a power system including wind and solar units. In [15], a gray wolf optimization algorithm (GWO) is applied to reach the optimal solution of power flow problem including wind and solar photovoltaic resources in a modified IEEE-30 bus and IEEE-57 bus power systems.
A new Manta Ray Foraging Optimization (MRFO) algorithm is developed in [16] to solve the OPF with and without renewable energy resources. e authors in [17] have applied the flower pollination algorithm (FPA) to solve an OPF problem IEEE-30 bus power system modified by solar photovoltaic, wind, and small hydro power units. In [18], the authors have proposed a particle swarm optimization (PSO) algorithm to solve the OPF for a power system including renewable energy resources and storage systems. e authors in [8] have proposed a combination between the success history based adaptive differential evolution (SHADE) technique and the superiority of feasible solutions (SF) technique to develop an efficient algorithm called SHADE-SF for solving the OPF incorporating wind and solar resources.

Problem Formulation
In this section, the cost models of all three types of power generators used in the modified power system are presented as follows.

Cost Model for TPGs.
e total generation cost of TPGs in ($/h) considering the valve point effect is calculated as follows: where P T G , i is the output power of the i-th TPG and its cost coefficients are represented by a i , b i , and c i . N T G refers to the number of TPGs in the power systems l i and m i are valve-point loading coefficients. P m i n T Gi indicates the minimum power of i-th TPG.

2
International Transactions on Electrical Energy Systems All cost coefficients of TPGs needed for calculations have been mentioned in Tables 1 and 2.

Direct Generation Cost of SPG and WPGs.
e direct generation cost of WPG ,j in relevant to its scheduled output power is calculated by (2)as follows: where P wds ch,j represents the output power scheduled from WPG and j and d j are its direct cost coefficient. Likewise, the direct generation cost of SPG,k is calculated by the following: where e k represents the coefficient of direct cost associated with SPG ,k , while P slsch,k denotes the output power scheduled from the SPG ,k .

Cost Assessment of Uncertain Output of WPG.
ere are two situations that may happen due to the intermittent nature of wind power. e first one takes place when the actual output power of WPG is lower than the anticipated output. is situation is referred to as overestimation, thus committing the spinning reserve will be necessary to overcome this situation and as a result, requires a reserve cost which is calculated as follows: where P wda v,j denotes the available power of WPG ,j and K RW,j refers to its coefficient of reserve cost, while f wd (P wd,j ) represents the Weibull PDF of WPG ,j output power.
In contrast, the second situation, which refers to underestimation, will happen when the power output from WPG is greater than the expected value, a penalty cost corresponding to the remaining wind power should be compensated by the system operator as illustrated in (5).
C wdp ,j P wdav,j − P wdsch,j � K Pwd,j P wdav,j − P wdsch,j � K Pwd,j P Wdr ,j P Wds ch,j P wd,j − P wdsch,j f wd P wd,j dP wd,j , where K pwd,j denotes the coefficient of penalty cost. P wd,j refers to the rated output power related to the WPG ,j .

Cost Assessment of Uncertain Output of SPG.
e output power of SPG is also intermittent which may arise the overestimation and underestimation situations similar to wind power. In overestimation situation, the reserve cost of SPG ,k is represented by the following: C slr,k P slsch,k − P sav,k � K rs,k P ssch,k − P sav,k � K rsl,k * f sl P slav,k < P slsch,k * P slsch,k − E P slav,k < P slsch,k , where K rsl,k refers to the coefficient of reserve cost for SPG ,k , P slav,k refers to the available output power from the same SPG, and f sl (P slav,k < P slsch,k ) denotes the shortage occurrence probability in the solar power production, and E(P slav,k < P slsch,k ) denotes the expectation of being the output of SPG below the P slsch,k . While, in underestimation situation, the penalty cost of SPG ,k is calculated as follows: where K psl,k indicates the coefficient of penalty cost, f sl (P slav,k > P slsch,k ) is the outstanding probability of solar output power from the SPG ,k comparing to P slsch,k , while E(P slav,k < P slsch,k ) refers to the anticipated outstanding output from the SPG ,k .

Objective Function.
e objective function (F) of the OPF is formulated to minimize the total generation cost including the cost models presented from (1) to (7).
where N SG and N WG are the number of SPGs and WPGs, respectively.

Equality Constraints.
Equality constraints of the power system are represented as follows [8]:

Inequality Constraints.
Inequality constraints of the power system are represented as follows: (i) Generator constraints (renewable or thermal as applicable): (ii) Security constraints: Equation (14) denotes the voltage limits subjected to load buses, while (15) provides the capacity constraints of transmission lines, where NL denotes the number of transmission lines in the power system.

Power Losses (P loss )
. P loss is determined by the following: δ ij stands for the voltage angles difference between bus i and bus j, while, G ij is the transfer conductance.

Voltage Deviation.
Voltage deviation indicates the cumulative load buses voltage deviation from 1.0 (p.u.) as follows:

Stochastic Modeling of RESs
e distribution of wind speed is suitable with Weibull probability density function (PDF) [21,22]. e wind speed probability (W v ) following Weibull PDF is determined as follows: where k and c stand for shape factor and scale factor, respectively. e mean of Weibull distribution is determined as follows: In (19), the symbol Γ represents gamma function which is given by the following: Figures 1 and 2 provide the wind frequency distribution depending on Weibull fitting after running 8000 Monte-Carlo simulation scenarios [8].
e output power of SPG affects by the solar irradiance (I) based on lognormal PDF [23]. is concept is illustrated in (21): where f I (I) denotes the irradiance probability, µ denotes the mean and of lognormal PDF and σ represents the standard deviation. Figure 3 provides the lognormal PDF for the SPG after running 8000 Monte-Carlo scenarios.
e chosen values of Weibull and lognormal PDFs are mentioned in Tables 3 and 4.

Modeling of WPGs.
e power output from WPG affects the speed of wind. e formula of power output from wind turbine is provided in [8] as follows: where W vin denotes the cut-in speed, W vout represents the cut-out speed, and W vr stands for the rated wind speed. P wdr indicates the rated power of the wind turbine.
e probabilities of power output from WPG in the discrete zone can be determined by [24]: While in the continuous zone, the probabilities of power output from WPG are determined by [24]:

Modeling of SPG.
In the same way, the solar irradiance versus the energy conversion of the SPG is provided in [25] as follows: where I st d denotes the solar irradiance in a standard environment (800 W/m 2 ), R c indicates a specific irradiance amount (120 W/m 2 ), and P slr denotes the rated actual power of SPG. e overestimation and underestimation costs of the power produced from the SPG are calculated by (27) and (28) respectively.
where P sln+ and P sln− denote the surplus and shortage powers represented by the left and right half planes of the schedule power of SPG (P slsch ) provided in Figure 4.
f sln+ and f sln− stand for the relative frequencies of the P s ln+ and P s ln− occurrence. N + and N − denote the number of discrete bins on the right and left planes of schedule power of SPG.

Optimization Algorithm
e marine predator algorithm (MPA) has been developed by Faramarzi et al. [26]. e MPA simulates the strategy of optimal searching of the marine predators (MPs) during detecting their prey as follows: MPs prefer to follow the Lévy behavior when the concentration of prey is low, while they follow the Brownian behavior when there is abundant prey [27,28]. e process of MPA has three main phases based on the velocity ratio as follows: is phase happens when the velocity ratio is high and it is expressed as follows: where Iter represents the present iteration and Max Iter refers to the maximum iterations number, while R B �→ refers to a vector contains random numbers depending on Brownian distribution. e sign ⊗ is needed for providing the entry wise multiplications. e constant P equals 0.5 and R → has a range from 0 to 1.

Phase 2.
is phase takes place when the velocity ratio is unity.
Step by step, the exploration changes to exploitation as follows: While, (1/3)Max Iter < Iter < (2/3)Max Iter In the 1 st half of the population: where R L �→ denotes a random numbers vector depending on Lévy distribution. R L �→ ⊗ Prey i ����→ simulates the prey movement in Lévy manner, while adding the stepsize i �������� �→ to prey position acts out the prey movement.
In the 2 nd half of the population, where CF � (1 − (Iter/Max_Iter)) (2(Iter/Max_Iter)) CF refers to an adaptive parameter considered to control the stepsize i �������� �→ for the movement of the predator. R B �→ ⊗ Elite i ����→ simulates the predator movement in Brownian behavior, while the position of prey is updated depending on the predator movement in Brownian behavior.

Phase 3.
is phase happens when the velocity ratio is low as follows: While Iter > (2/3)Max_Iter, International Transactions on Electrical Energy Systems (32)

Eddy Formation and FADs' Effect.
Another important point that may cause a change in MPs behavior is the environmental issues like the fish aggregating devices (FADs) effects and the eddy formation. e FADs can be considered as a local optima and their effects are mathematically formed as follows: where FADs � 0.2 represents the probability of FADs effects on the whole optimization process. U → refers to the vector of binary with arrays including 0 and 1. is random vector changes its array to 0 if the array is lower than 0.2, and changes its array to 1 if it is larger than 0.2. r represents the uniform random number in [0, 1]. X max ����→ and X min ����→ represent the vector that contains the upper and lower bounds of dimensions. r 1 and r 2 are random indexes of the prey matrix. Figure 5 shows the pseudocode of the MPA.

Results and Discussion
In this section, five case studies are implemented as follows.

Case 1: Minimization of Total Generation Cost for the Modified IEEE-30 Bus Power System.
is case study is applied to minimize the total cost of generation using the MPA based on equation (8) with maintaining the constraints of the system inside their predefined limits. e detailed parameters of the modified IEEE-30 bus power system used in this case are stated in Table 5.
e direct cost coefficients of the WPGs are d 1 � 1.6 and d 2 � 1.75. Penalty cost coefficient for not fully utilized wind power is assumed as K pwd,1 � K pwd,2 � 1.5 and reserve cost coefficient for overestimation is K rwd,1 � K rwd,2 � 3. e direct, penalty, and reserve cost coefficients for SPG are proposed to be e � 1.6, K psl � 1.5, and K rsl � 3, respectively. Table 6 provides the optimal results obtained by MPA through all runs. It also provides the results of other implemented algorithms, MPSO, PSO, and GA, in addition to the results of SHADE-SF provided in Ref. [8] to check the results of MPA with other optimization algorithms. e statistical details values of total generation cost with maximum, minimum, mean, and standard deviation over 10 runs of each algorithm are recorded in Table 7. e simulation results indicate the effectiveness of MPA in terms of total cost minimization as it achieved the minimum total cost, 781.924 ($/h) compared to other algorithms which have a fast convergence compared to MPA, but they lied on the local optima problem.as shown in Figure 6. e profile voltage of generator buses is within the lower and upper limits for the IEEE-30 bus system as recorded in Table 6 and illustrated in Figure 7. e generator reactive power is dependent or state variable in the OPF problem. e reactive power constraints should be satisfied after the optimization process. e generator reactive powers obtained through the MPA are within the predefined limits as observed from Table 6. e constraints forced on the load buses voltages are also critical issue in the OPF problem. In this work, the voltages of all load buses are within their limits as shown in Figure 8.

Case 2: Studying the Impact of Varying the Penalty Cost
Coefficients of WPGs and SPG. For this case, reserve cost coefficients of WPGs and SPG are kept constant at its initial value (KR � 3) in case1, while the penalty cost coefficients are increased from its initial value (KP � 1.5) in case1 to 3 in case 8 International    International Transactions on Electrical Energy Systems 2a and 4 in case 2b to study the impact of this increasing on the scheduled powers of the existence power generators in the modified power system and their corresponding costs. Figure 9 shows the impact of varying the penalty cost coefficients on the power scheduled from all generators in the modified system. It is expected with increasing the penalty cost coefficients, the powers scheduled from WPGs and SPG increases because this will help in decreasing the penalty cost. is is observed from Figure 9 as the scheduled power of WPGs increases with increasing the penalty cost coefficient. However, this did not occur with the scheduled power of SPG, as a fluctuation in its scheduled power is observed. is fluctuation can be interpreted by its stochastic nature.
Consequently, with increasing the value of penalty cost coefficients, a slight decrease in thermal power cost occurs, while the cost of solar power increases slightly and the cost of wind power increases significantly leading to an observed increase in the total generation cost as shown in Figure 10.

Case 3: Studying the Impact of Varying the Reserve Cost
Coefficients of WPGs and SPG. In this case, the penalty cost coefficients of WPGs and SPG are kept constant at its initial value (KP � 1.5) in case of 1, while the reserve cost coefficients are increased from its initial value (KR � 3) in cases 1 to 4 in case 3a and 5 in case 3b to study the impact of this increasing on the scheduled powers of the existence power generators in the modified power system and their corresponding costs.
Similar to Case 2, Figure 11 presents the impact of changing the reserve cost coefficients on the scheduled power of all generators. It is noticed that with increasing the values of reserve cost coefficients of WPGs and SPG, the scheduled power from WPGs and SPG decreases as expected because reducing them requires a lower spinning reserve level.
As a result, with increasing the reserve cost coefficients, the cost of scheduled power from WPGs and SPG decreases as observed from Figure 12, while the cost of scheduled power from TPGs increases significantly leading to a high increase in the total generation cost because the TPGs are used as a compensation to the shortage in the scheduled power from WPGs and SPG.

Case 4: Different Costs against the PDF Parameter of WPGs and SPG.
is case study is performed to observe and analyze the effect of the variation in scale parameter (c) of Weibull PDF on different costs of wind power for a constant schedule power. e shape parameter of the two WPGs is also kept constant at k � 2. According to [30], the capacity factor of a particular WPG has a value in a range from 30% to 45% of their installed capacity, thus the two WPGs are assumed to have fixed schedule powers at 25 MW and 20 MW, respectively. e cost coefficients of the two WPGs are kept with the same values used in Case 1. e impact of variation of the Weibull scale parameter of WPG1 and WPG2 on the different types of costs is demonstrated in Figures 13 and 14, respectively. e total generation cost of wind power reached its minimum value at a scale parameter value that lies in the middle of the selected range. With increasing the value of    scale parameter and keeping the scheduled power constant, higher wind speeds with certain probabilities dominate and the penalty cost rises which causes a rise in the overall generation cost. On the other hand, the reserve cost decreases slightly after a specific scale parameter value.
For studying the effect of changing the lognormal PDF mean parameter (µ) on the cost of solar power, µ is varied in a range from 3 to 8 with an increase of 0.5. e scheduled power of SPG is fixed at 20 MW and the standard deviation (σ) is 0.6. e coefficients of power cost related to the SPG do not differ from those used in Case 1. Figure 15 presents the curves of cost relevant to the solar output power. It is noticed from this figure that the total solar output power cost reduces gradually until reaching the minimum total cost at μ � 5.5. e penalty and reserve costs are the same at around μ � 5.8. After that, a sharp increase in the penalty cost happens, causing a sudden increase in the total solar power cost. Solar irradiance (I) is extremely sensitive to µ value, and accordingly the solar output power.
If μ has a low value, solar irradiance will be low and as a result, the output power will also be low, so almost all reserve power will be crucial to compensate this shortage. In contrast, if μ has a high value, irradiance (I) will have a higher value, and accordingly, the output power of the SPG tends to be higher.

Case 5: Minimization of Total Generation Cost for the
Modified IEEE-57 Bus Power System. In this case, the IEEE-57 bus system has been modified through replacing the two TPGs connected at bus 2 and bus 6 with two WPGs. In addition to that, the TPG connected at bus 9 is replaced by a SPG. is case has been implemented to verify the validity of MPA in solving more complicated power systems. e active and reactive components of load demand of this system are 1250.8 MW and 336.4 MVAR, respectively, at base of 100 MVA. Table 8 shows the main characteristics of the IEEE 57 bus system. e objective function and system constraints are the same as in equations (8)- (17). To verify the results    obtained by MPA, GA is used to solve the OPF problem under the same conditions. e two algorithms have been run for 10 times with a maximum of 500 iterations for each run as the criteria of ending the run. e obtained results show the effectiveness of MPA in terms of minimizing total generation cost maintain the system constraints within the predefined settings as shown in Table 9 and Figure 16. e statistical details values of total generation cost with maximum, minimum, mean, and standard deviation over 10 runs of each algorithm are recorded in Table 10, while the convergences of MPA and other algorithms are provided in Figure 17.

Conclusions
In this paper, a new application of the marine predator algorithm (MPA) is proposed for solving the OPF problem for IEEE-30 bus and IEEE-57 bus power systems that have been modified to include wind and solar photovoltaic energy sources in addition to the thermal generators. e stochastic nature of renewable energy sources has been modeled in this paper based on the Weibull and lognormal PDFs. e simulation results of MPA under various case studies have been compared with the results obtained by some recent optimization algorithms such as PSO, MPSO, and GA, in addition to the results of SHADE-SF provided in the literature. e simulation results prove the MPA effectiveness among the other algorithms in terms of minimizing the total generation cost. e impact of changing the penalty and reserve cost coefficients of WPGs and SPG is also studied due to their direct impact on the optimal scheduled active powers and their corresponding generation costs. e simulation results show also that the values of the Weibull PDF scale parameter (c) and lognormal PDF mean parameter (µ) have to be carefully defined as they have a direct effect on the different costs of wind and solar powers.

Data Availability
For the data-related issue, kindly contact skamel@aswu.edu.eg

Conflicts of Interest
e authors declare that they have no conflicts of interest.