 Open Access
 Authors : Ahmed S. Menesy , I. O. Habiballah , Hamdy M. Sultan
 Paper ID : IJERTV11IS120005
 Volume & Issue : Volume 11, Issue 12 (December 2022)
 Published (First Online): 15122022
 ISSN (Online) : 22780181
 Publisher Name : IJERT
 License: This work is licensed under a Creative Commons Attribution 4.0 International License
Comparison of Particle Swarm and Whale Optimization Algorithms for Optimal Power Flow Solution
Ahmed S. Menesy
dept. of Electrical Engineering King Fahd University of Petroleum
& Minerals Dhahran, Saudi Arabia

O. Habiballah
dept. of Electrical Engineering King Fahd University of Petroleum
& Minerals Dhahran, Saudi Arabia
Hamdy M. Sultan
dept. of Electrical Engineering Minia University
Minia, Egypt
Abstract Optimal power flow (OPF) solution is considered a vital tool for sensitive planning, energy management and operation analysis of the electrical power systems. The analysis of OPF seeks to accurately estimate the best solution of the power system nonlinear algebraic equations while satisfying the constraints of power system operation. In this paper, two reliable metaheuristic optimization techniques, namely, particle swarm optimization (PSO) and whale optimization algorithm (WOA), are used to solve the problem of OPF in electrical power systems. Minimizing the total cost of generation units is considered the main cost function in this study. The presented OPF formulation includes precise generator constraints such as active and reactive power generation limits, as well as the impacts of valve point loading. MATLAB software is used to implement the simulation process. To validate the accuracy of the proposed algorithms, PSO and WOA algorithms are tested on the standard system which called IEEE 30bus system. The results of simulation obtained by PSO and WOA techniques are comprehensively compared with each other. According to the simulation results, the proposed WOA technique has the optimal performance compared with PSO technique in terms of locating lowercost values and it has successfully proved itself as a robust competitor to PSO for tackling the problem of OPF solution.
Keywords optimal power flow; Optimization; PSO; whale optimization algorithm; Metaheuristic; valve point loading

INTRODUCTION
The OPF is a nonlinear and difficult optimization issue in power systems that is utilized for the processes of planning and operation of the power system [1]. OPF is critical for enhancing and improving the efficiency of existing power systems, and efficient development of the future systems [2] . OPF is an essential tool for improving the electrical efficiency of power system, voltage distribution, stability indicator, and reducing gas emissions especially for thermal plants [3]. OPF manages both discrete and continuous control variables for maximizing a certain objective function while meeting the operational restrictions, namely equality and inequality constraints [4, 5]. The goal objective of OPF issue might be to reduce overall cost of generating units or to decrease transmission line (TL) losses [6]. The generator active powers, except on the slack bus, the generator bus voltages, transformer tap ratios, and shunt VAR compensation units are all control variables in the OPF problem. The equality constraints are represented as power balance equations,
meanwhile the inequality constraints can be represented by the bounds of the control variables and state variables.
Many conventional techniques are utilized to solve the OPF problem, including linear programming [7, 8], nonlinear programming [9], quadratic programming [10], the interior point method [11], lambda iteration approach, gradient technique [12] and Newtonbased strategies [13]. Despite these methods are successfully developed to solve the studied OPF issue and their dependability, each of these algorithms has various limitations, including algorithmic complexity, unsettled convergence, piecewise quadratic cost approximation, inability to handle nonlinear functions, and falling in the local optima. It should be noted that the shortcomings of previous approaches are caused by linearizing the objective function and system restrictions around an operating point utilizing derivatives and gradients. These limitations are overcome by metaheuristic optimization algorithms, which avoid linearizing the objective function by selecting a set of random solutions, which are then updated around the best solution in an iterative process until the algorithm converges and the optimal solution is obtained. Metaheuristic optimization approaches offer the advantage of producing better results and consuming less computational time.
The widely used metaheuristic optimization methods to solve the problem of optimal power flow are as genetic algorithm (GA) [14, 15], gravitational search algorithm (GSA) [16], shuffle frog leaping algorithm (SFLA) [17], differential evolution (DE) algorithm [18], artificial bee colony (ABC) [19, 20], particle swarm optimization (PSO) [21, 22], differential search algorithm (DSA) [23], salp swarm algorithm (SSA) [24], firefly algorithm (FFA) [25], and krill herd algorithm (KHA) [26]. These approaches are adaptable and capable of locating global solutions by directing solutions toward different sections of the search space through rapid and abrupt changes. In [27], based on newton second order (NSO), GA is combined with active power flow (APF) and produced a new hybrid technique called (HGA) due to GA's slow convergence. In [28], a grey wolf optimizer (GWO) based on an adaptive operator and random mutation is devised to solve the OPF issue. According to the "no free lunch" theory [29], which states that no single optimization strategy can solve all problems, this motivates researchers to develop new optimization strategies.
The main purpose of this study is to apply two different optimization methods called PSO and WOA, for solving the
problem of OPF. The two proposed techniques connect
Ng
i gi i gi i i gi gi
(4)
Newton Raphsonbased Power Flow (PF) equations to
determine the lowest cost of generation units. The losses of
F
i1
(a P2 b P

ci) d sin(e (Pmin P ))
TLs and trends of convergence of the IEEE 30bus system are
compared after the optimization process end. In addition, the optimal WOA results obtained in this study are compared to the PSO algorithm results. However, the following are the primary contributions of this paper:

