Firefly Algorithm For Solving Non Convex
Firefly Algorithm For Solving Non Convex
Firefly Algorithm for solving non-convex economic dispatch problems with valve
loading effect
Xin-She Yang a , Seyyed Soheil Sadat Hosseini b , Amir Hossein Gandomi c,∗
a
Department of Engineering, University of Cambridge, Trumpington Street, Cambridge CB2 1PZ, UK
b
Young Researchers Club, Sari Branch, Islamic Azad University, Sari, Iran
c
Young Researchers Club, Central Tehran Branch, Islamic Azad University, Tehran, Iran
a r t i c l e i n f o a b s t r a c t
Article history: The growing costs of fuel and operation of power generating units warrant improvement of optimiza-
Received 5 August 2010 tion methodologies for economic dispatch (ED) problems. The practical ED problems have non-convex
Received in revised form 21 June 2011 objective functions with equality and inequality constraints that make it much harder to find the global
Accepted 22 September 2011
optimum using any mathematical algorithms. Modern optimization algorithms are often meta-heuristic,
Available online 17 November 2011
and they are very promising in solving nonlinear programming problems. This paper presents a novel
approach to determining the feasible optimal solution of the ED problems using the recently devel-
Keywords:
oped Firefly Algorithm (FA). Many nonlinear characteristics of power generators, and their operational
Economic load dispatch
Valve loading effect
constraints, such as generation limitations, prohibited operating zones, ramp rate limits, transmission
Firefly Algorithm loss, and nonlinear cost functions, were all contemplated for practical operation. To demonstrate the
Metaheuristic efficiency and applicability of the proposed method, we study four ED test systems having non-convex
solution spaces and compared with some of the most recently published ED solution methods. The results
of this study show that the proposed FA is able to find more economical loads than those determined by
other methods. This algorithm is considered to be a promising alternative algorithm for solving the ED
problems in practical power systems.
© 2011 Elsevier B.V. All rights reserved.
1568-4946/$ – see front matter © 2011 Elsevier B.V. All rights reserved.
doi:10.1016/j.asoc.2011.09.017
X.-S. Yang et al. / Applied Soft Computing 12 (2012) 1180–1186 1181
initial guess happens to be in the neighborhood of a local solution. This curve contains higher order nonlinearity because of the valve-
Dynamic programming method may cause the dimensions of the point effect, and should be refined by a sine function. Also the
ED problem to become extremely large, thus requiring enormous solution procedure can easily trap in the local minima in the vicinity
computational efforts. of optimal value. To take account for the valve-point effects, sinu-
To overcome these deficiencies, artificial intelligence meth- soidal terms are added to the quadratic cost functions as follows:
ods have been used to solve the ED problem, and these methods ∼
include Genetic Algorithm (GA) [16], real-coded genetic algo- Fi = ai Pi2 + bi Pi + ci + ei sin(fi (Pimin − Pi ) (3)
rithm (RCGA)[17], Tabu Search (TS) [5], Hopfield neural network
[18], different types of Evolutionary Programming (EP) [19], where ei and fi are constants of the unit with valve-point effects.
biogeography-based optimization (BBO) [20], Evolutionary Strat- The model in Eq. (3) is subject to the following constraints:
egy (ES) [21], Particle Swarm Optimization (PSO) ([22–25]), an
improved coordinated aggregation-based particle swarm opti- 2.1. Power balance constraint
mization (ICA-PSO) [26,27], Bacterial Foraging (BF) [28], harmony
search (HS) [29] and Hopfield Neural Network (HNN) [30]. NG
Although several optimization methodologies have been devel- Pi = PD + PL (4)
oped for the ED problem, the complexity of the task reveals the i=1
necessity for development of efficient algorithms to accurately
locate the optimum solution. In this context, the objective of this where PD is the load demand and PL is the total transmission net-
work is to demonstrate a new approach for solving ED problems, work losses of system. To compute network losses, the B-coefficient
aiming to provide a practical alternative for conventional methods. method [7] is commonly utilized by the power utility industry. In
Here, Firefly Algorithm, developed by Yang [31], is used which has the B-coefficient method, the transmission losses are expressed as
been successful to solve mixed variable and constrained engineer- a quadratic function:
ing problems [32]. A more detailed description concerning theoreti- n
n n
cal and implementation feature of the proposed method is provided PL = Pi Bij Pj + B0i Pi + B00 . (5)
in the later sections. To show the efficiency and applicability of the
i=1 j=1 i=1
proposed method, several types of ED problems are analyzed and
results are compared with those available in the literature.
This paper is organized as follows. Section 2 illustrates the ED 2.2. Ramp rate limits
problem formulation considering valve-loading effect, prohibited
operating zone (POZ) constraints and ramp rate limits. Moreover, One of the unrealistic assumptions that prevailed for simplifying
the proposed method for constraints handling is demonstrated in the problem in many of the earlier research is that the adaptations
this section. In Section 3, the Firefly Algorithm is described. In to the power output are instantaneous. However, under practical
Section 4, simulation results are presented that demonstrate the circumstances, ramp rate limit restrains the operating range of all
potential of the proposed algorithm. Finally, Section 5 concludes the online units for tuning the generator operation between two
the paper with discussions operating periods [33]. The generation may increase or decrease
with corresponding upper and lower ramp rate limits. Therefore,
2. Economic load dispatch problems with valve-point units are restricted due to these ramp rate limits as mentioned
loadings problem below.
If power generation increases, we have
The goal of economic dispatch (ED) problem is to find the opti- Pi − Pi0 ≤ URi . (6)
mal combination of power generations that minimizes the total
generation cost, while satisfying an equality constraint and inequal- If power generation decreases, we have
ity constraints. Cost efficiency is the most significant subproblem
of power system operations. Owing to the highly nonlinearity char- Pi0 − Pi ≤ DRi (7)
acteristics of power systems and generators, ED belongs to a class
of nonlinear programming optimization including equality and where Pi0 is the previous power generation of unit i. URi and DRi are
inequality constraints. Practically speaking, while the scheduled the up-ramp and down-ramp limits of the ith generator, respec-
combined units for each specific period of operation are listed from tively. The inclusion of ramp rate limits changes the generator
unit commitment, the ED planning must carry out the optimal gen- operation constraints (5) as follows:
eration dispatch among the operating units in order to meet the
max(Pimax , URi − Pi) ≤ Pi ≤ min(Pimax , Pi0 − DRi ). (8)
load demands and practical operation constraints of generators,
which consist of ramp rate limits, maximum and minimum lim-
its, and prohibited operating zones. In general, the generation cost 2.3. Prohibited operating zones
function is usually stated as a quadratic polynomial. Mathemati-
cally, the problem can be modeled as: A generator with prohibited operating zones has discontinuous
fuel-cost characteristics. The conception of prohibited operating
n
zones is consisted of the following constraint in the ED:
min f = Fi (Pi ) (1)
⎧ min LB
i=1 P ≤ Pi ≤ Pi,1
⎨ i
⎪
where Fi is the total generation cost for the generator unit i, which UB ≤ P ≤ P LB j = 2, 3, . . . , NP
Pi,j−1 i i . (9)
i,j
is defined by the following equation: ⎪
⎩ UB
Pi,j ≤ Pi ≤ Pimax j = NPi
Fi (Pi ) = ai Pi2 + bi Pi + ci (2)
LB and P UB are the lower and upper boundaries of prohibited
where Pi,j
where ai , bi and ci are coefficients of generator i. i,j
The valve-opening process of multivalve steam turbines pro- operating zone j of generator i, respectively; NPi is the number of
duces a ripple-like effect in the heat rate curve of the generators. prohibited operating zones of generator i.
1182 X.-S. Yang et al. / Applied Soft Computing 12 (2012) 1180–1186
3. Firefly Algorithm problem. The POZ constraints (9) are utilized as follows. If the gen-
eration of unit i is settled in its jth POZ, i.e.:
The Firefly Algorithm was developed by Yang ([34,35]), and it
LB UB
was based on the following idealized behavior of the flashing char- Pi,j ≺ Pi ≺ Pi,j (13)
acteristics of fireflies:
then the amount of generation is cut to the nearest boundary of the
• All fireflies are unisex so that one firefly is attracted to other jth POZ as follows:
fireflies regardless of their sex;
LB + P UB
Pi,j
• attractiveness is proportional to their brightness, thus for any ave i,j
Pi,j = (14)
two flashing fireflies, the less bright one will move towards the 2
brighter one. The attractiveness is proportional to the brightness
and they both decrease as their distance increases. If no one is LB LB ≺ P ≤ P ave
Pi,j if Pi,j i i,j
brighter than a particular firefly, it moves randomly; Pi = . (15)
• the brightness or light intensity of a firefly is affected or deter- UB
Pi,j ave ≺ P ≺ P UB
if Pi,j i i,j
mined by the landscape of the objective function to be optimized.
For a nonlinear optimization problem with equality and inequal-
For a maximization problem, the brightness can simply be ity constraints, a common method is the penalty method. The idea
proportional to the objective function. Other forms of brightness is to define a penalty function so that the constrained problem is
can be defined in a similar way to the fitness function in genetic transformed into an unconstrained problem. Now we can define
algorithms or the bacterial foraging algorithm (BFA) ([36]).
M
N
(x, i , vj ) = f (x) + i ϕi2 (x) + vj 2
j
(x) (16)
Firefly Algorithm
i=1 j=1
Objective function f(x), x = (x1 , . . ., xd )T
Initialize a population of fireflies xi (i = 1, 2, . . ., n) where i ≥ 1 and vj ≥ 0 which should be large enough, depending
Define light absorption coefficient on the solution quality needed. As we can see, when an equality
while (t < MaxGeneration) constraint it met, its effect or contribution to is zero. How-
for i = 1: n all n fireflies ever, when it is violated, it is penalized heavily as it increases
for j = 1: i all n fireflies significantly. Similarly, it is true when inequality constraints
Light intensity Ii at xi is determined by f(xi ) becomes tight or exactly. It should be mentioned that generation
if (Ij > Ii ) and ramp rate limits are similar type of constraints. These con-
Move firefly i towards j in all d dimensions straints together state the overall upper/lower generation limits of
end if the units.
Attractiveness varies with distance r via exp [− r2 ]
Evaluate new solutions and update light intensity
end for j 4. Implementation and numerical experiments
end for i
Rank the fireflies and find the current best All the EAs for the ED problems are implemented using
end while MATLABTM 7.0 on a PC with a Pentium IV, Intel Dual core 2.2 GHz,
Postprocess results and visualization 1 GB RAM. Owing to the random nature of the FA (and in fact all
metaheuristic algorithms), their performance cannot be judged by
the result of a single run. Many trials with independent popula-
The movement of a firefly i is attracted to another more attrac- tion initializations should be made to obtain a useful conclusion of
tive (brighter) firefly j is determined by the performance of the approach. Therefore, the results should be
− r2 analyzed using statistic measures such as mean and standard devi-
xit+1 = xit + ˇ0 e ij (xit − xit ) + ˛εti (12) ation. The best, worst and mean obtained in 100 trials are used to
where ˇ0 is the attractiveness at r = 0, the second term is due to the compare the performances of different EAs. To find the effective-
attraction, while the third term is randomization with the vector ness of the proposed FA, the test results are also compared with the
of random variables εi being drawn from a Gaussian distribution. results already reported by the most recently published methods
The distance between any for solving the ED problem.
two fireflies i and j at xi and xj can be the
There are 4 important parameters in the Firefly Algorithm: ˛0 ,
Cartesian distance rij = xi − xj or the l2 -norm. For other applica-
2 ˇ0 , , and the population size n. In order to obtain the right param-
tions such as scheduling, the distance can be time delay or any suit-
eters, we have carried out a detailed parametric study by varying
able forms, not necessarily the Cartesian distance. For most cases
these parameters. More specifically, we varied ˛0, ˇ0 from 0.1 to 1.0
in our implementation, we can take ˇ0 = 1, ˛ ∈ [0, 1] , and = 1.
with a step increase of 0.1, from 0.01 to 100 with a step increase
In addition, if the scales vary significantly in different dimensions
of 0.01 up to 1, and then 5 up to 100. We also varied n from 5 to
such as −105 to 105 in one dimension while, say, −10−3 to 103 along
100 with an interval of 5. By analyzing the optimal solutions for
others, it is a good idea to replace ␣ by ˛Sk where the scaling param-
a wide range of test functions, we found that the best values or
eters Sk (k = 1, . . ., d) in the d dimensions should be determined by
ranges of the parameters are: ˛0 = 0.4–0.9, ˇ0 = 0.5–1.0, = 0.1–10
the actual scales of the problem of interest. In essence, the param-
and n = 25–50. For most problems, we can use the fixed value of
eter characterizes the variation of the attractiveness, and partly
ˇ0 = 1. Therefore, the parameters of the proposed FA to solve the
controls how the algorithm behaves. It is also possible to adjust
ED problem in the four test cases are: ˇ0 = 1, = 1/L (where L is
so that multiple optima can be found at the same during iterations.
the characteristic scale of the problem), ˛ = 0.5 and then is gradu-
3.1. Constraint handling ally reduced to 0.01 as iterations proceed. n varies from 25 to 50,
depending on the complexity of the problem. In addition, the max-
A significant factor in the application of optimization tech- imum number of function evaluations varies from 5000 to 50,000,
niques is how the algorithm handles the constraints concerning the depending on the size of the ED problem.
X.-S. Yang et al. / Applied Soft Computing 12 (2012) 1180–1186 1183
Table 1
Comparison of FA and global optimal on the three benchmark constrained problems.
Table 2
The best, average and worst results of different ED solution methods for the 3 unit test system.
Table 1. As it can be seen from this table the FA obtained the global Total generation (MW) 850
optimal solution correctly in all the three examples. Generation cost ($/h) 8234.074
Example 1.
4.2. Economic dispatch problems
x
Minimize : f (x, y) = −y + 2x − ln
2
4.2.1. Case 1: 3 generating units
x
This test case includes three generating units. The expected load
Subject to : g1 = −x − ln +y≤0
2 demand to be met by all the three generating units is 850 MW.
The description of the system can be found from [19]. It has
where 0.5 ≤ x ≤ 1.5 and y ∈ 0, 1 .
been reported in Ref. [5] that the global minimum found for the
Example 2. three-generator system is 8234.07. Based on the above mentioned
parameters, the Firefly Algorithm has been executed for 100 trials
Minimize : f (x, y) = −0.7y + 5(x1 − 0.5)2 + 0.8 with various starting points to verify its performance and efficiency.
The best, average and worst of cost functions achieved by various
g1 = − exp(x1 − 0.2) − x2 ≤ 0 methods are shown in Table 2. All methods give a similar ‘best solu-
Subject to : g2 = x2 + 1.1y + 1.0 ≤ 0 tion’, whereas ‘average’ and ‘worst’ costs differ. Table 3 shows that
g3 = x1 − 1.2y − 0.2 ≤ 0 the proposed method has accomplished in finding the global opti-
mal solution presented in Ref. [5]. The average execution time of
where 0.2 ≤ x1 ≤ 1.0, −2.22554 ≤ x2 ≤ − 1.0 and y ∈ 0, 1 .
the FA for this test system is 2.07 s.
Example 3.
Minimize : f (x, y) = (y1 − 1)2 + (y2 − 1)2 + (y3 − 1)2 4.2.2. Case 2: 13 generating units
This test case consists of thirteen generating units; the complex-
− ln(y4 + 1) + (x1 − 1)2 + (x2 − 2)2 + (x3 − 3)2
ity to the solution process has significantly increased. Inasmuch as
this is a larger system with higher non-linearity, it has more local
g1 = y1 + y2 + y3 + x1 + x2 + x3 − 5.0 ≤ 0 minima and thus it is difficult to attain the global solution. To be
g2 = y32 + x12 + x22 + x32 − 5.5 ≤ 0 able to deal with more complicated case with highly non-linearity
g3 = y1 + x1 − 1.2 ≤ 0 is one of the main goals of FA applications. The load demand of this
g4 = y2 + x2 − 1.8 ≤ 0 test system is 1800 MW. Exactly the same data of all units as given
g5 = y3 + x3 − 2.5 ≤ 0 in Ref. [19] will be utilized in this case. Table 4 shows the best, aver-
age and worst results of different ED solution methods among 100
Subject to : g6 = y4 + x1 − 1.2 ≤ 0
trial runs in the same way as listed in Table 2. The outcomes of the
g7 = y22 + x22 − 1.64 ≤ 0
other approaches shown in Table 4 have been directly quoted from
g8 = y32 + x32 − 4.25 ≤ 0 their corresponding references (‘NA’ means the related result is not
g9 = y22 + x32 − 4.64 ≤ 0 available in the corresponding reference). The average execution
time of the FA for this test system is 10.36956 s. The computa-
where 0 ≤ x1 , x2 , x3 and y1 , y2 , y3 , y4 ∈ 0, 1 .
tion times of the FA are not compared with the other ED solution
1184 X.-S. Yang et al. / Applied Soft Computing 12 (2012) 1180–1186
Table 4
The best, average and worst results of different ED solution methods for the 13 unit test system.
methods, since the computation times of each ED method are com- results of the optimal solution of the proposed method, includ-
puted on a different hardware. Output power of the generators of ing generation output of each unit for this test system, are shown
the 13 unit test system in the minimum solution of the FA is shown in Table 7.
in Table 5.
Table 6
The best, average and worst results of different ED solution methods for the 40 unit test system.
Table 7 Table 8
Output power of generators in the best result of the proposed FA for the 40 unit test The best, average and worst result of different ED solution methods for the 15 unit
system. test system including POZ constraints, ramp rate limits and transmission losses.
Unit Power (MW) Unit Power (MW) Methods Generation cost ($/h)