Hydro Thermal Economic Dispatch With Renewable Energy
Hydro Thermal Economic Dispatch With Renewable Energy
Hydro Thermal Economic Dispatch With Renewable Energy
UNIVERSITY OF NAIROBI
SCHOOL OF ENGINEERING
DEPARTMENT OF ELECTRICAL AND INFORMATION
ENGINEERING
TITLE OF WORK
Declaration of Originality
FACULTY: ENGINEERING
a) I understand what plagiarism is and I am aware of the university policy on this regard.
b) I declare that this final year project is my original work and has not been submitted elsewhere
for examination, award of a degree or for publication. Where other people’s work or my own work
has been used, this has been properly acknowledged and referenced in accordance with the
University of Nairobi’s requirements.
c) I have not sought or used the service(s) of any professional agencies to produce this work.
d) 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.
e) 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:
……………………………………… ………………………………………
Certification
I ……………………………………………… certify on this …….. day of ………………….........
of the year 2016 that this project work entitled “Hydrothermal Economic Dispatch With
Renewable Energy” has been submitted to the University of Nairobi, Department of Electrical
and Information Engineering. This work is a partial fulfillment for the award of an undergraduate
degree in Bachelor of Science (Electrical & Information Engineering) degree and the work was
done under my utmost and clear guidance and supervision.
I also certify that the work has been submitted by MBOGO LAWRENCE MUNENE with the
student Registration Number F17/1459/2011 and it has not been submitted earlier by any other
student.
Signature
………………………………..
Dedication
To my ever present and supportive parents and family for your outstanding encouragement and
being there for me for the time that I have been studying is unfathomable.
To all electrical engineering students with the hope that the content of this project report will
become a pillar in your pursuit of this critical career line.
To my good and very supportive friend Christine Gatugi njagi. Your support in completion of this
work was unparalled.
To the source of all wisdom, knowledge and understanding, My Lord and Redeemer Jehovah God.
Acknowledgements
Attainment of education to the undergraduate degree level is not an easy task. It takes courage,
diligence and cooperation with the many kinds of people that one comes along in the journey of
getting there. Preparation and completion of this work was not without these virtues. I am therefore
deeply grateful for the sum total contributions of each individual that has been a part of my life in
school.
My utmost gratitude go to Mr. Peter Musau of the University of Nairobi, Department of Electrical
and Information who has been there for me, as my supervisor, from the initial stages of the
development of this project work. Your motivation, advise, supervision and support are
unparalleled.
Christine Gatugi, Wilfred Waweru, Lydia Wanja and Carol Kiama, diligent and compassionate
friends who allowed me to spend their precious time and resources without which this work would
have been hampered and probably not completed. Your encouragement and prayers counted much.
You are a gift to me and may your generosity abound.
My sincere regards also to the entire University of Nairobi fraternity-teaching staff, non teaching
staff, students, and Main Campus Christian Union community for providing an environment where
I have been nurtured to the level of preparation and completion of such work. The values I have
attained through my interactions with you shall remain.
My Parents, Family and Sponsors, Your support has been vital. You all believed in me and chose
to invest resources in me. God bless you so much.
I finally acknowledge the Author of human life and all wisdom, Jehovah God. His love and
enablement and grace allowed all the above and that which is contained in this work to be. His
Name be honoured.
Figure 2.2.1: Thermal electrical energy cost function of a thermal unit with and without valve-
points ……………………………………………………………………………………….……22
Figure 4.2: Variation of cost with respect to active power losses (sample of 1300MW)……….49
Figure 4.3: Variation of Total Cost with respect to the hourly demand (sample of 1300MW)…49
List of Abbreviations
ED-Economic Dispatch
RE-Renewable Energy
NN-Neural network
EAs-Evolutionary Algorithms
TS-Tabu Search
GA-Genetic Algorithm
Abstract
The main objective of any economic dispatch (ED) problem is cost minimization while still
meeting the required power demand and losses. With the current situation, renewable energy has
continued to be explored and its use found to greatly affect the optimal allocation of output power
to the scheduled units. The contribution of this project centers on solving the Dynamic Economic
Dispatch Problem (DEDP) of a hydro thermal system with a penetration of the renewable energy
sources of solar and wind. It suggests an effective way of utilization of Renewable Energy (RE) to
effectively cater for the active transmission line losses and also reduce the cost of generation for
the hydrothermal system. Since the renewable resources are not dispatchable to meet load demand
on their own (independently), a practical approach based on their availability and intermittent
nature is applied to maximize their positive impact in the Hydrothermal Economic Dispatch
(HTED) problem. Since maximizing on the Renewable Energy (RE) and minimizing fuel cost are
conflicting objectives, a practical approach based on multi-objective optimization is applied to
obtain solutions in a single simulation run for each demand value using the Particle Swarm
Optimization (PSO) algorithm. The efficacy of the proposed approach is illustrated with the help
of sample test cases on the IEEE 30 bus system. This project report would be useful for society,
electric utilities, consultants, regulatory bodies, policy makers and planners.
Contents
Declaration of originality.................................................................................................................2
Certification ... ................................................................................................................................3
Dedication .......................................................................................................................................4
Acknowledgements .....................................................................................................................…5
List of figures and tables .................................................................................................................6
List of abbreviations .......................................................................................................................7
Abstract ......................................................................................................................…….............8
CHAPTER ONE
CHAPTER TWO
2.3 Economic dispatch of Renewable Energy (Wind and Solar energy) ………………………..26
2.4 Hydrothermal Economic Dispatch with Renewable Energy (HTED with RE) …………..…26
CHAPTER 3
Solution to The Hydrothermal Economic Dispatch With Renewable Energy (HTED with
RE) Problem
CHAPTER FOUR
CHAPTER FIVE
References ……………………………………………………………………………………….53
Appendices ………………………………………………………………………………………54
CHAPTER ONE
There are different methods that are used in generating electrical energy. These include, hydro-
generation, nuclear, use of fossil fuels and also there is generation through renewable resources
such as solar and wind. This energy is usually generated at a place that is located far away from
the load center (consumers) and the distance in between is bridged through transmission. For
maximum benefits, the power system, which includes aspects such as generation, transmission and
distribution, has to operate under optimum economic conditions. This ensures profit for the
investment made in establishing a power plant. The system security, emissions and optimal
releases are some of the aspects that are necessary to consider to ensure optimum operation
costwise.
The generating units have different output capacities and production costs with the most efficient
ones being preferred to the least efficient. Economic dispatch therefore refers to the operation
of these generating units together so as to meet the power demand combined with the possible
losses during transmission at minimum generation costs. This raises a problem called economic
dispatch problem. The main aim in the economic dispatch problem is minimization of the total
generation cost at various selected stations or plants to meet a given load demand and the
transmission losses considering the various constraints for the selected system or area. The capital
investment is usually exempted when getting a solution to the economic dispatch problem.
As the name suggests above, this is economic dispatch that has only two types of generation
namely hydro-generation and use of fossil fuels (thermal). In this form of dispatch, the optimal
operation of the thermal plants is dependent on the hydro plants. The operation is constrained by
the availability of water since the generation costs for hydro power are negligible. This makes the
Hydrothermal Economic Dispatch problem a dynamic optimization problem. The other possible
constraint is the power balance constraint. Ramp limits and the generator power output limits are
also constraints in such a dynamic economic dispatch problem.
Renewable energy resources have a high potential of meeting power demand when harnessed
appropriately. These resources are increasingly being used because they are environmentally
friendly. The conventional methods of generation which include use of fossil fuels and coal are
being developed at a lower rate as compared to harnessing renewable energy. This is because of
their adverse environmental effects as a result of emissions. The declining capital costs and costs
of electricity generated from renewable energy has given a clear front that the future growth in the
energy sector will be primarily in the new regime of renewable energy and to some extent natural
gas based systems and not in the conventional oil and coal sources. [05] These sources include
solar, wind, tidal energy, geothermal gas and biomass. A brief summary of each is given below.
These energy sources are receiving significant importance in recent researches and studies due to
lower electricity generation price and positive effect on environment [07].
This is the primary source of all other form of energy. Solar energy is energy produced by the solar
radiation, directly or in a diffuse way through the atmosphere [07]. Solar energy it can be used in
its raw form to generate electricity. This happens in two broad ways where first, it can be converted
to heat and the heat is used to boil water to steam for steam generation. The other way of use is
where the solar insolation is converted to electricity using photovoltaic cells fondly known as solar
panels [18]. This second way is the most commonly used and is the one used in this project. An
array of solar panels are set to produce a certain amount of the overall power demand. Solar power
is cyclic as it depends on the hours that solar radiation is available and this is a cycle naturally.
This is energy harnessed from the movement of air masses as a result of differences in atmospheric
pressure in various places above the earth surface. This is as a result of solar insolation [18]. This
form of energy is equally useful like the solar energy and it does not cause emission. The wind
energy is harvested using wind turbine generators and many of them constitute generation that is
dispatchable. The wind speed is the major factor to consider in setting up a wind power station.
Due to wind uncertainty, wind power generation makes its incorporation into the grid quite tasking
[13]. Its generation cost is higher than that of solar energy. Unlike solar energy which is cyclic and
diurnal, wind is available throughout the day and the night. The only disadvantage is that it is
intermittent.[18]
Biomass is the term used for all organic material originating from plants (including Algae), trees
and crops and is essentially the collection and storage of the sun’s energy through photosynthesis
[05]. This was the first type of energy to be harnessed by humans. This type of energy is usually
not considered a modern source. It is readily available for use and contribute to a very small
percentage in to the power demands in developing countries.
This is energy that is in gases/steam that is generated underground as a result of heating of the
earth’s high temperatures. The heating results to steam at high pressure which can be harnessed
appropriately and electrical energy is harvested from them. This is the resource used at Ol-karia
and other potentially active places on the earth surface. The steam is processed first to remove any
harmful components to the system before it is used to run the steam turbines which in turn are
coupled with generators that produce electrical power.
Operating thermal generators, hydro generators, wind generators and incorporation of solar energy
raises a problem. Each of these units has constraints that in one or another affect the running of
the other units. This kind of a problem is known as economic dispatch problem. It is usually aimed
at minimizing the cost and at the same time meeting all the demand and losses involved. This
problem can be single objective or multi-objective problem depending on the aim of a project. In
a single objective problem there is only one aim which maybe to reduce costs or to minimize
emissions while in a multi-objective problem, both cost and emissions require to be minimized.
The economic dispatch problem can also be described as static or dynamic. The dynamic economic
dispatch aims to determine the optimal power outputs of on-line generating units in order to meet the load
demand subject to satisfying various operational constraints over finite dispatch periods [19]. The static
economic dispatch is limited to thermal plants only and does not consider constraints such as ramp
limits.
1.4 Optimization
The economic dispatch problem can be solved at different levels depending on the type of electrical
power generation under consideration. However, there are other basic considerations in solving
the economic dispatch problem and these include the unit commitment problem and load flow.
This project leans more on the unit commitment problem since the worst case scenario demands
that the bulk power be generated thermally.
This refers to the computational procedure for getting a sequence in which operating units should
be started up and when to connect them to the network so as to meet the load demand and losses
thereof []. It is the problem of determining the schedule of generating units within a power system
subject to equipment and operating constraints [10]. It also incorporates the shut down time and
how long a unit should remain shut down. The main aim of unit commitment is to ensure that the
power generated is able to meet the forecast load demand at minimum cost. There must be at least
one unit on-line to meet the base load as obtained from the load profile for any power system. Any
other load apart from the base load can be supplied through various combinations of the other
available units appropriately.
For a system with K units, we can get 2K-1 possible combinations in order to meet a certain load.
Considering the generator constraints and power output specifications, some of the combinations
are infeasible while the feasible ones have to be chosen wisely so as to get the optimal operation
point for the system.
The process of finding the possible combinations for optimum operation can be very time
consuming and various methods have been employed to solve this problem. These methods known
as dynamic programming approaches are used to compare the economics of combinations. These
techniques assume the following are known a priori:
a) The daily load schedule has N discrete time intervals or stages and durations of which are
not necessarily equal.
b) A decision must be made for e ach stage k regarding which p a reticular combination of
units to operate during that stage.
c) To solve for the N decisions, N sub-problems are solved sequentially in such a way that
the combined best decisions for the N sub-problems yield the best overall solution for the
original problem.
The unit commitment can as well be mathematically formulated by the equation below
Different authors have solved the economic dispatch problem in different ways, proposing the use
of MATLAB optimization toolbox, Lagrange`s techniques, direct search, evolutionary
programming, particle swarm optimization, genetic algorithms, simulated annealing among others.
The history of the economic dispatch (ED) is old and the literature is abundant. So far, there are
numerous optimization methods that solve this ED problem reaching a power generation
configuration that satisfies the demand at minimum cost. [17]
The problem of hydrothermal economic dispatch with renewable resources is non linear and
dynamic and aims at optimization on cost. The load demand must be met at other particular time
putting into consideration various constraints of the power system such as generator constraints,
transmission line losses, uncertainty of wind speed, the randomness of solar radiation and many
others. Thermal generation has the highest generation cost implication on the system and needs to
be optimized since hydro generation has almost negligible generation costs. Wind and solar energy
are freely available and are thus preferred as the renewable resources in order to cut on costs.
However, the uncertainty in them calls for an appropriate measure to take care of that shortcoming
in their use. The optimization in this problem is done by extracting renewable power as much as
possible from both wind and solar. The remaining power demand is distributed is distributed
among the hydro and thermal units. This is done considering all the possible constraints on the
objective function.
The problem will involve formulation of a solution to the hydrothermal economic dispatch with
renewable sources problem using MATLAB programming software. The particle swarm
optimization technique will be used to obtain the solution that guarantees power generation in the
most economical way. The PSO optimization method is well elaborated in the next chapter in an
attempt to solve the problem.
In light of the statement above, this project therefore seeks to solve this nonlinear, dynamic and
heuristic economic dispatch problem by aiming at the following:
2. To show the effect of incorporation of wind and solar generated power on costs of
generation by thermal units.
3. To appreciate the PSO technique of solving this heuristic problem and use it to find the
optimal solution for this particular economic dispatch problem.
1.8 Research Questions
1. What is the most appropriate method of solving the HTED with RE economic Dispatch
problem?
2. What are the possible sources of renewable energy in an economic dispatch problem?
3. What is the effect of including renewable energy in an economic dispatch problem?
4. How are the renewable resources accounted for in formulating the economic dispatch
problem?
5. What constraints are there in a power system that has renewable energy and how are they
factored in the solution for the economic dispatch problem?
The above five questions provide a research platform on which this project work is based and in
answering them, the objectives of the report shall have been achieved.
The contents of this work is organized in form of chapters and the brief details of each chapter is
as explained as shown below
Chapter One forms the introduction of the title. This introduction gives the definitions of various
key words in this work and also an overview of the various critical aspects of an ED problem and
formulation of its solution.
Chapter Two gives the literature review on the HTED with RE. it is in this chapter where there is
the mathematical formulations of ED of varius forms and the constraints involved there in.
Chapter Three forms the backbone of this project since it states the HTED with RE problem and
a solution of this problem is also given here.
Chapter Four has the results obtained from the simulations, the analysis and conclusions from
the analysis of these results. The test system used in this work is also explained in this chapter.
Chapter Five contains a summary of the work in this project in the form of conclusions of the
overall report. Recommendations and Further work are propsed here. It also gives the references
and appendices.
CHAPTER TWO
This is a system that constitutes of all units that use fossil fuels to generate electric power. This
system is very expensive and should be least used if the other methods of generation as listed
earlier are readily available. To help us understand the dynamics of such a system we are going to
study a thermal generator: its cost characteristics, the constraints and finally the economic dispatch
of a purely thermal system.
In a thermal system, fuel engines are used to turn as the prime movers of the generators. These
combustion engines use fossil fuel which is turned to heat and the rotary motion is hence produced.
The heat rate of the fuel determines the energy output of the generator. This gives a quadratic
relation between the output of the generator and its output. The most conventional thermal system
consists of a boiler, steam turbine and the generator. The unit of the generator fuel consumption
function is Btu per hour of heat input to the unit (or MBtu/h) where the conversion is 1Btu =
0.29307107Watt. This input output relation is also known as the generator cost function and is
given by the equation below.
𝐹 (𝑃g) = 𝑎 𝑃g + 𝑏 𝑃g + 𝑐
Where 𝐹 (𝑃g) is the fuel cost, 𝑃g is the generator power output. While a, b, and c are the constant
coefficients of the unit. The constant c is equivalent to the fuel consumption of the generating unit
operation without output. These constant coefficients can be obtained as outlined in [09]. A plot of the
fuel cost against for a unit is as shown in figure 1 below. The dotted line represents a system without
the valve point effects. The one with the valve point represents the system that is real and modern. To
model the valve-point effect, an additional sinusoidal term is added to the quadratic electrical
energy cost function, the fuel cost function of ith thermal generating unit is expressed as:
The non-smooth electrical energy cost function considering multiple valve-point effects [20] is
shown in Fig. 2.1.1 below.
Figure 2.2.1: Thermal electrical energy cost function of a thermal unit with and without valve-
points
The above curve can be obtained experimentally. The maximum power output and minimum
power output are determined by the design of the unit.
In a power system, the operations of various units vary widely depending on the fuel costs, labour
and maintenance costs and capital cost. The formulation of the ED is considered for thermal units
only without any constraints. Consider N thermal units generating at optimum costs. Thus: CT
CT = ∑ 𝐹i (Pgi)
𝑖=1
Where CT is fuel cost plus any other cost of unit i and Pgi is the total power production of unit i.
The above equation leads us to the total load, PT demand equation which is given by
The total load can be assumed constant for a short period and thus for economic dispatch the
equality constraint of power demand must be satisfied to get the unit output that minimize the total
cost, CT.
To minimize total cost, CT all the units should operate at equal incremental costs also known as
marginal costs. Marginal costs can be defined as the costs incurred to generate one extra megawatt
of electrical power. Therefore:
From the above, we get that the minimum value of the total cost occurs when its differential is
equal to zero. That is;
d P1 + d P3 + d P3 + … + d PN = 0
The above type of system was uncostrained and in real life situation, it is almost impossible to
have such a problem. This calls for a mention of some of the possible constraints. These include,
the generator ratings of power output, overloading of transmission lines and other involved
equipment and also adverse weather conditions. These constraints are as briefly explained below.
Given that the design of machines varies widely, a generator output cannot be infinite and
therefore, there is a limit to the maximum amount of power it can generate. Similarly, the
generators have a lower limit in terms of output below which the production would be
uneconomical [18]. This is given as an inequality constraint for a power system. It is usually given
as below.
Pmin ≤ P ≤ Pmax
Where Pmin is the minimum power that the given unit can generate and Pmax is the maximum power
from the same generator.
The change in power output for any generator within a finite time is also a key consideration in
any economic dispatch problem. One of the impractical assumption has taken in conventional
economic dispatch problem is that the adjustment of power output are instantaneous [51].The ramp
rates for thermal generating units is given as follows:
Such that
These losses are as a result of the load center being far away from the generating units. They can
be modeled using the B coefficients and more details of these are given in the hydrothermal system
that incorporates the renewable resources.
Hydrothermal economic dispatch is where we have both hydro and thermal units being used in the
generation of power [11]. A hydrothermal system is a more complex one as compared to an all
thermal system since it is dynamic as the water levels keep changing, whereas the thermal problem
is a static one. In this kind of a system the thermal units come in where water in not readily
available because hydro generation is almost at zero cost since water is freely available. The
constraint above for the all thermal system apply as well in the hydrothermal system with an
additional constraint known as the water discharge constraint. A hydrothermal ED problem can be
viewed as the problem of minimizing operation cost of thermal plants under the constraint of water
availability for hydro generation over a given period of time.
This constraint is well dealt with in the formulation of the objective function of the hydro
generation. It specifies the limits of water discharge so as to attain a certain amount of hydro power
bearing in mind that minimum power is to be generated by conventional method of using fossil
fuels.
In this project, the two resources named above are the ones considered in the Hydrothermal
Economic dispatch. The potential in them is increasingly being exploited. Their impact in this type
of ED problem is dependent on their availability as well as their predictability. These renewable
energy resources depend on the data of the climate such as the wind speed for wind energy, solar
radiation and the temperature for solar thermal energy [07]. These resources may not be dispatched
to find their optimal operation costs but their penetration into a hydrothermal power system has a
great impact on the cost of generation using thermal units only. Although renewable sources, e.g.,
wind, tidal, and photovoltaic, are environmentally-friendly practices, the intermittent nature of the
renewable sources choices degrades their applicability as dispatchable options [19]
2.4 Hydrothermal Economic Dispatch with Renewable Energy (HTED with RE)
Penetration of renewable energy makes the HTED problem more complicated and thus careful
study of the effects of these renewable sources. In light of the facts above concerning the RE it is
important to consider the possible other constraints in this kind of a system.
There is only one equality constraint in this system and it is known as the active power balance
equation. This equation has it that the total power generated must be able to meet the total demand
and the active losses involved in the system. This equation is given as
PD + PL = ∑𝑵 𝑵 𝑵 𝑵
𝒊=𝟏 𝑷TH + ∑𝒊=𝟏 𝑷H + ∑𝒊=𝟏 𝑷W + ∑𝒊=𝟏 𝑷S
Where PD is the total load demand and PL is the total active losses. The first term refers to total
thermal power, second term refers to hydro power, third term refers to wind power and fourth
term refers to solar power respectively.
These are quite a number and their effect on the economic dispatch cannot be assumed. They
include, the generator constraints, the ramp limits, the water discharge constraints, transmission
line losses, power loss constraint, Renewable power constraint, spinning reserve constraint,
generator prohibited zones [19]. Each of these constraints is explained below while much more
details for others are as explained in other sections of this report.
This type of constraint has been explained as shown the classical economic dispatch problem
above.
The problem of minimizing the operating cost of a hydrothermal system can be viewed as one of
minimizing the fuel cost of thermal plants under the constraint of water availability (storage and
inflow) for hydro generation over a given period of operation [12]. Depending on the type of the
hydro power station, the optimization can be determined accordingly. In this kind of dynamic
problem, it is assumed that the amount of water at the beginning of the dispatch period is equal to
the amount at the end of the dispatch period. This leaves us to deal with water discharge as the
only issue to determine the amount of hydro energy available. This can be modeled as follows.
where xmin is the minimum discharge possible, x is discharge for generation and xmax is the
maximum possible discharge for the hydrothermal unit. A further understanding of this is given in
the formulation of the cost function for a hydro unit.
Given that the load centre is located far from the power plants, the power losses encountered during
transmission need to be accounted for. Additionally, Large interconnected networks where power
is transmitted for a long distances, transmission losses are a major factor and affect the optimum
dispatch of generation [21]. The following equation is a representation of the losses as derived
using the B coefficients and expressed as a function of the thermal generating units.
Due to the intermittent nature of the renewable resources, it is important to allocate them for
dispatch as appropriate. The renewable power used for dispatch should not exceed the 30% of total
power demand as seen from many studies reveal. Therefore this can be formulated as
Pw Ps 0.3 PD
Where Pw is the wind power available, Ps is the solar power available and PD is the power demand
for a specific period of time.
Each generator has its generation capacity, which cannot be exceeded at any time. Therefore, in
practical operation, adjusting the power output of a unit must avoid all capacity limits and unit
operations in prohibited zones. The feasible operating zones of a unit can be described as follows:
As mentioned earlier, this fuel cost is represented as quadratic function with the input as the power
output. It is assumed that the labour cost, the maintenance cost and the capital cost are not
considered in this objective function. This function is given as:
J = ∑𝑇𝑡=1 𝑓 [𝑐 (𝑡)],
where t is the Time period (week or month or hour), T is the number of time periods, f is operational
cost function and c (t) is the Non hydro generation such that the non hydro generation refers
thermal generation using coal, oil nuclear power or gas. The total hydro generation is obtained
from the equation:
where ⌽I (t) is the hydrogenation function xi is the water storage in reservoir i and ui is the water
release from reservoir i. The hydro-generation is a function of water head and the water release as
given by the equation
such that k is a constant that takes into account gravitational force, density of water, turbine and
generator efficiency and all the conversion factors, h1(x) is the upstream level as a function of
storage, h2(u) is the downstream level as a function of release and qmax is the maximum water
discharge.
The dynamic water balance equations for each reservoir are given by
where yi is the incremental water flow into reservoir 1. The storage and releases are bounded due
to operational limits, flood control, navigation as well as other purposes by the constraint:
ximin(t) ≤ xi ≤ ximax(t)
uimin(t) ≤ ui ≤ uimax(t)
The wind power is dispatched depending on its availability. As a result, the scheduled wind power
may be greater than or less than the generated wind power. To cater for the deviation in wind
power, penalty factors for over-generation (wind power available exceeds the scheduled wind
power) and under-generation (wind power available is less than the scheduled wind power). A cost
coefficient for the wind power generated is also factored in as a representation of the other costs
involved. The above factors put together as a function of wind power constitute the cost function
given as:
where wi is the total output of the wind generation, cw, co, and cu are the coefficients of generation,
over-generation and under-generation respectively all of which range from 1 to 3 [20] respectively
and ws is the scheduled wind power.
where si is the total output of the wind generation, cs, cos, and cus are the coefficients of generation,
over-generation and under-generation respectively all of which range from 1 to 3 [20] respectively
and sss is the scheduled wind power.
The total cost function is attained as a summation of the individual cost function and this is as
summarized below.
such that J is assumed to be zero since the hydro generation costs is assumed to be zero. This
reduces the function which is to be minimized to
The objective of the economic dispatch problem in this project is to minimize costs and ensuring
maximum utilization of the available renewable energy. The problem is formulated as a multi-
objective optimization problem. It consists in distributing the power demand and the active
transmission line losses to the renewable energy productions and between the hydro and thermal
power stations in the most economical way, to reduce the generation costs especially using the
thermal units. The generation costs for the hydro power have been considered negligible and thus
it is assumed in this project that we are not incurring any costs to get hydro power. All the available
hydro power under the water discharge constraint is first dispatched and the remaining amount out
of the total demand is generated by the thermal units. The approach used does not consider the
renewable energy while dispatching power. Once the scheduled and available thermal units are
decided and operated, the availability of wind energy and solar energy are considered as an extra
benefit. If solar energy is available, it is used to meet the transmission losses and if the losses are
fully met and there is more solar energy available, the thermal generator producing the maximum
power is de-loaded to the order of the solar energy available after meeting the losses. The wind
energy available is treated in a similar manner, that is, the first thermal generator is de-loaded an
amount equal to the available wind energy. Any other thermal unit can be de-loaded since they are
already dispatched and that means they have equal marginal costs. The generation dispatch is the
fundamental issue during operational process. For this approach to be as practical as possible there
are many wind generators in one farm and the minimum available units are 50 in number.
Similarly, the solar energy is assumed to be from a solar farm with many solar cell arrays. The
wind energy is set to be determined by the available units while solar energy is determined by solar
irradiance. The losses are obtained using the B coefficients formula. Therefore, this project deals
with hydrothermal generation dispatch, under the effect of renewable energy from wind and solar
on the fuel costs. The feasibility of this problem is displayed by testing on IEEE-30 bus test system.
CHAPTER 3
Methodology
3.1 Optimization Techniques
A large number of optimization techniques have been applied to power systems [10]. These include
dynamic programming techniques, linear programming techniques, newton methods and more
recently the intelligent search methods. Some of the intelligence search methods include the
following: Neural network (NN), Evolutionary Algorithms (EAS), Tabu Search (TS), Particle
swarm Optimization (PSO), Ant Colony Search Method (ACSM), Bee Colony Algorithm (BCA)
[11] and Genetic Algorithm (GA). This section gives an overview of some of the most commonly
used techniques with most inclined on the intelligent search methods and the ones applicable to
such an economic dispatch problem as the handled in this project.
Simulated annealing techniques were originally inspired by the formation of crystals in solids
during cooling [10]. Annealing is the process of heating up a metal and then cooling it down
slowly. It is the opposite of hardening or quenching. As the metal cools down, the thermal energy
of the molecules reduces and this makes the internal energy low and thus a nice crystal is formed.
In this method, the internal energy corresponds to the objective function while the state represents
the solution to the objective function. Temperature is used as the control parameter and a freezing
point is set to give the heuristic solution. Each iteration consists of the random selection of a
configuration from the neighbourhood of the current configuration and the calculation of the
corresponding change in cost function. The process can be simply described as follows.
Step 3: An evaluation condition is set (the difference between B and A must be greater than 0)
Step 4: An equilibrium point (a point where there is no further change is observed) is then reached.
In this way of operation, two things must be determined and these are the cooling schedule and the
neighborhood selection.
The advantages of Simulated Annealing are its general applicability to deal with arbitrary systems
and cost functions; its ability to statistically guarantee finding an optimal solution and its simplicity
of implementation, even for complex problems. However, it has a major drawback in that it is slow
which translates to huge computational time and it can be easily trapped in a local minimum. In
addition, it does not tell whether it has found an optimal solution.
With its roots going back to the late 1960's and early 1970's, the tabu search was proposed in its
present form a few years ago by Glover. It is a heuristic search strategy for efficiently solving
combinatorial optimization problems. [10] This method works by the means of an evaluation
function; that chooses the highest evaluation situation at each iteration. It then selects the more
that produces the most improvement or the least deterioration in the objective function [11]. The
most basic components of the TS are the moves, tabu list and aspiration level (criterion). Moves
are procedures in which the TS method is implemented. They are of two types namely single
moves and exchange moves. A tabu list is a means of storing some of the moves made in order to
prevent going back to a local optimum already achieved. The aspiration criterion is a way of
determining when a tabu move is to be overridden. The main purpose of the criterion is to enable
tabu moves that could possibly lead to an optimal solution.
This is a population based search algorithm that has found extensive use in optimization problems.
Instead of iterative changes to a single solution, GAs work with a population of solutions, which
are 'evolved' in a manner analogous to natural selection [10]. This method is inspired of the
biological concept of genetics and reproduction. The population is represented as chromosomes
and the individuals in a population correspond to genes. The evolution usually starts from a
population of randomly generated individuals and happens in generations. In each generation, the
fitness of every individual in the population is evaluated, multiple individuals are stochastically
selected from the current population (based on their fitness), and modified (recombined and
possibly randomly mutated) to form a new population. The new population is then used in the next
iteration of the algorithm [12].
To illustrate the working process of genetic algorithm, the steps to realize a basic GA are:
Step 1: Represent the problem variable domain as a chromosome of fixed length; choose the size
of the chromosome population N, the crossover probability Pc and the mutation probability Pm.
Step 2: Define a fitness function to measure the performance of an individual chromosome in the
problem domain. The fitness function establishes the basis for selecting chromosomes that will be
mated during reproduction.
Step 3: Randomly generate an initial population of size N: X1, X2, X3… XN ; N = 1, 2, 3,…
Step 4: Calculate the fitness of each individual chromosome: F (X1), F (X2), F (X3)… F (XN).
Step 5: Select a pair of chromosomes for mating from the current population. Parent chromosomes
are selected with a probability related to their fitness. High fit chromosomes have a higher
probability of being selected for mating than less fit chromosomes.
Step 8: Repeat Step 5 until the size of the new population equals that of initial population, N.
Step 9: Replace the initial (parent) chromosome population with the new (offspring) population.
Step 10: Go to Step 4, and repeat the process until the termination criterion is satisfied. [13]
The main advantage of GAs is that it can employ implicit parallelism in its operation. Its high
intuitiveness and ease of implementation strengthens its ability to effectively solve highly
nonlinear mixed integer optimization problems. This method however has its shortcomings as
well. These include highly correlated parameters, premature convergence and expensive
computational costs.
The genetic algorithm differs from other search methods in that it searches among a population of
points, and works with a coding of parameter set, rather than the parameter values themselves. It
also uses objective function information without any gradient in-formation. The transition scheme
of the genetic algorithm is probabilistic, where as traditional methods use gradient information.
Because of these features of genetic algorithm, they are used as general purpose optimization
algorithm. They also provide means to search irregular space and hence are applied to a variety of
function optimization, parameter estimation and machine learning applications [17].
This is an algorithm that is inspired by the behavior of a colony of ants in search for food. It was
proposed by Marco Dorigo in1992 in his PhD thesis [51]. The algorithm mimics the behavior of
real ants. The key considerations are the ability of these almost blind insects with their small
individual capacities are capable of finding the shortest path between their nest and the food source.
The ants colony is able to do this by employing what is known as pheromone trails as they locate
the paths as they wonder randomly. Once the shortest path is located, they are likely not to keep
travelling at random, but to instead follow this trail, returning and reinforcing it if they eventually
find food. This is repeated upon finding an obstacle on the path and also in attempt to adapt to the
changing environmental conditions. The algorithm mimics this behavior and can be simply
modeled in the steps below as outlined in the book Modern Optimization Techniques in Power
Systems.
Step 3: Add trail: Trail quantity is added to the particular directions the ants have selected in
proportion to the ants' fitness.
Step 4: Send ants A (t): According to the objective function, their performance will be weighed as
fitness value which directs influence to the level of trail quantity adding to the particular directions
the ants have selected.
Step 5: Evaporate: Finally, the pheromone trail secreted by an ant eventually evaporates and the
starting point (nest) is updated with the best tour found.
There are several attractive characteristics of this algorithm and these are: its use of constructive
greedy heuristic approach which helps to find acceptable solutions in the early stages of the
process; the positive feedback by ants gives a rapid discovery of a good solution and to sum it all,
its distributed computation helps to avoid premature convergence [10]. The flow diagram of this
algorithm is as shown below.
The Hopfield neural network was first developed in 1982 and has since found applications in many
optimization problems [10]. The original Hopfield network consists of a single layer of simple
processing elements known as neurons and models its working from the functioning of the human
brain perspective. Hopfield networks are single layer, recurrent neural networks. The action of a
Hopfield network is to minimize an energy function. This method is iterative and this process
continues until the outputs do not change on successive iterations at which stage convergence is
said to have occurred. This method has a limitation in that any cost function which contains both
discrete and continuous terms may not be accurately mapped to the energy function of a Hopfield
network. To speed up convergence of the economic dispatch problem solved by Hopfield’s Neural
Networks, two adjustment methods can be used namely the Slope Adjustment Method and Bias
Adjustment Method [16].
This is a modern optimization technique that has found its application in solving economic
dispatch problems that are non linear and dynamic. It belongs to the category of the heuristic and
stochastic methods due to its versatility and applicability to both discrete and continuous data. This
method was first established by Kennedy and Eberhart in 1995 as an alternative to Genetic
Algorithms [16]. PSO is inspired by particles moving around in the search space. The individuals
in a PSO thus have their own positions and velocities. These individuals are denoted as particles.
Traditionally, PSO has no crossover between individuals and has no mutation, and particles are
never substituted by other individuals during the run. More of this method is given in the
subsequent section.
In the simplest of its meaning, the word hybrid refers to combination of two or more elements to
make a stronger and more robust single element. In our case here, hybrid methods or techniques
refers to a combination of two or more optimization methods with the aim of taking advantage of
the pros of each method used in the mix while reducing on computation time hence speeding up
convergence and/or better the quality of the solution [09]. Due to the complexity of real-world
problems and the pro and cons of various search techniques, it is apparent that hybridization is a
way forward to develop more powerful algorithms [10]. This is a totally new area of research that
is being explored and some of these techniques include: integrating GA and PSO to maximize on
the search criteria and reduce on time of calculation and integration of simulated annealing and
genetic algorithm. Hybridisation allows searches that display particular properties to be produced.
algorithm uses the objective function and the evaluation function (known as fitness function in
GA) to evaluate the candidate solution [13].
In this method, individuals normally referred to as particles, keep shifting in positions (states) with
time in a multi dimensional search space to attain the optimum values. As the particles fly around
the search space, they keep updating their positions and velocities according to two factors as
follows:
Particle: This refers to a candidate solution to the problem at hand and is represented by an m-
dimensional vector where m is the number of optimizing parameters.
State: This is the actual location of the particle in the multi dimensional search space. It is defined
by the position and velocity of the individual particle.
Particle Velocity: This is the speed of the moving particles represented by an m-dimensional real
valued vector.
Inertial Weight: This can be defined as a control parameter that is used to determine the impact
of the previous velocities on the current velocity. Hence, it influences the tradeoff between the
local and global exploration abilities of the particles. It is usually set at large values in the initial
stages for faster global exploration and to small values for final stages for faster local exploration.
Individual best: This is the best position that is associated with the best fitness value encountered
as the particle flies through the search space size since its initialization.
Global Best: This is the best position among all the individual best positions achieved for any
iteration.
Iteration: It is the act of repeating the process of generating the optimum value by application of
the process of PSO.
Stopping criteria: These are a set of previously determined conditions under which the search for
an optimum value will terminate.
Particle Swarm Optimization technique has the following key features compared with the
conventional optimization algorithms.
It only requires a fitness function to measure the “quality” of a solution instead of complex
mathematical operations like gradient, Hessian, or matrix inversion. This reduces the
computational complexity and relieves some of the restrictions that are usually imposed on the
objective function like differentiability, continuity, or convexity.
i) It can be easily programmed and modified with basic mathematical and logic operations.
ii) It is inexpensive in terms of computation time and memory.
iii) It requires less parameter tuning.
iv) It works with direct real - valued numbers, which eliminates the need to do binary
conversion of a classical canonical genetic algorithm.
3.3 Formulation of the PSO
This is an iterative search process and is carried out as follows. Let Pg and V denote a particle
position and its corresponding velocity in a search space, respectively. Hence, the i th particle is
represented as:
The state of each particle is defined by its position and velocity in the multi dimensional search
space with the initial states given randomly as
In each iteration, the best previous known positions of the ith particle recorded are presented as
Pbest1, Pbest2 , Pbest3, and the best particle among all the particles is represented by Gbestd. After the
first iteration the velocity and position of the each particle is updated and hence, the modified
velocity and the position of each particle can be calculated by using the current velocity and the
distance from Pbestd to Gbestd as shown in the formulas below:
Vi(t + 1) = w*Vid (t) + c1*rand (Pgi - Xik)/ ∆t + c2*rand (Pbestd - Xik)/ ∆t………….3.4 (a)
where w is the inertia weighting factor and its value ranges from 0.4 to 0.9, c1 and c2 are self
confidence factors for the particle velocity and swarm velocity respectively. c1 ranges between 1.5
to 2.0 and c2 ranges between 2.0 and 2.5. The velocity update formula includes some random
parameters, represented by the uniformly distributed variables, rand , to ensure good coverage of
the design space and avoid entrapment in local optima[21]. The three steps of velocity update,
position update, and fitness calculations are repeated until a desired convergence criterion is met.
In the PSO algorithm implemented in this study, the stopping criteria is that the maximum change
in best fitness should be smaller than specified tolerance, ε, for a specified number of iterations, S.
In this work, S is specified as five thousand iterations and ε is specified as 10-10 for all test
problems.
Step 1: Specify the fuel cost coefficients of each unit and the maximum and minimum limits of
power generation of each generating unit, the B coefficients for computation of power loss and the
PSO parameters as listed below starting with the maximum number of iteration to be performed.
Step 2: initialize the population and the velocity of each particle in the population and also set the
maximum possible velocity of the particles.
Step 3: Perform the first iteration which begins by obtaining the pbest value and gbest value for this
iteration. Set the iteration counter at this point.
Step 4: update the particle velocity as given by the equation given by 3.4 (a) above.
Step 5: update the particle position as given by the equation given by 3.4 (b) above.
Step 6: check whether the stopping criteria is fulfilled by the final gbest value.
Step 7: if the stopping condition has been fulfilled, return this final gbest value as the optimal
solution to the particular demand. If the condition is not met, get back to step 3 for the next
iteration.
Step 8: Using the B coefficients, calculate and display the active transmission line losses.
The flow chart that is used for the formulation of the Particle Swarm Optimisation Method is as
shown in the figure 3.6 below.
CHAPTER FOUR
To verify the feasibility of this project, the results are based on the IEEE 30 bus network and the
dispatch takes into account the transmission line losses. The test includes six thermal units, one
wind farm and one solar farm. The demand is scheduled for a period of one hour. The hydro power
is dispatched first and is determined by water discharge. The remaining power is supplied
thermally using fossil fuels and the effects of the renewable sources are accounted for thereafter
as explained earlier. The generator cost coefficients, maximum and minimum limits are as shown
on table 4.1, the B coefficients are as shown in matrix 4.0
The one line diagram of an IEEE-30 bus system is shown in Fig. 4.1. as seen from this figure, the
units are connected to the buses 1, 2, 5, 8, 11 and 13 respectively. There are several transmission
lines interconnected to the transformers as shown.
Simulations were carried out on a Intel Core i5, 2.40 GHz, 4 GB RAM processor. The coding is
written in MATLAB 2011 version. The PSO algorithm is used for solving the HTED problem for
the demand of one hour finite periods. The results obtained are as shown on the figures and tables
on the next few pages.
P1 (Unit 1) 183.883 210.261 273.687 264.475 284.169 320.038 343.789 407.424 428.888
P2 (Unit 2) 50.000 50.000 50.000 56.387 71.400 95.384 109.969 151.133 167.588
P3 (Unit 3) 80.000 99.220 127.15 137.18 152.89 176.80 192.694 234.954 251.493
P4 (Unit 4) 50.000 50.000 50.000 50.000 50.000 50.000 59.443 99.566 116.129
P5 (Unit 5) 50.000 50.000 50.000 50.000 50.000 72.453 89.878 133.120 150.001
P6 (Unit 6) 50.00 50.000 50.000 50.000 50.000 50.000 50.000 51.179 69.311
Power 5.369 6.335 7.895 8.680 10.111 13.572 16.6102 27.056 33.039
Loss
Wind 25.447 24.538 24.084 23.175 22.721 26.356 24.993 25.265 27.265
Power (56) (54) (53) (51) (50) (58) (55) (60) (60)
Solar 24.295 24.823 0.000 23.767 26.407 24.295 23.239 23.351 31.689
Power (2300) (2350) (2000) (2250) (2500) (2300) (2200) (2400) (3000)
Total 5810.47 6258.35 7183.79 7283.94 7830.66 9058.61 10007.77 12871.94 14242.32
Cost
Hydro
Thermal 6024.27 6493.31 7192.90 7530.64 8115.61 9311.19 10252.83 13080.69 14485.83
Cost
Figure 4.2: Variation of cost with respect to active power losses (sample of 1300MW)
Figure 4.3: Variation of Total Cost with respect to the hourly demand (sample of 1300MW)
The power values in table 4.2 are given in Megawatts and the cost values are in dollars per hour.
It can be clearly noted that the power demand is proportional to the total cost incurred for
generation with the hydrothermal cost only being higher than that of the hydrothermal with
renewable resources. The effect of the inclusion of the renewable resources is reduction on cost
primarily as seen by comparing between the pure hydrothermal cost against the Total cost for the
various power demand values.
The values in brackets in the row for the hydro power, wind power and solar power represent the
variable parameters of water discharge, number of wind generators available and the amount of
solar radiation available for solar power generation respectively. It can be noted clearly that all are
proportional to the power generation in each method with the minimum values set at 200m/s, 50
generators each rated at 0.85 MW and 2200 respectively. From the results obtained, the first unit
carries the biggest load for each power demand while the last three units each generates its
minimum of fifty megawatts for the power demand of less than 800MW. The power loss also
increases with increase in demand. The special case where the solar energy is 0 MW and the overall
effect on the cost is well illustrated by the cost values.
The convergence characteristics displayed by the method is that the different power demand values
have the gbest values at different iteration numbers with the samples of the 900MW, 1000MW,
1300MW and 600MW as shown in figures 4.1 (a), (b), (c) and (d). The variation of total generation
cost with loses is linear as shown and its variation with the power demand is also linear as shown.
The typical wind power curve is as shown in figure 4.2. This figure just shows the region on which
wind power is available the section when the power is zero and maximum have been omitted.
Alongside figure 4.2 is the typical cost curve for a thermal generator and as shown, it is linear.
From the results obtained, we can conclude that PSO is a viable method for finding the solution to
an economic dispatch problem that involves the renewable energy. In addition, renewable energy
has a significant effect on the cost of power generation and overall performance of the power
system. The Particle Swarm Optimisation Method is both practical and reliable as a power
optimization method.
CHAPTER FIVE
In this project, the PSO optimization method has been successfully used to solve the formulated
hydrothermal economic dispatch problem incorporating the renewable resources. The effect of the
penetration of the wind and solar power energy as the renewable resources considered has been
well reflected by the values of cost as shown in the results. Various constraints to the dynamic
economic dispatch have been explored and as many as practical have been applied in finding a
solution to the economic dispatch problem of the nature in this report. Renewable energy is
becoming more preferred in the minimization of costs and they also therefore greatly impact the
emissions from plants that use fossil fuels. To understand the impact of the renewable energy
sources, the results obtained for the hydrothermal costs are compared with the cost results for the
hydrothermal with the renewable sources.
The problem solved in this project is multi objective in the sense that it seeks to minimize the cost
while at the same time maximizing on the renewable energy. This has made its solution to be
constrained to renewable sources of wind and solar energy only. Since the renewable energy
exploration is ongoing and gaining preference with time, I therefore recommend a solution to
economic dispatch problem that includes other types of renewable energy such as geothermal gas
and tidal energy.
In addition, hybrid methods can be used so as to ensure that an optimal solution to the dispatch
problem is found, such that most of the constraints to the problem are taken care of and this makes
the solution as practical as possible. Hybrid methodology is the useful tool for efficient solution
by exploiting the strengths of PSO with the powers of other techniques [51] alongside the strengths
of other methods incorporated.
I also recommend that a solution that takes care of emission minimization be sought so as to ensure
environmental effects in economic dispatch problem are taken care of. This will ensure that clean
energy is obtained and that other methods of optimization are used in solving this type of a problem
which is taking root as time spans. This will cause a reduction in the gaseous emissions from diesel
and other fossil fuel power plants which in turn leads to environmental conservation as the cost is
being minimized.
To make the method used in this project both flexible and versatile, an improvement of it to allow
data input such as wind speeds and the bus datas is recommended. This will make it apply for
different places where establishment of wind and solar farms is feasible. A provision for solar cell
arrays and other factors influencing solar power can also be factored in. in improving this method,
wind power and solar power can be treated in a different manner other than the used in this project.
References
01. F. R. Pazheri, M. F. Othman, N. H. Malik, E. A. Al-Ammar and Rohikaa M. R, Optimization of
Fuel Cost and Transmission Loss in power dispatch with Renewable Energy and Energy
Storage, IEEE Transmission Power Journal, pp 293-296, 2012
02. D.P Kothari and I.J Nagrath, Modern Power Systems Analysis, New Delhi, Mc Graw Hill
Education Ltd, 3rd Edition pp 242-276.
03. S. Chanda, D. Bose, S. Chakraborty & D. Abhinandan, A Self Healing Methodology for
Economic Integration of Wind Farms to Modern Power Networks, International Journal
of Electrical and Electronics Engineering,Volume 1, Issue 3, 2012
04. Syafawati A.N., I.Daut, S.S. Shema, M. Irwanto, Z. Farhana, N. Razliana and Shatri C.,
Potential of Wind and Solar Energy using Weibull and hagreaves Method Analysis, The
5th International Power Engineering and Optimization Conference, 2011
05. A.V. Hertzog, T.E. Lipman and D.M Kammen, Renewable Energy Resources,
Encyclopedia of life Support Systems, 2011
07. B. Saoussen, A. Hsan Hadj, and O. Abderrazak, Economic Dispatch for Power System
included Wind and Solar Thermal Energy, Leonardo Journal of Sciences, Issue 14,
January-June 2009, p. 204-220
08. Fahad S. Abu-Mouti and Mohamed E. El-Hawary, Optimal Dynamic Economic Dispatch
Including Renewable Energy Source using Artificial Bee Colony Alorithm, IEEE
Transactions on Power, 2012
09. O.N. Ronald, Hydrothermal Economic Dispatch using Generic Algorithm, University of
Nairobi, 2015
12. K. Sapna K, A Comparative Study of Genetic Algorithm and the Particle Swarm
Optimization, AKGEC International Journal of Technology, Vol. 2, No. 2, pp 21-24
14. R. Sakshi, Performance Analysis of GA and PSO over Economic Load Dispatch,
International Journal of Engineering Research & Technology (IJERT) Vol. 2, Issue 5, May
2013.
15. M. K. Danson, Optimal Solution To Economic Load Dispatch Using Modified Particle
Swarm Optimization Method, University of Nairobi, 2015
16. Z. Jizhong, Optimization Of Power System Operation, IEEE Press Series On Engineering,
Piscataway, John Wiley & Sons, 2009
17. A. Eduardo, E. Lopez, L. Miguel and J. Vannier, A Stochastic Economic Dispatch Model
with Renewable Energies Considering Demand and Generation Uncertainties, IEEE
Transmission Power Journal, 2011
18. Zwe-Lee Gaing, Particle Swarm Optimization to Solving the Economic Dispatch
Considering the Generator Constraints, IEEE Transactions On Power Systems, Vol. 18,
No. 3, August 2003
19. K. Cheng-Chien and T. Teng-Fa, Generation Dispatch under Large Penetration of Wind
Power Considering Emission and Economy, International Conference on Energy and
Environment Technology, 2009
20. A. A. ElDesouky, Security and Stochastic Economic Dispatch of Power System Including
Wind and Solar Resources with Environmental Consideration, International Journal of
Renewable Energy Research Vol.3, No.4, 2013
Appendices
clc fprintf('==========================
===================================
global data Pd B =\n');
propmt='Enter the power demand Pd = PD - power;
value (in MW)= ';
tic
PD = input(propmt);
data=[0.007 7 240 100 500
%% HYDRO POWER GENERATION
0.0095 10 200 50 200
%P=W*Q*H*n*g Watts where w=water
density, q=discharge in m^3/s, 0.009 8.5 220 80 300
n=efficiency, 0.009 11 200 50 150
%g=gravitational acceleration 0.008 10.5 220 50 200
propmt='\n Enter the water dicharge 0.0075 12 120 50 120];
value=';
B=1e-4*[0.14 0.17 0.15
Q=input(propmt); 0.19 0.26 0.22
w=1000; % Water density 0.17 0.6 0.13 0.16 0.15
H=70; % The water head of the Plant 0.2
l=data(:,4)'; vin=2;
u=data(:,5)'; vr=14;
tic
P = [OPTIMout(1:6)]' pwvbins=0;
fprintf('\n======================== pwvbins=prated;
===================================
elseif data<=vr
===');
pwvbins=prated;
fprintf('\n The total active losses
for this demand = %8.6g MW \n', else pwbins=0;
Pl);
end;
fprintf('==========================
=================================== pdwind=fitdist(v0, 'weibull');
=\n');
toc
% wind power calculation
probdistvbins=pdf(pdwind,vbins);
%% COST OF WIND GENERATION
intterm=probdistvbins.*pwvbins;
format long;
avgpower=trapz(vbins,intterm);
data=[9.891 10.785 6.861 14.482
pwd=(avgpower/(10^6));
12.184 4.602 7.232 8.036 12.333
11.074 10.040]; prompt='\n Enter the available wind
generators = ';
v0= data';
Twind =input(prompt)*pwd;% power
vbins=0:0.5:max(data);
from 50 wind generators
% weibull data distribution.
fprintf('\n\n======================
pdwind = fitdist(v0, 'weibull'); ===================================
====');
% turbine parameters
fprintf('========================== Psolar=n*output/10^6;
=================================== fprintf('\n\n======================
='); ===================================
% COST FUNCTION ====');
VRmax=ones(D,1)*100;
rand('state',sum(100*clock));
VR=[VRmin,VRmax];
if nargin < 2
minmax = 0;
error('Not enough arguments.');
P = [];
end
mv = 4;
plotfcn='goplotpso';
% PSO PARAMETERS elseif nargin == 3 % specified
functname, D, and mv
VRmax=ones(D,1)*100; mv=4;
VR=[VRmin,VRmax]; end
minmax = 0; VR=varargin{2};
mv=varargin{1}; minmax=varargin{3};
mv=4; plotfcn='goplotpso';
df = P(1);
if ( (PSOseed==1) &
me = P(2); ~exist('PSOseedValue') )
ps = P(3); error('PSOseed flag set but no
ac1 = P(4); PSOseedValue was input');
iw1 = P(6);
posmaskmax = [forcecol(-
repmat(VR(1:D,2)',ps,1); % max pos mv),forcecol(mv)]',1);
pbest = pos;
% PLOTTING
end
if (trelea == 3)
if plotflg==1
% INITIALIZE END INITIALIZE END
if (rem(i,df) == 0 ) |
INITIALIZE END INITIALIZE END
(i==me) | (i==1)
rstflg = 0; % for dynamic
environment checking
fprintf(message,i,gbestval);
% start PSO iterative procedures
cnt = cnt+1; % count how
cnt = 0; % counter used for many times we display (useful for
updating display according to df in movies)
the options
iwt(1) = iw1;
out =
feval(functname,[pos;gbest]);
% check for an error space that
outbestval = out(end,:); changes wrt time/iter
if chkdyn==1
gbestval =
pbestval(idx1);
if (outorng & samepos) &
rem(i,letiter)==0 end
rstflg=1;
vel = vel*10; %
agitate particles a little (or a end % end if chkdyn
lot)
[tempi] =
find(pbestval>=out); % new min
[iterbestval,idx1] =
pbestvals
max(pbestval);
pbestval(tempi,1) =
if gbestval <= iterbestval
out(tempi); % update pbestvals
gbestval = iterbestval;
pbest(tempi,:) =
pos(tempi,:); % update pbest gbest =
positions pbest(idx1,:);
sqrerr2 =
net=setx(net,gbest); ((pbestval-egones).^2);
end sqrerr1 = ((out-
egones).^2);
end
elseif minmax == 1
sqrerr = % % pred_coef =
((pbestval-egones).^2); % need to polyfit(200:i,(bestpos(200:i,dimcnt
do this to reflect new pbests ))',20);
[temp,idx1] = % gbest_pred(i,dimcnt) =
min(sqrerr); polyval(pred_coef,i+1);
iterbestval = % end
pbestval(idx1); % else
% gbest_pred(i,:) =
zeros(size(gbest));
if (iterbestval-errgoal)^2
<= (gbestval-errgoal)^2 % end
gbestval = iterbestval;
gbest = %gbest_pred(i,:)=gbest;
pbest(idx1,:);
% pos = pos +
net=setx(net,gbest); repmat(gbestoffset,ps,1);
end % pbest = pbest +
repmat(gbestoffset,ps,1);
end
end
end
%PSOPSOPSOPSOPSOPSOPSOPSOPSOPSOPSOP
ac11 = rannum1.*ac1; %
+1.494.*rannum2.*(repmat(gbest,ps,1 for common PSO w/inertia
)-pos); % social ac22 = rannum2.*ac2;
elseif trelea == 1
elseif posmaskmeth == 3
% 2) wraparound at
limit , 3) bounce off limit vel =
(vel.*minposmask_keep) + (-
minposmask_throwaway = pos
vel.*minposmask_throwaway);
<= posmaskmin; % these are psXD
matrices vel =
(vel.*maxposmask_keep) + (-
minposmask_keep = pos
vel.*maxposmask_throwaway);
> posmaskmin;
else
maxposmask_throwaway = pos
>= posmaskmax; % no change, this is the
original Eberhart, Kennedy method,
maxposmask_keep = pos
< posmaskmax; % it lets the particles
grow beyond bounds if psoparams (P)
pos = (
minposmask_throwaway.*posmaskmin )
+ ( minposmask_keep.*pos ); %PSOPSOPSOPSOPSOPSOPSOPSOPSOPSOPSOP
SOPSOPSOPSOPSOPSOPSOPSOPSOPSOPSOPSO
pos = (
PSOPSO
maxposmask_throwaway.*posmaskmax )
+ ( maxposmask_keep.*pos ); % check for stopping criterion
based on speed of convergence to
elseif posmaskmeth == 2
desired
% this is the wraparound
% error
method
tmp1 = abs(tr(i) - gbestval);
pos = (
minposmask_throwaway.*posmaskmax ) if tmp1 > ergrd
+ ( minposmask_keep.*pos );
if plotflg == 1 break
end
fprintf(message,i,gbestval);
disp(' ');
end if plotflg == 1
break
fprintf(message,i,gbestval);
end
disp(' ');
end
disp(['--> Error Goal
reached, successful
termination!']);
% this stops if using
constrained optimization and goal
is reached
eval(plotfcn);
if ~isnan(errgoal)
end
if ((gbestval<=errgoal) &
(minmax==0)) | ((gbestval>=errgoal) break
& (minmax==1)) end
fprintf(message,i,gbestval);
% % convert back to inertial
disp(' '); frame
disp(['--> Error Goal % pos = pos -
reached, successful repmat(gbestoffset,ps,1);
termination!']);
OUT=[gbest';gbestval];
out=z21*range+newminmax(1)*ones(siz
varargout{1}=[1:te]; e(z21));
varargout{2}=[tr(find(~isnan(tr)))] end
;
return
%----------------------------------
NORMMAT.M -----------------------------------
-----------------------------------
This function takes a matrix and
elseif flag==1
reformats the data to fit between a new
range a=min(x,[],1);
function b=max(x,[],1);
[out,varargout]=normmat(x,newminmax
,flag) for i=1:length(b)
if flag==0 if abs(a(i))>abs(b(i))
a=min(min((x))); large(i)=a(i);
b=max(max((x))); small(i)=b(i);
if abs(a)>abs(b) else
large=a; large(i)=b(i);
small=b; small(i)=a(i);
else end
large=b; end
small=a; den=abs(large-small);
end temp=size(newminmax);
temp=size(newminmax); if temp(1)*temp(2)==2
if temp(1)~=1
newminmaxA(1,:)=newminmax(1).*ones(
error('Error: for method=0, size(x(1,:)));
range vector must be a 2 element
row vector');
end newminmaxA(:,1)=newminmax(1).*ones(
range=newminmaxA(2,:)- size(x(:,1)));
newminmaxA(1,:);
end
out(j,i)=z21(j,i).*range(1,i)+newmi
nmaxA(1,i);
end range=newminmaxA(:,2)-
newminmaxA(:,1);
end
for j=1:length(x(1,:))
end
for i=1:length(b)
%----------------------------------
----------------------------------- if den(i)==0
-----------------------------------
out(i,j)=x(i,j);
elseif flag==2
else
a=min(x,[],2);
z21(i,j)=(x(i,j)-
b=max(x,[],2); a(i))./([forcecol(den(i))]);
for i=1:length(b)
out(i,j)=z21(i,j).*range(i,1)+newmi
if abs(a(i))>abs(b(i)) nmaxA(i,1);
large(i)=a(i); end
small(i)=b(i); end
else
end
%----------------------------------
-----------------------------------
-----------------------------------
varargout{1}=a;
varargout{2}=b;
return
FORCECOL.M
Function to force a vector to be a single
column
function[out]=forcecol(in)
len=prod(size(in));
out=reshape(in,[len,1]);
FORCEROW.M
function to force a vector to be a single row
function[out]=forcerow(in)
len=prod(size(in));
out=reshape(in,[1,len]);
F7.m
function [y Pl]=f7(in)
a=data(:,1);
b=data(:,2);
c=data(:,3);
y1=in.*in*diag(a)+in*diag(b);
Pl1=(in*B).*in;
Pl=sum(Pl1');
lam=abs(Pd+Pl-sum(in'))';
y=(sum(y1')+sum(c))'+100*lam;
THE END
THANK YOU