PS Lab Manual
PS Lab Manual
Expt.No:1
Date :
OBJECTIVES
(i) To procure sufficient knowledge in MATLAB to solve the power system Problems.
SOFTWARE REQUIRED
(i) MATLAB
1. INTRODUCTION TO MATLAB
MATLAB comprising lot of optional tool boxes and block set like control system,
optimization, and power system and so on.
Algorithm development.
MATLAB is a widely used tool in electrical engineering community. It can be used for simple
mathematical manipulation with matrices for understanding and teaching basic mathematical and
engineering concepts and even for studying and simulating actual power system and electrical system
in general. The original concept of a small and handy tool has evolved to become an engineering work
house. It is now accepted that MATLAB and its numerous tool boxes replace and/or enhance the usage
of traditional simulation tool for advanced engineering applications.
1
Engineering personnel responsible for studies of electrical power system, control system and
power electronics circuits will benefit from the MATLAB. To expertise in Electrical System
Simulation one should have a basic understanding of electric circuits, power system and power
electronics.
To open the MATLAB applications double click the Matlab icon on the desktop. This will open
the MATLAB window space with Matlab prompt as shown in the fig.1.
>> quit
(Or)
>>exit
To select the (default) current directory click ON the icon [] and browse for the folder named
D:\SIMULAB\xxx, where xxx represents roll number of the individual candidate in which a folder
should be created already.
When you start MATLAB you are presented with a window from which you can enter
commands interactively. Alternatively, you can put your commands in an M- file and execute it at the
MATLAB prompt. In practice you will probably do a little of both. One good approach is to
incrementally create your file of commands by first executing them.
M-files can be classified into following 2 categories,
i) Script M-files Main file contains commands and from which functions can
also be called.
ii) Function M-files Function file that contains function command at the first
line of the M-file.
M-files to be created by you should be placed in your default directory. The M-files developed
can be loaded into the work space by just typing the M-file name.
2
To load and run a M-file named ybus.m in the workspace.
>>ybus
These M-files of commands must be given the file extension of .m. However M-files are not
limited to being a series of commands that you dont want to type at the MATLAB window, they can
also be used to create user defined function. It turns out that a MATLAB tool box is usually nothing
more than a grouping of M-files that someone created to perform a special type of analysis like control
system design and power system analysis. Any of the matlab commands (eg: sqrt) is really an M-file.
One of the more generally useful matlab tool boxes is simulink a drag and-drop dynamic
system simulation environment. This will be used extensively in laboratory, forming the heart of the
computer aided control system design (CACSD) methodology that is used.
>>simulink
At the matlab prompt type simulink and brings up the Simulink Library Browser. Each of the
items in the Simulink Library Browser are the top level of a hierarchy of palette of elements that you
can add to a simulink model of your own creation. At this time expand the simulink pallete as it
contains the majority of the elements you will use in this course. Simulink has built into it a variety of
integration algorithm for integrating the dynamic equations. You can place the dynamic equations of
your system into simulink in four ways.
1 Using integrators
2. Using transfer functions.
3. Using state space equations.
4. Using S- functions (the most versatile approach)
Once you have the dynamics in place you can apply inputs from the sources palettes and look
at the results in the sinks palette.
Finally the most important MATLAB features are its help. At the MATLAB Prompt simply
typing helpdesk gives you access to searchable help as well as all the MATLAB manuals.
>>helpdesk
To get the details about the command name sqrt, just type
>>help sqrt
Where sqrt is the command name and you will get pretty good description in the MATLAB
window as follows.
/SQRT Square root.
SQRT(X) is the square root of the elements of X. Complex
results are produced if X is not positive.
Overloaded methods
help sym/sqrt.m
3
1.3 MATLAB WORKSPACE
The workspace is the window where you execute MATLAB commands (Ref. figure-1). The best
way to probe the workspace is to type whos. This command shows you all the variables that are
currently in workspace. You should always change working directory to an appropriate location under
your user name.
It eliminates all the variables in your workspace. For example start MATLAB and execute the
following sequence of commands
>>a=2;
>>b=5;
>>whos
>>clear all
The first two commands loaded the two variables a and b to the workspace and assigned value
of 2 and 5 respectively. The clear all command clear the variables available in the work space. The
arrow keys are real handy in MATLAB. When typing in long expression at the command line, the up
arrow scrolls through previous commands and down arrow advances the other direction. Instead of
retyping a previously entered command just hit the up arrow until you find it. If you need to change it
slightly the other arrows let you position the cursor anywhere.
Finally any DOS command can be entered in MATLAB as long as it is preceded by any
exclamination mark.
>>!dir
1.4 MATLAB Data Types
The most distinguishing aspect of MATLAB is that it allows the user to manipulate vectors (like
5+j8) and matrices with the same ease as manipulating scalars (like5,8). Before diving into the actual
commands everybody must spend a few moments reviewing the main MATLAB data types. The three
most common data types you may see are,
>>a=4.2:
>>A=[1 4;6 3];
>>whos
Two things should be evident. First MATLAB distinguishes the case of a variable name and
that both a and A are considered arrays. Now lets look at the content of A and a.
>>a
>>A
4
Again two things are important from this example. First anybody can examine the contents
of any variables simply by typing its name at the MATLAB prompt. Second, when typing in a matrix
space between elements separate columns, whereas semicolon separate rows. For practice create the
matrix in your workspace by typing it in all the MATLAB prompt.
>>mytime =0:0.001:5;
Automatic construction of arrays of all ones can also be created as follows,
>>myone=ones (3,2)
Note:
Any MATLAB command can be terminated by a semicolon, which suppressed any echo
information to the screen.
Since MATLAB treats everything as an array, you can add matrices as easily as scalars.
Example:
>>clear all
>> a=4;
>> A=7;
>>alpha=a+A;
>>b= [1 2; 3 4];
>>B= [6 5; 3 1];
>>beta=b+B
Of course cannot violate the rules of matrix algebra which can be understood from the following
example.
>>clear all
>>b=[1 2;3 4];
>>B=[6 7];
>>beta=b*B
In contrast to matrix algebra rules, the need may arise to divide, multiply, raise to a
power one vector by another, element by element. The typical scalar commands are used for this +,-,/,
*, ^ except you put a . in front of the scalar command. That is, if you need to multiply the elements
of [1 2 3 4] by [6 7 8 9], just type...
>>[1 2 3 4].*[6 7 8 9]
5
1.6 Conditional Statements
Like most Programming languages, MATLAB supports a variety of conditional statements and
looping statements. To explore these simply type
>>help if
>>help for
>>help while
Example :
>>if z=0
>>y=0
>>else
>>y=1/z
>>end
Looping :
>>for n=1:2:10
>>s=s+n^2
>>end
- Yields the sum of 1^2+3^2+5^2+7^2+9^2
1.7 PLOTTING
MATLABs potential in visualizing data is pretty amazing. One of the nice features is that with
the simplest of commands you can have quite a bit of capability.
>>clear all
>>t=0:10:360;
>>y=sin (pi/180 * t);
The commands above provide the most plotting capability and represent several
shortcuts to the low-level approach to generating MATLAB plots, specifically the use of handle
graphics. The helpdesk provides access to a pdf manual on handle graphics for those really interested in
it.
6
1.8 Functions
z=[5 2 4;
1 4 5] as input, the output would be,
With this introduction anybody can start programming in MATLAB and can be updated
themselves by using various commands and functions available. Concerned with the Power System
Simulation Laboratory, initially solve the Power System Problems manually, list the expressions used
in the problem and then build your own MATLAB program or function.
7
Result:
8
COMPUTATION OF TRANSMISSION LINES PARAMETERS
Expt.No:2
Date :
AIM
To determine the positive sequence line parameters L and C per phase per kilometer of a three
phase single and double circuit transmission lines for different conductor arrangements .
THEORY
Transmission line has four parameters namely resistance, inductance, capacitance and
conductance. The inductance and capacitance are due to the effect of magnetic and electric fields
around the conductor. The resistance of the conductor is best determined from the manufactures data,
the inductances and capacitances can be evaluated using the formula.
FORMULAS:
Inductance:
The general formula:
L = 0.2 ln (Dm / Ds) mH / KM
Where,
Dm = geometric mean distance (GMD)
Ds = geometric mean radius (GMR)
Single phase 2 wire system
GMD = D
GMR = re-1/4 = r' = 0.7788 r
Where, r = radius of conductor
Three phase symmetrical spacing
GMD = D GMR = re-1/4 = r'
Where, r = radius of conductor &
GMR = re-1/4 = r' = 0.7788 r
Capacitance:
A general formula for evaluating capacitance per phase in micro farad per km of a transmission
line is given by
C = 0.0556/ ln (Deq / r) F/km
Where,
GMD is the Geometric mean distance which is same as that defined for inductance under various
cases.
ALGORITHM:
Step 1: Start the Program.
Step 2: Get the input values for distance between the conductors and bundle spacing of
D12, D23 and D13.
Step 3: From the formula given calculate GMD.
GMD= (D12, D23, D13)1/3
Step 4: Calculate the Value of Impedance and Capacitance of the line.
Step 5: End the Program.
9
PROCEDURE:
PROGRAM:
EXERCISE: 2
10
PROGRAM:
%3 phase double circuit
%3 phase single circuit
D12=input('enter the distance between D12in cm: ');
D23=input('enter the distance between D23in cm: ');
D31=input('enter the distance between D31in cm: ');
d=input('enter the value of d: ');
r=d/2;
Ds=0.7788*r;
x=D12*D23*D31;
Deq=nthroot(x,3);
Y=log(Deq/Ds);
inductance=0.2*Y
capacitance=0.0556/(log(Deq/r))
fprintf('\n The inductance per phase per km is %f mH/ph/km \n',inductance);
fprintf('\n The capacitance per phase per km is %f mf/ph/km \n',capacitance);
RESULT:
Thus the positive sequence line parameters L and c per phase per kilometer of a three phase
single and double circuit transmission lines for different conductor arrangement were determined and
verified with MATLAB software.
11
MODELLING OF TRANSMISSION LINES PARAMETER
Expt.No:3
Date :
AIM:
To understand the modeling and performance of medium lines
THEORY:
Transmission line has four parameters namely resistance, inductance, capacitance and
conductance. The inductance and capacitance are due to the effect of magnetic and electric fields
around the conductor. The resistance of the conductor is best determined from the manufactures data,
the inductances and capacitances can be evaluated using the formula.
FORMULAS:
Inductance:
The general formula:
L = 0.2 ln (Dm / Ds) mH / KM
Where,
Dm = geometric mean distance (GMD)
Ds = geometric mean radius (GMR)
Single phase 2 wire system
GMD = D
GMR = re-1/4 = r' = 0.7788 r
Where, r = radius of conductor
Three phase symmetrical spacing
GMD = D GMR = re-1/4 = r'
Where, r = radius of conductor & GMR = re-1/4 = r' = 0.7788 r
Capacitance:
A general formula for evaluating capacitance per phase in micro farad per km of a transmission
line is given by
C = 0.0556/ ln (Deq / r) F/km
Where,
GMD is the Geometric mean distance which is same as that defined for inductance under various
cases.
ALGORITHM:
12
PROCEDURE:
PROGRAM:
RESULT:
Thus the modeling of transmission line was done and the sending end parameter, regulation&
efficiency were determined and verified using MATLAB software.
13
FORMATION OF BUS ADMITTANCE AND IMPEDANCE MATRICES
Expt.No:4
Date :
AIM:
To determine the bus admittance and impedance matrices for the given power system network.
THEORY:
Y-bus may be formed by inspection method only if there is no mutual coupling between the
lines. Every transmission line should be represented by - equivalent. Shunt impedances are added to
diagonal element corresponding to the buses at which these are connected. The off diagonal elements
are unaffected. The equivalent circuit of Tap changing transformers is included while forming Y-bus
matrix.
The bus impedance matrix can be determined by two methods. In one method we can form the
bus admittance matrix and than taking its inverse to get the bus impedance matrix. In another method
the bus impedance matrix can be directly formed from the reactance diagram and this method requires
the knowledge of the modifications of existing bus impedance matrix due to addition of new bus or
addition of a new line (or impedance) between existing buses.
ALGORITHM:
14
Step 5: Format the Impedance Z bus Matrix.
Step 6: End the Program.
FLOW CHART:
PROCEDURE:
1. Enter the command window of the MATLAB.
2. Create a new M file by selecting File - New M File
3. Type and save the program in the editor window.
4. Execute the program by pressing Tools Run.
5. View the results.
EXERCISE:
(i) Determine the Y bus matrix for the power system network shown in fig.
(ii) Check the results obtained in using MATLAB.
15
2. (i) Determine Z bus matrix for the power system network shown in fig.
(ii) Check the results obtained using MATLAB.
Line data
From To R X B/2
Bus Bus
1 2 0.10 0.20 0.02
1 4 0.05 0.20 0.02
1 5 0.08 0.30 0.03
2 3 0.05 0.25 0.03
2 4 0.05 0.10 0.01
2 5 0.10 0.30 0.02
2 6 0.07 0.20 0.025
3 5 0.12 0.26 0.025
3 6 0.02 0.10 0.01
4 5 0.20 0.40 0.04
5 6 0.10 0.30 0.03
16
FORMATION OF BUS ADMITTANCE AND IMPEDANCE MATRIX
17
OUTPUT
RESULT:
Thus the bus Impedance and admittance matrix for the given system were determined and
verified using MATLAB.
18
LOAD FREQUENCY DYNAMICS OF SINGLE AREA POWER SYSTEMS
Expt.No:5
Date :
AIM:
To become familiar with modeling and analysis of the frequency and tie-line flow dynamics of
a power system without and with load frequency controllers (LFC) and to design better controllers for
getting better responses.
THEORY:
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).
PROCEDURE:
1. Enter the command window of the MATLAB.
2. Create a new Model by selecting File - New Model.
3. Pick up the blocks from the simulink library browser and form a block diagram.
4. After forming the block diagram, save the block diagram.
5. Double click the scope and view the result.
EXERCISE
EXERCISE: 1
1. An isolated power system has the following parameter Turbine rated output 300 MW, Nominal
frequency 50 Hz, Governer speed regulation 2.5 HZ per unit MW, Damping co efficient 0.016 PU
MW / Hz, Inertia constant 5 sec, Turbine time constant 0.5 sec, Governer time constant 0.2 sec, Load
change 60 MW, The load varies by 0.8 percent for a 1 percent change in frequency, Determine the
steady state frequency deviation in Hz
(i) Find the steady state frequency deviation in Hz.
20
(ii) Use MATLAB to obtain the time domain performance specifications and the frequency deviation step
response.
EXERCISE: 2
2. An isolated power system has the following parameter Turbine rated output 300 MW, Nominal
frequency 50 Hz, Governer speed regulation 2.5 HZ per unit MW, Damping co efficient 0.016 PU MW
/ Hz, Inertia constant 5 sec, Turbine time constant 0.5 sec, Governer time constant 0.2 sec, Load
change 60 MW, The system is equipped with secondary integral control loop and the integral controller
gain is Kf = 1. Obtain the frequency deviation for a step response
RESULT:
Modeling and analysis of the frequency and tie-line flow dynamics of a single area power
system without and with load frequency controllers (LFC) was studied and responses are simulated
using simulation software.
21
LOAD FREQUENCY DYNAMICS OF TWO AREA POWER SYSTEMS
Expt.No:6
Date :
AIM:
To become familiar with modelling and analysis of the frequency and tie-line flow dynamics of
a two area power system without and with load frequency controllers (LFC) and to design better
controllers for getting better responses.
THEORY:
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).
PROCEDURE:
1. Enter the command window of the MATLAB.
2. Create a new Model by selecting File - New Model.
3. Pick up the blocks from the simulink library browser and form a block diagram.
4. After forming the block diagram, save the block diagram.
5. Double click the scope and view the result.
22
EXERCISE:
1. A Two- area system connected by a tie line has the following parameters on a 1000 MVA common
base.
Area 1 2
Speed Regulation R1=0.05 R2=0.0625
Frequency sens .load coeff. D1=0.6 D2=0.9
Inertia Constant H1=5 H2=4
Base Power 1000MVA 1000MVA
Governor Time Constant g1 = 0.2sec g1 = 0.3sec
Turbine Time Constant T1 =0.5sec T1 =0.6sec
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).
23
RESULT:
Modeling and analysis of the frequency and tie-line flow dynamics of a two area power system
without and with load frequency controllers (LFC) was studied and responses are simulated using
simulation software.
24
Expt.No:7
Date :
AIM
To become familiar with various aspects of the transient and small signal stability analysis of
Single-Machine-Infinite Bus (SMIB) system
THEORY
Stability:
Stability problem is concerned with the behavior of power system when it is subjected to
disturbance and is classified into small signal stability problem if the disturbances are small and
transient stability problem when the disturbances are large.
Transient stability:
When a power system is under steady state, the load plus transmission loss equals to the
generation in the system. The generating units run at synchronous speed and system frequency,
voltage, current and power flows are steady. When a large disturbance such as three phase fault, loss of
load, loss of generation etc., occurs the power balance is upset and the generating units rotors
experience either acceleration or deceleration. The system may come back to a steady state condition
maintaining synchronism or it may break into subsystems or one or more machines may pull out of
synchronism. In the former case the system is said to be stable and in the later case it is said to be
unstable.
S*
Stator Current It =
Et*
Pe - jQe
=
Et*
Voltage behind transient condition
E1 = Et + j Xd1It
Voltage of infinite bus
EB = Et - j( X3 + Xtr )It
X1 X2
where, X3 =
X1 + X2
25
Angular separation between E1 and EB
o = E1 - EB
Prefault Operation:
X1 X2
X = j Xd1+ jXtr +
X1 + X2
E1 x EB
Power Pe = sino
X
Pe * X
o = sin-1
E1 * EB
During Fault Condition:
Pe = PEii = 0
E1 x EB
Power Pe = sino
X
max = - o
Pm
Pe =
sinmax
2H (cr - o)
tcr =
fo Pm Secs
PROCEDURE
1. Enter the command window of the MATLAB.
2. Create a new M file by selecting File - New M File
26
3. Type and save the program.
4. Execute the program by pressing Tools Run
5. View the results.
EXERCISE
1. A 60Hz synchronous generator having inertia constant H = 5 MJ/MVA and a direct axis transient
reactance Xd1 = 0.3 per unit is connected to an infinite bus through a purely reactive circuit as shown in
figure. Reactances are marked on the diagram on a common system base. The generator is delivering
real power P e = 0.8 per unit and Q = 0.074 per unit to the infinite bus at a voltage of V = 1 per
unit.
a)A temporary three-phase fault occurs at the sending end of the line at point F.When the fault is
cleared, both lines are intact. Determine the critical clearing angle and the critical fault clearing time.
.
b)Verify the result using MATLAB program.
27
RESULT
Transient and small signal stability analysis of Single-Machine-Infinite Bus (SMIB) system
was studied and simulated using simulation software.
THEORY
28
In a power system, with negligible transmission loss and with N number of spinning thermal
generating units the total system load PD at a particular interval can be met by different sets of
generation schedules
Out of these NS set of generation schedules, the system operator has to choose the set of schedules,
which minimize the system operating cost, which is essentially the sum of the production cost of all the
generating units. This economic dispatch problem is mathematically stated as an optimization problem.
Given : The number of available generating units N, their production cost functions, their operating
limits and the system load PD,
The ED problem given by the equations (1) to (4). By omitting the inequality constraints (4)
tentatively, the reduce ED problem (1),(2) and (3) may be restated as an unconstrained optimization
problem by augmenting the objective function (1) with the constraint multiplied by LaGrange
multiplier, to obtained the LaGrange function, L as
N N
Min : L (PG1 ..PGN , ) = Fi(PGi) - [ PGi PD] (6)
i=1 i=1
The necessary conditions for the existence of solution to (6) are given by
The solution to ED problem can be obtained by solving simultaneously the necessary conditions (7)
and (8) which state that the economic generation schedules not only satisfy the system power balance
equation (8) but also demand that the incremental cost rates of all the units be equal be equal to
which can be interpreted as incremental cost of received power.
When the inequality constraints (4) are included in the ED problem the necessary condition (7) gets
modified as
dFi (PGi) / dPGi = for PGi,min PGi PGi, ,max
for PGi = PGi, ,max
for PGi = PGi, ,mi ____(9)
Economic Schedule
PGi = ( -bi)/ 2ai ; i=1,2.N (10)
N N
= PD + ( bi/2ai ) / (1/2ai) (11)
i=1 i=1
ALGORITHM:
PROCEDURE:
1. Enter the command window of the MATLAB.
2. Create a new M file by selecting File - New M File
3. Type and save the program.
4. Execute the program by either pressing Tools Run.
5. View the results.
EXERCISE:
30
1. The fuel cost functions for three thermal plants in $/h are given by
C1 = 500 + 5.3 P1 + 0.004 P12; P1 in MW
C2 = 400 + 5.5 P2 + 0.006 P22; P2 in MW
C3 = 200 +5.8 P3 + 0.009 P32; P3 in MW
The total load , PD is 800MW.Neglecting line losses and generator limits, find the optimal dispatch and
the total cost in $/h by analytical method. Verify the result using MATLAB program.
PROGRAM:
clc;
clear all;
warning off;
a=[.004; .006; .009];
b=[5.3; 5.5; 5.8];
c=[500; 400; 200];
Pd=800;
delp=10;
lambda=input('Enter estimated value of lambda=');
fprintf('\n')
disp(['lambda P1 P1 P3 delta p delta lambda'])
iter=0;
while abs(delp)>=0.001
iter=iter+1;
p=(lambda-b)./(2*a);
delp=Pd-sum(p);
J=sum(ones(length(a),1)./(2*a));
dellambda=delp/J;
disp([lambda,p(1),p(2),p(3),delp,dellambda])
lambda=lambda+dellambda;
end
lambda
p
totalcost=sum(c+b.*p+a.*p.^2)
OUTPUT
lambda =
8.5000
31
p=
400.0000
250.0000
150.0000
totalcost = 6.6825e+003
EXERCISE:
2. The fuel cost functions for three thermal plants in $/h are given by
C1 = 500 + 5.3 P1 + 0.004 P12; P1 in MW
C2 = 400 + 5.5 P2 + 0.006 P22 ; P2 in MW
C3 = 200 + 5.8 P3 + 0.009 P32; P3 in MW
The total load , PD is 975MW. Generation limits
200 P1 450 MW
150 P2 350 MW
100 P3 225 MW
Find the optimal dispatch and the total cost in $/h by analytical method. Verify the result using
MATLAB program.
PROGRAM
clear
clc
n=3;
demand=925;
a=[.0056 .0045 .0079];
b=[4.5 5.2 5.8];
c=[640 580 820];
Pmin=[200 250 125];
Pmax=[350 450 225];
x=0; y=0;
for i=1:n
x=x+(b(i)/(2*a(i)));
y=y+(1/(2*a(i)));
lambda=(demand+x)/y
Pgtotal=0;
for i=1:n
Pg(i)=(lambda-b(i))/(2*a(i));
Pgtotal=sum(Pg);
end
Pg
for i=1:n
if(Pmin(i)<=Pg(i)&&Pg(i)<=Pmax(i));
Pg(i);
else
32
if(Pg(i)<=Pmin(i))
Pg(i)=Pmin(i);
else
Pg(i)=Pmax(i);
end
end
Pgtotal=sum(Pg);
end
Pg
if Pgtotal~=demand
demandnew=demand-Pg(1)
x1=0;
y1=0;
for i=2:n
x1=x1+(b(i)/(2*a(i)));
y1=y1+(1/(2*a(i)));
end
lambdanew=(demandnew+x1)/y1
for i=2:n
Pg(i)=(lambdanew-b(i))/(2*a(i));
end
end
end
Pg
OUTPUT
lambda =
8.6149
Pg =
Pg =
demandnew =
575
33
lambdanew =
8.7147
Pg =
RESULT:
Economic load dispatch for the given problem was solved using classical method with and
without line losses and verified using MATLAB software.
AIM
To become familiar with various aspects of the transient stability analysis of Multi -Machine-
Infinite Bus (SMIB) system
THEORY
Stability :
Stability problem is concerned with the behavior of power system when it is subjected to
disturbance and is classified into small signal stability problem if the disturbances are small and
transient stability problem when the disturbances are large.
Transient stability:
When a power system is under steady state, the load plus transmission loss equals to the
generation in the system. The generating units run at synchronous speed and system frequency,
34
voltage, current and power flows are steady. When a large disturbance such as three phase fault, loss of
load, loss of generation etc., occurs the power balance is upset and the generating units rotors
experience either acceleration or deceleration. The system may come back to a steady state condition
maintaining synchronism or it may break into subsystems or one or more machines may pull out of
synchronism. In the former case the system is said to be stable and in the later case it is said to be
unstable.
FORMULA
Reactive power Qe = sin(cos-1(p.f))
S*
Stator Current It =
Et*
Pe - jQe
=
Et*
Voltage behind transient condition
E1 = Et + j Xd1It
Voltage of infinite bus
EB = Et - j( X3 + Xtr )It
X1 X2
where, X3 =
X1 + X2
Prefault Operation:
X1 X2
X = j Xd1+ jXtr +
X1 + X2
E1 x EB
Power Pe = sino
X
Pe * X
o = sin -1
E1 * EB
35
Pe = PEii = 0
E1 x EB
Power Pe = sino
X
max = - o
Pm
Pe =
sinmax
2H (cr - o)
tcr =
fo Pm Secs
PROCEDURE
1. Enter the command window of the MATLAB.
2. Create a new M file by selecting File - New M File
3. Type and save the program.
4. Execute the program by pressing Tools Run
5. View the results.
EXERCISE:
1. Transient stability analysis of a 9-bus, 3-machine, 60 Hz power system with the following system
modelling requirements:
I. Classical model for all synchronous machines, models for excitation and speed governing systems
not included.
36
(a) Simulate a three-phase fault at the end of the line from bus 5 to bus 7 near bus 7 at time = 0.0 sec.
Assume that the fault is cleared successfully by opening the line 5-7 after 5 cycles ( 0.083 sec) .
Observe the system for 2.0 seconds
(c) Determine the critical clearing time by progressively increasing the fault clearing time.
PROGRAM :
For (a)
Pm = 0.8; E = 1.17; V = 1.0;
X1 = 0.65; X2 = inf; X3 = 0.65;
eacfault (Pm, E, V, X1, X2, X3)
For( b)
Pm = 0.8; E = 1.17; V = 1.0;
X1 = 0.65; X2 = 1.8; X3 = 0.8;
eacfault (Pm, E, V, X1, X2, X3)
37
RESULT
Transient stability analysis of Multi-Machine-Infinite Bus (SMIB) system was studied and
simulated using simulation software.
Expt.No:10
Date :
AIM:
To understand, in particular, the mathematical formulation of power flow model in complex
form and a simple method of solving power flow problems of small sized system using Gauss-Seidel
iterative algorithm.
THEORY:
The GAUSS SEIDEL method is an iterative algorithm for solving a set of non-linear load
flow equations.
The non-linear load flow equation is given by
38
1 Pp j Qp p-1 n
Vpk+1
= - Ypq Vq - Vq
k+1 k
ALGORITHM:
Step 1: Start the Program.
Step 2: Get the input Value.
Step 3: Calculate the Y bus impedance Matrix.
Step 4: Calculate P and Q by using formula,
P= Gen Mw- Load Mw;
Q= Gen MVA Load MVA;
Step 5: Check the condition for the loop
For i=2: bus and assume sum Yv =0.
Step 6: Check the Condition of for loop
if for K=i:n bus and check if i=k and calculate
sum Yv= sum Yv + Ybus (i,k)*V(k)
Step 7:
Check the condition for type if type(i)==2, Calculate Q(i)
Q(i)=-imag (conj(V(i))*(sum Yv+ Ybus (i,i)*V(i));
Step 8: Check the condition for Q(i) by using if loop
If Q(i)< Qmin(i)
Q(i)<=Qmin(i)
Else
Q(i)= Qmax(i)
Step 9: Check the Condition for type
V(i)=1/Ybus(i,i)*(P(i)-jQ(i)/Conj(V(i))-sum Yv);
Step 10: Iteration incremented
Step 11: Find the angle Value angle=180/Pi*angle(v)
Step 12: End the Program.
PROCEDURE:
1. Enter the command window of the MATLAB.
2. Create a new M file by selecting File - New M File.
3. Type and save the program in the editor Window.
4. Execute the program by pressing Tools Run.
5. View the results.
EXERCISE:
The figure shows the single line diagram of a simple 3 bus power system with generator at bus-
1. The magnitude at bus 1 is adjusted to 1.05pu. The scheduled loads at buses 2 and 3 are marked on
39
the diagram. Line impedances are marked in p.u. The base value is 100kVA. The line charging
susceptances are neglected. Determine the phasor values of the voltage at the load bus 2 and 3.
1) Find the slack bus real and reactive power.
2) Verify the result using MATLAB.
PROGRAM:
%GAUSS SEDIAL
clc
clear all
sb=[1 1 2 4 3]; %input('Enter the starting bus = ')
eb=[2 3 4 3 2]; % input('Enter the ending bus = ')
nl=5; %input(' Enter the number of lines= ')
nb=4; %input(' Enter the number of buses= ')
sa=[1-5j 1.2-4j 1.1-2j 1.2-3j .5-4j]; %input('Enter the value of series impedance =')
Ybus=zeros(nb,nb);
for i=1:nl
k1=sb(i);
k2=eb(i) ;
y(i)=sa(i);
Ybus(k1,k1)=Ybus(k1,k1)+y(i);%+h(i);
Ybus(k2,k2)=Ybus(k2,k2)+y(i);%+h(i);
Ybus(k1,k2)=-y(i);
Ybus(k2,k1)=Ybus(k1,k2);
end
40
Ybus
PG=[0 .5 .4 .2];
QG=[0 0 .3j .1j];
V=[1.06 1.04 1 1];
Qmin=.05;
Qmax=.12;
for i=1:nb
Pg=PG(i);
Qg=QG(i);
if(Pg==0&&Qg==0)%for slackbus
p=1;
Vt(p)=V(p) ;
end
if(Pg~=0&&Qg==0)%for Generator bus
for q=1:p-1
A=Ybus(p,q)*V(q);
end
B=0;
for q=p:nb
B=B+Ybus(p,q)*V(q);
end
c=V(p)*(A+B);
Q=-imag(c)
41
end
B2=0;
for q=p+1:nb
B2=B2-(((Ybus(p,q))*V(q)));
end
C2=(-PG(p)+(QG(p))/V(p));
Vt(p)=((C2+A2+B2)/Ybus(p,p))
end
p=p+1;
end
42
START
INPUT
No. of buses, n =?
Line parameters, = ?
FORMULATE
Ybus using relevant rules
INPUT
3) Slack bus Voltage V(1) = ?
INPUT
9) Tolerance Limit, e =?
43
G
INITIAL GUESS
V(i,1) = 1+j0.0 P.U for i = 2,3,..n
SET
Iteration Count, k = 1; delVmax = 1
DO WHILE
delVmax <= e
FOR
i = 2 to n (Bus count)
IS YE
PV Bus S
COMPUTE
NO V(I,k+1) = ?
Increment Ref. : Equn.=> C
k = k+1
P
ACCELERATE
V(i,k+1) =>
V V(I,k+1) + a(V(i,k+1)-V(I,k))
COMPUTE
delV(i) = V(i,k+1)-V(i,k)
NO Is
BusFinished?
YE
S
M N
44
M
N
FIND
delVmax = max(delV)
NO
IS
delVmax <=e
YES
COMPUTE
Slack bus Power, P(1) = ?
COMPUTE
REAL POWER LOSS = ?
REACTIVE POWER LOSS = ?
Ref. Equn. => 6&7
STOP
45
OUTPUT FOR GAUSS SEIDAL LOAD FLOW METHOD
Ybus =
Q=
Qg =
0 + 0.1200i
Vt =
RESULT
Load flow solution for the given problem was solved using Gauss-Seidal method and verified
using MATLAB software.
46
SOLUTION OF POWER FLOW USING NEWTON-RAPHSON METHOD
Expt.No:11
Date :
AIM:
To determine the power flow analysis using Newton Raphson method
THEORY:
The Newton Raphson method of load flow analysis is an iterative method which approximates
the set of non-linear simultaneous equations to a set of linear simultaneous equations using Taylors
series expansion and the terms are limited to first order approximation.
The load flow equations for Newton Raphson method are non-linear equations in terms of real
and imaginary part of bus voltages.
n
PP = ep(eq Gpq + fq Bpq) + fp (fq Gpq - eq Bpq)
q=1
n
QP = fp (eq Gpq + fq Bpq) - ep (fq Gpq - eq Bpq)
q=1
ALGORITHM:
dQa= Qsp- Q
dQ= Zeros(npq,1)
(ii) Set if type(i)==3
(iii) End the Loop.
47
Step 8: Find Derivative of Real power injections with angles for Jacobian J1.
Step 9: Find Derivative of Reactive power injections with angles for J3.
Step 10: Find Derivative of Reactive power injections with voltage for J4 & Real power injections with
angles for J2.
Step 11: Form Jacobian Matrix J= [J1 J2;J3 J4]
Step 12: Find line current flow & line Losses.
Step 13: Display the output.
Step 14: End the Program.
EXERCISE:
PROGRAM:
48
%NEWTON RAPHSON METHOD
clc
clear all
sb=[1 1 2]; %input('Enter the starting bus = ')
eb=[2 3 3]; % input('Enter the ending bus = ')
nl=3; %input(' Enter the number of lines= ')
nb=3; %input(' Enter the number of buses= ')
sa=[1.25-3.75j 5-15j 1.667-5j]; %input('Enter the value of series impedance =')
Ybus=zeros(nb,nb);
for i=1:nl
k1=sb(i);
k2=eb(i);
y(i)=(sa(i));
Ybus(k1,k1)=Ybus(k1,k1)+y(i);
Ybus(k2,k2)=Ybus(k2,k2)+y(i);
Ybus(k1,k2)=-y(i);
Ybus(k2,k1)=Ybus(k1,k2);
end
Ybus
Ybusmag=abs(Ybus);
Ybusang=angle(Ybus)*(180/pi);
% Calculation of P and Q
v=[1.06 1 1];
P=[0 0 0];
Q=[0 0 0];
del=[0 0 0];
Pg=[0 0.2 0];
Pd=[0 0 0.6];
Qg=[0 0 0];
Qd=[0 0 0.25];
for p=2:nb
for q=1:nb
P(p)=P(p)+(v(p)*v(q)*Ybusmag(p,q)*cos(del(p)+angle(Ybus(p,q))-del(q)));
Q(p)=(Q(p)+(v(p)*v(q)*Ybusmag(p,q)*sin(del(p)-angle(Ybus(p,q))-del(q))));
Pspe(p)=Pg(p)-Pd(p);
Qspe(p)=Qg(p)-Qd(p);
delP(p)=Pspe(p)-P(p);
delQ(p)=Qspe(p)-Q(p);
end
end
P;
Q;
Pspe;
Qspe;
delP;
delQ;
%Calculation of J1
P2=[0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
49
P1=2*v(p)*Ybusmag(p,q)*cos(angle(Ybus(p,q)));
for j=1:nb
if (j~=p)
P2(q)=P2(q)+v(j)*Ybusmag(q,j)*cos(del(q)+angle(Ybus(q,j))-del(j));
PV(p,q)=P1+P2(q);
end
end
else
PV(p,q)=v(p)*Ybusmag(p,q)*cos(del(p)+angle(Ybus(p,q))-del(q));
end
end
end
PV;
% Calculation of J2
Pdel=[0 0 0;0 0 0;0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
for j=1:nb
if(j~=p)
Pdel(p,q)=Pdel(p,q)-v(j)*v(q)*Ybusmag(q,j)*sin(del(q)-angle(Ybus(p,j))-del(j));
end
end
else
Pdel(p,q)=-v(p)*v(q)*Ybusmag(p,q)*sin(del(p)+angle(Ybus(p,q))-del(q));
end
end
end
Pdel;
%Calculation of J3
Q2=[0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
Q1=2*v(p)*Ybusmag(p,q)*sin(-angle(Ybus(p,q)));
for j=1:nb
if (j~=p)
Q2(q)=Q2(q)+v(j)*Ybusmag(q,j)*sin(del(q)-angle(Ybus(q,j))-del(j));
QV(p,q)=Q1+Q2(q);
end
end
else
QV(p,q)=v(p)*Ybusmag(p,q)*sin(del(p)-angle(Ybus(p,q))-del(q));
end
end
end
QV;
%Calculation of J4
Qdel=[0 0 0;0 0 0;0 0 0];
for p=2:nb
for q=2:nb
50
if(p==q)
for j=1:nb
if(j~=p)
Qdel(p,q)=Qdel(p,q)+v(j)*v(q)*Ybusmag(q,j)*cos(del(q)+angle(Ybus(p,j))-del(j));
end
end
else
Qdel(p,q)=-v(p)*v(q)*Ybusmag(p,q)*cos(del(p)+angle(Ybus(p,q))-del(q));
end
end
end
Qdel;
%Jacobian matrix
PV(1,:)=[ ];
PV(:,1)=[ ];
Pdel(1,:)=[ ];
Pdel(:,1)=[ ];
QV(1,:)=[ ];
QV(:,1)=[ ];
Qdel(1,:)=[ ];
Qdel(:,1)=[ ];
J=[PV Pdel;QV Qdel]
%Find the change in v&del
delP(1:1)=[];
delQ(1:1)=[];
delpq=[delP';delQ']
vdel=inv(J)*delpq
%Find new v&del
for i=1:nb-1
for j=2:nb
vnew(i)=v(j)+vdel(i);
delnew(i)=del(j)+vdel(i+2);
end
end
VNEW=[v(1) vnew]
DELNEW=[del(1) delnew]
51
OUTPUT FOR NEWTON RAPHSON LOAD FLOW METHOD
Ybus =
J=
delpq =
0.2750
-0.3000
0.2250
0.6500
vdel =
0.0575
0.0410
0.0088
-0.0201
VNEW =
DELNEW =
0 0.0088 -0.0201
RESULT
Thus the power flow for the given problem was solved using Newton Raphson method and
verified using MATLAB software.
52
SYMMETRICAL SHORT CIRCUIT ANALYSIS
Expt.No:12
Date :
AIM:
To develop a program to carry out simulation study of symmetrical three phase short circuit
on the given power system.
PROBLEM:
For the given network determine the fault current when fault occurs at bus no.1 also
determine the voltage at all the buses and all line currents.
ALGORITHM :
1.Read the line data, machine data and transformer data.
2.Compute the ybus matrix.
3. Form the zbus matrix by inverting the ybus matrix.
4. Compute the fault current at the faulted bus.
5.Compute the bus voltage at all the buses.
6. Compute all line currents.
7. Print the result.
PROGRAM:
disp('symmetrical fault analysis')
nb=input('enter the no. of buses')
nl=input('enter the no.of lines')
sb=input('enter the starting bus number')
eb=input('enter the ending bus number')
linez=input('enter the line impedance')
for i=1:nb
y(i,i)=0;
z(i,i)=0;
end
%formation of ybus matrix
for i=1:nl
r1=sb(i);
r2=eb(i);
y(r1,r1)=y(r1,r1)+(1/linez(i));
y(r2,r2)=y(r2,r2)+(1/linez(i));
y(r1,r2)=-(1/linez(i));
y(r2,r1)=y(r1,r2);
53
end
OUTPUT:
symmetrical fault analysis
54
enter the no. of buses3
nb =
3
enter the no.of lines4
nl =
4
enter the starting bus number[1 1 2 1]
sb =
1 1 2 1
enter the ending bus number[2 2 3 3]
eb =
2 2 3 3
enter the line impedance[0.05i 0.05i 0.06i 0.1i]
linez =
0 + 0.0500i 0 + 0.0500i 0 + 0.0600i 0 + 0.1000i
enter generator 1 impedance value0.25i
G=
0 + 0.2500i 0 + 0.2000i
enter generator 2 impedance value0.2i
G=
0 + 0.2500i 0 + 0.2000i
enter Transformer 1 impedance value0.1i
T=
0 + 0.1000i 0 + 0.0200i
enter Transformer 2 impedance value0.08i
T=
0 + 0.1000i 0 + 0.0800i
y=
0 -52.8571i 0 +20.0000i 0 +10.0000i
0 +20.0000i 0 -56.6667i 0 +16.6667i
0 +10.0000i 0 +16.6667i 0 -26.6667i
y=
0 -52.8571i 0 +20.0000i 0 +10.0000i
0 +20.0000i 0 -56.6667i 0 +16.6667i
0 +10.0000i 0 +16.6667i 0 -30.2381i
y=
0 -52.8571i 0 +20.0000i 0 +10.0000i
0 +20.0000i 0 -56.6667i 0 +16.6667i
0 +10.0000i 0 +16.6667i 0 -30.2381i
formation of zbus matrix
z=
0 + 0.0279i 0 + 0.0150i 0 + 0.0175i
0 + 0.0150i 0 + 0.0291i 0 + 0.0210i
0 + 0.0175i 0 + 0.0210i 0 + 0.0504i
If =
0 -35.8422i
v=
0 0.4627 0.3731
i=
0 + 9.2537i 0 + 9.2537i 0 - 1.4925i 0 + 3.7313i
55
RESULT:
A program was developed to analysis symmetrical three phase short circuit on a
given power system and the output was verified.
56
ELECTROMAGNETIC TRANSIENTS IN POWER SYSTEMS
Ex. No.:13
Date:
AIM:
To plot the electromagnetic transients in the power system using MATLAB
SOFTWARE REQUIRED:
MATLAB 6.1
FORMULA USED:
Case (i):
REACTIVE TERMINATION: LINE TERMINATED BY INDUCTOR:
ef(s) = E
Case (iv): OPEN CIRCUITED LINE:
et = 2ef
er = e
r=-if
PROGRAM:
%line terminated by inductor for voltage
Ef=10000;
L=0.004; Zc=400;
57
n1=[2*Ef 0]; d1=[1 Zc/L];
t=0:0.00001:0.0001;
Et=step(n1,d1,t);
plot(t,Et,'r');
Er=Et-Ef;
hold on;
plot(t,Er,'b');
58
If=Ef/Zc;
Ir=It-If;
plot(t,Ir,'b');
RESULT:
Thus the electromagnetic transients in power system have been studied using matlab.
59