Psa Lab Till Exp5
Psa Lab Till Exp5
-3
~
~
~ Department of Electrical Engineering
~
~ ScMJ.-t1nllefo-
ea.e-
HiVMdatv
~
-$
~
~
..
,_, .,.
a....
rJtlV Of' IMV
s___,,.c:a.e-
~
rJOVMdHtN
~
Advanced Power System Analysis I
~
~ Laboratory Manual
~
~
~
~
E~+EC' .
.......
~
~
=-'1-------------------
=--
~ -- - -- - - - -
----·
,
~
~
List of Experiments
~
s. Title of Experiment Addressed
No cos
41 1 To compute the bus admittance matrix (Ybus) for a given COl
V
power system network.
-4 2 To compute the power-flow solution of a given power CO2
,/
--
~
8
.
Determine the critical clearing time for a given single
machine infinite bus system.
After completion of this course the students will be able to
cos
•
~
CO3. Carry out economic load dispatch and op~imal power flow .
CO4. Implement symmetrical fault analysis in Power Systems.
COS. Carry out transients and small signal stability analysis in Power Systems.
..
!!t
~
::.9
~
i
$
~
~
~
EXPERIMENT 1
~
Aim: To compute the bus admittance matrix Ybus for the small power system
~ network given below using MATLAB mfile/Python/C++
~
~
~
~
~
~
k.
4
~
The branch data / line data for the above network is given below:
~
From To R X B
~ bus no. bus no. (p.u) (p.u) (p.u)
~ 1 2 0.02 0.1 0.03
1 3 0.02 0.1 0.03
~ 1
2
4
4
0.02 0.1 0.03
0.02 0.1 0.03
3 4 0.02 0.1 0.03
~
Theory: In an AC power system network, the relationship between the
injected node currents and the node voltages is given by
~
l~
T~
.. ~
~
where
I = vector of injected node currents
Ybus = bus admittance matrix
V= vector of node voltages
Each component element of the interconnected network is referred to as abranch.
The branch or the component is connected between two nodes of the network, or be-
tween anode and the referenee node. For the puryose of modeling, we will repre-
sent a branch by either the branch impedance z, or the branch admittance y. The
branch impedance zis also referred to as the primitive impedance, and the branch ad-
mittance y is referred to as the primitive admittance. In terms of the primitive ad-
mittances, the steps in developing the bus admittance matrix or Ybus for a ~ven
~ network are as follows:
~
•
-A
allel between the two nodes, the equivalent primitive admittance of the com-
ponents is first obtained before determining the entry in the Ybus.
~
!!I
.J
~
,
"'
~
Consider the five-bus system shown in Figure E9.4. The parameters for the line data
~ and the transformer data are provided in Table E9.4. The table provides information
regarding the network topology by providing the bus numbers to which the branches
~
are connected. In addition, the table provides the series impedance and the line charg-
~ ing susceptance for each line in p.u. on an appropriately chosen base. Determine the
-bus admittance matrix Ybus for the given system.
I~
0
~
~
I ~ 10--t2..,.__---:.-a4
Ti
,-r
T,.
~
Figure E9,4 Single--line
4 3 diagram for Example 9.4.
._§
_,
TABLE E9.4 . TRANSFORMER AND -z· I
-9 TRANSMISSION LINE DATA
..__
/
1
)123 = 0.02 + j0.25 = 0.318 - j3.975
Having calculated the primitive admittances, we can now start assembling the ele-
ments of the Yt,u,• For the purpose of clarity, we will individually form each element
and then display the elements in matrix form. ,,
~ = Yu = 1.400 - jlS.657
Y12 = Yi1 = - Yi2 = -1.400 + j 18.657
~
YiJ = Yi.. = y 15 = ¥J1 = Y.t1 = Ys1 = 0
B/ -~-
•~4
"z22 = Yu + .Y2J + .>'24 + J•,., 223 + JT
~
= 1.400 - j18.657 + 0.318 _: j3.975 + 0.442 - j6.637 + j0ll + j0.055
= 2.16 - j29.104
Y23 = Y32 = -123 = -0.318 +. j3.975
~
~
Yi. = l':.2 = -.Y24 = -0.442 +
Yis = Y;i = 0
j6.637
~ V
.L33 =)In+ Y34
+ .Bn +
lT
,B'J4
lT
*
~
= 0.318 - j3.915 + 0.318 - j3.975 +
Y34 = Y43 = -y34 = -0.318 + j3.975 .
j0.11 + j0.11 = 0.636 - j7.73
l";s = fs3 = 0
~
•
24
Y44 = '24 + .>'34 + Y4s +. j~ + j8;
,
_,
~5
~
I
---_)
~
~
~
._ Having calculated all the elements of the Ybou we are now in aposition to write the
Y1,m in matrix form.
-
r4i (1.40-j18.66) (-1.40 +j18.(,6) 0 0 0
G (-1.40+jl8.66) (2.16-j29.10) (-OJ18+j3.98) (-0.442+j6.64) 0
,_--
Y. • O· (-0.318+j3.98) (0.636-j7.73) (-0318+j3.98) 0
0 (-0.442+j6.64) (-OJ18+j3.98) (1.6gi-; 22.88) (-0.932+j12.43)
0 0 0 (-0.932+j12.43) (0.932-j12.43)
~
~
Procedure:
~ (a) Using the method as explained, compute the Ybus for the given power system
~ network manually.
~ (b) Write codes given below to build the Ybus from the line / branch data. Use
a the following steps:
Stepl: Type in the branch data (i.e. R, X and B as given) in a matrix 'D'.
~
'D' should contain five columns and as many rows as that in the
given branch data / line data of the given network. The five
columns correspond to 'From bus number', 'To bus number', R, X
and B, respectively. Check if data of B corresponds to Btotat or B112.
Step 2: Type the code given below and save it in a MATLAB mfile. Save
t~e code as amit 1 if Amit is your first name (no blank spaces in
between).
Step 3: Debug and run the code to generate Ybus•
Step 4: Check the programme results with the manually calculated Ybus•
Code in MATLAB mfile:
clc
clear all
nb=4; % nb is number of buses in the network
z=inf(nb, nb);
D=[l 2 0.02 0.1 0.03;1 3 0.02 0.1 0.03;1 4 0.02 0.1 0.03;2 4 0.02 0.1 0.03;3 4 0.02
0.1 0.03); % Five columns are for 'From bus', 'To bus', 'R', 'X' and 'B'
r=size (D);
rows=r(l) ;
for i=l:rows
z ( D( i, 1) , D ( i, 2) ) =D ( i, 3) +j * D ( i, 4) ;
z ( D ( i, 2) , D ( i, 1) ) =z ( D( i, 1) , D( i, 2) ) ;
b ( D ( i, 1) , D ( i, 2) ) =D ( i, 5) ;
b ( D ( i, 2) , D( i, 1) ) =b ( D( i, 1) , D( i, 2) ) ;
end
for i=l:nb
yO(i)=j*s um(b(i, :))/2;
end
for i=l:nb
for m=l:nb
if i~=m
Y(i,m)=-1 /z(i,m);
else
Y (i,m) =yO (i) +sum(l. /z (i,:));
end
end
end
~----------------------------~-r
EXPERIMENT 2
r~
~
~ '
t:
•
~
, V3
So3 = 2.8653 + jl .2244
I
In the above network, all the transmission lines are identical. For each line, the
~ shunt element is a capacitor with an adm1ttance of Ysh j 0.01 while each series
r4 element is an inductor with an impedance of Zse j 0 .1.
~ 1. Theory:
,...,.,,
4
A
~
'~
~
JI
~
JI,
rp1
••
r.
~
-• Consider Case I of the power flow problem: given Vi ,S2, S3, • • • , Sn, find S1 ,l'z, V3,
... , "Yn. We use a form of (10.3) repeated here for convenience,
•-s
n
--
n
S; =V;Ir:v: i =2, I • • 'n (10.3b)
--
k:a I
Note: If we know Vi, Yi, ... , Yn we can solve for S1 explicitly using (10.3a). Since
we already do know Yi, it only remains to find Vi, v;, . . . , ~. These n - 1 un-
-.- knowns may be found from the n - l equations of (10.3b). Thus, the heart of the
problem is the solution of n - 1 implicit equations in the unknown vi, ~, . . . ,
Yn, where Vi and S2, S3, . . , , Sn are known. Equivalently, taking complex conju-
~
- k=l
t
- Dividing (10.6) by Yf and separating out the Y;; term, we can rewrite (10.6) as
s~
~*=Vu)',·+
l;Y:
n
11
k
.iJI./"YI
~ ~L l
0
=2 3
, , , • •, n (10.7)
V; k=l
t k1i
.
' or, rearrangmg,
1 s: II
V; =;7 y• - ~fik~ i = 2, 3, ... , n (10.8)
1 U l k=l
k Pi
l 2. Procedure: First compute the bus admittance matrix. Check that
--
I
4
-- Ybus = jl0
/10
- j19.98
jlO
jlO
- j19.98
Type the code given below for the Gauss-Siedel algorithm in a MATLAB mfile.
19 Save the code as amit2 if Amit is your first name (no blank spaces in between).
---- Debug the code and run it to get the final results as:
82] --:3° ]
41 [
83 =[ -10°
._ V3 O.9S·p. u.
-a
.9 Code in MATLAB mfile:
~ clc
clear all
~ %Data%
slb=l;pvb=l;pqb=l;nb=slb+pvb+pqb;
.s Y=[-j*19.98 j*lO j*lO;j*lO -j*19.98 j*lO;j*lO j*lO -j*l9.98];
y=abs,(Y) ;phj.=_angle (Y);
v(l)=l.O;th(l)=O;v(2)=1.05;
~ Psp12)=0.6661;Psp(3)=-2.8653;Qsp(3)=-l.2244;
%initial guess for unknown theta·and v %
th(2)=0;v(3)=1.0;th(3)=0;
~ m=180/pi;
-
%Program for Gauss Siedel algorithm%
err=l. 0; t=O; %• '•t' is the number of iterations of the algorithm
while err>le-4
for i=2:3
~ Px(i)=O;Qx(i)=O;
for k=l:3
a end
Px(i)=Px(i)+v(i)*v(k)*y(i,k)*cos(th(i)-th(k)-phi(i,k));
Qx(i)=Qx(i)+v(i)*v(k)*y(i,k)*sin(th(i)-th(k)-phi(i,k));
a end
for i=l:3
a end
V(i)=v(i)*(cos(th(i))+j*sin(th(i)));
for i=2:3
,,
~ vint(i)=O;
I
-
•
•
• for k=l:3
• if k~=i
vint(i)=v int(i)+Y (i,k)*V( k);
•
else • • • •
end
end
• end
for i=2:nb
•
if i<=(slb+p vb)
V ( i) = ( ( ( Psp ( i) -j *Qx ( i) ) / conj (V ( i) ) -vint ( i) ) /Y ( i, i) ) ;
else •
• end
end
V(i)=((( Psp(i)-j* Qsp(i))/ conj (V(i))-v int(i))/Y (i,i));
for i=2:nb
'
if i<=(slb+p vb)
th(i)=an gle(V(i) );
else
v(i)=abs (V(i));
th(i)=an gle(V(i) );
end
end
delp=Psp -Px;
delq=Qsp -Qx;
delpqx= [delp'; delq'];
err=abs{ rnax{del pqx));
t=t+l;
end
[v' rn*th']
'I
~
~
-
~
EXPERIMENT 3
~
r-~ Aim: To compute the power-flow solution of the given power system network
using the Newton-Raphson algorithm.
~
~ Pc 2 =0.6661
~
.......... f V2 i =I.OS
V3
So3 = 2.8653 + jJ .2244
For the above network, all the transmission lines are identical. In the equivalent-
pi representation of each line, the series impedance equals Zse = j 0.1 while each
of the shunt admittances (equal on both sides) equal Ysh = j 0.01. This gives the
rI
bus admittance matrix Ybus as
3
3
•
Raphson algorithm for power-flow of the above three bus system is given by
xl =XO+ ,-1flf
where
92
JC = 83
l~I
r• BP2
a82
a]'l
aP2
a63
aP3
a~
a IVjl
aP3
J(x) = a ll'31
ae2 a93
aQ3 BQl aQ3
as2 aB3 a IV31
and L\f on the right-hand side is given by
Procedure: Type the code given below for the Newton-Raphson algorithm in a
MATLAB mfile. Save the code as amit3 if Amit is your first name (no blank
spaces in between). Debug the code and run it to get the final results as:
_30
-10°
0.95 p. u.
Code in MATLAB mfile:
clc
clear all
%Data%
slb=l;pvb=l;pqb=l;nb=slb+pvb+pqb;
Y=[-j*l9.98 j*lO j*lO;j*lO -j*l9.98 j*lO;j*lO j*lO -j*l9.98];
y=abs(Y);phi=angle(Y);
v(l)=l.O;th(l)=O;v(2)=1.05;
Psp(2)=0.666l;Psp(3)=-2.8653;Qsp(3)=-l.2244;
%initial guess for unknown theta and v %
th(2)=0;v(3)=1.0;th(3)=0;
cc=l80/pi;
THV=[O;O;l];
%Program for Newton-Raphson algorithm%
err=l.0; t=O; % 't' is number of iterations of the algorithm
while err>le-4
for i=(slb+l) :nb
Px(i)=O;Qx(i)=O;
for k=l:3
Px(i)=Px(i)+v(i)*v(k)*y(i,k)*cos(th(i)-th(k)-p hi(i,k));
Qx(i)=Qx(i)+v(i)*v(k)*y(i,k)*sin(th(i)-th(k)- phi(i,k));
end
end
% formation of Jacobian 'J' %
% P-theta jacobian %
JPth(l,l)=-Qx(2)-(((v(2))A2)*abs(Y(2,2))*sin( angle(Y(2,2))));
JPth(l,2)=v(2)*v(3)*abs(Y(2,3))*sin(th(2)-th( 3)-(angle(Y(2,3))));
JPth(2,l)=v(3)*v(2)*abs(Y(3,2))*sin(th(3)-th(2 )-(angle(Y(3,2) )));
JPth(2,2)=-Qx(3)-(((v(3))A2)*abs(Y(3,3))*sin( angle(Y(3,3))));
% P-v jacobian %
JPv(l,l)=v(2)*abs(Y(2,3))*cos(th(2)-th(3)-(an gle(Y(2,3))));
JPv(2,l)=(Px(3)/v(3))+(v(3)*abs(Y(3,3))*cos(a ngle(Y(3,3))));
% Q-theta jacobian %
JQth(l,l)=-v(3)*v(2)*abs(Y(3,2))*cos(th(3)-th (2)-(angle(Y(3,2))));
JQth ( 1, 2) = Px ( 3) - ( ( (v ( 3) ) A2) * abs (Y ( 3, 3) ) * cos ( ang 1 e ( Y ( 3, 3) ) ) ) ;
% Q-v jacobian %
JQv(l,l)=(Qx(3)/v(3))-(v(3)*abs(Y(3,3))*sin(a ngle(Y(3,3))));
J=[JQth JQv;JPth JPv];
for p=l:pgb
delq(p)=Qsp(p+slb+pvb)-Qx(p+slb+pvb);
end
for p=l: (pvb+pqb)
delp(p)=Psp(p+slb)-Px(p+slb);
end
delPQ=[delq';delp'];
delthv=THV+(inv(J)*delPQ);
for p=(slb+l) :nb
th(p)=delthv(p-1);
end
for p=(slb+pvb+l) :nb
v(p)=delthv(p+pqb-slb);
end
THV=delthv;
err=max(abs(delPQ))
t=t+l;
end
[v' cc*th']
WF1fi?t1:WG:liilft ct46WE;&W4 1 1 S e ,+
EXPERIMENT 4
Aim: To compute the power-flow solution of the given power system network
using the fast-decoupled power-flow algorithm.
Pc 2 = 0.6661
............-.. V3
Sol = 2.8653 + j] .2244
For the above network, all the transmission lines are identical. In the equivalent-
pi representation of each line, the series impedance equals Zse = j 0.1 while each
of the shunt admittances (equal on both sides) equal Ysh = j 0.01. This gives the
bus admittance matrix Ybus as
3 3
.
-[-19.98
10 -~~-98] [:::J = ~~
111;1
And
AQ3)"
-( .:..19.98) '11¥';1" =( 1v;1
• I
Procedure: Type the code given below for the fast-decoupled power-flow
algorithm in a MATLAB mfile. Save the code as amit4 if Amit is your first
name (no blank spaces in between). Debug the code and run it to get the final
results as
l
- for p=l:pqb
end
delq(p)=(Qsp(p+slb+pvb)-Qx(p+slb+pvb))/v(p+slb+pvb);
-I V=V+(Jqv*delq');
for p=l:pqb
end
v(slb+pvb+p)=V(p);
delPQ=[delp';delq'];
err=max(abs(delq))
• end
t=t+l;
[v' cc*th']
I
EXPERIMENT 5
~
~
~
"I~
,,,~
':, The fuel cost functions of the above three generators are given as
t
t
~
~
......,.rr ew::::::;• s i E, a >d k if 144, ,¥ \51 LI' 2 i t9 ; ti 'Si z i hd ► F+& 4¥! di h
Theory: (a) Without transmission loss, the optimal dispatch rule is given as
From the three generators' fuel cost functions, the above equations can be
written in matrix form as
0.003124 0 0 -1 -7.92
0 0.00388 0 -1 -7.85
I
0 0 0.00964 -1 -7.97
1 1 1 0 850
The above equations are linear, of the form [A] [X] = [B] and can be solved
very easily using [X] = [A]- 1 [BJ.
Thus, after putting values of the parameters given for the system, the first
equation becomes L1 IC1 = A i.e. 1-!~1l oss = A, which can be written as
oPG1
0.003124PG1 + 7.92
--------=A
1 - (0.00006PG1)
[
0.003124 + 0.00006 A
0 .
0
0.00388 + 0.00018 A
0
0 j [Pei]
Pc2
0 0 0.00964 + 0.00024 pG3
~
- 7.92]
= A- 7.85
-7.97
It can be observed that with transmission losses included, the above equations
have become nonlinear, unlike in part (a). They have now to be iteratively
solved after assuming an initial value of A. This method is known as the
lambda iteration method. As a good approximation, we can choose the value
of A which was obtained in part (a) i.e. without transmission losses.
Procedure: Type the code given below in a MATLAB mfile. Save the code
as amit5 if Amit is your first name (no blank spaces in between). Debug the
code and run it to get the fmal results.
~
• Aim: To compute the bus impedance matrix of a given power system network
in MATLAB using Z bus building algorithm .
•• l5
•• 1-- ---2
~
- lJ
3
~ Reference node
Theory:
The Ybus /Zbus matrix constitutes the models of the passive portions of the
power network. The impedance matrix is a full matrix and is most useful for
short circuit studies. An algorithm for formulating [Zbus] is described in terms
of modifying an existing bus impedance matrix designated as [Zbus]otd· The
modified matrix is designated as [Zbus]new• The network consists of a reference
bus and a number of other buses. When a new element having self impedance
Zb is added, a new bus may be created (if the new element is a tree branch) or
a new bus may not be created (if the new element is a link). Each of these two
cases can be subdivided into two cases so that Zb may be added in the
following ways or modifications: