0% found this document useful (0 votes)
6 views24 pages

File Merged

The document outlines a practical file for EE 304 Power System Analysis, detailing various experiments related to power system analysis techniques including bus admittance matrix computation, power-flow solutions using different methods, optimal dispatch, and fault analysis. Each experiment includes aims, theoretical background, procedures, and MATLAB code examples. The document serves as a comprehensive guide for students to perform practical analysis in power systems.

Uploaded by

Kanishque Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views24 pages

File Merged

The document outlines a practical file for EE 304 Power System Analysis, detailing various experiments related to power system analysis techniques including bus admittance matrix computation, power-flow solutions using different methods, optimal dispatch, and fault analysis. Each experiment includes aims, theoretical background, procedures, and MATLAB code examples. The document serves as a comprehensive guide for students to perform practical analysis in power systems.

Uploaded by

Kanishque Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Practical File- EE 304

Power System Analysis


24.02.2024


Submitted by- Submitted To-
Kanishque Yadav Mr. Kuldeep Singh
2K22/EE.142
TABLE OF CONTENT:

Sr.no AIM Page no.

1. To compute the bus admittance matrix (Ybus) for a given 2-4


power system network.

2. To compute the power-flow solution of a given power 5-8


system network using the Gauss-Siedel method.

3. To compute the power-flow solution of a given power 9-11


system network using the Newton-Raphson algorithm.

4. To compute the power-flow solution of a given power 12-14


system network using the fast-decoupled power-flow
algorithm.

5. To compute the optimal dispatch in a given three-generator 15-19


system (a) without and (b) with transmission losses.

6. Formation of bus impedance matrix (Zbus) for a given power 20-23


system network from scratch.

7. Computation of symmetrical fault analysis in a given power 24-27


system network.

8. Determine the critical clearing time for a given single 28-29


machine infinite bus system.
List of Experiments

1. To compute the bus admittance matrix (Ybus) for a given power


system network.

2. To compute the power-flow solution of a given power system


network using the Gauss-Siedel method.

3. To compute the power-flow solution of a given power system


network using the Newton-Raphson algorithm.

4. To compute the power-flow solution of a given power system


network using the fast-decoupled power-flow algorithm.

5. To compute the optimal dispatch in a given three-generator


system (a) without and (b) with transmission losses.

6. Formation of bus impedance matrix (Zbus) for a given power


system network from scratch.

7. Computation of symmetrical fault analysis in a given power


system network.

8. Determine the critical clearing time for a given single machine


infinite bus system.
EXPERIMENT 1

Aim: To compute the bus admittance matrix Ybus for the small power
system network given below using MATLAB mfile/Python/C++

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 4 0.02 0.1 0.03
2 4 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
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 the following steps:
Step1: 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
X and B, respectively.
Check if data of B corresponds to Btotal or B1/2.
Step 2: Type the code given below and save it in a MATLAB mfile.
Save the code as amit1 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=[1 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

r=size(D);
rows=r(1);
for i=1: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=1:nb
y0(i)=j*sum(b(i,:))/2;
end
for i=1:nb
for m=1:nb
if i~=m
Y(i,m)=-1/z(i,m);
else
Y(i,m)=y0(i)+sum(1./z(i,:));
end
end
end
Matlab Output :-
Editor - /Users /kunalgupta/Documents/MATLAB/PAS_LAB/EXP_1.m • x Workspace
EXP_1m xE
| XP_2m
. x | EXP_3m . x| +
. x | EXP_4m Name 4 Value
clc 5x5 double
nb=5; % bn is number of buses ni hte network E D 5x5 double
z = inf(nb, nb); 旧i

s ss
b = zeros(nb, nb);
D
S

D=1 2 0.004 0.0533 0;2 30.02 02.5 0.22;3 40.02 02.5 0.22;2 400.1 0.15 0.11;4 5 0.006 0.08 0]; %Fvie 155,1
4 9

# rows
r=size(D);
⽥Y
6 8

