Lab Manual PSOC
Lab Manual PSOC
EXPERIMENTS IN
1
EXPERIMENTS IN
2
INTRODUCTION
Power System Operation and Control is concerned with the optimal and
economical operation of power systems. All the major steps of Power System
Operational Planning (i.e. Unit Commitment, Economic Dispatch, Optimal Power
Flow, Hydro-thermal Scheduling) and Power System Control (Load Frequency
Control, Automatic Voltage Regulator) are covered in this manual.
This Manual, presents a series of experiments dealing with all the major aspects of
power system operational planning and power system control. Each experiment is
accompanied by a set of objectives, , a detailed discussion of the theoretical
concepts and Mathematical Formulation that are investigated or verified through
manual calculation and MATLAB Simulations. Most of the question require
students to compare experimental with theoretical concepts to speculate on reasons
for discrepancies, and to learn from deductive resonating.
The sequence and scope of the experiments in this manual is parallel to the
material covered in the text book. These experiments are basically implementation
of lessons covered in theory through Software Simulation to verify the results. At
the end of each experiment students have to submit a separate report which should
include the analysis of results of the experiment.
3
POWER SYSTEM OPERATION AND CONTROL
TABLE OF CONTENT
Sr. No DESCRIPTION
4
Modeling of Different Components of Load Frequency
5
EXPERIMENT No. 1
STUDY AND PLOT OF DIFFERENT TYPES OF LOAD CURVES FROM
GIVEN DATA USING MATLAB
PURPOSE:
To learn
1. How to build a load curve, load duration curve and integrated load duration for a
given data.
2. Valuable information extracted from these load curves.
SOFTWARE USAGE:MATLAB
INTRODUCTION:
The demand for power has increased exponentially over the last century. This has increased the
emphasis on the performance and efficiency of power supplies used in everyday electronics as
well as sophisticated electronic and communication systems. A power supply is a component,
subsystem, or system that converts electrical power from one form to another. In power system,
it is important to know the daily-load curve that consists of demand pattern by various classes of
users.
Load Curve: A graphical plot showing the variation in demand for energy of the consumers on a
source of supply with respect to time is known as the load curve.
If this curve is plotted over a time period of 24 hours, it is known as daily load curve. If it’s
plotted for a week, month, or a year, then it’s named as the weekly, monthly or yearly load curve
respectively.
From out of the load connected, a consumer uses different fractions of the total load at various
times of the day as per his/her requirements. Since a power system has to supply load to all such
consumers, the load to be supplied varies continuously with time and does not remain constant.
If the load is measured (in units of power) at regular intervals of time, say, once in an hour (or
half-an-hour) and recorded, we can draw a curve known as the load curve.
Load Duration Curve: The load–duration curve is a plot of the load demands (in units of
power) arranged in a descending order of magnitude (on the y-axis) and the time in hours (on
the x-axis). A load duration curve enables us to determine the number of hours per year, when
the load is greater or lesser than any given amount. Similarly it also shows the loads that are
carried for more or lesser than particular direction.
Information obtained from load curves:
6
Area under the load curve = Units generated,
Highest point of the curve = Maximum Demand
(Area under curve) / (by total hours) = Average load
It helps in selection of the rating and number of generating units required. To further assess
the usefulness of the generating plants from these curves, various factors are also computed.
Some of them are:
𝑨𝒗𝒆𝒓𝒂𝒈𝒆 𝑳𝒐𝒂𝒅
𝑳𝒐𝒂𝒅 𝑭𝒂𝒄𝒕𝒐𝒓 = (𝟏. 𝟏)
𝑴𝒂𝒙𝒊𝒎𝒖𝒎 𝑫𝒆𝒎𝒂𝒏𝒅
𝑴𝒂𝒙𝒊𝒎𝒖𝒎 𝑫𝒆𝒎𝒂𝒏𝒅
𝑫𝒆𝒎𝒂𝒏𝒅 𝒇𝒂𝒄𝒕𝒐𝒓 = (𝟏. 𝟐)
𝑪𝒐𝒏𝒏𝒆𝒄𝒕𝒆𝒅 𝑳𝒐𝒂𝒅
𝑨𝒗𝒆𝒓𝒂𝒈𝒆 𝑳𝒐𝒂𝒅
𝑷𝒍𝒂𝒏𝒕 𝑪𝒂𝒑𝒂𝒄𝒊𝒕𝒚 𝑭𝒂𝒄𝒕𝒐𝒓 = (𝟏. 𝟑)
𝑷𝒍𝒂𝒏𝒕 𝑪𝒂𝒑𝒂𝒄𝒊𝒕𝒚
PROCEDURE:
Generally load curves are built by recording the values of load demands for every instant during
a certain time interval and plot a graph of load demands against a time for which it occurs. The
procedure for plotting Load Curves in MATLAB is as:
1. Open a new M-file in MATLAB.
2. A function is initialized that takes input variable data and in output we obtain plot of load
cycle for a given interval.
Function[]=loadcurve(data)
3. First of demand interval and load is defined by the variable data in a three column matrix.
For Example:
4. The first two columns are the demand interval and third column is load value. The
demand interval may be minutes, hours, and months in ascending order and load values
7
are generally in KW or MW. In above example first row of data variable shows that for
first two hours (00-02) load demand is 6 MW.
5. Now type the following commands at M-file window.
L=length(data)
tt=[data(:,1) data(:,2)]
t=sort(reshape(tt,1,2*L));
pp=data(:,3);
for n=1:L
P(2*n-1)=pp(n);
P(2*n)=pp(n);
end
plot(t,p)
6. Save the commands above in your thumb drive directory, save as loadcurve.m
7. Now execute the above function and following load curve plot will be obtained.
However the procedure for plotting a load duration curve is different from load curves that is
given below:
8. Determine the peak load and duration for which it occurs.
9. Then take the next lower load and find the total time during the year when this and the
previous greater load occurs.
10. Plot the load against the number of hours during the year, month or day for which it
occurs, or against the percentage of time during the year.
11. Further some useful information can also be extracted from these curves. i.e. Total
Energy from area under the curve, load factor etc.
E=pp’*(t2-t1)
Pavg=W/sum(t2-t1)
Peak=max(pp)
LF=(Pavg/Peak)*100;
Load (KW) 15 35 70 80 90 15
8
(i) Load Curve:
As the load demands are given for 24 hours, so daily load curve plotted for a given load by
adopting above mentioned procedure is shown below:
1. First of all peak load demand and duration for which it is occurs are determined. In this
example peak demand is 90 MW and it occurs for 2 hours.
2. Starting from peak load demand following table is constructed to determine various
points on load duration curve.
9
EXERCISE-1
A generating station has the following daily load cycle:
Load (KW) 20 25 30 25 35 20
Draw the load curve and find (i) maximum demand (ii) Units generated per day (iii)
Average Load (iv) Load Factor
EXERCISE-2
A consumer has a connected load of 12 lamps each of 100 W at his/ her premises. His/ her load
demand is as follows:
From midnight to 5 A.M.: 200 W.
5 A.M. to 6 P.M.: no load.
6 P.M. to 7 P.M.: 700 W.
7 P.M. to 9 P.M.: 1,000 W.
9 P.M. to midnight: 500 W.
10
Draw the load curve and calculate the (i) energy consumption during 24 hours, (ii) demand
factor, (iii) average load, (iv) maximum demand, and (v) load factor
CONCLUSION:
Plotting of different types of load factors and their significance has been studied. There are
various performance factors related to the load curves.Energy consumption during different
periods can be calculated using load curves.
TASK:
After going through the questions and answers related to the experiment, submit a
separate report which should include the analysis of the results of the experiment.
11
EXPERIMENT No. 2
TO STUDY THE CONVEX AND NON-CONVEX CHARACTERISTICS OF
THERMAL UNITS USING MATLAB
PURPOSE:
To learn
1. Analysis and plot of convex characteristics of thermal generating units.
2. Analysis and plot of non-convex characteristics of thermal generating units.
3. To analyze the effect of cost coefficients on the convex and non-convex characteristics.
SOFTWARE USED:
MATLAB
INTRODUCTION:
In analyzing the problems associated with the operation of power system, there are many
possible parameters of interest. Fundamental is the basic cost data and set of input-output
characteristics of generation units. Different types of fuel are used in thermal power plants.
Depending on the types of turbine such as single value or multi value, the characteristic differs.
Although the operating cost of these units consists of both fuel and maintenance costs, only the
fuel cost varies directly with the units and also with the level of generation. The fuelcost is
incurred during the running (either at no-load or at any load), start-up and sometimesshutdown
conditions of the steam units.
Steam turbines with single valve operation usually exhibit smooth operations in
comparison with multivalve machine. Multi-inlet valves are opened and closed in sequence by
the turbine governor controlling the flow of steam to a separate group of nozzles. These valves
are opened and closed to minimize losses at partial loads allowing higher efficiencies to be
maintained under all load conditions but unfortunately their cost curves are not exactly convex
rather they exhibit discontinuities at valve opening and closing points making cost characteristics
non convex as shown below:
12
Figure 2.1: Input-Output heat rate characteristics
13
This incremental heat rate characteristic is the slope (the derivative) of the input-output
characteristic (dH/dP or dF/dP). The data shown on this curve are in terms of Btu per kilowatt
hour (or $ per kilowatt hour) versus the net power output of the unit in megawatts. This
characteristic is widely used in economic dispatching of the unit. It is converted to an
incremental fuel cost characteristic by multiplying the incremental heat rate in Btu per kilowatt
hour by the equivalent fuel cost in terms of $ per Btu. Frequently this characteristic is
approximated by a sequence of straight-line segments. The incremental heat rate characteristic
for a unit of Convex Characteristics type is shown in Following Figure:
14
Figure 2.4: Net heat rate characteristics
PROCEDURE:
The procedure of plotting the convex and non-convex characteristics of thermal generating
stations is given below:
15
hold on;
a=307; b=8.1 ; c=.00056;
p=10:10:100;
t=a+b*p+c*(p).^2;
plot(p,t,'-g*');
hold on;
16
t=a+b*p+c*(p).^2+abs(e*sin(f*(10-p)));
plot(p,t,'-r.');
hold on;
a=307; b=8.1 ; c=.00056; e=150; f= 0.042;
p=10:10:100;
t=a+b*p+c*(p).^2+abs(e*sin(f*(10-p)));
plot(p,t,'-g*')
hold on;
EXERCISE:
The fuel cost functions for three thermal plants in $/h are given by:
F 500 5.3P 0.004P2
1 1 1
For the given system plot the input-output fuel cost curve, incremental cost curve and net fuel
rate curve.
CONCLUSION:
From the above curves we analyse that
Parameter ‘a’ is always constant and is independent of the loading on the unit and
represents the fix cost of the unit. It is the no load cost and always present.
‘b’ is responsible for the steepness of the cost curve and is linearization factor for the
curve. ‘c’ is multiplied with the square function so it makes the line a curved figure.
The curve changes enormously with a very small change in ‘c’ as compared with ‘a’ and
‘b’.
‘e’ and ‘f’ are responsible for non-convex behaviour of the curve. ‘f’ is responsible for
the number of oscillations in the non-convex behaviour and it repeats itself faster as ‘f’
gets bigger while ‘e’ is the magnitude of these oscillations.
17
TASK:
After going through the questions and answers related to the experiment, submit a
separate report which should include the analysis of the results of the experiment.
18
EXPERIMENT No. 3
ECONOMIC DISPATCH OF THERMAL GENERATING UNITS USING
ANALYTICAL METHOD
PURPOSE:
To learn
1. Mathematical formulation of economic dispatch problem
2. Equal incremental cost criteria to solve simplified economic dispatch problem (without
considering generation limits and losses)
SOFTWARE USED:
MATLAB
INTRODUCTION:
Economic Dispatch Problem(EDP)is the process of calculating the generation allocation
to the machines at minimum cost while satisfying the constraints. It is a generation allocation
problem.
The economic dispatch problem mathematically may be defined as:
Where FT is total fuel cost and Fi(Pi) is fuel cost function. The fuel cost functions for convex
systems is given below:
𝐹𝑖(𝑃𝑖) = 𝑎 + 𝑏𝑃𝑖 + 𝑐𝑃2𝑖 … … . (𝑅⁄ℎ)
Equal Incremental Cost Criteriastates that total cost of generation will be minimum if all
the machines are operating at same incremental cost while satisfying the constraints.It means that
cost for generation of next unit form a point is same for all machines.
19
Analytical method is used to find the value of lambda λ for the Equal Incremental Cost
Criteria to solve EDP. It is a single iteration method for EDP, which gives λ and Pi, for which
cost is minimum.
𝐿 = 𝐹𝑇 + 𝜆 [𝑃𝐷 − ∑ 𝑃𝑖]
𝑖=1
The necessary conditions for constrained local minima of L are the following:
𝜕𝐿
=0
𝜕𝑃𝑖
𝜕𝐿
=0
𝜕𝜆
Condition 1:
20
First condition gives:
𝜕𝐿 = 𝜕𝐹𝑇 + 𝜆(0 − 1) = 0
𝜕𝑃𝑖 𝜕𝑃𝑖
or
𝜕𝐹𝑇 𝜕𝐹𝑇
−𝜆=0⇒ =𝜆
𝜕𝑃𝑖 𝜕𝑃𝑖
As 𝐹𝑇 = 𝐹1 + 𝐹2 + ⋯ + 𝐹𝑁
𝜕𝐹𝑇 𝑑𝐹𝑇
= =𝜆
𝜕𝑃𝑖 𝑑𝑃𝑖
and therefore the condition for optimum dispatch is
𝑑𝐹𝑇
=𝜆
𝑑𝑃𝑖
or
𝑏𝑖 + 2𝑐𝑖𝑃𝑖 = 𝜆
Condition 2:
Second condition results in
𝑁
𝜕𝐿
= 𝑃𝐷 − ∑ 𝑃𝑖 = 0
𝜕𝜆
𝑖=1
or
𝑁
𝑃𝐷 = ∑ 𝑃𝑖
𝑖=1
For most economical operation, all plants must operate at equal incremental production cost
while satisfying the equality constraint equation given above:
𝜆 − 𝑏𝑖
𝑃𝑖 =
2𝑐𝑖
The relation given above are known as coordination equations. They are function of 𝜆. An
analytical solution for 𝜆 is given by substituting the values of𝑃𝑖 in equality constraint:
𝑁
𝜆 − 𝑏𝑖
∑( ) = 𝑃𝐷
2𝑐𝑖
𝑖=1
Solving it for 𝜆 gives
𝑃 + ∑𝑁 ( 𝑏 𝑖 )
𝐷 𝑖=1 2𝑐𝑖
𝜆= ∑𝑁 ( )
1
𝑖=1 2𝑐
𝑖
PROCEDURE:
21
The procedure for implementation of equal incremental cost criteria to solve economic dispatch
problem is given below:
1. Identify cost coefficients (ai, bi, ci), power demand (Pd) and its constraints from the
given problem.
2. Calculate the Lamda (R/MWh) by using following equation:
n
PD i
b
Lamda() i 1 2ci
n
2c1
i 1 i
bi
Pi
2ci
Note:
4. A
The problem must be solved by hand and the obtained results must be verified using
f MATLAB
t
er computing the individual power calculate the individual cost of each generator by
substituting the value of power (obtained in step-3) in the respective fuel cost equations.
5. Calculate total cost of generation by adding up the individual costs as:
n n
FTotal Fi (ai bi Pi ci P 2
i )
i 1 i 1
6. Write down the calculated results in the Table-1.
Now obtained result are verified through MATLAB.
7. Open a new M-file in MATLAB.
8. Type the following code
MATLAB-Code:
function [P,Lamda,Cost]=analytical(Pd,A)
n=length(A);
for i = 1:n
a(i,1)=A(i,1);
b(i,1)=A(i,2);
c(i,1)=A(i,3);
end
Lamda = (Pd +sum( b./(2*c)))/sum( 1./(2*c) );
P=(Lamda-b)./(2*c);
Cost=sum( [sum(a) sum(b.*P) sum(c.*(P.^2))] );
22
9. Write down the MATLAB result in Table-1.
10. Compare both the results to verify that the calculated results are in accordance with
MATLAB.
EXERCISE:
The fuel cost functions for three thermal plants in $/h are given by:
F 500 5.3P 0.004P2
1 1 1
Where P1, P2 and P3 are in MW. The Total load PD is 800 MW, neglecting the line losses and
generation limits, find the optimal dispatch and the total cost $/h using Analytical Method.
RESULTS:
After compilation of MATLAB program, write down the obtained results in following table and
compare it with the manual calculations:
Table-3.1
Lambda(λ) P1 P2 P3 F1 F2 F3 Total
($/MWhr) (MW) (MW) (MW) ($/hr) ($/hr) ($/hr) Cost($/hr)
Calculated
Values
MATLAB
results
CONCLUSION:
Analytical method is the mathematical implementation of Equal Incremental Cost
Criteria. It gives one value of λ for which total cost is minimum. It provides an overview of the
ideal operation of thermal units. It is quite simple to perform.
TASK:
After going through the questions and answers related to the experiment, submit a
separate report which should include the analysis of the results of the experiment.
23
EXPERIMENT No. 4
ECONOMIC DISPATCH OF THERMALGENERATING UNITS USING
lAMBDA ITERATION METHOD
PURPOSE:
To learn
SOFTWARE USED:MATLAB
INTRODUCTION:
Economic Dispatch Problem (EDP) is the process of calculating the generation allocation to the
machines at minimum cost while satisfying the constraints. It is a generation allocation problem. The
economic dispatch problem mathematically may be defined as:
24
Iterative Method:
λ-iteration method is an iterative procedure in which EDP is repeated until a certain level
of accuracy is achieved. Initial value of λ is specified in the start of procedure. Value of λ is used
to find generation allocation Pi for all the units which are then used to find new value of λ.
The equality constraint in economic dispatch problem is given as:
𝑁
∑ 𝑃𝑖 = 𝑃𝐷
𝑖=1
In equal incremental cost criteria method, we derived the relation of 𝑃𝑖 as:
𝜆 − 𝑏𝑖
𝑃𝑖 =
2𝑐𝑖
By substituting the value of 𝑃𝑖 in equality constraint, we get
𝑁
𝜆 − 𝑏𝑖
∑( ) = 𝑃𝐷
2𝑐𝑖
𝑖=1
The above equation can be expressed as:
𝑓(𝜆) = 𝑃𝐷
Expanding by Taylor’s series about an operating point 𝜆𝐾 and neglecting higher order terms
results in
25
𝐾
𝑑𝑓(𝜆)
𝑓(𝜆)(𝐾) + ( ) Δ𝜆(𝐾) = 𝑃𝐷
𝑑𝜆
Δ𝜆(𝐾) = 𝑃𝐷 − 𝑓(𝜆)
(𝐾)
𝐾
𝑑𝑓(𝜆)
( )
𝑑𝜆
(𝐾)
Δ𝜆(𝐾) = Δ𝑃 𝐾
𝑑𝑓(𝜆)
( )
𝑑𝜆
(𝐾)
Δ𝜆(𝐾) = Δ𝑃
𝑑𝑃𝑖 𝐾
( )
𝑑𝜆
or
Δ𝑃(𝐾)
Δ𝜆(𝐾) =
∑1
2𝑐𝑖
and therefore
𝜆(𝐾+1) = 𝜆(𝐾) + Δ𝜆(𝐾)
Where
𝑁
Δ𝑃(𝐾) = 𝑃𝐷 − ∑ 𝑃𝑖
𝑖=1
The process is continued until Δ𝑃(𝐾) is less than a pre-specified accuracy.
PROCEDURE:
The procedure of implementation of Lamda-iteration method to solve economic dispatch
problem is given below:
Note:
The problem must be solved by hand and the obtained results must be verified
using MATLAB
1. Identify cost coefficients (ai, bi, ci), power demand (PD) and its constraints from the given
problem.
2. Assume an initial value of lambda a little higher than bi coefficients of fuel cost
26
3. Calculation generation of individual generators by substituting that assumed value of
lambda into the following equation:
bi
Pi
2ci
4. Check whether the value of Pi of each generating unit calculated in above step is within
the prescribed limits. If the calculated value violates the maximum limit put P equal to
Pmax and if P violates lower limit put it equal to Pmin.
5. Calculate residual power by subtracting power demand from generated power as:
n
P Pd P
i 1
i
9. Repeat steps 3, 4 and 5 until a certain level of accuracy is achieved such as (∆λ<0.0001)
10. Calculate the individual cost of each generator by substituting the value of final power in
the respective fuel cost equations.
11. Calculate total cost of generation by adding up the individual costs as:
n n
FTotal Fi (ai bi Pi ci P 2
i )
i 1 i 1
11. Write down the calculated results in the Table-1.
Now obtained results are also verified through MATLAB Program.
12. Open a new M-file in MATLAB.
13. Type the following code:
MATLAB CODE:
%g= initial guess of lamda; A= co-efficients of cost equations; pd= power demand;
function [cost,lamda,p]=iter_lamb(pd,A,g)
n=length(A);
dg=10;
for i=1:n
a(i,1)=A(i,1);
27
c(i,1)=A(i,3);
end
while ( abs(dg)>0.0001 )
p=(g-b)./(2*c);
for k=1:n
if p(k) > pmax(k)
p(k)=pmax(k);
elseif p(k)< pmin(k)
p(k)=pmin(k);
else, end
end
dp=pd-sum(p);
dg = dp/sum(1./(2*c));
g=g+dg;
lamda=g;
end
cost=sum([sum(a) sum(b.*p) sum(c.*(p.^2))])
EXERCISE:
The fuel cost functions for three thermal plants in $/h are given by:
F 500 5.3P 0.004P2
1 1 1
150 P2 350
100 P3 225
Where P1, P2 and P3 are in MW, the total load PD is 800 MW, neglecting the line losses and
considering generation limits, find the optimal dispatch and the total cost $/h using Lambda
Iteration Method.
28
RESULTS:
After compilation of MATLAB Program, write down the obtained results in following table and
compare it with the manual calculations.
Table-4.1
Lambda(λ) P1 P2 P3 F1 F2 F3 Total
($/MWhr) (MW) (MW) (MW) ($/hr) ($/hr) ($/hr) Cost($/hr)
Calculated
Values
MATLAB
results
CONCLUSION:
λ-iteration method is an accurate iterative method of solving ED Problem. In this
experiment a simplified version of ED problem with generation limits is effectively solved
through iterative method. However iterative method is unable to solve ED problem with non-
convex fuel cost function.
TASK:
After going through the questions and answers related to the experiment, submit a separate report
which should include the analysis of the results of the experiment.
Teacher / Supervisor’s Signature:
29
30
EXPERIMENT No. 5
ECONOMIC DISPATCH OF THERMAL POWER SYSTEM WITH
TRANSMISSION LINE LOSSES
PURPOSE:
To learn
1. Formulation of economic dispatch problem with transmission losses.
2. To construct and implement an algorithm to solve dispatch problem with
transmission line losses using iterative approach.
SOFTWARE USED:
MATLAB
INTRODUCTION:
Economic Dispatch Problem(EDP)is the process of calculating the generation allocation
to the machines at minimum cost while satisfying the constraints. It is a generation allocation
problem. The economic dispatch problem mathematically may be defined as:
𝑁
Subjected to:
𝑃𝑖𝑚𝑖𝑛 − 𝑃𝑖 ≤ 0
Where 𝑖 = 1,2, … . . 𝑁. and 𝑃𝐿 is transmission line losses.
One common practice for including the effect of transmission line losses is to express the total
transmission line losses as a quadratic function of the generator power outputs. The simplest
quadratic form is:
𝑁 𝑁
𝑃𝐿 = ∑ ∑ 𝑃𝑖𝐵𝑖𝑗𝑃𝑗
𝑖=1 𝑗=1
A more general formula containing a linear term and a constant term, referred to Kron’s Loss
formula is:
31
𝑁 𝑁 𝑁
The coefficient 𝐵𝑖𝑗 are called loss coefficients or B-coefficients. B-coefficients are assumed
constant and reasonable accuracy is expected providing the actual operating conditions are close
to the base case where the B-constants are computed.
The Langrange function for this problem is:
𝐿 = 𝐹𝑇 + 𝜆𝜑
𝑁
𝐿 = 𝐹𝑇 + 𝜆 [𝑃𝐷 + 𝑃𝐿 − ∑ 𝑃𝑖]
𝑖=1
The necessary conditions for constrained local minima of L are the following:
𝜕𝐿
=0
𝜕𝑃𝑖
𝜕𝐿
=0
𝜕𝜆
Condition 1:
32
If following simplified loss equation is used for transmission line losses calculation then the
value of 𝑃𝑖.
𝜆 − 𝑏𝑖
𝑃𝑖 =
2(𝑐 + 𝜆𝐵 )
𝑖 𝑖𝑖
Condition 2:
Second condition results in:
𝑁
𝑃𝐷 + 𝑃𝐿 = ∑ 𝑃𝑖
𝑖=1
PROCEDURE:
The procedure to solve economic dispatch problem with transmission line losses for a given
system is given below:
Note:
The problem must be solved by hand and the obtained results must be verified
using MATLAB
1. Identify cost coefficients (ai, bi, ci), power demand (Pd) and its constraints from the
given problem.
2. Assume an initial value of lambda a little higher than bi coefficients of fuel cost
equations.
33
n
P PD PL P
i 1
i
𝑁 𝑛
𝜕𝑃𝑖 𝑐𝑖 + 𝐵𝑖𝑖𝑏𝑖
∑( )=∑
𝜕𝜆 2(𝑐𝑖 + 𝜆𝐵𝑖𝑖)2
𝑖=1 𝑖=1
K 1 K K
9. Repeat above steps (3, 4, 5, 6, 7, 8) until a certain level of accuracy is achieved such as
(∆λ<0.0001).
10. Calculate the individual cost of each generator by substituting the value of final power in
the respective fuel cost equations.
11. Calculate total cost of generation by adding up the individual costs as:
n n
FTotal Fi (ai bi Pi ci P 2
i )
i 1 i 1
12. Now open MATLAB and create a new M-file.
13. Type the following code:
MATLAB CODE:
%g= initial guess of lamda; A= co-efficients of cost equations; pd= power
%demand; pmin=min limits of generation; pmax= max limits of generation. ;
%B= B co-efficient matrix
function [cost,lamda,p]=iter_lamb_loss(pd,A,g,B,pmax,pmin)
n=length(A);
dg=10;
for i=1:n
a(i,1)=A(i,1);
b(i,1)=A(i,2);
c(i,1)=A(i,3);
end
while ( abs(dg)>0.0001 )
for u=1:n
den(u,1)=(2*(c(u)+g*B(u,u)));
34
den1(u,1)=(2*(c(u)+g*B(u,u)).^2);
num1(u,1)=(c(u)+B(u,u)*b(u));
end
p=(g-b)./den;
for k=1:n
if p(k) > pmax(k)
p(k)=pmax(k);
elseif p(k)< pmin(k)
p(k)=pmin(k);
else, end
end
pl=sum((B)*(p.^2));
dp=pd-sum(p)+pl;
s=num1./den1;
dg = dp/sum(s);
g=g+dg;
lamda=g;
end
cost=sum([sum(a) sum(b.*p) sum(c.*(p.^2))]);
EXERCISE:
The fuel cost functions for three thermal plants in $/h are given by:
F 200 7.0P 0.008P2
1 1 1
10 P2 80
10 P3 70
The transmission loss is given by the following expression:
35
Where P1, P2 and P3 are in MW. The Total load PD is 150 MW, considering generation limits
and line losses, find the optimal dispatch and the total cost $/h using Lambda Iteration
Method.
RESULTS:
After compiling the MATLAB Program, write down the obtained result in following table and
compare it with the manual calculations:
Table-5.1
Lambda(λ) P1 P2 P3 F1 F2 F3 Total
($/MWhr) (MW) (MW) (MW) ($/hr) ($/hr) ($/hr) Cost($/hr)
Calculated
Values
MATLAB
results
CONCLUSION:
Lambda iteration method is an effective method to solve EDProblem. In this experiment
we have also included generation limits and transmission losses and we came to know that it
takes large number of iterations to solve the problem than the iterations required in case of
simple ED problem (i.e. in case of neglecting the limits & losses or only including the generation
limits).
TASK:
After going through the questions and answers related to the experiment, submit a separate report
which should include the analysis of the results of the experiment.
36
EXPERIMENT No. 6
SOLUTION OF ECONOMIC DISPATCH PROBLEM BY NEWTON
METHOD AND GRADIENT METHOD
PURPOSE:
To learn
1. To construct an algorithm to solve Economic Dispatch Problem usingGradient Method
and Newton Method.
2. To Implement algorithm in MATLAB and solve ED Problem for given test system
SOFTWARE USED:
MATLAB
INTRODUCTION:
(i) Gradient Method:
Note that the lambda search technique always requires that one be able to find the power output
of a generator, given an incremental cost for that generator. In the case of a quadratic function
for the cost function, or in the case where the incremental cost function is represented by a
piecewise linear function, this is possible. However, it is often the case that the cost function is
much more complex, such as the one below:
(P E)
F(P) A BP CP2 D exp[ ]
F
In this case, we shall propose that a more basic method of solution for the optimum be found.
Gradient method works on the principle that the minimum of a function, f(x), can be found by a
series of steps that always take us in a downward direction. From any starting point, xo, we may
find the direction of “steepest descent” by noting that the gradient off.
In this method new value of a variable x is found from the relation:
Where
37
Where f(x) is objective function to be minimized and x is vector of variables.
Subjected to:
The economic dispatch requires a starting value of λ and Pl, P2,….The new values of λ, Pl,
P2,…, etc., are found from:
Where
38
PROCEDURE:
The procedure of finding solution of economic dispatch problem using Gradient Method is given
below:
Note:
The problem must be solved by hand and the obtained results must be verified
using MATLAB
1. Identify cost coefficients (ai, bi, ci), power demand (Pd) and its constraints from the
given problem.
2. Calculate initial value of Lambda by first supposing the initial values of Pi using
following equation:
1 n d F (P 0)
0 i i
n i 1 dp
3. Form a vector of initial values of power and lambda as:
39
5. Compute new values of powers and lambda by the equation:
FTotal Fi (ai bi Pi ci P 2
i )
i 1 i 1
9. The obtained results are also verified through MATLAB Program. Open a new M-file in
MATLAB and type the following code:
MATLAB CODE:
function [p,sump,lamda,cost]=gradient_method(cost,pd,p,alpha,iter)
%cost=[561 7.92 0.001562;310 7.85 0.00194;78 7.97 0.00482];
%pd=800;
%p=[300 200 300];
%alpha=1;
%iter=10;
n=length(cost);
nlang=50;
j=1;
for i=1:n
a(i,1)=cost(i,1);
b(i,1)=cost(i,2);
y(i,1)=cost(i,3);
end
lamda =(1/3)*sum(b+2*y.*p');
while(j<iter);
x=p';
x(4,1)=lamda;
nlang=b+2*y.*p'-lamda;
nlang(4,1)=pd-sum(p');
x=x-(alpha*nlang);
p=x(1:3);
p=p';
lamda=x(4,1);
sum(p);
40
j=j+1;
end
p=p';
sump=sum(p);
lamda;
cost=sum([sum(a) sum(b.*p) sum(y.*p.*p)]);
EXERCISE:
The fuel cost functions for three thermal plants in $/h are given by:
F 561 7.92P 0.001562P2
1 1 1
F 78 7.97P 0.00482P2
3 3 3
100 P2 400
50 P3 200
Where P1, P2 and P3 are in MW. The Total load PD is 800 MW, considering generation limits
and line losses, find the optimal dispatch and the total cost $/h using Gradient Method.
RESULTS:
After compiling the MATLAB, write down the MATLAB results here and compare it with the
manual calculations:
Table 6.1
Lambda(λ) P1 P2 P3 F1 F2 F3 Total
($/MWhr) (MW) (MW) (MW) ($/hr) ($/hr) ($/hr) Cost($/hr)
Calculated
Values
MATLAB
results
41
(ii) NEWTON METHOD:
Newton Method is also an iterative procedure but it uses a technique other than used in λ-
iteration method.
Subjected to:
Generally, Newton's method will solve for the correction that is much closer to the minimum
generation cost in one step than would the gradient method.
PROCEDURE:
The procedure to find solution of Economic Dispatch (ED) problem through Newton’s Method is
given below:
42
Note:
The problem must be solved by hand and the obtained results must be verified
using MATLAB
1. Identify cost coefficients (ai, bi, ci), power demand (Pd) and its constraints from the
given problem.
2. Take initial value of lambda equal to zero.
3. Form a vector of initial values of power and lambda as:
43
n n
MATLAB CODE:
function [p,sump,lamda,cost]=gradient_method(cost,pd,p,iter)
cost=[561 7.92 0.001562;310 7.85 0.00194;78 7.97 0.00482];
pd=800;
p=[300 200 300];
iter=10;
n=length(cost);
nlang=50;
j=1;
for i=1:n
a(i,1)=cost(i,1);
b(i,1)=cost(i,2);
y(i,1)=cost(i,3);
end
lamda =0;
H=[0.003124 0 0 -1;0 0.00388 0 -1;0 0 0.00964 -1;-1 -1 -1 0];
while(j<iter);
x=p';
x(4,1)=lamda;
nlang=b+2*y.*p'-lamda;
nlang(4,1)=pd-sum(p');
x=x-(inv(H)*nlang);
p=x(1:3);
p=p';
lamda=x(4,1);
sum(p);
j=j+1;
end
p=p';
sump=sum(p);
lamda;
cost=sum([sum(a) sum(b.*p) sum(y.*p.*p)]);
44
13. Compare both the results to verify that the calculated results are in accordance with
MATLAB.
EXERCISE:
The fuel cost functions for three thermal plants in $/h are given by:
F 561 7.92P 0.001562P2
1 1 1
F 78 7.97P 0.00482P2
3 3 3
100 P2 400
50 P3 200
Where P1, P2 and P3 are in MW. The Total load PD is 800 MW, considering generation limits
and line losses, find the optimal dispatch and the total cost $/h using Newton Method.
RESULTS
After compiling the MATLAB, write down the MATLAB results here and compare it with the
manual calculations:
Table 6.2
Lambda(λ) P1 P2 P3 F1 F2 F3 Total
($/MWhr) (MW) (MW) (MW) ($/hr) ($/hr) ($/hr) Cost($/hr)
Calculated
Values
MATLAB
results
CONCLUSION:
Newton and gradient method converge in fewer number of iterations than conventional lambda
iterative techniques but these methods are more complex as compared to lambda iterative
techniques.
TASK:
45
After going through the questions and answers related to the experiment, submit a separate report
which should include the analysis of the results of the experiment.
46
EXPERIMENT No.7
SOLUTION OF UNIT COMMITMENT PROBLEM BY ENUMERATION
METHOD
PURPOSE:
To learn
1. Mathematical formulation of Unit Commitment (UC) problem
2. Solution of Unit Commitment problem using Enumeration Method
SOFTWARE USED:
MATLAB
INTRODUCTION:
The Unit Commitment (UC) is an important research challenge and vital optimization
task in the daily operational planning of modern power systems due to its combinatorial nature.
Because the total load of the power system varies throughout the day and reaches a different
peak value from one day to another, the electric utility has to decide in advance which generators
to start up and when to connect them to the network and the sequence in which the operating
units should be shut down and for how long. The computational procedure for making such
decisions is called unit commitment, and a unit when scheduled for connection to the system is
said to be committed.
In general, the UC problem may be formulated as a non-linear, large scale, mixed-integer
combinatorial optimization problem with both binary (unit status variable) and continuous (unit
output power) variables.
Objective Function:
The principal objective is to prepare on/off schedule of the generating units in every sub-period
(typically 1h) of the given planning period (typically 1 day or 1 week) in order to serve the load
demand and spinning reserve at minimum total production cost (fuel cost, startup cost, and shut
down cost), while meeting all unit, and system constraints.
The following costs are considered.
(i) Fuel Cost
The quadratic approximation is mostly used for fuel cost function and it is mathematically
represented as:
47
F(𝑃𝑖) = 𝑎𝑖 + 𝑏𝑖𝑃𝑖 + 𝑐𝑖𝑃2 … … . . (𝑅⁄ )
𝑖 ℎ
(ii) Start-up Cost
Start-up cost is warmth-dependent. Mathematically it is represented as a step function:
𝑆𝑇𝑖ℎ = 𝐻𝑜𝑡 − 𝐶𝑜𝑠𝑡: 𝑇𝐷𝑜𝑤𝑛 ≤ 𝑋𝑂𝑓𝑓(ℎ) ≤ (𝑇𝐷𝑜𝑤𝑛 + 𝐶𝑜𝑙𝑑 − 𝑆𝑡𝑎𝑟𝑡 𝐻𝑜𝑢𝑟𝑠)
𝑖 𝑖 𝑖
𝑆𝑇𝑖ℎ = 𝐶𝑜𝑙𝑑 − 𝐶𝑜𝑠𝑡: 𝑋𝑂𝑓𝑓(ℎ) > (𝑇𝐷𝑜𝑤𝑛 + 𝐶𝑜𝑙𝑑 − 𝑆𝑡𝑎𝑟𝑡 𝐻𝑜𝑢𝑟𝑠)
𝑖 𝑖
(iii) Shut down Cost
The typical value of the shut down cost is zero in the standard systems. This cost isconsidered as
a fixed cost:
𝑆𝐷𝑖ℎ = 𝐾𝑃𝑖ℎ … … … (𝑅⁄ℎ)
Where K is the incremental shut-down cost.
Thus objective function of the unit commitment problem is to minimize the total production cost
and is mathematically formulated as:
𝐻 𝑁
ENUMERATON METHOD:
This method takes all the combinations (2N– 1)H and then calculated the economic dispatch of
each unit. Where N = number of units, H = number of hours (24). For a total period of H
interval, the maximum number of possible combinations is (2N-1)H. For example, take a 24-h
period (e.g. 24 one hour intervals) and consider with 5, 10, 20 and 40 units. The value of (2N-1)H
becomes the following:
48
These very large numbers are the upper bounds for the numbers of enumerations required. The
constraints on the units and the loading capacity of the units limit the search space. Never the
less, the real practical barrier in the UCP is the high dimensionality of the possible search space.
PROCEDURE:
The procedure to find solution of unit commitment problem for a given power system is given
below:
1. Write down all the possible combinations of generation units using the relation (2N-1).
2. Calculate the minimum and maximum generation capacity of each combination by using
the given loading limits.
3. Find out the feasible combinations among all combinations that can satisfy the given
power demand. (Those combinations whose maximum generation capacity as calculated
in step-2 is greater than given load demand)
4. For every feasible combination, calculate lambda (λ) using analytical method by
considering only the units that are in the ON state.
n
PD i
b
Lamda() i 1 2ci
n
2c1
i 1 i
bi
Pi
2ci
3. Calculate the individual cost of each generator by substituting the value of power
(obtained in step-3) in the respective fuel cost equations and write down in Table-1.
4. Calculate total cost of generation by adding up the individual costs as
n n
FTotal Fi (ai bi Pi ci P 2
i )
i 1 i 1
And record the results in Table-1
5. Select the combination with the lowest cost which is the most feasible combination.
6. Now obtained results are verified through MATLAB. Open a new M-file in MATLAB
and type the following code:
MATLAB CODE:
function [p1,lamda1,cost1]=lamda_iteration(cost1,pu1,pl1,pd1,lamda1)
49
n1=length(pl1);
dp1=500;
for i1=1:n1
a1(i1,1)=cost1(i1,1);
b1(i1,1)=cost1(i1,2);
y1(i1,1)=cost1(i1,3);
end
while(abs(dp1)>5)
p1=(lamda1-b1)./(2*y1);
for j1=1:n1
if(p1(j1,1)>pu1(1,j1))
p1(j1,1)=pu1(1,j1);
end
if(p1(j1,1)<pl1(1,j1))
p1(j1,1)=pl1(1,j1);
end
end
dp1=pd1-sum(p1);
dlamda1=dp1/sum(1./(2*y1));
lamda1=lamda1+dlamda1;
end
cost1=sum( [sum(a1) sum(b1.*p1) sum(y1.*p1.*p1)]);
end
function [p]=unit_commitment(cost,pu,pl,pd,lamda)
%cost= [500 5.3 0.004;400 5.5 0.006;200 5.8 0.009;500 4.7 0.007];
%pu=[450 350 225 400];
%pl=[200 150 100 150];
%pd=800;
%lamda=6;
n=length(pl);
com=2^n;
com=com-1;
for i=1:com
a=dec2bin(i);
g=log2(i);
g=fix(g);
for j=0:g
p(i+1,g+1-j)=str2num(a(1,j+1));
end
50
end
for t=1:(com+1)
p(t,n+1)=0;
p(t,n+2)=0;
end
for k=1:(com+1)
for q=1:n
if p(k,q)==1
p(k,n+1)=p(k,n+1)+pl(1,q);
p(k,n+2)=p(k,n+2)+pu(1,q);
end
end
end
for v=1:(com+1)
f=1;
if p(v,n+2)>=pd
for u=1:n
if p(v,u)==1
e(f,1)=cost(u,1);
e(f,2)=cost(u,2);
e(f,3)=cost(u,3);
pl1(1,f)=pl(1,u);
pu1(1,f)=pu(1,u);
f=f+1;
end
end
[p1,lamda1,cost1]=lamda_iteration (e,pu1,pl1,pd,lamda);
r=1;
for x=1:n
if p(v,x)==1
p(v,n+2+x)=p1(r,1);
r=r+1;
end
end
end
end
n2=length(pl);
for i2=1:n2
a2(i2,1)=cost(i2,1);
b2(i2,1)=cost(i2,2);
51
y2(i2,1)=cost(i2,3);
end
for z=1:n
for b=1:(com+1)
if p(b,n+2+z)>0
p(b,2*n+2+z)=a2(z,1)+b2(z,1)*p(b,n+2+z)+y2(z,1)*p(b,n+2+z)*p(b,n+2+z);
end
end
end
for d=1:(com+1)
p(d,3*n+3)=0;
for h=1:n
p(d,3*n+3)=p(d,2*n+2+h)+p(d,3*n+3);
end
end
EXERCISE:
3- machine system given for the Unit Commitment Problem is as:
𝐻1(𝑃1) = 510 + 7.2𝑃1 + 0.00142𝑃12 ; 150 ≤ 𝑃1 ≤ 600 F.C = 1.1 $ / MBtu
𝐻2(𝑃2) = 310 + 7.85𝑃2 + 0.00194𝑃22 ; 100 ≤ 𝑃2 ≤ 400 F.C = 1.0 $ / MBtu
𝐻3(𝑃3) = 78 + 7.94𝑃3 + 0.00482𝑃32 ; 50 ≤ 𝑃3 ≤ 200 F.C = 1.2 $ / MBtu
Pd = 550 MW
Solve it using Enumeration Method.
RESULTS:
After compiling the MATLAB program write down the obtained results in following table and
compare it with manual calculations.
Table 7.1
Combinations Pmax Pmin Lambda P1 P2 P3 C1 C2 C3 CT
52
CONCLUSION:
Unit Commitment is a problem on broad basis i.e. to select units from a no. of available
stations to meet forecasted load on the system during certain period. Economic Dispatch
Problem is a step within UC which is performed for all possible combinations. Also
economic dispatch is performed later when UC has already been done to minimize the
cost.
TASK:
After going through the questions and answers related to the experiment, submit a
separate report which should include the analysis of the results of the experiment.
53
Experiment 8:
Task 8-a
Reading Material: Topic 11.7, Chapter 11: “Stability”, Book: “Power System Analysis by Hadi
Sadaat”.
Numerical Methods
54
Numerical methods are used for those problems where exact solution is difficult to obtain and
these can give an approximate solution to (almost) any equation. In power system stability
analysis, we usually encounter swing equation which is a non-linear equation and solution can be
obtained using numerical methods like Euler method and Runge-Kutta methods. In Task 6-a, we
will have a brief overview of these methods and in Task 6-b we will apply them for obtaining
solution of a swing equation for a single machine system.
EULER METHODS
The Euler methods are simple methods for solving first-order ODE, particularly suitable for quick
programming because of simplicity but accuracy is not high. The three versions of Euler methods
involve:
𝑦1 = 𝑦0 + ℎ𝑦′0
𝑦1 = 𝑦0 + ℎ𝑓(𝑦0, 𝑥0)
and can be generalized as
55
The accuracy of this method is quite the same as that of the forward Euler method.
1. Define 𝑓(𝑥, 𝑦)
2. Input initial values 𝑥0 and 𝑦0
3. Input step sizes ℎ and number of steps 𝑛
4. Calculate 𝑥 and y
for i=1:n
x=x+h
y=y+hf(x,y)
end
5. Output 𝑥 and y
6. End
Part (I)
𝒅𝒚 𝒙
= , 𝒚(𝟎) = 𝟏
𝒅𝒙 𝒚
B) Suppose we now want to approximate 𝒚(𝟑 × 𝒉) using the Euler’s methods with step
sizes 𝒉 = 𝟎. (𝒚𝒐𝒖𝒓 𝒓𝒆𝒈𝒊𝒔𝒕𝒓𝒂𝒕𝒊𝒐𝒏 𝒏𝒖𝒎𝒃𝒆𝒓) {example: 2014-EE-10 h=0.10, 2014-
EE-4, h=0.4, 2014-EE-251 h=0.251}
ℎ=
56
𝑥0 = 0, 𝑦0 = 1
𝑥1 = , 𝑥2 = , 𝑥3 = 3 × ℎ =
𝑦1 = 𝑦0 + ℎ𝑓(𝑥0, 𝑦0) =
𝑦2 =
𝑦3 =
Now find 𝑦(3 × ℎ) directly from the analytical solution obtained in A) and name it is 𝑦(𝑥)
𝑦(3 × ℎ) =
Calculate Error
|𝑦(𝑥) − 𝑦3|
× 100 =
𝑦(𝑥)
Error =
57
C) Create User-Defined Function Files
//Euler Forward//
function [x,y]=euler_forward(f,xinit,yinit,xfinal,n)
% Euler approximation for ODE initial value problem
% Euler forward method
% Calculation of h from xinit, xfinal, and n
h=(xfinal-xinit)/n;
% Initialization of x and y as column vectors
x=[xinit zeros(1,n)]; y=[yinit zeros(1,n)];
% Calculation of x and y
for i=1:n
x(i+1)=x(i)+h;
y(i+1)=y(i)+h*f(x(i),y(i));
end
end
Create eulerbackward.m and eulermodified.m in a similar fashion.
D) Solve the problem by putting data and called functions into a script file named as
‘electrical.m’. Calculate exact solution, estimate errors and plot all results (i.e., exact
solution, eulerforward, eulerbackward and eulermodified) on a same plot. [Hint: You
may have to use legend command for this purpose].
//Calculate Exact Solution. You have to write equation obtained in A) here and
compute 𝒚 by defining a vector 𝒙 //
//Call Functions//
//Plot//
58
//Estimate Errors//
Error
h= Forward Backward Modified
Result:
Part (II):
MATLAB has several different functions (built-ins) for the numerical solution of ODEs.
Instead of writing our own MATLAB code as we did in the Part (I) we will call the built-in
function. These solvers can be used with the following syntax:
Solver is the solver you are using, such as name, ode45 or ode23. ‘odefun’ is the function that
defines the derivatives, so odefun defines 𝑦′ as a function of the independent parameter. tspan
is a vector that specifies the interval of the solution. 𝑦0 is the intial value of 𝑦. [x,y] is the
output, which is the solution of the ODE.
59
A) Use ode45 and ode23 to obtain solution for the ODE given in Part (I) and compare
both with the results obtained using exact solution. Plot all results on a same graph.
Attach all plots with this handout.
tspan=[𝒙𝟎, 𝒙𝒇𝒊𝒏𝒂𝒍] = [ ]
B) Compare ode45, ode23 with Euler methods and state which algorithm is most
appropriate to be used if step size is large.
Task 8-b
Reading Material: Topic 11.8, Chapter 11: “Stability”, Book: “Power System Analysis by Hadi
Sadaat”.
In Task 6-b, we’ll numerically obtain the solution of the swing equation using ode23 and ode45
solvers. A function named 𝑠𝑤𝑖𝑛𝑔𝑚𝑒𝑢 (𝑃𝑚, 𝐸, 𝑉, 𝑋, 𝑋2, 𝑋3, 𝐻, 𝑓, 𝑡𝑐, 𝑡𝑓, 𝐷𝑡) is written below for the
transient stability analysis of a one machine system.
Swingmeu Function
% This program solves the swing equation of a one-machine system
60
%
%global Pm f H E V X1 X2 X3
clear t
if exist('Pm')~=1
if exist('E')~=1
if exist('V')~=1
if exist('X1')~=1
if exist('X2')~=1
if exist('X3')~=1
if exist('H')~=1
if exist('f')~=1
if exist('Dt')~=1
if exist('tc')~=1
61
tc = input('Clearing time of fault in sec tc = '); else, end
if exist('tf')~=1
clear t x1 x2 delta
d0 =asin(Pm/Pe1max);
t(1) = 0;
x1(1)= d0;
x2(1)=0;
np=tf /Dt;
Pemax=Pe2max;
ck=pi*f/H;
for k = 1:np
if t(k) >= tc
Pemax=Pe3max;
else, end
t(k+1)=t(k)+Dt;
Dx1b=x2(k);
Dx2b=ck*(Pm-Pemax*sin(x1(k)));
x1(k+1)=x1(k)+Dx1b*Dt;
x2(k+1)=x2(k)+Dx2b*Dt;
Dx1e=x2(k+1);
Dx2e=ck*(Pm-Pemax*sin(x1(k+1)));
Dx1=(Dx1b+Dx1e)/2;
62
Dx2=(Dx2b+Dx2e)/2;
x1(k+1)=x1(k)+Dx1*Dt;
x2(k+1)=x2(k)+Dx2*Dt;
end
delta=180*x1/pi;
clc
head=[' '
' '];
disp(head)
h=figure; figure(h)
In addition to this, based on the MATLAB automatic step size Runge Kutta ode23 and ode45
functions, two more functions are developed for the transient stability analysis of a one machine
system. These are swingrk2 based on ode23 and swingrk4 based on ode45. Both of these
functions are given below.
Swingrk2 Function
% This program solves the swing equation of a one-machine system
63
% when subjected to a three-phase fault with subsequent clearance
% of the fault.
%global Pm f H E V X1 X2 X3
if exist('Pm') ~= 1
if exist('E') ~= 1
if exist('V') ~= 1
if exist('X1') ~= 1
if exist('X2') ~= 1
if exist('X3') ~= 1
if exist('H') ~= 1
if exist('f') ~= 1
if exist('tc') ~= 1
64
if exist('tf') ~= 1
clear t x delta
d0 =asin(Pm/Pe1max);
t0 = 0;
x0 = [d0; 0];
%tol=0.001;
delta = 180/pi*x(:,1);
clc
head=[' '
' '];
disp(head)
65
disp([t, delta, x(:, 2)])
h=figure; figure(h)
Swingrk4 Function
% This program solves the swing equation of a one-machine system
% of the fault.
%global Pm f H E V X1 X2 X3
if exist('Pm') ~= 1
if exist('E') ~= 1
if exist('V') ~= 1
if exist('X1') ~= 1
66
if exist('X2') ~= 1
if exist('X3') ~= 1
if exist('H') ~= 1
if exist('f') ~= 1
if exist('tc') ~= 1
if exist('tf') ~= 1
clear t x delta
d0 =asin(Pm/Pe1max);
t0 = 0;
x0 = [d0; 0];
tol=0.001;
67
tspan = [tc, tf];
delta = 180/pi*x(:,1);
clc
head=[' '
' '];
disp(head)
h=figure; figure(h)
The above two functions use another function named as cctime which obtains the critical clearing
time of fault for critical stability and is given below:
Cctime Function
% This function simulates the swing equation of a one-machine system
68
%
d0 =asin(Pm/Pe1max);
dmax = pi-asin(Pm/Pe3max);
cosdc = (Pm*(dmax-d0)+Pe3max*cos(dmax)-Pe2max*cos(d0))/(Pe3max-Pe2max);
if abs(cosdc) > 1
return
else
end
dc = acos(cosdc);
if dc > dmax
return
else
end
tf = 0.4;
x0 = [d0; 0];
69
kk=find(xf(:,1) <= dc); k=max(kk);
tt=t1(k);
tf=tf+.4;
tol=0.00001+tf*2.5e-5;
tt= t1(k);
end
%end
tmargin = t1(k);
if tf >= 3.6
return
else
end
Note:
You may use above codes for swingmeu, cctime, swingrk2 and swingrk4 functions.
70
Part (I):
a) Solve example 11.6 using the swingmeu function and swingrk4 function.
b) Using the state-space representation of the swing equation, develop SIMULINK model. [Hint:
See Figure 11.29]
Part (II):
Consider the system shown in Figure below
The machine of the above system is delivering a real power input of 0.77 per unit to the infinite bus at a
voltage of 1.0 per unit. The generator excitation voltage is E`=1.25 per unit. A three-phase fault at the
middle of one line is cleared by isolating the faulted circuit simultaneously at both ends. [Note: This is
Problem 11.16 from Power System Analysis by Hadi Sadaat]
a) The fault is cleared in 0.2 second. Obtain the numerical solution of the swing equation for
1.5 seconds. Select one of the functions swingmeu, swingrk2, or swingrk4.
b) Repeat the simulation and obtain the swing plots when fault is cleared in 0.4 second, and for the
critical clearing time.
Note:
Show your calculation details and attach the printouts of the plots and Simulink Model with this manual.
71
EXPERIMENT No. 9
MODELLING OF DIFFERENT COMPONENTS OF LOAD FREQUENCY
CONTROL FOR THERMAL GENERATING UNIT AND SIMULATION
OF SINGLE AREA POWER SYSTEM
PURPOSE:
To learn
INTRODUCTION:
Active power control is one of the important control actions to be perform to be normal operation
of the system to match the system generation with the continuously changing system load in
order to maintain the constancy of system frequency to a fine tolerance level. This is one of the
foremost requirements in proving quality power supply. A change in system load cases a change
in the speed of all rotating masses (Turbine – generator rotor systems) of the system leading to
change in system frequency. The speed change form synchronous speed initiates the governor
control (primary control) action result in the entire participating generator – turbine units taking
up the change in load, stabilizing system frequency. Restoration of frequency to nominal value
requires secondary control action which adjusts the load - reference set points of selected
(regulating) generator – turbine units. The primary objectives of automatic generation control
(AGC) are to regulate system frequency to the set nominal value and also to regulate the net
interchange of each area to the scheduled value by adjusting the outputs of the regulating units.
This function is referred to as load – frequency control (LFC).
MATHEMATICAL MODELLING OF LFC:
The first step in the analysis and design of a control system is mathematical modelling of the
system. The two common methods are the transfer function method and state variable approach.
The state variable approach can be applied to portray linear as well as non-linear system. In order
to use the transfer function and linear state equations the system has to be linearized. Proper
assumption and approximation are made to linearize the mathematical equations describing the
system and a transfer function is obtained for the following components:
(a) Generator Model
72
With the use of swing equation of a synchronous machine to small perturbation, we have
73
turbine relates the changes in mechanical power output ΔPm and the changes in the steam valve
position ΔPv:
In s-domain
The command ΔPg is transformed through amplifier to the steam valve position command ΔP V.
We assume here a linear relationship and considering simple time constant we get this s-domain
relation:
Combining all the above block diagrams, for an isolated area system we get the following:
The open loop transfer function of the block diagram shown in above figure is:
1
𝐾𝐺(𝑠)𝐻(𝑠) = (13.1)
𝑅(2𝐻𝑠+𝐷)(1+𝜏𝑔𝑠)(1+𝜏𝑇𝑠)
74
The closed loop transfer function that relates the load change ΔPL to the frequency deviation ΔΏ
is:
∆Ω(𝑠) (1+𝜏𝑔𝑠)(1+𝜏𝑇𝑠) (13.2)
= 1
−∆𝑃𝐿 (2𝐻𝑠+𝐷)(1+𝜏𝑔𝑠)(1+𝜏𝑔𝑠)+ ⁄𝑅
or
∆Ω(𝑠) = −∆𝑃𝐿 (𝑠)𝑇(𝑠) ∆𝑃
(13.3)
The load change is a step input i.e. ∆𝑃 (𝑠) = 𝐿. Utilizing the final value theorem, the steady
𝐿 𝑠
state value of ∆𝑤 is:
1
∆𝑤𝑠𝑠 = lim 𝑠∆Ω(𝑠) = (−∆𝑃𝐿 ) 1 (13.4)
𝑠→0 (𝐷+𝑅)
It is clear that for the case with no frequency sensitive load (D=0), the steady state deviation in
frequency is determined by governor speed regulation and is
∆𝑤𝑠𝑠 = (−∆𝑃𝐿 )𝑅 (13.5)
With several generators with governor speed regulations R2, R3, R4,…, Rn are connected to the
system, the steady state deviation in frequency is given by:
1
∆𝑤𝑠𝑠 = (−∆𝑃𝐿 ) (13.6)
𝐷+1⁄𝑅1+1⁄𝑅2+⋯+1⁄𝑅𝑛
PROCEDURE:
The procedure of implementing Load Frequency Control (LFC) mechanism is given here:
1. For the given isolated power system network, read the value of following parameters of
LFC components; Turbine time constant, Governor time constant, governor inertia
constant, governor speed regulation.
2. Put these parameters into equation to find the closed loop transfer function of LFC block
diagram.
3. Now find the steady state frequency deviation by using the relation (13.5).
4. The computed steady state frequency deviation is also verified by finding the frequency
deviation step response in MATLAB. Open a new M-file in MATLAB and type the
following code:
Pl=0.2;
numc=[0.1 0.7 1];
denc=[1 7.08 10.56 20.8];
t=0:0.2:10;
c=-Pl*step(num,den,c)
plot(t,c)
xlabel(‘t,sec’);
ylabel(‘pu’)
title(‘Frequency deviation step response’)
75
5. To verify the obtained result, the frequency deviation step response can also determine by
simulating the LFC block diagram in MATLAB Simulink. For given test system the
following block diagram is implemented in MATLAB Simulink.
SIMULINK MODEL:
RESULTS:
(i) MANUAL CALCULATIONS:
76
(ii) MATLAB RESULTS:
CONCLUSION:
Changes in real power affect mainly the system frequency, while reactive power is less sensitive
to changes in frequency and it is mainly dependent on changes in voltage magnitude. The
operation objectives of LFC are to maintain reasonably uniform frequency, to divide the load
between generators and to control the tie-line interchange schedules. In this experiment LFC
mechanism for an isolated power system is simulated and simulation result shows that the steady
state deviation in frequency is determined by the governor speed regulation.
TASK:
After going through the questions and answers related to the experiment, submit a separate report
which should include the analysis of the results of the experiment.
77
EXPERIMENT NO. 10
AUTOMATIC GENERATION CONTROL OF SINGLE AREA POWER
SYSTEM
PURPOSE:
To learn
1. Determination of frequency deviation of Automatic Generation Control (AGC) system
for isolated power system using transfer function approach
2. Simulation of AGC mechanism for a given isolated power system network in MATLAB
INTRODUCTION:
If the load on the system is increased, the turbine speed drops before the governor can adjust the
input of the steam to new load. As the change in the value of speed diminishes, the error signal
becomes smaller and position of fly ball governor gets closer to the point required to maintain a
speed. However constant speed will not be the set point and there will be an offset. One way to
restore the speed or frequency is to its nominal value is to add an integrator. The integral unit
monitors the average error over the period of time and will overcome the offset. Thus as the
system load changes continuously, the generation is adjusted automatically to restore the
frequency to nominal value. This scheme is known as the automatic generation control.
AGC IN SINGLE AREA SYSTEM:
With the primary LFC loop, a change in the system load will result in a steady state frequency
deviation, depending on the governor speed regulation. In order to reduce the frequency
deviation to zero, we must provide a rest action. The rest action can be achieved by introducing
an integral controller to act on the load reference setting to change the speed test point. The LFC
system, with the addition of the secondary loop is shown in following figure.
Figure 14.1: Block diagram of AGC for single area power system
78
The integral controller gain KI must be adjusted for a satisfactory transient response. The
equivalent block diagram is shown below:
The closed loop transfer function for above system is given below:
∆Ω(s) 𝑠(1+𝜏 𝑠)(1+𝜏 𝑠)
= 𝑠(2𝐻 +𝐷)((1+𝜏𝑔 𝑠)(1+𝜏𝑇 𝑠)+𝐾𝐼+ 𝑠 (14.1)
−∆𝑃𝐿(𝑠) 𝑠 𝑔
𝑅
Or 𝑇
PROCEDURE:
The procedure of implementing Automatic Generation Control (AGC) mechanism in single area
power system is given here:
1. For the given isolated power system network, read the value of following parameters of
AGC components; Turbine time constant, Governor time constant, governor inertia
constant, governor speed regulation, Integral Controller gain.
2. Put these parameters into equation to find the closed loop transfer function of AGC block
diagram.
3. Now find the steady state frequency deviation by using the relation (14.3).
4. The computed steady state frequency deviation is also verified by finding the frequency
deviation step response in MATLAB. Open a new M-file in MATLAB and type the
following code:
Pl=0.2;
KI=7;
numc=[0.1 0.7 1 0];
denc=[1 7.08 10.56 20.8 KI];
t=0:0.2:10;
79
c=-Pl*step(num,den,c)
plot(t,c)
xlabel(‘t,sec’);
ylabel(‘pu’)
title(‘Frequency deviation step response’)
5. To verify the obtained result, the frequency deviation step response can also determine by
simulating the AGC block diagram in MATLAB Simulink. For given test system the
following block diagram is implemented in MATLAB Simulink.
SIMULINK MODEL:
80
The LFC system is equipped with the secondary integral control loop for AGC,
(a) Find the frequency deviation step response using MATLAB step function. Set the
integral control gain to KI=7
(b) Construct the Simulink block diagram and obtain the frequency deviation response for
same conditions.
RESULTS:
(i) MANUAL CALCULATIONS:
CONCLUSION:
If the load on the system is increased, the turbine speed drops before the governor can adjust the
input of the steam to new load. One way to restore the speed or frequency to its nominal value is
to add an integrator. In this experiment Load frequency control mechanism is simulated with the
addition of integral controller and it is evident from simulation results that frequency deviation
reduced to zero with the addition of integral controller.
TASK:
After going through the questions and answers related to the experiment, submit a separate report
which should include the analysis of the results of the experiment.
81
EXPERIMENT NO. 11
AUTOMATIC GENERATION CONTROL FOR MULTI-AREA POWER
SYSTEM
PURPOSE:
To learn
1. Mathematical formulation of AGC problem for two or multi-area power systems
2. Simulation of AGC mechanism for given two area power system in MATLAB
Simulink
INTRODUCTION:
If the load on the system is increased, the turbine speed drops before the governor can adjust the
input of the steam to new load. As the change in the value of speed diminishes, the error signal
becomes smaller and position of fly ball governor gets closer to the point required to maintain a
speed. However constant speed will not be the set point and there will be an offset. One way to
restore the speed or frequency is to its nominal value is to add an integrator. The integral unit
monitors the average error over the period of time and will overcome the offset. Thus as the
system load changes continuously, the generation is adjusted automatically to restore the
frequency to nominal value. This scheme is known as the automatic generation control.
AGC in Multi-Area System:
In many cases, a group of generators are closely coupled internally and swing in a unison.
Furthermore, the generator turbines tend to have the same response characteristics. Such a group
of generators are coherent. Then it is possible to let the LFC loop to represent the whole system
which is referred to as control area. The AGC of multi-area system can be realized first the AGC
for two area system,
Consider two areas represented by an equivalent generated unit interconnected by lossless tie-
line with reactance Xtie. Each area is represented by a voltage source behind an equivalent
reactance is shown below:
82
During Normal operation, the real power transferred over the tie line is given below:
|𝐸1||𝐸2|
𝑃 = 𝑆𝑖𝑛𝛿 (15.1)
12 𝑋12 12
83
Figure 15.2: Block diagram of AGC mechanism
The change in mechanical power is determined by governor speed characteristics, given by:
−∆𝑤
∆𝑃𝑚1 =
𝑅1
−∆𝑤
∆𝑃𝑚2 =
𝑅2
Solving for 𝝙w, we have
−∆𝑃𝐿1 (15.6)
∆𝑤 = ( 1 +𝐷 1
1)+( +𝐷2)
𝑅1 𝑅2
−∆𝑃𝐿1
∆𝑤 = (15.7)
𝐵1+𝐵2
Where
1
𝐵1 = + 𝐷1 (15.8)
𝑅1
1
𝐵2 = + 𝐷2 (15.9)
𝑅2
B1, B2 are known as frequency bias factors. The change in the tie-line power is
1
( +𝐷2)∆𝑃𝐿1
𝑅2
∆𝑃12 = 1 1
( +𝐷1)( +𝐷2)
(15.10)
𝑅1 𝑅2
84
𝐵2
∆𝑃12 = (−∆𝑃𝐿1 ) (15.11)
𝐵1+𝐵2
PROCEDURE:
The procedure of implementing Automatic Generation Control (AGC) mechanism in two area
power system is given here:
1. For the given two area power system network, keep the value of following parameters of
AGC components for both area 1 and area 2; Turbine time constant, Governor time
constant, governor inertia constant, governor speed regulation.
2. Using these values, find the frequency bias factors for both areas as given in equation
(15.8) and (15.9).
3. After that compute the steady state frequency deviation (Δw) using the relation
mentioned in equation (15.7).
4. Also find the power transferred over the tie line from area 2 to area 1 by using the
relation (15.11).
5. These obtained results (Steady state frequency deviation, Tie Line Power) can also be
verified by simulating the AGC block diagram in MATLAB Simulink. The Simulink
block diagram for example test system is given below:
SIMULINK MODEL:
85
EXERCISE:
A two area system connected by a tie line has the following parameters on a 1000MVA
common base
Area 1 2
The units are operating in parallel at the nominal frequency of 60Hz. The synchronizing power
coefficient is computed from the initial operating condition and is given to be Ps = 2 p.u. A load
change of 187.5 MW occurs in area1.
(a) Determine the new steady state frequency and the change in the tie-line flow.
(b) Construct the SIMULINK block diagram and obtain the frequency deviation response for
the condition in part (a).
RESULTS:
86
(ii) MATLAB RESULTS:
CONCLUSION:
In an interconnected system consisting of several power pools, the role of automatic generation
control is to divide the load among system, stations, and generators so as to achieve maximum
economy and correctly control the scheduled interchanges of tie-line power while maintaining a
uniform load frequency.
TASK:
After going through the questions and answers related to the experiment, submit a separate report
which should include the analysis of the results of the experiment.
87
EXPERIMENT No. 12
MODELLING OF DIFFERENT COMPONENTS OF AUTOMATIC
VOLTAGE REGULATOR (AVR) SYSTEM FOR THERMAL
GENERATING UNIT AND SIMULATION OF GIVEN TEST SYSTEM
PURPOSE:
To learn
1. Mathematical Modelling of different components of Automatic Voltage Regulator
(AVR) System
2. Simulation of AVR mechanism for a given test system
INTRODUCTION:
The generation exciter system maintains generator voltage and controls the reactive power flow.
The sources of reactive power are generators, capacitors and reactors. The generator reactive
powers are controlled by field excitation. Other supplementary methods of improving voltage
profile on electric transmission systems are transformer load-tap changers, switched capacitors,
step voltage regulators and static VAR control equipment. The primary means of generator
reactive power control is the generation excitation control using Automatic Voltage Regulator
(AVR). The role of AVR is to hold the terminal voltage magnitude of a synchronous generator at
a specified level. The schematic diagram and mathematical modelling of different components
involved in AVR system is given below:
88
MATHEMATICAL MODELLING OF AUTOMATIC VOLTAGE
REGULATOR (AVR):
𝑉𝑅(𝑠) 𝐾𝐴
=
𝑉𝐸(𝑠) 1 + 𝜏𝐴𝑠
𝑽𝑬(𝒔) 𝑲𝑨 𝑽𝑹(𝒔)
𝟏 + 𝝉𝑨𝒔
𝑉𝐹(𝑠) 𝐾𝐸
=
𝑉𝑅(𝑠) 1 + 𝜏𝐸 𝑠
𝑲𝑬
𝑽𝑹(𝒔) 𝑽𝑭 (𝒔)
𝟏 + 𝝉 𝑬𝒔
𝑉𝑡(𝑠) 𝐾𝐺
=
𝑉𝐹(𝑠) 1 + 𝜏𝐺 𝑠
89
𝑲𝑮
𝑽𝑭(𝒔) 𝑽𝒕(𝒔)
𝟏 + 𝝉 𝑮𝒔
𝑉𝑆(𝑠) 𝐾𝑅
=
𝑉𝑡(𝑠) 1 + 𝜏𝑅𝑠
𝑲𝑹
𝑽𝒕(𝒔) 𝑽𝑺 (𝒔)
𝟏 + 𝝉𝑹 𝒔
The closed loop transfer function related to generator terminal voltage and reference voltage is:
𝑉𝑡(𝑠) 𝐾𝐴 𝐾𝐸𝐾𝐺𝐾𝑅(1+𝜏𝑅𝑠)
= (16.2)
𝑉𝑟𝑒𝑓(𝑠) (1+𝜏𝐴𝑠)(1+𝜏𝐸𝑠)(1+𝜏𝐺𝑠)(1+𝜏𝑅𝑠)+𝐾𝐴𝐾𝐸𝐾𝐺𝐾𝑅
90
𝐾𝐴
𝑉 = lim 𝑠𝑉 (𝑠) = (16.4)
𝑡(𝑠𝑠) 𝑡
𝑠→0 1+𝐾𝐴
PROCEDURE:
The procedure for simulating Automatic Voltage Regulator (AVR) system on a generating unit is
given below:
1. From a given system data, keep the values of gain and time constants of following four
components of AVR; Amplifier, Exciter, Sensor and generator.
2. By using these values, find the closed loop transfer function of AVR block diagram as
given in equation (16.2).
3. With the application of final value theorem, find the steady state step response of above
mentioned system according to the equation (16.4).
4. The obtained response in step 3 can also be verified through MATLAB. Open the new
M-file and type the following code to find steady state step response of the AVR system.
KA=10;
numc=KA*[25 500];
denc=[1 33.5 307.5 775 500+500*KA];
t=0:.05:20;
c=step(numc,denc,t);
plot(t,c);
grid
timespec(numc,denc)
5. The obtained result are further verified by simulating the AVR system in MATLAB
Simulink. For example test system the following block diagram will be simulated in
MATLAB Simulink.
SIMULINK MODEL:
91
Figure 16.2: Simulink Model
EXERCISE:
The AVR system of a generator has the following parameters:
(a) The amplifier gain is set to KA=10. Find the steady state step response and time-domain
performance specifications.
(b) Construct the Simulink block diagram and obtain the step response.
RESULTS:
(i) MANUAL CALCULATIONS:
92
CONCLUSION:
Changes in reactive power load demand effects the voltage magnitude. It is concluded from this
experiment that AVR mechanism helps to maintain constant voltage despite of changes in
reactive power load demands. Moreover the steady state response can be further improved by
adding stabilizer.
TASK:
After going through the questions and answers related to the experiment, submit a separate report
which should include the analysis of the results of the experiment.
93
94