Академический Документы
Профессиональный Документы
Культура Документы
SCHOOL OF ENGINEERING
DECLARATION
NAME OF STUDENT:
REGISTRATION NUMBER:
F17/2390/2009
COLLEGE:
ARCHITECTURE AND
ENGINEERING
FACULTY:
ENGINEERING
DEPARTMENT:
COURSE NAME:
BACHELOR OF SCIENCE IN
ELECTRICAL AND
ELECTRONICENGINEERING
TITLE OF WORK:
SOLVING
ECONOMIC LOAD DISPATCH
USING TABU SEARCH
1.I understand what plagiarism is and I am aware of the university policy in this
regard.
2.I declare that this final year project report is my original work and has not been
submitted elsewhere for examination, award of a degree or publication. Where other
peoples work or my own work has been used, this has properly been acknowledged
and referenced in accordance with the University of Nairobis requirements.
3.I have not sought or used the services of any professional agencies to produce this
work.
4.I have not allowed, and shall not allow anyone to copy my work with the intention
of passing it off as his/her own work.
5.I understand that any false claim in respect of this work shall result in disciplinary
action, in accordance with University anti-plagiarism policy.
SIGNATURE:
..................................................................................................................
DATE:.....................................................................................................................
II
CERTIFICATION
This report has been submitted to the Department of Electrical and Information
Engineering, University of Nairobi with my approval as supervisor:
.....................................................
DR.NICODEMUS ABUNGU
DATE:
............................................................
III
DEDICATION
IV
ACKNOWLEDGEMENT
I would like to express my gratitude to my advisor and supervisor Dr.Abungu and
Mr.Musau, whose expert knowledge, subject understanding and patience, aided
considerably towards my graduate studies experience. I appreciate their continuous
support and motivation during my final year project. I would like to thank the other
members of my student fellow final year students for the assistance they provided
towards this project.
TABLE OF CONTENT
TITLE PAGE
DECLARATION
II
CERTIFICATION
III
DEDICATION
IV
ACKNOWLEDGEMENT
LIST OF FIGURES
VII
LIST OF TABLES
VII
LIST OF ABBREVIATIONS
IX
ABSTRACT
CHAPTER1
1.1INTRODUCTION........................................................................................................................
1.2.1GENETIC ALGORITHM..........................................................................................................
1.2.2SIMULATED ANNEALING...................................................................................................
1.2.4PARTICLE SWARM..................................................................................................................
1.2.5TABU SEARCH........................................................................................................................
1.3OBJECTIVES............................................................................................................................
1.4PROJECT QUESTIONS
1.5PROJECT ORGANIZATION...................................................................................................
CHAPTER 2
2.1LITERATURE REVIEW......................................................................................................
2.1.1PROBLEM FORMULATION.................................................................................................
2.1.2INEQUALITY CONSTRAINTS............................................................................................
10
10
15
15
16
18
18
VI
CHAPTER 3
38
3.1MDTS ALGORITHM...................................................................................................................
31
32
3.3PARAMETER SETTINGS..........................................................................................................
33
CHAPTER 4
35
4.1RESULTS.....................................................................................................................................
35
CHAPTER 5
38
5.1DISCUSSION............................................................................................................................
38
5.2CONCLUSION.............................................................................................................................
39
5.3RECOMMENDATION.................................................................................................................
39
41
REFERENCE
42
MATLAB CODE
44
VII
VIII
LIST OF FIGURES
Figure 1
Figure 2
Figure 3
Simplex of 3 vertices
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Jelly fish
IX
LIST OF TABLES
Table 1
simulation results
Table A.1
LIST OF ABBREVIATION
TS
Tabu Search.
ELD
UC
Unit Commitment
NLP
LP
Linear Programming
IP
Interior Point
TL
Tabu List
ATS
PSO
mDTS
AC
Aspiration Criterion
TC
Termination Criterion
NMS
Neder-Meader Search
APS
VRL
TR
Tabu Region
STR
JFA
XI
ABSTRACT
Economic Load Dispatch(ELD) is the scheduling of generators' output levels such as
to suffice the system load at the minimum total fuel cost subject to generation and
operation constraints. As power grids have become more integrated and grand, Power
Utility companies have sought out to achieve a delicate balance between reliable
power supply to consumers and minimal operational cost. Planning for tomorrow's
dispatch involves scheduling generating units for each hour of the next day's dispatch
based on forecast load for the next day and unit committing. Dispatching power today
involves monitoring load, generation, transmission and interchange(exports/imports)
to ensure balance in supply and load and losses. From a computational perspective,
Economic Load dispatch is a multi objective combinatorial optimization problem
that can be solved by both conventional computation methods and artificially
intelligent
methods.
Conventional
computational
methods
include
Linear
XIII
CHAPTER 1
1.1 INTRODUCTION
In a Power System Operation and Planning, there are many optimization problems that require
real-time solutions such as to determine the optimal resources required at minimum cost within a
given set of constraints.The various operation problems in power system which require optimization
include Load Frequency Control (LFC), Optimal Power Flow(OPF), Economic Load
Dispatch and Unit Commitment (UC), Hydrothermal Dual Problem, Hydrothermal Interchange
Coordination, Maintenance Scheduling, Interchange Coordination, maintenance Scheduling and
Generation Planning. This project endeavors to tackle the Economic Load Dispatch problem, whose
scheduling is done over a time period of hours with the sole purpose of minimizing the expected
cost of operation of power plants while providing reliable and robust power to consumer within
given set of system and operational constraints.[1]
optimization
techniques include:
Linear Programming(LP)
Non-Linear Programming(NLP)
Integer Programming
Separable Programming(SP)
Dynamic Programming
Most mathematical based algorithms can guarantee reaching an optimal solution; while do not
necessarily guarantee reaching a global optimum. Global optimality may be only reached, checked
or guaranteed for simple cases. On the other hand, many practical optimization problems do not fall
in strict forms and assumptions of mathematical based algorithms.
Moreover, if the problem is highly complex, we may not readily be able to solve them, at all,
through mathematical algorithms.Besides, finding global optimum is of interest, as finding a local
one would be a major drawback. These drawbacks are tackled by employing heuristic techniques[1]
[13]. Heuristic techniques that have been adopted in solving ELD include:
Heuristic search methods are robust and have a faster development time while tend to be insensitive
to noise and missing data.
1.3 OBJECTIVES
To come up with a modified version of Tabu search that effectively and efficiently solves
the Economic Load Dispatch problem.
The total fuel cost obtained from the modified version of Tabu search should the lower than
that obtained by other meta-heuristics Genetic Algorithm(GA) and Particle Swarm
Optimization method(PSO)
Is the modified Direct Tabu Search (mDTS) efficient and effective in solving Economic
Load Dispatch?
Is the total fuel cost obtained by modified Direct Tabu Search (mDTS) cheaper than that
obtained by Genetic Algorithm(GA) and Particle Swamp Optimization(PSO)?
CHAPTER 2
2.1 LITERATURE REVIEW
This project endeavors to tackle the economic load dispatch problem, whose scheduling is done
over a time period of hours with the sole purpose of minimizing the expected cost of operation of
power plants while providing reliable and robust power to consumer within a given set of
constraints.
The definition of Economic Load Dispatch provided in EPAct section 1234 is: The operation of
generation facilities to provide energy at the lowest cost to reliably serve consumers,
recognizing any operational limits of generation and transmission facilities[2].
Economic Load Dispatch Problem is a sub problem of Unit Commitment (UC) .UC is defined as
handling of unit generation schedule in a power system for minimizing operation cost and
sustaining load demand and system reserve constraints.
FT = F i ( Pi )
i=1
where
(2.1)
n=no.of generating
Fi ( Pi )=fuel cost of generating unit i
The fuel cost of thermal generating unit is a polynomial
Fi ( Pi )=ai +bi pi +c i pi2 where
(2.2)
pi= p d + pl
where
(2.3)
i=1
PL = pi pij p j+ b oi pi +boo
i=1 j=1
(2.4)
i=1
Generation limit constraint is given by minimum and maximum generation limit of unit i
Pi min P i Pi max
(2.5)
(2.6)
If the power output of a generating unit for optimum performance of the system is less than a pre assigned value
Pi min , the unit is not connected to the bus bar because it is not possible to generate
such low value of power from that unit. Hence the generated power P cannot be taken outside the
range given by the inequality . Similarly, the maximum and minimum reactive power that can be
generated by a source is limited. Hence the generator reactive power Q cannot be taken outside the
range as stated by the inequality.
Qmin Q Qmax .
(2.7)
b) VOLTAGE CONSTRAINTS
It is needed that the voltage magnitudes and phase angles at each node should vary within a certain
range. The voltage magnitude should vary within a certain range otherwise most of the equipment
connected to the system would not operate as needed or additional use of voltage regulating device
would make the system non-economical. Thus
Vmin Vp Vmax
(2.8)
p min p max
(2.9)
where V and stand for the voltage magnitude and phase angle at the p th bus or node. Normally
operating angle of transmission line lies between 300 and 450 for transient stability considerations.
Therefore a higher limit is set on angle d. A lower limit of d assures proper usage of transmission
facility.
c) RUNNING SPARE CAPACITY CONSTRAINTS
These constraints are required to meet:
The forced outages or cut off of one or more alternators on the system
The load generation should be such that in addition to load demand and system losses a
minimum spare capacity must be available:
GP D + P L or
(2.10)
G=P D + P L + PSO
(2.11)
where G is the total the generation capacity and PSO is some pre-assigned power. A well
planned system is the one in which spare capacity PSO is minimum.
d) TRANSFORMER TAP SETTINGS
If an auto transformer is used, the minimum tap setting could be 0 and the maximum could be 1
that is
0t1 . Similarly for a two winding transformer if tapings are provided on the
secondary side ,
0tn where n is the transformer ratio. Phase shift limits of the phase shifting
pmin p pmax
e) TRANSMISSION LINE CONSTRAINTS
The flow of real and reactive power through the transmission line is limited by the
thermal stability of the line and is expressed as :
C PC Pmax
(2.13)
where
(2.14)
i = 1,2n
Equality constraint (active power balance equation)
n
Pi=P D
(2.15)
i=1
Kuhn tucker conditions compliment the lagrangian conditions to include inequality constraints as
additional terms.
Conditions for optimal dispatch in a lossless system but including generator limit include
d ci
= for Pi (min ) Pi Pi ( max )
d pi
(2.16)
d ci
for Pi=Pi (max )
d pi
(2.17)
d ci
for Pi=Pi (min )
d pi
(2.18)
For an estimated value of lambda the powers are found for each participating generator. If the
power is beyond the limits of a generator, the generator is no longer a participating generator in the
optimization of dispatched power
ng
ng
PL = pi pij p j+ B oi pi + Boo
i=1 j=1
(2.19)
i=1
10
B coefficients
n no. of generators
It is assumed that these coefficients are constant
If all generator participate in the minimization then ng = n, then one cam use either of the formulas
below
ng
Ct = C i
(2.20)
i=1
n
Ct = ( i + P i+ P2i ) (ii )
(2.21)
i=1
For ng< n
The first equation (i) is used
The active power constraint
ng
Pi=P D +P L
(2.22)
i=1
Inequality constraint
Pi ( min ) Pi Pi ( max ) i=1, 2 .. ng
(2.23)
Using the lagrange multiplier and adding additional terms to include inequality, we have a
Kuhn-tucker function
ng
(2.24)
i=1
ng
ng
L=Ct + P D + P L Pi + p i
i=1
i=1
When the upper and the lower limits are not exceeded then
M i (min )=0
when
Pi > Pi (min )
ng
L=C t + P D + PL Pi
i=1
(2.25)
If a generators power exceed either of the limits that generators is pegged at the exceeded limit and
the remaining generators participate in the load dispatch process.
Thus the following conditions are necessary for a minimum to be achieved
11
L
=0
Pi
(2.25)
L
=0
(2.26)
L
=P1 Pi (max )=0
M i (max )
(2.27)
L
=Pi Pi (min )=0
M i (min )
(2.28)
The last equations imply that power should not go beyond its limit, and when the limit
M i (min )=M i (max ) the Kuhn-tucker function becomes the same as Lagrangian.
First equation
L
=0
Pi
results in
Ct
PL
+ O+
1 =0
P1
P1
(2.29)
Pd is constant
CT =C 1+ C2 + ..+C ng then the equation above becomes
(2.30)
C i
PL
+
= i=1,2 . ng
Pi
Pi
(2.31)
The term
PL
=incremental transmissionloss
Pi
(2.32)
Results in
ng
Pd + P L Pi =0
(2.33)
i=1
Which is precisely the equality constraint imposed by the losses and load demand
12
From
C i
PL
+
= We have
Pi
Pi
C i
PL
= 1
Pi
Pi
(2.34)
Ci
Pi
C
=
,=Li
i=1,2 ng
Pi
PL
1
Pi
(2.35)
1
PL
1
Pi
(2.36)
Thus the effect of transmission losses is to introduce a penalty factor with a value that depend on
location of plant with respect to load.
It is clear that the most economical cost dispatch is obtained when incremental cost multiplied by
corresponding penalty factor are equal for all participating plants.
Incremental transmission loss can be found from loss equation and is given by
ng
PL
=2 Bij P j+ Boi
Pi
j=1
(2.37)
(2.38)
The costs of electrical energy generation arise mainly from three sources: facility construction,
ownership costs, and operating costs. The last is the most significant portion of power system
operation, and in this section we focus on this aspect. Despite the high price of natural gas as a fuel
relative to coal, the past 10 years have seen new gas-fired plants far outpace new coal-fired plants,
with gas or lower capital costs, higher fuel efficiency, shorter construction lead times, and lower
emissions. In addition, projections are that natural gas prices will decline in the next few years, but
13
so far they havent, largely as a result of the increased power plant use. Petroleum-gas fired plants
accounting for over 99% of new capacity in this time period.The reason for this has been that
natural-gas-fired plants have These values reflect only the cost of fuel input to a generation plant;
they do not reflect the actual costs of producing electrical energy as output from the plant because
substantial losses occur during production. Some power plants have overall efficiencies as low as
35%; in addition, the plant efficiency varies as a function of the generation level P g. We illustrate
this point in what follows.[13]
14
2.1.5TABU SEARCH
Tabu is derived from the word taboo meaning prohibited, not allowed. Tabu search was developed
by Glover in 1987 who was motivated by the randomness of human behavior given similar
situations. Glover argued that such deviance from consistence might be to some advantage. Thus,
Tabu search operates this way except that the new courses are not chosen randomly. Tabu search
proceeds to elude that there's no point in accepting a new solution unless its to avoid a path already
chartered. This ensures that the whole problem space will be investigated as we move away from
local minima to alternatively find the desired solution.
Tabu begins by moving to local minima. A list(s) is used to record the moves in order to avoid
retracing such path or reverse of the path. This list is referred to as Tabu search memory. The
purpose of the search memory is not rigid; during algorithm initialization, the purpose is
diversification (rough examination of the solution space) but as candidate locations are spotted the
search is more focused to produce local optimal solution a process called intensification. TS has
traditionally been used on combinatorial optimization problems.[15]
Always move to a new position even if its worse than the current solution.
Maintain a list of solution points that must be avoided / or list of move attributes
Aspiration criterion allow for exception from Tabu list if such moves lead to promising
solution
15
STOPPING CRITERIA
Stopping Criteria are conditions for stopping the Tabu search include: when maximum allowable
number of iterations is reached and when number of iterations performed since the best solution last
changed is greater than a pre- specified maximum number of iterations[15].
x
X''
x'
E(x)
N(x)
S(x)
SS(x)
current solution x X
best solution created
best solution among a sample of trial solutions
evaluation function of solution x
set of neighborhood of x X (trial solution)
sample of neighborhood of x, S(x) N(x)
sorted sample ascending order according to their evaluation function E(x)
Step 1
Set Tabu list (TL) as empty and aspiration criteria (AC) to be zero
Step 2
Step 3
Randomly generate a set of trial solutions s(x) N(s) and sort them in an ascending
order to obtain SS(x).Let x' be the best trial solution in sorted set SS (x), the first element
Step 4
in sorted set.
If E(X') > E(x''), go to step 5; else set best solution x'' = X' and go to step 5
Step 5
Perform Tabu search. If X' is NOT in the TL then accept it as the current solution. Set x
= X' and update TL (Taboo list) and AC (aspiration criteria) and go to step 7; else go to
Step 6
step step 6.
If end of SS(x) is reached, go to step 8;otherwise let X' be the next solution in SS(x) and
Step 7
go to step 4.
Perform the AC test. If satisfied override Tabu status. Set x = X' update AC and go to
Step 8
TS ADVANCES
In the recent past, other strains have been developed to improve the efficiency and effectiveness of
Tabu search. Such improvement among other include ATs (adaptive Tabu), MATs (Modified
Adaptive Tabu) and MTs (multiple Tabu search).The Tabu search algorithm used for these projects
17
brings together the best attributes of both MTs and MATs. In 2004, Adaptive Tabu search (ATs)
introduced two key mechanisms: backtracking mechanism (BT) to unlock the deadlock of moving
back to a visited solution and adaptive search radius mechanism (AR) which accelerates the search
speed by reducing search radius when the current evaluation function is threshold TABU. In 2001,
MATs introduced Adaptive neighborhood mechanism (AN) where number of neighbors for
solutions vary .AN is invoked at the same time as AR. MATs is branched into MATs -a (increasing
neighbors) and MATs -b (decreasing neighbors). Multiple Tabu Search (MTs) uses several initial
solutions which increase probability of reaching optimum solution. MTs consists of several
conventional TS algorithm. Additional mechanism namely initialization, adaptive searches,
replacing and restarting process are included. There has also been a proliferation of hybridization of
TS with both heuristics and neighborhood search method[15].
be a set of some visited solution. Points in the TL one ranked and saved according to their recency
and objective function values .Therefore, two types of regions are specified in search space the first
one is Tabu region (TR) is which no new trial point is allowed to be generated. The other is semi
Tabu region (semi TR) generates neighboring trial point is a way so that returning to a visited TR is
avoided when the trial solution lies inside a semi TR. Another memory element is VRL (visited
region list). The centers of visited regions and frequency of visiting these regions are saved in the
VRL in order to direct a diversification scheme to explore the space outside these visited region.
MULTI-RANKED TABU LIST
Some of the previously visited solutions are stored in the TL
Let
TL={ t i }i=1
(2.40)
Element in TL are ranked in ascending order according to their recency using rank indices
I ri ,i=1, . L,
(2.41)
I k' =L
I rk =1
Elements in TL are also ranked in ascending order according to their objective function using
another set of rank indices
I ifv , i=1,... , L
(2.42)
fv
I j =1
fr
I j ' =L
{t i }Li=1
(2.43)
i=1, ., L
Where mri , mifv [0,1] are recency and function value ranked values for element ti.
Computed as follows
and
( )
LI i
m =min +
i=1, .. L
L1
r
i
(2.44)
Where
1 L L while 0 min max 1
(2.45)
L' I fvi
L' 1
)}
if I ifv=1, , L
fv
if I i = L +1, , L
(2.46)
TABU REGIONS(TRS)
Defined to be spheres with radius r TR and centers being point of TL where r TR > 0
For each TR, we define semi TR to be surrounding regions around TR with outer radius
r STR
t 1 , , t v compute centroid t of
the semi TRS centers and maximum distance d max between x and these centers
V
1
'
t = ti ,
(2.47)
V i=1
(2.48)
i=1, . v
where
20
(2.49)
ei R
Neighborhood trial points are generated along these search direction with a suitable
step size > 0. In the case of V>1, the step size should be chosen to be greater
than d max + r TR in order to avoid generating trial points outside a TR.
Note that step size use to generate a trial point along search direction d1 and d2 is chosen to be
greater than
r TR +R +max ( xt 1) ,xt 2
not hit.[5]
VISITED REGION LIST (VRL)
Center i of visited region which is a sphere of radius and frequency
of visiting this
(2.50)
Information of VRL is used to direct search towards new religion whenever the current TS
procedure fails to get improvement or as a diversification scheme in order to generate new trial
points outside the visited points.
Generating trial points near to more frequently visited religions is discouraged thus a function
() is introduced to distinguish between more and less frequently visited regions.
( )= ( 1e ( 1) ) where ( 0,1 ) is given constant
(2.51)
The procedure allows the acceptance of a trial point outside the visited regions, especially the more
frequently visited ones.
a) Generate a trial point x randomly in the search domain of f
b) Compute the qualities
d i=x/(1+ ( ) ), i=1,. . , M .If min1 i m di/ pi 1 then accept x else return to
step a)
21
p
{ y i }i=1
p
{ y i }i=1 by executing a local search to
q
{ y p+ i }i=1 which are called local trial points.
Details on neighborhood local search strategies, NMS and APS are given below.
{ y i }ni=1
n
{ y i }i=1 that is {x , y , . , y n }
22
q=0
y n+1
y 1 and
y 2 in figure 2
To find a local trial point we construct a simplex whose vertices are S={ x , y 1 , y 2 } as
shown figure 3.
find a better movement. If there exists a better movement, we call it local trial point.
23
Semi - TR
T2
TR
t'
TR
x
d1
T1
Semi - TR
b(x-t)
d2
FIGURE 1. Neighborhood search from a point in Semi-TRs
24
y2
y1
FIGURE 2
FIGURE 3
y1
x
25
EXPANSION
REFECTION
INSIDE CONTRACTION
OUTSIDE CONTRACTION
SHRINKAGE
FIGURE
26
n
{ y i }i=1 along these dimensions with suitable step-size.[5]The adaptive
direction, V along which we may expect to decrease the function value, is computed using these
trial points as follows:
V = wi v i
(2.52)
i=1
Where
w i=
fi
n
(2.53)
, 1,2,... , n ,
f j
j=1
( y i x)
, i=12, , n
y ix i
(2.54)
f j =f ( y i ) f ( x ) ,i=1, 2, , n
(2.55)
v i=
(q=2)
n
{ y i }i=1 using the standard
n pattern direction parallel to co-ordinate axes emanating from the current solution x and
generate n neighborhood trial points
n
{ y i }i=1 along these directions with some step-size.
V = wi v i
i=1
y n+2
27
y n+1 and
Exploration
Diversification
Intensification
In the exploration stage, neighborhood local search strategies NMS or APS are employed.
Moreover, multi-ranked TL,TR and semi-TR restriction rules are applied to avoid revisiting recently
visited solutions or being entrapped in local minima. Diversification is used in diversify the search
to areas of the solution space overlooked by the Exploration search. Diversification search is
managed using VRL information. Finally, intensification search is used to explore the region around
the best solution thus far. In the mDTS, the Exploration and Diversification stages are combined to
form the main loop, which need termination conditions to be met in order to stop[5][6].
EXPLORATION SEARCH
Starts with an initial solution for every iteration of the main loop. For each iteration a neighborhood
local search strategy (NMS or APS) is used to generate n neighborhood trial points. If a better
solution is found among these trial points, we update the current iterate and move to next
exploration/inner loop iteration. Otherwise, NMS or APS continue to generate q local trial points.
Then the current iterate/ solution is updated to be the best of the neighborhood. TL is update by
letting current best solution replace the element with least membership value. If a new region is
reached then VRL is update with information of the new region[5][7][11].
This Exploration loop is repeated for a fixed predetermined number of times.
28
DIVERSIFICATION
Diversification is carried out when the exploration/inner loop has reached a predetermined positive
integer or consecutive inner iterations fail to obtain an improvement of the current solution. With
the current VRL information, is used to generate search towards new regions outside visited
regions, especially more frequently visited ones. Thus a new trail point is generated and Exploration
search is repeated from this point[6][7].
INTENSIFICATION
With the multi-ranked TL, we have the best points visited thus far. In order to fine tune our solution,
we used the modified NM starting with some of the solutions in TL[5][6].
29
CHAPTER 3
3.1ALGORITHM FOR mDTSNMS
There are two versions of mDTS method: mDTSNMS and mDTSAPS.[5]
Step 1
Initialization. Choose positive integers lmain , lmain , linner and linner . Choose an initial
solution x, and set TL and VRL to be empty.
Step 2
Step 3
Exploration Search(NMS) (Inner Loop). Let k = 0 and repeat this inner loop until l
inner consecutive inner iterations fail to obtain improvement or the inner loop iteration
counter k exceeds linner .
Step 4
Search Directions. If the current iterate xk lies in Semi-TRs, use VRL information
to construct search directions {di}i=1 and to choose step sizes{i}i=1 . Otherwise,
construct search directions di = sign(vi) ei ,i= 1,...,n, where ei R n is the ith unit
vector of in Rn and Vi is the ith component of vi and choose suitable step size
{i}i=1 .
Step 5
Step 6
Local Search. Compute the direction v at xk using {yi}i=1.Choose two suitable step
sizes 1 and 2 to generate local trial points. yn+i = xk + i v/ |v| , i = 1, 2.
Set xk+1 = arg mini=1,...,n+2 {f (yi)} .
Step 7
Parameter Update. Let xk replace the element with the smallest membership value
in TL and re-rank the TL elements using (1). Update the VRT and set k = k + 1.
Step 9
30
EXPLORATION SEARCH
This is the first phase and starts with an initial solution .For each iteration, a neighborhood local
search strategy (NMS or APS) is employed to generate n neighborhood trial points. If a better
solution is found among these trial points, we update the current iterate and move to next
exploration/inner loop iteration.
DIVERSIFICATION
Diversification is carried out when the exploration has reached a predetermined maximum limit or
consecutive inner iterations fail to obtain an improvement of the current solution. With the current
VRL information, is used to generate search towards new regions outside visited regions, especially
more frequently visited ones.
INTENSIFICATION
With the TL, we have the best points visited thus far. To fine tune our solution, we used the NM
starting with some of the solutions in TL[5].
31
INITIALIZATION
Set intial solution,iteration counters,TL,VRL,maximum
exploration loop, set main loop counter J = 0
YES
_DIVERSIFICATION
NO
Is K> inner loop max or
After Linner consecutive iterations there's
No improvement
YES
NO
CONSTRUCT SEARCH
DIRECTIONS and STEP SIZE using
APS
Set inner counter K=0
Intialize vector v
NEIGHBORHOOD SEARCH
Generate n trial points and Locate the best
solution
YES
thancurrent solution.
INTENSIFICATION
Search using NM
NO
LOCAL SEARCH using vector v and choosing two
PARAMETER UPDATE
Update TL,VRT, counter K +1
DIVERSIFICATION SEARCH
Generate a trial point from current VRT
Update TL, and VRT.set k=0. Update main
counter J+1
32
STOP
Initial solution, X0 is chosen such that it is within range of minimum and maximum limit of
generator outputs.
TR and semi TR parameters .The r TR radius of each TR and r STR outer radius of semi TR.
2r TR = r STR.
r TR = 0.01 .
TL parameters. Number L of elements in the TL, the maximum and minimum recency
ranked values max and min. The number
The maximum and minimum function value ranked values max and min respectively. We
set max = max = 1
min = min = 1/L
L = 5n and L = 2n.
Step Size used to generate neighborhood points. i=1,..,n used in generating neighborhood
trial points for both DTSNMS and DTSAPS. 1 and 2 used to generate local trial points for
DTSAPS.
Intensification trials. The number of Nbest of best points used in the intensification search.
Set Nbest equal to 1.
AND
L'inner. = L'main,=2n
33
34
CHAPTER 4
RESULTS
The modified direct Tabu Search(mDTS) Algorithm is used to solve the Economic Load Dispatch
problem for IEEE 30 bus test system. The simulation was carried out using MatLab 7.0 software.
The total fuel cost and power loss of the system are minimized.
TABLE 1
METAHEURISTICS mDTS
PSO[16]
GA[16]
Pg1
176.8710
176.727
180.367
Pg2
45.2423
49.6812
50.24
Pg3
20.6910
22.4282
25.61
Pg4
20.7210
23.8313
19.9
Pg5
11.9324
12.0667
11.71
Pg6
13.1423
13
14.09
TOTAL
POWER(MW)
288.5923
297.7344
301.917
14.3344
18.517
FUEL COST($/hr)
596.2021
615.6207
616.4811
CPU TIME(s)
13.2331
27.1314
30.2421
35
POWER OUTPUT(MW)
160
140
120
mDTS
PSO
GA
100
80
60
40
20
0
Gen 1
Gen 2
Gen 3
Gen 4
GENERATOR
FIGURE 7
36
Gen 5
Gen 6
1000
800
600
mDTS
PSO
GA
400
200
0
0
100
200
300
400
500
600
NO.CF ITERATION
FIGURE 8
37
700
800
900 1000
CHAPTER 5
5.1 DISCUSSION
The sole purpose of this project was to minimize the fuel cost for the generating units in addition to
minimizing losses. As seen from Table 1, mDTS did outperform PSO and GA in solving the
Economic Load Dispatch problem since mDTS provided the optimal total power output, least fuel
cost
based on the search space terrain using Tabu List and Visited
Regions List unlike in conventional TS, GA and PSO where the neighborhood points are generated
randomly without considering the dynamics of the search space. Its is also vital to point out that
unlike GA or PSO, Tabu search is based on memory response. The information contained in TL and
VRL ensure that the search evade local optima entrapment.
MDTS is also guaranteed to reach global optima due to its thoroughness in exploration of the search
space. mDTS consist of a main and inner loop. The inner loop makes up the exploration phase
which starts with an initial solution then using neighborhood search strategies, it generates
neighbors and selects an improvement from the batch. Neighborhood solutions are then used to
generate other points. This procedure is repeated until the maximum iteration is reached or a
specified number of of consecutive iterations does not generate an improvement. At this instance,
we step into the Diversification Phase(main loop), which generates a trial point based on
information in Visited Region List which is used to generate a point from a feasible unexplored or
rarely explored region. This new point is then passed to the Exploration search which uses
38
5.2 CONCLUSION
The goal of this project was to come up with an effective and reliable version of Tabu search
algorithm for the scheduling of the generators power outputs so as to meet the system load at the
least total fuel cost under various operating constraints. This project presents an application of the
modified Directed Tabu search algorithm (mDTS) to Economic Load Dispatch problem (ELD). The
proposed mDTS algorithm with Neder-Mead Search(NMS) and Adaptive Pattern Search(APS)
easily handled different system constraints and greedily ploughed through the search terrain.
Simulations were performed on MATLAB 7 for IEEE- 30 test bus system. Simulation results were
compared with those of Genetic Algorithms (GA) and Particle Swarm Optimization (PSO). The
results confirmed the robustness and proficiency of the proposed modified Directed Tabu search
over GA and PSO.
5.3 RECOMMENDATIONS
1.To make the solution of Economic Load Dispatch more practical othser constraints should be
catered for in the mDTS. The other constraints include transformer tap setting, voltage
constraints,ramp rate effects and transmission line constraints.
2.Propose Jelly Fish Algorithm (JFA) for solving combinatorial optimization problems .Consider
the feeding habits of a bloom of Jelly fish shown in figure 3 below. Individual jelly fish are made of
39
tentacles that are used for filter feeding since they lack brains and eyes .Jelly can assume any
position since they are moved by drifts currents, waves and winds though some have the ability of
moving vertically by contraction. Jelly fish mainly feed on planktons. Since planktons cannot swim
against current, at any given time a large percentage of Jelly fish will be in regions where there are
large amount of planktons. Jelly fish hunt and feed by spreading and closing their tentacles. Their
umbrella like structure also contact and expand during hunting and feeding. See figure 4 below.
Figure 10.
Jelly fish moving vertically
Figure 9.
Swarm of jelly fish
From a nature-inspired heuristic perspective, the changing of shape and size of jelly fish during
feeding will represent an adaptive search radius strategy. The ability of the jelly fish to assume any
posture in water as shown in figure 3 also points to JFA having an adaptive search radii. The fact
that planktons(solutions) and jelly fish are drifted by currents means that the global optima is
always in the proximity of each fish.
The ability of some jelly fish to move vertically unlike planktons means that the search space can be
explored much aggressively than the planktons are eluding capture. This alludes to a faster
convergence rate. Since the planktons(solution) are always in motion, Jelly Fish Algorithm(JFA)
would be suitable for problems whose parameters,variables and other dynamics are constantly
changing. The ability of jelly fish to communicate through chemicals in water can be modeled to
accommodate problem constraints.
40
APPENDIX A
DATA FOR IEEE 30 BUS TEST SYSTEM
TABLE A.1
GEN. No. Pmin (MW) Pmax(MW) Qmin(MVar)
Qmax(MVar)
ai
bi
ci
50
200
0.00375
2.00
20
80
-20
100
0.01750
1.75
15
50
-15
80
0.06250
1.00
10
35
-15
60
0.00834
3.25
10
30
-10
50
0.02500
3.00
12
40
-15
60
0.02500
3.00
Table A.1 consists of data on generators minimum and maximum active and reactive powers
outputs and fuel cost co-efficient values for an IEEE 30 Test Bus System.
TABLE A.2
2
-1.1
1.2
1.3
1.09
-1.9
3.14
-1.55
-5
-2
-0.1
-1
-1.5
2.98
5.5
1.1
1.2
-5
5.5
1.3
1.3
-2
1.14
1.2
Table A.2 :Table of loss coefficients for IEEE 30 bus system. Each element is to be multiplied by
(10^ -4)
41
REFERENCES
[1]
Hossein Seifi & Mohammed Sadegh Sepasian Electric Power Systems Planning:Issues,
Algorithms and Solutions 2011 Pg. 4 -7
[2]
FERC Staff Economic Dispatch:concept, Practices and Issues, Novermber 13, 2005, Pg 2
[3]
Soumja Ranjan Panda, Distributed Slack Bus Model for Qualitative Economic Load
Dispatch, Department of Electrical Engineering, National Institute of Technology, Rourkela
May (2013)
[4]
Hawary & G.S:Christen Optimal Operation of Electric Power Systems, vol.142 ,pg 32-42
2003
[5]
Abdel-Rahman Hedar, Masao Fukushima , Tabu Search directed by direct search methods
for nonlinear global optimizationDepartment of Applied Mathematics and Physics,
Graduate School of Informatics, Kyoto University, Kyoto 606-8501, Japan
[6]
A. Nelder, R. Mead, A simplex method for function minimization'', The Computer Journal
7 (1965) pg.308-313.
[7]
A. Hedar, M. Fukushima: Heuristic pattern search and its hybridization with simulated
annealing for nonlinear global optimization, Optimization Methods and Software 19 (2004)
pg.291308.
[8]
N. Hu, Tabu search method with random moves for globally optimal design, International
Journal for Numerical Engineering 35 (1992) pg.1055-1070.
[9]
[10]
42
[12]
[13]
Cesar rego, Bahram Alidaee: Metaheuristic Optimization Via Memory and Evolution,
Kulwer Academic Publishers, vol 2,pg.345 455,2005
[14]
[15]
[16]
Basir.A and Noor Abdi,''Solving Economic Load Dispatch using Evolutionary Algorithms
Islamic Institute of Technology, Quatar.2010.
43
MATLAB CODE:DTSp.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
function [XMin,FMin,FCount] = DTSp (f,U,L,demand)
% Inputs:
%
f = Objective function
%
U = n-Dimension Vector of upper limits of the generators output
%
L = n-Dimension Vector of lower limits of the generators output
%
demand = total power demand
% Outputs:
%
XMin = Best point obtained by DTSps
%
FMin = Best function value obtained by DTSps
%
FCount = Number of function evaluations
%
%%%%%%%%%%%%%%%%%% Intial Parameters %%%%%%%%%%%%%%%%%%%%
%
n=length(U);
Edg=0.1*min(U-L);
% Simplex edge length
FCount=0;
% Number of function evaluations
tol =1.0D-6;
% Termanation acurcy
MaxItrs=10*n;
itrc=0;
NoImprv=2*n;
inNoImprv=0;
H=1;
% Ratio of accepting Diversification point
dVR=2*Edg;
% Region redius in VRL
%
%%%%%%%%%% Generation of the initial Solution %%%%%%%%
Pmin=[50 20 15 10 10 12];
Pmax=[200 80 50 35 30 40];
r=rand(1,n);
x=L+(U-L).*r;
fx=feval(f,x);
FCount=FCount+1;
fbetter=fx;
S=zeros(n+2,n);
fv=zeros(n+2,1);
id=eye(n);
%
% **************** 1st iteration ******************
% Constructing the Neighborhood Search
tic
in=1;
while(fbetter >= fx & in <= n)
EdgL=Edg+rand*Edg;
sn=(-1)^(round(rand));
S(in,:)=x+sn*EdgL*id(in,:);
fv(in)=feval(f,S(in,:));
FCount=FCount+1;
if fv(in)<fbetter
44
x1=S(in,:);
f1=fv(in);
Bflag=1;
fbetter=fv(in);
else
Bflag=0;
end
in=in+1;
end
if (Bflag == 0)
df=zeros(n,1);
u=zeros(n,n);
v=zeros(1,n);
for j=1:n;
df(j)=fv(j)-fx;
end
for i=1:n;
w(i)=df(i)/sum(abs(df));
u(i,:)=-(S(i,:)-x);
u(i,:)=u(i,:)/norm(u(i,:));
end
for j=1:n; v=v+w(j)*u(j,:); end
v=v/norm(v);
S(n+1,:)=x+(0.5*rand)*Edg*v;
S(n+2,:)=x+(0.5+0.5*rand)*Edg*v;
for j=1:2
jn=n+j;
fv(jn)=feval(f,S(jn,:));
end
FCount=FCount+2;
[fvs,is]=sort(fv);
Stmp=S(is,:); S=Stmp; fv=fvs;
xnew=S(1,:);
fnew=fv(1);
else
xnew=x1; fnew=f1;
end
% TL and VRL Setting
inTL=1; TL(inTL,:)=x; fTL(inTL)=fx; rec(inTL)=1;
inVRL=1; VRL(inVRL,:)=x; frVRL(inVRL)=1;
x=xnew; fx=fnew;
Xold=x; Fold=fx;
% %%%%%%%%%%%%Transmission loss coefficients%%%%%%%%%%%%%
B00=[0.000014];
B01=[-0.000003 0.000021 -0.000056 0.000034 0.000015 0.000078];
B=[
0.000218 0.000103 0.000009 -0.000010 0.000002 0.000027;
0.000103 0.000181 0.000004 -0.000015 0.000002 0.000030;
0.000009 0.000004 0.000417 -0.000131 -0.000153 -0.000107;
0.000010 -0.000015 -0.000131 0.000221 0.000094 0.000050;
0.000002 0.000002 -0.000153 0.000094 0.000243 -0.000000;
0.000027 0.000030 -0.000107 0.000050 -0.000000 0.000358];
%%%%%%%%%%%%%%%%%%%%%% Main Loop %%%%%%%%%%%%%%%%%%%%%%%%%
%
while(inNoImprv < NoImprv & itrc < MaxItrs)
45
[FM1,XM1,FCount1,TL1,fTL1,rec1,VRL1,frVRL1]=APS(f,n,x,fx,Edg,TL,fTL,rec,VRL,frVR
L);
TL=TL1;
fTL=fTL1;
rec=rec1;
VRL=VRL1;
frVRL=frVRL1;
FCount=FCount+FCount1;
% Diversification Solution
accpt=0;
while accpt==0
r=rand(1,n);
xnw=L+(U-L).*r;
for j=1:inVRL
dxV(j)=norm(xnw-VRL(j,:))*(1+0.25*(1-exp(-0.25*(frVRL(j)-1))));
end
if min(dxV)>= H*dVR
accpt=1;
end
end
x=xnw;
fx=feval(f,x);
FCount=FCount+1;
% Update TL
%
[sortrec,iTLr]=sort(rec);
TLrtmp=TL(iTLr,:); TL=TLrtmp;
fTLtmp=fTL(iTLr); fTL=fTLtmp;
rec=sortrec;
inTL=length(fTL);
for j=1:inTL
rec(j)=j;
end
%
[sortfTL,iTL]=sort(fTL);
TLtmp=TL(iTL,:); TL=TLtmp;
rectmp=rec(iTL); rec=rectmp;
fTL=sortfTL;
fTL(inTL)=fx;
TL(inTL,:)=x;
rec(inTL)=inTL+1;
%
inVRL=length(frVRL);
VRL(inVRL+1,:)=x; frVRL(inVRL+1)=1;
%
if FM1 <= Fold
inNoImprv = 0;
else
inNoImprv = inNoImprv+1;
end
Xold=XM1; Fold=FM1;
itrc=itrc+1;
end
%
%%%%%%%%%%%%% Intensification Search %%%%%%%%%%%%%%%%
46
%
[fTLs,ifTL]=sort(fTL);
TLtmp=TL(ifTL,:);
TL=TLtmp; fTL=fTLs;
XMin=TL(1,:); XM=TL;
FMin=fTL(1);
% Applying N-M method starting from Best Point
if n<5
maxitt=100*n;
budget=200*n;
else
maxitt=5000*n;
budget=10000*n;
end
for j=1:1
[x1,FCoun1,f1]=NeMe(n,f,XM(j,:),maxitt,budget);
if f1 < FMin
XMin1=x1(:,1);
FMin=f1;
end
FCount=FCount+FCoun1;
end
%%%%%%%%%%%%%%%%%%%%%%%%%% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MATLAB CODE:NeMe.m
function [z,fcount,f1,lhist,histout,simpdata]=NeMe(n,f,x0,maxit,budget)
%
% function [x,lhist,histout,simpdata] = nelder(x0,f,tol,maxit,budget)
%
% inputs:
%
vertices of initial simplex = x0 (n x n+1 matrix)
%
The code will order the vertices for you and no benefit is
%
accrued if you do it yourself.
%
%
objective function = f
%
%
termination tolerance = tol
%
maximum number of iterations = maxit (default = 100)
%
As of today, dist = | best value - worst value | < tol
%
or when maxit iterations have been taken
%
budget = max f evals (default=50*number of variables)
%
The iteration will terminate after the iteration that
%
exhausts the budget
%
%
% outputs:
%
final simplex = x (n x n+1) matrix
%
%
number of iterations before termination = itout (optional)
%
iteration histor = histout itout x 5
47
%
histout = iteration history, updated after each nonlinear iteration
%
= lhist x 5 array, the rows are
%
[fcount, fval, norm(grad), dist, diam]
%
fcount = cumulative function evals
%
fval = current best function value
%
norm(grad) = current simplex grad norm
%
dist = difference between worst and best values
%
diam = max oriented length
%
simpdata = data for simplex gradient restart
%
= [norm(grad), cond(v), bar f]
%
% initialize counters
%
lhist=0; fcount=0;
%
% set debug=1 to print out iteration stats
%
debug=0;
%
% Set the N-M parameters
%
rho=1; chi=2; gamma=.5; sigma=.5;
tol=1.0D-8;
% Generation of the initial point
for i=1:n; z(i,1)=x0(i); end
fv(1)=feval(f,z(:,1));
fcount=1;
edgel=1;
edge=edgel*ones(n,1);
id=eye(n);
for j=2:n+1; z(:,j)=z(:,1)+edge(j-1)*id(:,j-1); end
for j=2:n+1; fv(j)=feval(f,z(:,j)); end;
fcount=fcount+n;
if nargin < 4 maxit=100*n; end
if nargin < 5 budget=200*n; end
if n >= 10; maxit = 10*maxit; budget=10*budget; end
%
% set the parameters for stagnation detection/fixup
% setting oshrink=0 gives Nelder-Mead
%
oshrink=1; restartmax=3; restarts=0;
%
%
% Order the vertices for the first time
%
%x=x0;
histout=zeros(maxit*3,5); simpdata=zeros(maxit,3);
itout=0; orth=0;
ztmp=zeros(n,n+1); delf=zeros(n,1);
[fs,is]=sort(fv); ztmp=z(:,is); z=ztmp; fv=fs;
f1=fv(1);
itc=0; dist=fv(n+1)-fv(1);
diam=zeros(n,1);
for j=2:n+1
v(:,j-1)=-z(:,1)+z(:,j);
delf(j-1)=fv(j)-fv(1);
diam(j-1)=norm(v(:,j-1));
48
end
sgrad=v'\delf; alpha=1.d-4*max(diam)/norm(sgrad);
lhist=lhist+1;
histout(lhist,:)=[fcount, fv(1), norm(sgrad,inf), 0, max(diam)];
%
% main N-M loop
%
while(itc < maxit & dist > tol & restarts < restartmax & fcount <= budget)
fbc=sum(fv)/(n+1);
xbc=sum(z')'/(n+1);
sgrad=v'\delf;
simpdata(itc+1,1)=norm(sgrad);
simpdata(itc+1,2)=cond(v);
simpdata(itc+1,3)=fbc;
if(det(v) == 0)
disp('simplex collapse')
break
end
happy=0; itc=itc+1; itout=itc;
%
% reflect
%
y=z(:,1:n);
zbart = sum(y')/n; % centriod of better vertices
zbar=zbart';
zr=(1 + rho)*zbar - rho*z(:,n+1);
fr=feval(f,zr); fcount=fcount+1;
if(fr >= fv(1) & fr < fv(n)) happy = 1; zn=zr; fn=fr; end;
%
if(happy==1) disp(' reflect '); end
%
% expand
%
if(happy == 0 & fr < fv(1))
ze = (1 + rho*chi)*zbar - rho*chi*z(:,n+1);
fe=feval(f,ze); fcount=fcount+1;
if(fe < fr) zn=ze; fn=fe; happy=1; end
if(fe >=fr) zn=zr; fn=fr; happy=1; end
%
if(happy==1) disp(' expand '); end
end
%
% contract
%
if(happy == 0 & fr >= fv(n) & fr < fv(n+1))
%
% outside contraction
%
zc=(1 + rho*gamma)*zbar - rho*gamma*z(:,n+1);
fc=feval(f,zc); fcount=fcount+1;
if(fc <= fr) zn=zc; fn=fc; happy=1; end;
%
if(happy==1) disp(' outside '); end;
end
%
% inside contraction
%
if(happy == 0 & fr >= fv(n+1))
zc=(1 - gamma)*zbar+gamma*z(:,n+1);
fc=feval(f,zc); fcount=fcount+1;
49
%
%
%
%
%
%
%
%
%
%
%
%
% You're in trouble now! Shrink or restart.
%
%
if(restarts >= restartmax) disp(' stagnation in Nelder-Mead'); end;
if(happy == 0 & restarts < restartmax)
%
if(orth ~=1) disp(' shrink '); end;
if(orth ==1)
if debug == 1 disp(' restart '); end
orth=0; end;
for j=2:n+1;
z(:,j)=z(:,1)+sigma*(z(:,j)-z(:,1));
fv(j)=feval(f,z(:,j));
end
fcount=fcount+n;
[fs,is]=sort(fv); ztmp=z(:,is); z=ztmp; fv=fs;
end
%
% compute the diameter of the new simplex and the iteration data
%
for j=2:n+1
v(:,j-1)=-z(:,1)+z(:,j);
delf(j-1)=fv(j)-fv(1);
diam(j-1)=norm(v(:,j-1));
end
dist=fv(n+1)-fv(1);
50
lhist=lhist+1;
sgrad=v'\delf;
histout(lhist,:)=[fcount, fv(1), norm(sgrad,inf), dist, max(diam)];
f1=fv(1);
end
MATLAB OBJFUNCT1.M
function y = objfunct1(x)
y(1) =0.00375+2*x(1)+0.0175+1.75*x(2)+44.1+0.0625+...
x(3)+0.00834+3.25*x(4)+0.02500+3*x(5)+0.02500+3*x(6);
MATLAB CODE:APS.m
function
[FMin1,XMin1,FCount1,TLm,fTLm,recm,VRLm,frVRLm]=APS(f,n,x,fx,Edg,TL,fTL,rec,VRL,
frVRL)
%
%%%%%%%%%%%%%%%%% TS Memory Parameters %%%%%%%%%%%%%%%%
%
dTR=0.01*Edg;
% TR radius
dSTR=2*dTR;
% Semi-TR outer radius
nTL=5*n;
% No. of tabus in TL
inTL=length(fTL);
% Index for No. of tabus in TL
dVR=2*Edg;
% Region redius in VRL
inVRL=length(frVRL);
% Index for No. of regions in VRL
etamax=1; etamin=1/nTL;
% Max & Min Recency Ranked Values
nBP=nTL/2.5;
% No. of Best Points saved in TL
miumax=1; miumin=1/nTL;
% Max & Min f-value Ranked Values
MaxIts=3*n;
NoImprov=n;
inNoImprov=0;
% Parameters
FCount1=0;
fbetter=fx;
fv=zeros(n+2,1);
id=eye(n);
vflag=0;
% **************** Main iteration ******************
% Constructing the Neighborhood Search
itc=0;
while(itc < MaxIts & inNoImprov < NoImprov);
% Check Hitting the STR
itc=itc+1;
S=zeros(n+2,n);
fbetter=fx;
STRHitTest=0;
indd=0;
for j=1:inTL;
if norm(x-TL(j,:))<dSTR
indd=indd+1;
end
end
51
52
vd=TL(k,:)-x;
newedg=abs(vd(in))+sqrt(dTR^2+(norm(vd))^2-(vd(in))^2);
S(in,:)=x+newedg*(1+0.1*rand)*sn(in)*id(in,:);
end
end
for j=1:inTL;
dx1=norm(S(in,:)-TL(j,:));
if(dx1 < dSTR)
EdgL= dx1+(1+0.5*rand)*dSTR;
S(in,:)=x+EdgL*id(in,:);
end
end
fv(in)=feval(f,S(in,:));
FCount1=FCount1+1;
if fv(in)<fbetter
x1=S(in,:);
f1=fv(in);
Bflag=1;
fbetter=fv(in);
else
Bflag=0;
end
in=in+1;
end
end
if (Bflag == 0)
df=zeros(n,1);
u=zeros(n,n);
v=zeros(1,n);
for j=1:n;
df(j)=fv(j)-fx;
end
for i=1:n;
w(i)=df(i)/sum(abs(df));
u(i,:)=-(S(i,:)-x);
u(i,:)=u(i,:)/norm(u(i,:));
end
for j=1:n; v=v+w(j)*u(j,:); end
v=v/norm(v);
S(n+1,:)=x+(0.5*rand)*Edg*v;
S(n+2,:)=x+(0.5+rand)*Edg*v;
for j=1:2
jn=n+j;
fv(jn)=feval(f,S(jn,:));
end
[fvs,is]=sort(fv);
Stmp=S(is,:); S=Stmp; fv=fvs;
xnew=S(1,:);
fnew=fv(1);
vflag=1;
else
xnew=x1; fnew=f1;
vflag=0;
end
53
end
54
[fTLs,ifTL]=sort(fTL);
TLtmp=TL(ifTL,:);
TL=TLtmp; fTL=fTLs;
rectmp=rec(ifTL); rec=rectmp;
FMin1=fTL(1); XMin1=TL(1,:); XM1=TL;
TLm=TL; fTLm= fTL; recm=rec; VRLm=VRL; frVRLm=frVRL;
55