rows=r(1);
10
11 무 for 1=1: rows
12 z(D(i,1),D(i,2))=D(1,3)+j*D(i,4);|
13 z(D(i,2) ,D(i,1))=z(D(i, 1),D(i,2));
14
15
16
B 0(4,210(4, 2) 6 1(1)41,0(1, 21);
17
18 @ for i=1:nb
19
20 end Ye(1) =j*sumcb(1,:)1/2;
21
22 무 for i=1inb
32 뮈 for m=1:nb
24 if i~=m
52 Y(i,m)=-1/z(i,m);
26 else

28
27
end Y1(, m)=yo(1) + sum(1/2(1, :)):
29
30 end end
31
32 disp(Y);
Command Window
1.4001
-1.4001
-18.65671
+18.65671
0.0000 + 0.00001
-1.4001 +18.6567i
2.1606 -29.10341
-0.3180 + 3.97461
0.0000 + 0.0000i
-0.3180 + 3.97461
0.6359 - 7.72911
94.425 +66.9121
-0.4425
-0.3180 + 3.97461
0.0000
0.0000 + 0.0000i -0.4425 + 6.63721 -0.3180 + 3.97461 1.6927 -22.87681 -0.9323 +12.43011
0.0000 + 0.00001 0.0000 + 0.0000i 0.0000 + 0.00001 -0.9323 +12.43011 0.9323 - 12.43011
EXPERIMENT 2

Aim: To carry out power-flow / load-flow of a given power system


network using Gauss-Siedel method

In the above network, all the transmission lines are identical. For each
line, the shunt element is a capacitor with an admittance of ysh=j 0.01
while each series element is an inductor with an impedance of zse=j 0.1.

1. Theory:
2. Procedure: First compute the bus admittance matrix. Check that
Type the code given below for the Gauss-Siedel algorithm in a MATLAB
mfile. 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:

Code in MATLAB mfile:


clc
clear all
%Data%
slb=1;pvb=1;pqb=1;nb=slb+pvb+pqb;
Y=[-j*19.98 j*10 j*10;j*10 -j*19.98 j*10;j*10 j*10 -j*19.98];
y=abs(Y);phi=angle(Y);
v(1)=1.0;th(1)=0;v(2)=1.05;
Psp(2)=0.6661;Psp(3)=-2.8653;Qsp(3)=-1.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=1.0; t=0; % 't' is the number of iterations of the algorithm
while err>1e-4
for i=2:3
Px(i)=0;Qx(i)=0;
for k=1:3
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));
end
end
for i=1:3
V(i)=v(i)*(cos(th(i))+j*sin(th(i)));
end
for i=2:3
vint(i)=0;
for k=1:3
if k~=i
vint(i)=vint(i)+Y(i,k)*V(k);
else
end
end
end
for i=2:nb
if i<=(slb+pvb)
V(i)=(((Psp(i)-j*Qx(i))/conj(V(i))-vint(i))/Y(i,i));
else
V(i)=(((Psp(i)-j*Qsp(i))/conj(V(i))-vint(i))/Y(i,i));
end
end
for i=2:nb
if i<=(slb+pvb)
th(i)=angle(V(i));
else
v(i)=abs(V(i));
th(i)=angle(V(i));
end
end
delp=Psp-Px;
delq=Qsp-Qx;
delpqx=[delp'; delq'];
err=abs(max(delpqx));
t=t+1;
end
[v' m*th']
Matlab Output :-
Editor - /Users/kunalgupta/Documents /MATLAB/PAS_LAB/EXP_2m
. ° x Workspace
.
EXP_2m |+x Name 4 Value
[1,0;1.0500,-2.9...
[0,5.5929e-05,-...
dear al [0;5.5929e-05;-...
[0,-1.6417,2.644...
GO N O U A

pqb=1;
• err
⽥i 5 59290-05
nb=slb+pvb+pqb; 旧k 3
57.2958
¥=I-j*19.98 j*10 j*10;j*10 -j*19.98 j*10;j*10 j*10 -j×19.98];
⿊ phi -1.570815..
10
11 paaangler: • pab
12
31 th(1)=0;
v(2)=1.05;
Psp
pvb
Px
1100,,06..66616-02,8.6-258.635121
14
15 Psp(2)=0.6661; Qsp [0,0,-1.2244)
16 PSp(3) =-2. 8653: Qx [0,1.6417,-1.2244]
17 Qsp (3)=-1.2244; sib
18
19
20
21
th
1 0105000,9500
2
eprootn ot us, estl anurer t etiraotns of
eht aglhotm
ir


23
24 while err>le-4

52 for i=2:3
62 PX(1)=0: 0X( 4)=0;
Command Window

ans =
1.0000
1.0500 -2.9999
0.9500 -10.0001

Computational Time:-
Profile Summary (Total time: 0.029 s)
+Falme Graph

EXP. 2
Profile Summary
Generated 13-Feb-2025 13:42:58 using performance time.
Function Name Calls Total Tm
ie Self Time* Total Time Plot
(s) (s) (self time / total time)

EXP 2 0.029 0.028


angle 35 0.000 0.000
webwindowmanager>webwindowmanager.delete 0.000 0.000
*Self time si the time spent ni a function excluding any time spent ni child functions. The time includes any overhead time resulting from the profiling process.
EXPERIMENT 3

Aim: To compute the power-flow solution of the given power system


network using the Newton-Raphson algorithm.

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

Theory: In the above 3-bus system, there are three buses the first bus is
the slack bus, the second bus is a PV bus and the third bus is a PQ bus.
Hence the unknown variables to be computed are and . Hence, the
Newton-Raphson algorithm for power-flow of the above three bus system
is given by

where

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:
Code in MATLAB mfile:
clc
clear all
%Data%
slb=1;pvb=1;pqb=1;nb=slb+pvb+pqb;
Y=[-j*19.98 j*10 j*10;j*10 -j*19.98 j*10;j*10 j*10 -j*19.98];
y=abs(Y);phi=angle(Y);
v(1)=1.0;th(1)=0;v(2)=1.05;
Psp(2)=0.6661;Psp(3)=-2.8653;Qsp(3)=-1.2244;
%initial guess for unknown theta and v %
th(2)=0;v(3)=1.0;th(3)=0;
cc=180/pi;
THV=[0;0;1];
%Program for Newton-Raphson algorithm%

while err>1e-4
for i=(slb+1):nb
Px(i)=0;Qx(i)=0;
for k=1:3
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));
end
end
% formation of Jacobian 'J' %
% P-theta jacobian %
JPth(1,1)=-Qx(2)-(((v(2))^2)*abs(Y(2,2))*sin(angle(Y(2,2))));
JPth(1,2)=v(2)*v(3)*abs(Y(2,3))*sin(th(2)-th(3)-(angle(Y(2,3))));
JPth(2,1)=v(3)*v(2)*abs(Y(3,2))*sin(th(3)-th(2)-(angle(Y(3,2))));
JPth(2,2)=-Qx(3)-(((v(3))^2)*abs(Y(3,3))*sin(angle(Y(3,3))));
% P-v jacobian %
JPv(1,1)=v(2)*abs(Y(2,3))*cos(th(2)-th(3)-(angle(Y(2,3))));
JPv(2,1)=(Px(3)/v(3))+(v(3)*abs(Y(3,3))*cos(angle(Y(3,3))));
% Q-theta jacobian %
JQth(1,1)=-v(3)*v(2)*abs(Y(3,2))*cos(th(3)-th(2)-(angle(Y(3,2))));
JQth(1,2)=Px(3)-(((v(3))^2)*abs(Y(3,3))*cos(angle(Y(3,3))));
% Q-v jacobian %
JQv(1,1)=(Qx(3)/v(3))-(v(3)*abs(Y(3,3))*sin(angle(Y(3,3))));
J=[JQth JQv;JPth JPv];
for p=1:pqb
delq(p)=Qsp(p+slb+pvb)-Qx(p+slb+pvb);
end
for p=1:(pvb+pqb)
delp(p)=Psp(p+slb)-Px(p+slb);
end
delPQ=[delq';delp'];
delthv=THV+(inv(J)*delPQ);
for p=(slb+1):nb
th(p)=delthv(p-1);
end
for p=(slb+pvb+1):nb
v(p)=delthv(p+pqb-slb);
end
THV=delthv;
err=max(abs(delPQ))
t=t+1;
end
[v' cc*th']
Matlab Output :-
• Editor - /Users/kunalgupta/Documents/MATLAB/PAS_LAB/EXP_3.m x Workspace
EXP_3.m x+ Name A Value
60 [1,0;1.0500,-3.0...
⽩ 57.2958
61
62
for p = 1: pqb
d e l q ( p ) = Qsp(p+slb+pvb) - Q×(p+slb+pvb); E9ep [4.0124e-07,-8....
63 end
Text
⽥delpo [-1.3475e-06;4....
64
65 ⽩ for p = 1: (pvb+pqb) 坦del thv 00 4-017 .
11.3475e-06
66 delp(p) = Psp(p+slb) - Px(p+slb);
67 end ⽥i
68
69 delPQ = [delq' ;delp'1; %j⽥
J
eth
70 delthv = THV + (inv(J)*delPQ); [1.2796;-3.01611
71 [1.2156,-2.86531
72 for p = (slb+1) :nb 17.6921

m m
73 th(p) = d e l t h v ( p - 1 ) ;
74 end
75 3
76
77
for p = (slb + pvb +1):nb
v(p) = delthv(p+pqb-slb); 1.5708.1.570.
78 end 10,0.6661,-2.86531
79
80 V = delthv;
T
H [0,0.6661,-2.8653]
18 err = max (abs (delPQ)) 1 0. 0 -1.2244]
82 t t +1; 10,1.6417,-1.2244]
83 end
84 Iv' co*th'l
85
Command Window ◎ [1,1.0500,0.95001
err = 1090-1010
1.3475-06
ans =

10.380 --310.00.000900
0.9500

Computational Time:-
Profile Summary (Total time: 0.021 s)
~Flame Graph

EXP 3
Profile Summary
Generated 13-Feb-2025 13:46:10 using performance time.
Function Name Calls Total Tm
ie i e*
Self Tm Total Time Plot
(s) (s) (self time / total time)
EXP_3 1 0.021 0.021
angle 37 0.000 0.000
webwindowmanager>webwindowmanager.delete 1 0.000 0.000
*Sefl time si hte time spent ni afunction excluding any time spent ni child functions. The m
it e includes any overhead time resulting orfm hte profiling process.
EXPERIMENT 4

Aim: To compute the power-flow solution of the given power system


network using the fast-decoupled power-flow algorithm.

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

Theory: The advantage of the fast-decoupled power-flow algorithm is that


the Jacobian matrices are constants. Hence, their inverses are precalculated
and stored before the iterative loop starts. Since the usually large Jacobian
matrices are not required to be inverted in every iteration, time taken by
each iteration is very less. The form of the fast-decoupled power-flow
algorithm is given by

where

In the above 3-bus system, there are three buses the first bus is the slack
bus, the second bus is a PV bus and the third bus is a PQ bus. Hence the
unknown variables to be computed are and . Hence, the fast-
decoupled power-flow algorithm for the above three bus system is given by

And

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
and

Code in MATLAB mfile:


clc
clear all
%Data%
slb=1;pvb=1;pqb=1;nb=slb+pvb+pqb;
Y=[-j*19.98 j*10 j*10;j*10 -j*19.98 j*10;j*10 j*10 -j*19.98];
y=abs(Y);phi=angle(Y);
B=imag(Y);
v(1)=1.0;th(1)=0;v(2)=1.05;
Psp(2)=0.6661;Psp(3)=-2.8653;Qsp(3)=-1.2244;
%initial guess for unknown theta and v %
th(2)=0;v(3)=1.0;th(3)=0;
cc=180/pi;
TH=[0;0];
V=1;
%jacobian for P-theta %
Jpth_old=-B(slb+1:end,slb+1:end);Jpth=inv(Jpth_old); % inverse of matrix
precalculated and stored before iteration loop starts
%jacobian for Q-v %
Jqv_old=-B(slb+pvb+1:end,slb+pvb+1:end);Jqv=inv(Jqv_old); % inverse of
matrix precalculated and stored before iteration loop starts
%Program for Newton-Raphson algorithm%

while err>1e-4
for i=(slb+1):nb
Px(i)=0;
for k=1:nb
Px(i)=Px(i)+v(i)*v(k)*y(i,k)*cos(th(i)-th(k)-phi(i,k));
end
end
% P-theta loop %
for p=1:(pvb+pqb)
delp(p)=(Psp(p+slb)-Px(p+slb))/v(p+slb);
end
TH=TH+(Jpth*delp');
for p=(slb+1):nb
th(p)=TH(p-1);
end
% Q-v loop %
for i=(slb+pvb+1):nb
Qx(i)=0;
for k=1:nb
Qx(i)=Qx(i)+v(i)*v(k)*y(i,k)*sin(th(i)-th(k)-
phi(i,k));
end
end
for p=1:pqb
delq(p)=(Qsp(p+slb+pvb)-Qx(p+slb+pvb))/v(p+slb+pvb);
end
V=V+(Jqv*delq');
for p=1:pqb
v(slb+pvb+p)=V(p);
end
delPQ=[delp';delq'];
err=max(abs(delq))
t=t+1;
end
[v' cc*th']
Matlab Output :- Workspace
• Editor - /Users /kunalgupta/Documents/MATLAB/PAS_LAB/EXP_4.m ° x
EXP_4.m x+ Name A Value
57 end = ans [1,0;1.0500,-3.0...
58 ⽥B [-19.9800,10,10;..
59 57.2958
60 for i = (slb + pvb + 1):nb [6.2263-05,-6...
61 x (i) = 0;
Q [6.2263e-05;-6....
国dela
62
63
64

Qx(1) =Qx(1) + v(1)*v(k)*y(i,k)×sin(th(i)-th(k)-phi(i,k)); 43126-005
end end ⽇ Jpt h
65
66
67 ⽇
EJpth_old
# Jqv
1960131
0.0501
for p =1:pqb
delq(p) = (osp(p+slb+pvb)-Qx(p+slb+pvb))/v(p+slb+pvb); " Jqv_old
1920
68
69 end ⽥k
70 Enb


71 V = V + (Jqv*delq');
⽩ phi
72
73
for p = 1: pqb
end (sib+pyb+p) = Vp() ; (-1.570,157..
74
75 10.06661--22.68665523)1
10. 0. 6660,
7
76
78
dt etr+1f;m
axatsdea) [0,0,-1.2244]
10,0,-1.2244]
79
80
81 Ev' couth' 1 0.- 0.0524.- 0.17...
1- 0. 0524:- 0.1745]
[ 1, 1.0500,0 .9500]
Command Window ◎ 0.9500
t = 1 19,9800. 10. 10:1. .
10. 0000- 19.980. .
5

ans =
10.9500
0.580 -10.30.0000001

Computational Time:-
Profile Summary (Total time: 0.014 s)
- Flame Graph

EXP 4
Summary
Profile
Generated 13-Feb-2025 13:46:50 using performance time.

Function Name Calls Total Time Self Time* Total Time Plot
(s) (s) (self time / total time)

EXP 4 1 0.014 0.013


angle 1 0.000 0.000
"Self time si the time spent ni a function excluding any time spent ni child functions. The time includes any overhead time resulting orfm hte profiling process.
COMPARISION TABLE
METHODS NO. O
F ITERATIONS ERROR COMPUTATION TM
IE
GAUSS - SIEDAL 71 1E-04 29 mili seconds
METHOD
NEWTON RAPHSON 21 mili seconds
ALGORITHM 4 1E-04

FAST - DECOUPLED 5 1E-04 14 mili seconds


LOAD FLOW ALGORITHM

Conclusion :-
1.Gauss-Seidel method requires the most iterations (17) and highest computation time (29 ms).

2.Newton-Raphson Algorithm achieves faster convergence with only 4 iterations and 21 ms computation time.

3.Fast-Decoupled Load Flow Algorithm is the most efficient, requiring just 5 iterations and the least time (14 ms).

You might also like