Minimizing the total cost of generation units is the main cost function of this study.

The PSO and WOA methods are applied to optimally solve the OPF problem.

A comparison between the two wellknown optimization methods (PSO and WOA) is constructed to validate their efficiency in solving the studied optimization problem of OPF solution.

Standard IEEE 30bus test system is applied to test and confirm the reliability and strength of the developed algorithms in solving the OPF problem.

The obtained results prove the robustness and reliability of WOA in solving the OPF problem compared with PSO.

The other sections of the paper are structured as the followings: The OPF mathematical formulation is represented in Section 2. The developed optimization methods are explained in Section 3. Section 4 provides the simulations performed and the best results gained. Section 5 includes the paper's conclusion as well as the anticipated future work.


PROBLEM FORMULATION
Fuel Cost ($/MWh)
where, ai, bi, and ci represent the cost coefficients of ith generator, Ng represents the number of generators, and di, ei represent the fuel cost coefficients of the ith generator with the influence of valveloading point.
Output Power (MW)
Fig. 1. Fuel cost curves with and ithout the influence of valvepoint.
The state variables represent the dependent variables x which characterize a certain state of power system. The state variables are represented by the equation, which may be written as follows:
The primary goal of the optimal power flow tool is to solve
x V
…..V
, P ,Q
…..Q
, S …..S
(5)
the main equations of power flow problem to assign the control
L1 LNPQ G1 G1
GNPV TL1
TLNTL
variables values and achieve the optimal solutions for the chosen objective function. Consequently, the resulting solutions are constrained by both kinds of constraints. The goal of the OPF issue in this study is to find the lowest generation cost of generator units that fulfill equality and inequality requirements. The inequality constraints describe the system's operating and control boundaries, whereas the equality constraints represent the traditional electric PF equations.
The studied problem of the optimal power flow is
where PG1 represent the active power of slack bus, VL
denotes the load bus voltage, QG represents the generator reactive power, STL represents the transmission line (TL) loading, NPQ represents the number of load buses, NPV represents the generation buses number, and NTL denotes the TLs number in the power system.
The control variables represent the independent variables u that can satisfy the power flow equations. The OPF control variables can be formulated as the following,
mathematically formulated as a nonlinear optimization problem with two different types of constraints , namely,
u VG1…..VGNG , PG2…..PGNG ,T1…..TNT
(6)
equality and inequality restrictions as follows [30], Minimize:
F (x, u)
Subject to:
(1)
where, VG represents the generator voltage bus, PG represent
the real output power of generator, T denotes the tap setting of transformers, NG represents the generators number, and NT is the transformers number.

