OPF Tabu Search
OPF Tabu Search
SCHOOL OF ENGINEERING
EXAMINER:PROF. J.MBUTHIA
DECLARATION
NAME OF STUDENT: ONYANGO ODHIAMBO DICKENS
REGISTRATION NUMBER: F17/2390/2009
COLLEGE: ARCHITECTURE AND
ENGINEERING
FACULTY: ENGINEERING
DEPARTMENT: ELECTRICAL AND ELECTRONIC
ENGINEERING
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
people’s work or my own work has been used, this has properly been acknowledged
and referenced in accordance with the University of Nairobi’s 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.
V
TABLE OF CONTENT
TITLE PAGE I
DECLARATION II
CERTIFICATION III
DEDICATION IV
ACKNOWLEDGEMENT V
LIST OF FIGURES VII
LIST OF TABLES VII
LIST OF ABBREVIATIONS IX
ABSTRACT X
CHAPTER1 1
1.1INTRODUCTION........................................................................................................................ 1
1.2SURVEY OF EARLIER WORKS............................................................................................... 1
1.2.1GENETIC ALGORITHM.......................................................................................................... 2
1.2.2SIMULATED ANNEALING................................................................................................... 3
1.2.3ANT COLONY ALGORITHM............................................................................................... 4
1.2.4PARTICLE SWARM.................................................................................................................. 4
1.2.5TABU SEARCH........................................................................................................................ 5
1.3OBJECTIVES............................................................................................................................ 5
1.4PROJECT QUESTIONS 6
1.5PROJECT ORGANIZATION................................................................................................... 6
CHAPTER 2 7
2.1LITERATURE REVIEW...................................................................................................... 7
2.1.1PROBLEM FORMULATION................................................................................................. 7
2.1.2INEQUALITY CONSTRAINTS............................................................................................ 8
2.1.3ECONOMIC DISPATCH WITHOUT LOSSES........................................................... 10
2.1.4ECONOMIC DISPATCH WITH LOSSES............................................................................. 10
2.1.5TABU SEARCH …................................................................................................................. 15
2.I.5.1TABU SEARCH TENETS 15
2.1.5.2TABU SEARCH ALGORITHM............................................................................................ 16
2.1.5.3DIRECTED TABU SEARCH................................................................................................ 18
2.1.5.4DIRECTED TABU SEARCH ALGORITHM........................................................................ 18
VI
CHAPTER 3 38
3.1MDTS ALGORITHM................................................................................................................... 31
3.2FLOW CHART MDTS................................................................................................................. 32
3.3PARAMETER SETTINGS.......................................................................................................... 33
CHAPTER 4 35
4.1RESULTS..................................................................................................................................... 35
CHAPTER 5 38
5.1DISCUSSION............................................................................................................................ 38
5.2CONCLUSION............................................................................................................................. 39
5.3RECOMMENDATION................................................................................................................. 39
APPENDIX A:DATA ON IEEE 30 TEST BUS 41
REFERENCE 42
MATLAB CODE 44
VII
VIII
LIST OF FIGURES
IX
LIST OF TABLES
X
LIST OF ABBREVIATION
TS Tabu Search.
UC Unit Commitment
LP Linear Programming
IP Interior Point
TL Tabu List
AC Aspiration Criterion
TC Termination Criterion
TR Tabu Region
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
programming,Non-Linear programming, Integer Programming, Mixed Integer
Programming, calculus Method and Dynamic Programming while artificially
intelligent methods include TS, GA, PSO, Ant Colony algorithm. Artificially
intelligent methods are preferred due to their flexibility, adaptability,less development
time and faster convergence. This project solves ELD problem using on a hybrid of
Tabu search and direct search strategies(Neder-Mead search and Adaptive Search
Pattern).The simulation was done on IEEE test bus and run on Matlab 8.2.The results
were then compared with those of GA and PSO.It was observed that modified
Directed Tabu search gave the lowest total cost(596.20214$/hr) compared to
GA's(616.4811$/hr) and PSO's(615.20715$/hr).MDTS also had the fastest
computation time of (13.2333s) and the lowest power loss value(5.91MW).The
robustness and efficiency of modified directed tabu search is attributed to to the fact
that it is a memory based meta-heuristic compared to GA and PSO which are
memoryless. Tabu List and Visited Regions List ensures that modified Directed Tabu
escapes from entrapment of local minima. Modified Directed tabu search has also the
advantage of generating neighborhood points through a directed search strategies.
Finally, MDTSsearch goes through Exploration,Diversification and Intensification
phases which ensure an aggressive ploughing of the search terrain.
XII
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]
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.
1
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:
• Genetic Algorithm (GA)
Heuristic search methods are robust and have a faster development time while tend to be insensitive
to noise and missing data.
Genetic Algorithm (GA) is based on conjunction of natural selection (survival for the fittest) and
genetics. GA was developed by John Holland in 1960's. The decision variables to be found are in
the form of string of genes. This string is called the problem chromosome, selected from a set of
population. The objective function calculated for this chromosome is called problem fitness
function. Next population (off-springs) are generated from initial chromosomes (parents).This
regeneration results in chromosomes with a better fitness value.
GA depends on selection, crossover and mutation. Population of chromosomes is initially
generated. Then two chromosomes are considered as parents based on the fitness value.Crossover is
used to generate off- springs from the two parents by interchanging the value of genes at specific
positions. Mutation curds the drawback of the value of a given gene not changing during crossover.
Mutation operator tries to alter the value of a gene randomly. A summary of GA approach is made
below.
2
1. Randomly generate an initial solution population
In recent times, GA has become the most popular algorithm for solving Economic Load Dispatch
problem. GA has the following advantages: ease of coding, inherent parallelism, the use of
genotype instead of phenotype moves the search from local minima. However, GA requires
intensive computational time making the optimization process slow. GA is suited for optimization
of multi-modal functions in highly complex and nonlinear landscape, especially when the function
does not have an analytic description and is noisy and discontinuous and such is the nature of ELD
problem. [13]
3
1.2.3 ANT COLONY OPTIMIZATION
Ant colony is a combinatorial optimization technique developed in the 1990s from the study of ants
food hunting behavior of finding the shortest route from food to their nest. Ants use pheromones to
communicate with one another, and therefore leave a trail of the chemical as they crawl. The ant
that finds food first (shortest route) returns to the nest sooner and redeposits pheromone as it returns
to the nest. The path will be richer with pheromone, other ants recognize it as a promising path and
therefore follow it. Ant Colony algorithm is given below.
1. Initialization in which the problem variables, are encoded and initial population generated;
randomly within a feasible space. They will crawl to different directions at a radius not
exceeding
3. Trail adding in which a trail quantity is added for each ant; in proportion to its calculated
4. Ant sending in which ants are sent to their next nodes, according to density and visibility.
5. Trail density is based pheromone deposition and node visibility since the ants are not
completely blind.
6. Evaporation in which trail deposited by an ant is eventually evaporated and start point is
4
parameters to fiddle and ease to search in a large search space.
PSO algorthm starts with Initialization of particles position and velocity. In each time-step a
particle has to move to a new position and this is done by adjusting its position.
New Position = current velocity + (weighted random portion in the direction of its personal best) +
(weighted random portion in the direction of neighborhood best)[10][13].
Particles adjust their position on a “psychosocial compromise” between what an individual is
comfortable with and what society reckons. PSO algorithm is given below
1. For each particle, initialize particle
2. For each particle, calculate fitness value. If the fitness value is better than the best personal
fitness value in history set current value as new personal fitness value
3. Choose the particle with the best fitness value and if value is better than current global
4. For each particle, calculate velocity according to velocity change equation the update
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)
5
1.4 PROJECT QUESTIONS
• 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) deals with review of Economic Load Dispatch and modified Directed Tabu Search in
detail.
Chapter(3) gives the flow chart and algorithm of the modified Directed Tabu search. It also
introduces the IEEE 30 test bus.
Chapter(4) is on results and analysis .
Chapter(5) is on conclusion and recommendations.
6
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.
(Active power)
7
pl is total transmission loss
Generation limit constraint is given by minimum and maximum generation limit of unit i
Pi min ≤ P i ≤ Pi max (2.5)
a) GENERATOR CONSTRAINTS
The kVA loading on a generator is given by √ (P2 +Q2) and this should not exceed a pre-
decided value C because of the temperature rise condition that is :
(P +Q ) ≤ C2
2 2
(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
∣V∣min ≤∣V∣p ≤∣V∣max (2.8)
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.
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.
9
C P≤C Pmax (2.13)
where Cpmax is the maximum loading capacity of Pth line.[3]
∑ 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 ) (2.16)
d pi
d ci
≤ λ for Pi=Pi (max ) (2.17)
d pi
d ci
≥ λ for Pi=Pi (min ) (2.18)
d pi
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
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
M i (max ) ( P i − Pi ( max ) ) +∑ M i (min ) ( Pi − P i (min ) )
i=1 (2.24)
[ ]
ng ng
L=Ct + ⋋ P D + P L − ∑ Pi + ∑ p i
i=1 i=1
The constraints mean that M i (max )=0 when Pi < Pi (max ) and M i (min )=0 when Pi > Pi (min )
When the upper and the lower limits are not exceeded then M i (min )=M i (max )=0 , then L will only
contain the equality constraint that is Lagrangian formula .
[ ]
ng
L=C t +⋋ P D + PL − ∑ Pi (2.25)
i=1
If a generator’s power exceed either of the limits that generators is pegged at the exceeded limit and
the remaining generators participate in the load dispatch process.
11
∂L
=0 (2.25)
∂ Pi
∂L
=0 (2.26)
∂⋋
∂L
=P1 − Pi (max )=0 (2.27)
∂ M i (max )
∂L
=Pi − Pi (min )=0 (2.28)
∂ M i (min )
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.
∂L
First equation =0 results in
∂ Pi
∂ Ct
∂ P1
+ ⋋ O+
[∂ PL
∂ P1
−1 =0
] (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 (2.31)
∂ Pi ∂ Pi
The term
∂ PL
=incremental transmissionloss (2.32)
∂ Pi
The second equation
∂L
=0
∂⋋
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 (2.34)
∂ Pi ∂ Pi
∂C i
∂ Pi
=⋋ 1−
[
∂ PL
∂ Pi ]
∂ Ci
∂ Pi ∂C
⋋= ,⋋=Li i=1,2 … … ng (2.35)
∂ PL ∂ Pi
1− (
∂ Pi )
Li is know as penalty factor of plant i
1
Li =
∂ PL (2.36)
1−
∂ Pi
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 (2.37)
∂ Pi j=1
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 haven’t, 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 search has the following advantages:
• Ability to avoid the entrapment of local minima
• Employs a flexible memory system in contrast to SA or GA which are memoryless and
Branch and Bound which are rigid memory.
• TS has better performance than GA or SA in terms of computational time and solution
quality.
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]
15
TABU LIST RESTRICTION
Generally, TS seeks to avoid local optimality by a strategy of forbidding certain moves contained in
Tabu List (TL).Elements on TL are determined by a function that utilizes historical information
from the search process extending up to Z iterations in the past where (Z = TL size which can be
fixed or variable depending on application or search stage).TL restrictions can be state directly as a
given change of variables (moves) or indirectly as a set of logical relationships. Each time a new
element is added to the 'bottom' the oldest element on the list is dropped from the 'top'. Empirically,
the best way to select a good TL size and Tabu restrictions is simply by watching for occurrence of
cycling when the TL size is too large and deterioration of the solution quality when the when the TL
size is too large[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].
Variables include:_
16
x current solution x Є X
X'' best solution created
x' best solution among a sample of trial solutions
E(x) evaluation function of solution x
N(x) set of neighborhood of x Є X (trial solution)
S(x) sample of neighborhood of x, S(x) Є N(x)
SS(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 Set iteration counter K = 0. Select an initial solution x Є X and set x'' = x
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
in sorted set.
Step 4 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 step 6.
Step 6 If end of SS(x) is reached, go to step 8;otherwise let X' be the next solution in SS(x) and
go to step 4.
Step 7 Perform the AC test. If satisfied override Tabu status. Set x = X' update AC and go to
step 3
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].
18
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.
19
Specifically, the recency ranked value for each element of TL is given by
r
r
m =ηmin +
i ( )
L−I i
L−1
i=1, ….. L (2.44)
fv
{
m = μ min +(μ max −μmin )
i ( 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
from its center, where r STR > r TR .
If a trail solution lies in semi-TRs, a special procedure is applied to create special neighborhood
trail points to avoid return to vicinity of previously visited solution. The following procedures is
used for that purpose
• Let trial point x lie in V Semi TRS with centers 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
i=1, … . v
• Construct neighborhood search directions parallel to co-ordinate axes but point
towards direction of x−t ' neighborhood search directions are determined as sign
20
n n
ei ∈ R is the ith unit vector in 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 ∣ ( x−t 1)∣ ,∣x−t 2∣ this ensures that TRs strategies with center t1 and t2 are
not hit.[5]
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.
21
NEIGHBORHOOD LOCAL SEARCH STRATEGIES
To explore region around a solution to generate the next move we use the neighborhood and local
search strategies in which directed search methods are employed. Two strategies are used
Nelder-Mead search (NMS) and adaptive pattern search (APS)[5]. Those neighborhood-local search
strategies are invoked to generate trial exploration search stage of DTS method.
Two types of points are generated by the neighborhood local search strategy; neighborhood trial
points and local trial points which are needed in neighborhood search and local search steps
respectively[5][6].
p
P trial points { y i }i=1 are generated in neighborhood of current solution x. (neighborhood search)
p
Then we try to improve the neighborhood trial points { y i }i=1 by executing a local search to
q
generate q trial points { y p+ i }i=1 which are called local trial points.
Details on neighborhood local search strategies, NMS and APS are given below.
generate a local trial point, we construct a simplex S consisting of solution x and the current
n
neighborhood trial points { y i }i=1 that is {x , y , … . , y n }
N/B: some iterations of NM method are applied starting from S.
If an improvement point is obtained from those NM iterations then we set the local trial y n+1
equal to improvement point i q=1 otherwise, there’s no trial point q=0
Consider example below shown in two dimensions in figure 2
Given current solution x, two
22
• Generate neighborhood trial points 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.
• Assuming that the worst point in S is y 2 ,we apply Nelder-Mead method operations to
find a better movement. If there exists a better movement, we call it local trial point.
23
ADAPTIVE PATTERN SEARCH
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
GENERATION OF NEIGBOURHOOD AND TRIAL POINTS
y2
y1
x
FIGURE 2
FIGURE 3
y1
x
25
NEMER – MEAD STRATEGIES
EXPANSION
REFECTION
INSIDE CONTRACTION
FIGURE
26
ADAPTIVE PATTERN SEARCH (APS) STRATEGY
We construct n pattern directions parallel to the co-ordinates axes emanating from point x and
n
generate n trial point { 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:
n
V =∑ wi v i (2.52)
i=1
Where
Δfi
w i= n
, 1,2,... , n , (2.53)
∑∣Δ f j∣
j=1
−( y i −x)
v i= , i=12, … , n (2.54)
∣y i−x i∣
Δ f j =f ( y i ) −f ( x ) ,i=1, 2, … , n (2.55)
n
In the APS strategy, we generate (P=n) neighborhood trial points { y i }i=1 using the standard
pattern direction and (q=2) local trial points .Using an adaptive pattern direction ,we construct
n pattern direction parallel to co-ordinate axes emanating from the current solution x and
n
generate n neighborhood trial points { y i }i=1 along these directions with some step-size.
n
Adaptive pattern direction V at x is computed using V =∑ wi v i two trial points y n+1 and
i=1
y n+2 are generated along vector V using two different step sizes.[5]
27
2.1.5.4 DIRECTED TABU SEARCH ALGORITHM
Three search procedures are used namely:
• 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 , l′main , linner and l′inner . Choose an initial
solution x, and set TL and VRL to be empty.
Step 2 Exploration-Diversification Search (Main Loop). Let j = 0 and repeat this main
loop until l′main consecutive main iterations fail to obtain improvement or the main
loop iteration counter j exceeds lmain
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 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 Intensification Search. NM method starting from some elite solutions in the TL
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
3.2 FLOW CHART
START
INITIALIZATION
Set intial solution,iteration counters,TL,VRL,maximum
exploration loop, set main loop counter J = 0
NO
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
PARAMETER UPDATE
STOP
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
3.3 PARAMETER SET UP
Parameter set up determines the sensitivity and accuracy of our algorithm. The distance parameter
are based on δ which is diameter of range {L U}. We set δ = max1 ≤ i ≤ n (ui − li ) .Where u and l are
the upper and lower limit of i th generator output.
• 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 ̄L of the function – value ranked elements.
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.
• VRL parameters. Radius ρ j =1,...M , frequency and center of visited M regions.
We set ρ = 0.15δ .
• 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.
• We set ∆ i = (0.1 + 0.025ωi )δ, i = 1, . . . , n,. Set
α1 = (0.1 − 0.05θ1 )δ,
α2 = (0.1 + 0.05θ2 )δ.
Where ω i = 1, . . . , n, are random numbers from the interval (−1, 1)
θ1 and θ2 are random numbers from the interval (0, 1).
• Diversification trials. Parameters γ = 0.25 and Itmax = 100n.
• Intensification trials. The number of Nbest of best points used in the intensification search.
Set Nbest equal to 1.
• Termination conditions. Loop termination values.
Lmain= Linner = 5n AND L'inner. = L'main,=2n
33
3.4 IEEE 30 TEST BUS
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 288.5923 297.7344 301.917
POWER(MW)
POWER LOSS(MW) 5.91 14.3344 18.517
FUEL COST($/hr) 596.2021 615.6207 616.4811
CPU TIME(s) 13.2331 27.1314 30.2421
35
GRAPH 1: COMPARISON OF GENERATOR OUTPUTS
200
180
160
140
POWER OUTPUT(MW)
120 mDTS
100 PSO
GA
80
60
40
20
0
Gen 1 Gen 2 Gen 3 Gen 4 Gen 5 Gen 6
GENERATOR
FIGURE 7
36
GRAPH 2: COMPARISON OF CONVERGENCE
1200
1000
800
TOTAL FUEL COST($/hr)
600
mDTS
PSO
400 GA
200
0
0 100 200 300 400 500 600 700 800 900 1000
NO.CF ITERATION
FIGURE 8
37
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 least power losses and the least computational time. The bar Graph 1 gives a visual
representation of the result posted on Table 1.
It can be seen that mDTS has the least fuel cost value for each generator output. Graph 2 is a plot of
number of iteration against objective function value(total fuel cost).It can be generally noted that
total fuel cost drops with increasing iteration values. This is the concept of convergence to a global
minima. More iterations translate into exploring a wider solution space which increases the
probability of reaching global minima. From Graph 2, mDTS has a faster convergence than either
PSO or GA. The faster convergence of mDTS can be attributed to a number of factors.
Firstly, mDTS is a hybrid of conventional Tabu search and directed search methods. Directed search
methods as Neder- Mead search and Adaptive Pattern search stabilizes the search especially in the
vicinity of local optima. Adaptive Pattern search was implemented in the Exploration phase to
generate neighborhood points 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
neighborhood search strategies to generate neighborhood points .
An additional phase,Intensification is the used to fine tune the current best solution. Intensification
is based on TL which consists of best solution thus far. Starting from one of the solutions in TL,
Neder-Mead is used to apply another local search. The flow chart gives a visual representation of
the aggressiveness of mDTS.
The performance of mDTS is based on the parameters setting like any other metaheuristic .The
advantage of the mDTS used for this project is that its parameters are set such that they are
independent of the problem at hand. This has the advantage of solving related problems under
similar environment. One popular application of this novice programming technique is when
solving the Unit commitment problem and its subproblem – Economic Load Dispatch Problem.
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.
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
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
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 optimization”Department 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.291–308.
[8] N. Hu, Tabu search method with random moves for globally optimal design, International
Journal for Numerical Engineering 35 (1992) pg.1055-1070.
[9] H. H. Happ, "Optimal power dispatch - A comprehensive survey," Power Apparatus and
Systems, IEEE Transactions on, vol. 96, pp. 841-854, 1977
[10] R. K. Pancholi and K. S. Swarup, "Particle swarm optimization for security constrained
42
economic dispatch," in International Conference on Intelligent Sensing and Information
Processing. (IEEE Cat. No.04EX783), Chennai, India, 2004, pp. 7-12.
[13] Cesar rego, Bahram Alidaee: Metaheuristic Optimization Via Memory and Evolution,
Kulwer Academic Publishers, vol 2,pg.345 – 455,2005
[15] Soliman Abdel – hady Soliman, Abdel – Aal Hassan Mantawy:Modern Optimization
Techniques with Application in Electric Power Systems,Springer,pg185-230,2010
[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;
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
if(fc < fv(n+1)) happy=1; zn=zc; fn=fc; end;
% if(happy==1) disp(' inside '); end;
end
%
% test for sufficient decrease,
% do an oriented shrink if necessary
%
if(happy==1 & oshrink==1)
zt=z; zt(:,n+1)=zn; ft=fv; ft(n+1)=fn;
% xt=x; xt(:,n+1)=xn; ft=fv; ft(n+1)=feval(f,xn); fcount=fcount+1;
fbt=sum(ft)/(n+1); delfb=fbt-fbc; armtst=alpha*norm(sgrad)^2;
if(delfb > -armtst/n)
restarts=restarts+1;
orth=1; diams=min(diam);
sx=.5+sign(sgrad); sx=sign(sx);
if debug==1
[itc, delfb, armtst]
end
happy=0;
for j=2:n+1; z(:,j)=z(:,1);
z(j-1,j)=z(j-1,j)-diams*sx(j-1); end;
end
end
%
% if you have accepted a new point, nuke the old point and
% resort
%
if(happy==1)
z(:,n+1)=zn; fv(n+1)=fn;
% x(:,n+1)=xn; fv(n+1)=feval(f,xn); fcount=fcount+1;
[fs,is]=sort(fv); ztmp=z(:,is); z=ztmp; fv=fs;
end
%
% 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
if indd>0; STRHit=zeros(indd,n); end
indd=0;
for j=1:inTL;
if norm(x-TL(j,:))<dSTR
indd=indd+1;
dxSTR(indd)=norm(x-TL(j,:));
STRHit(indd,:)=TL(j,:);
STRHitTest=1;
end
end
if STRHitTest == 1
% Constructing the Neighborhood Search under Hitting STR
ddmax=max(dxSTR);
if indd == 1
Tbar=STRHit;
else
Tbar=sum(STRHit)/indd;
end
in=1;
sgn=sign(x-Tbar);
while(fbetter >= fx & in <= n)
if sgn(in)==0; sgn(in)=(-1)^round(rand); end
S(in,:)=x+ddmax*sgn(in)*id(in,:);
for k=1:inTL
if norm(S(in,:)-TL(k,:))<dTR
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)*sgn(in)*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
else
% Constructing the normal Neighborhood Search
in=1;
if vflag==1
sn=sign(v);
else
rn=rand(n,1);sn=(-1).^round(rn);
end
while(fbetter >= fx & in <= n)
EdgL=Edg+rand*Edg;
if sn(in)==0; sn(in)=(-1)^round(rand); end
S(in,:)=x+sn(in)*EdgL*id(in,:);
Sflag=3;
for k=1:inTL
if norm(S(in,:)-TL(k,:))<dTR
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
%%%%%%%%%Calculation of Transmission loss%%%%%%%%%
PL1=B00;
PL2=zeros(1,n);
for i=1:n
PL2(i)=(B01(i)*P(i));
end
PL2=sum(PL2(:,:));
PL3=zeros(n,n);
for i=1:n
for j=1:n
PL3(i,j)=P(i)*B(i,j)*P(j);
end
end
PL3=sum(PL3(:,:));
PL3=sum(PL3(:,:));
PL=PL1+PL2+PL3;
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