Constraints of Operation
g j (x,u) 0
wj (x,u) 0
j=1, 2, ., m (2)
j=1, 2, ., p (3)
There are two types of optimal power flow constraints: equality constraints and inequality constraints. The equality and inequality constraints are as follows:
where, F (x, u) is the studied cost function, x denotes the state
variables, u is the control variables, g (x, u) denotes the equality constraints, w (x, u) denotes the inequality constraints, m and p denote the equality and inequality constraints number,
respectively.

Equality Constraints: The equations that balance active and reactive power flow are known as equality constraints of OPF, and they are as follows:
N

Objective Function
The fuel cost functions of some generating units are nonlinear and convex, as seen in Fig. 1. This is due to the ripples caused by the opening procedures of steam turbine control valves. The objective function of the studied OPF
PGi PLi Vi Vj (Gij cos(i j ) Bij sin(i j ))
j1
N
QGi QLi Vi Vj (Gij cos(i j ) Bij sin(i j ))
j1
(7)
(8)
problem, including the influence of valve loading point, is formulated as follows,
where, PGi denotes the generator real power, PLi represents the load real power, QGi represents the generator reactive power,
and QLi indicates the load reactive power. Gij represents the transfer conductance and Bij is the susceptance between any
The velocity of ith individual at (k+1) iteration is computed as follows,
two buses.


Inequality Constraints: The inequality constraints are

V k 1 wV k c rand
i i 1 1
( pbestk xk )
i i
(20)
classified into generator constraints, transformer constraints
and security constraints. The inequality constraints are
c2rand2
i i
(Gbestk xk )
formulated as follows,
where, K represents the number of iterations. V k and xk is
i i
min max
PGi
PGi PGi
i=1, 2, ., NPV (9)
the velocity and position of particle i at iteration k, respectively. c1 and c2 represent the coefficients of
min max
QGi
QGi QGi
i=1, 2, ., NPV (10)
acceleration. w is the inertia weight parameter. rand1 and rand2
are random numbers between 0 and 1. The flow chart of PSO
min max
VGi
VGi VGi
i=1, 2, ., NPV (11)
for the optimal power flow solution is shown in Fig. 2.

WOA
i i
i
T min T T max
max
i=1, 2, ., NT (12)
WOA is based on whale hunting and encirclement techniques. This is known as the bubblenet feeding strategy.
STLi STLi
min max
i=1, 2, ., NTL (13)
Humpback whales seek to hunt small fish at the surface by forming a bubble net around the prey as it climbs along a circle
VLi
VLi VLi
i=1, 2, ., NPQ (14)
path. The WOA algorithm assumes that the target prey is the
A. PSO


OPTIMIZATION PROBLEMS
current best candidate solution. After the top search agent is
identified, the remaining search agents will aim to improve their positions in relation to the best search agent. The
Particle swarm optimization (PSO) is a technique
developed by Eberhart, Kennedy, and Shi [31, 32]. PSO is a populationbased approach that simulates the social ties of flocks of birds and fish education. The velocity of particles governs their movement, which is represented as a vector with magnitude and direction. The particles organize their route for each generation based on their best position (local best) and the location of the best particle (global best) of the whole population. According to this viewpoint, particles' stochastic properties are enhanced, resulting in better solutions and faster convergence to global optima. PSO works similarly to the other evolution strategies. The population size in the search space is represented by the number of particles. Particles began their movement at random. Every particle has a fitness value determined by the fitness function of the issue to be solved.
PSO is determined by the values of key parameters. The best parameter values are determined by the type of problem under study [33]. It is critical to strike a balance between exploration and exploitation based on the algorithm's goal. PSO is governed by the following parameters: total number of particles, total number of iterations, inertia weight (w), and social behavior coefficients (c1 and c2). For given values of c1, c2, convergence of the cost function is guaranteed [34].
The equations (15) and (160) represent a particle's position and velocity vectors in a N dimensional search space:
mathematical formulation of this phenomenon is as follows [35]:
= . () () (21)
( + 1) = () . (22)
where t is the current iteration, and represent coecient vectors,
represents the position vector of the best solution obtained so far,
denotes the position vector, and . is an elementbyelement multiplication if there is a better solution must be updated in each individual iteration. The vectors A and can be computed as,
A = 2a Â· r a (23)
= 2. r (24)
where, a is linearly decreased from 2 to 0 through the iterations number and r is an arbitrary vector in [0, 1].
Xi (xi1,……, xin )
Vi (vi1,……,vin )
(15)
(16)
where, xin and vin represent the particle ith position and velocity in a search space with n particles, respectively. A particle's optimal position can be described as (17) and the particle with the best position among all the other particles in the population is represented in (18).
pbest (x x
)
best best
i1 ,……, in
Gbest (x x
)
best best
i i1 ,……, in
(17)
(18)
Each particle's position and velocity are updated every (k+1) steps as follows:
k 1
k k 1
Xi Xi
Vi
(19)
START
Start
Initialize the population of the whales xi(i = 1, 2, .., n) consider the boundaries ub and lb and maximum no. of iterations
Random initial population within feasible range
J=1
Run NR for every particle
Calculate each search agent fitness
Record the violation values of voltage and line
NO
F=the best search agent
yes
if j>max_iter
Is population
count over?
YES
Output the best position
End
No
No
if p<0.5
Calculate the objective function
yes
if (A >=1) ?
yes
i=i+1
No
START PSO
Record the best and global best positions
Update the position of the current search agent
Update the position of the current search agent
Update the position of the current search agent
Update the velocity and position of
particle
Run NR for every updated particle
if i<n
No
yes
Evaluate the objective function for
updated population
J=j+1
update whales depending on
the upper and lower bounds
Is stopping criteria
satisfied?
YES
STOP
Fig. 2. The flow chart of PSO for the OPF problem.
The flow chart of WOA for the OPF problem is presented in Fig. 3.
Fig. 3. The flow chart of WOA for the OPF problem.

RESULTS AND DISCUSSION
In this work, Newton Raphson based WOA is applied to standard IEEE 30bus systems to find the optimal solution for the objective function. The proposed WOA has been compared with conventional PSO algorithm. The control variables for the proposed WOA technique are summarized as follows, Maximum number of iterations are 500 iterations while the number of search agents is adjusted to 15. while for the PSO algorithm the following control variables are utilized in the optimization process; number of iterations = 500, number of particles = 15, wmin = 0.4, wmax = 0.9, c1 = c2 = 1.4. The cost coefficients of generation units, active and reactive power bound for IEEE 30 bus test systems are listed in Table I [27].
P1 (MW)
173.733
159.194
P2 (MW)
4,.49
39.286
P5 (MW)
20.84
28.450
P8 (MW)
20.84
32.726
P11 (MW)
18.859
13.531
P13 (MW)
16.51
18.505
VG1 (pu)
1.050
1.050
VG2 (pu)
1.089
1.027
VG5 (pu)
1.0105
1.004
VG8 (pu)
1.0056
1.062
VG11 (pu)
1.0861
1.093
VG13(pu)
1.0468
1.032
T11
1.0053
0.986
T12
0.968
0.975
T15
0.968
1.094
T36
0.968
1.094
Plosses (MW)
9.371
8.291
Cost ($/h)
805.805
812.755
TABLE I. COST COEFFICIENTS OF UNITS, ACTIVE AND REACTIVE POWER OUTPUTS FOR THE TESTED IEEE 30 BUS SYSTEM.
Bu s
a
b
c
d
e
Pmi
n
Pma
x
Qmi
n
Qma
x
1
0..375
2
0
50
0.06
3
50
200
40
200
2
0.0175
1.7
5
0
40
0.09
8
20
80
20
100
5
0.0625
1
0
0
0
15
50
15
80
8
0.0083
4
3.2
5
0
0
0
10
35
15
60
11
0.025
3
0
0
0
10
30
10
50
13
0.025
3
0
0
0
12
40
15
60
The IEEE 30bus test system is presented in Fig. 4. In this system, while 6 buses of the system are chosen as generation buses (PV), the remaining 21 buses are load buses (PQ). Total load demand of the system is defined as (PD) 283.40 MW.
Fig. 4. Standard IEEE 30bus test system.
The convergence curves of the proposed WOA and the conventional PSO algorithms are presented in Fig. 5. Moreover, the obtained results of the OF, active and reactive power generation, power losses in the lines of the IEEE 30 bus standard system are shown in Table II. The results obtained from the proposed WOA are compared with that of the conventional PSO algorithm. The objective function is found to be 805.805 $/h and 812.755 $/h for WOA and PSO, respectively. The transmission line losses obtained are 9.371 MW and 8.291 MW, for WOA and PSO, respectively. It is clearly observed that the proposed WOA method gives better results over the PSO in terms of the generation cost of the generating units. The main objective in this work is the total generation cost, therefore the system losses are not taken into consideration as an objective function. Therefore, it can be concluded that the losses of the studied system are in the acceptable margins provided in the current study.
Fig. 5. Convergence curves of the OPF solution for standard IEEE 30bus system.
IEEE 30Bus
WOA
PSO
TABLE II. OPF RESULTS FOR IEE 30BUS TEST SYSTEM.

CONCLUSION
In this work, PSO and WOA optimization techniques are applied to solve the OPF problem. The objective function is tested on IEEE 30bus system. The objective function has been restricted with equality and inequality constraints to demonstrate the reliability and robustness of OPF solutions of the proposed algorithms. The results show that WOA can find a better OPF solutions compared with the conventional technique called PSO. The objective function is found to be 805.805 $/h and 812.755 $/h for WOA and PSO, respectively. The comparison between the convergence trends of WOA and PSO techniques proves the dominance of WOA to achieve the OPF solution with fast convergence with fewer number of iterations. In the future work, the WOA technique can be used to tackle various optimization problems in power systems and other different disciplines.
ACKNOWLEDGMENTS
The authors acknowledge the support of King Fahd University of Petroleum and Minerals in conducting this research work.
REFERENCES
[1] A. Mukherjee and V. Mukherjee, "Solution of optimal power flow using chaotic krill herd algorithm," Chaos, Solitons & Fractals, vol. 78, pp. 1021, 2015. [2] Y. Brar and J. . Randhawa, "Optimal power flow using power world simulator," in 2010 ieee electrical power & energy conference, 2010, pp. 16: IEEE. [3] M. Ghasemi, S. Ghavidel, M. M. Ghanbarian, M. Gharibzadeh, and A.
Vahed, "Multiobjective optimal power flow considering the cost, emission, voltage deviation and power losses using multiobjective modified imperialist competitive algorithm," Energy, vol. 78, pp. 276 289, 2014.


vol. 4, no. 2, pp. 530537, 1989.
[10] R. Burchett, H. Happ, and D. Vierath, "Quadratically convergent optimal power flow," IEEE Transactions on Power Apparatus and Systems, no. 11, pp. 32673275, 1984. [11] X. Yan and V. H. Quintana, "Improving an interiorpointbased OPF by dynamic adjustments of step sizes and tolerances," IEEE Transactions on Power Systems, vol. 14, no. 2, pp. 709717, 1999. [12] M. AlRashidi and M. ElHawary, "Hybrid particle swarm optimization approach for solving the discrete OPF problem considering the valve loading effects," IEEE transactions on power systems, vol. 22, no. 4, pp. 20302038, 2007. [13] D. I. Sun, B. Ashley, B. Brewer, A. Hughes, and W. F. Tinney, "Optimal power flow by Newton approach," IEEE Transactions on Power Apparatus and systems, no. 10, pp. 28642880, 1984. [14] M. Osman, M. A. AboSinna, and A. Mousa, "A solution to the optimal power flow using genetic algorithm," Applied mathematics and computation, vol. 155, no. 2, pp. 391405, 2004. [15] T. Chung and Y. Li, "A hybrid GA approach for OPF with consideration of FACTS devices," IEEE power engineering Review, vol. 21, no. 2, pp. 4750, 2001. [16] S. Duman, U. GÃ¼venÃ§, Y. SÃ¶nmez, and N. YÃ¶rÃ¼keren, "Optimal power flow using gravitational search algorithm," Energy conversion and management, vol. 59, pp. 8695, 2012. [17] S. Duman, "GÃ¼ venÃ§ U, SÃ¶ nmez Y, YÃ¶ rÃ¼ keren N. Optimal power flow using gravitational search algorithm," Energy Conversion and Management, vol. 59, pp. 8695, 2012. [18] A. Abou El Ela, M. Abido, and S. Spea, "Optimal power flow using differential evolution algorithm," Electric Power Systems Research, vol. 80, no. 7, pp. 878885, 2010. [19] F. S. AbuMouti and M. E. ElHawary, "Overview of Artificial Bee Colony (ABC) algorithm and its applications," in 2012 IEEE International Systems Conference SysCon 2012, 2012, pp. 16: IEEE. [20] M. R. Adaryani and A. Karami, "Artificial bee colony algorithm for solving multiobjective optimal power flow problem," International Journal of Electrical Power & Energy Systems, vol. 53, pp. 219230, 2013. [21] M. A. Abido, "Optimal power flow using particle swarm optimization," International Journal of Electrical Power & Energy Systems, vol. 24, no. 7, pp. 563571, 2002. [22] G. Chen and J. Yang, "A new particle swarm optimization solution to optimal reactive power flow problems," in 2009 AsiaPacific Powerand Energy Engineering Conference, 2009, pp. 14: IEEE.
[23] H. Pulluri, R. Naresh, and V. Sharma, "An enhanced selfadaptive differential evolution based solution methodology for multiobjective optimal power flow," Applied Soft Computing, vol. 54, pp. 229245, 2017. [24] S. Kamel, M. Ebeed, and F. Jurado, "An improved version of salp swarm algorithm for solving optimal power flow problem," Soft Computing, vol. 25, no. 5, pp. 40274052, 2021. [25] G. E. Manoranjitham and A. Shunmugalatha, "Retracted: application of firefly algorithm on optimal power flow control incorporating simplified impedance UPFC model," ed: Elsevier, 2015. [26] P. K. Roy and C. Paul, "Optimal power flow using krill herd algorithm," International Transactions on Electrical Energy Systems, vol. 25, no. 8, pp. 13971419, 2015. [27] T. N. Malik, A. ul Asar, M. F. Wyne, and S. Akhtar, "A new hybrid approach for the solution of nonconvex economic dispatch problem with valvepoint effects," Electric Power Systems Research, vol. 80, no. 9, pp. 11281136, 2010. [28] M. Abdo, S. Kamel, M. Ebeed, J. Yu, and F. Jurado, "Solving non smooth optimal power flow problems using a developed grey wolf optimizer," Energies, vol. 11, no. 7, p. 1692, 2018. [29] D. H. Wolpert and W. G. Macready, "No free lunch theorems for optimization," IEEE transactions on evolutionary computation, vol. 1, no. 1, pp. 6782, 1997. [30] A. J. Wood and F. Bruce, "Wollenberg.Power Generation, Operation and Control," John Wily & Sons, Inc, USA, 1996. [31] J. Kennedy and R. Eberhart, "Particle swarm optimization," in Proceedings of ICNN'95international conference on neural networks, 1995, vol. 4, pp. 19421948: IEEE. [32] Y. Shi and R. Eberhart, "A modified particle swarm optimizer," in 1998 IEEE international conference on evolutionary computation proceedings. IEEE world congress on computational intelligence (Cat. No. 98TH8360), 1998, pp. 6973: IEEE. [33] E.G. Talbi, Metaheuristics: from design to implementation. John Wiley& Sons, 2009.
[34] F. V. D. Bergh, "An analysis of particle swarm optimizers," Unpublished doctoral dissertation, University of Pretoria, South Africa, 2001. [35] S. Mirjalili and A. Lewis, "The whale optimization algorithm,"Advances in engineering software, vol. 95, pp. 5167, 2016.