Power System Stability and Analysis: Assignment: 1
Power System Stability and Analysis: Assignment: 1
Power System Stability and Analysis: Assignment: 1
and Analysis
Assignment: 1
Yashwant Singh
101804044
3EE3
Aesmunn
Epman MV VP
I)
SoovSAv 9:6 AVA s . 302 2 I1.713
2i2eV -2 v 4 0.08 2
New ba
AgSov.s v S 4o -2pv lokVA 8. 138
in8 . v .2v
133 p4 + -6-655pT PT
A M - AMw-loae
H Joscin Canlo n
V Yoo V
:
S AsemmLnk at
TEEE S bus data
shunt
0 02t 0 . S-
A -2
B 3 0-03 ti 2y 2S-3-2 0.o 23S
C -3 0-6t 0.r O077-SD) 2
D -y P7-S
E -S .o ti 0-12 S-7S
3- .o ti 0.03 lo- 3
003 j:24 .32S
Page
Yh
Ybu 62Sj1372s - S I 25 3s
-5 +jls 31-27-0.) h3732 -6) tjs -
12s +3-7 0.o74 3-722 13-1S773747-btj3o
-167 +jS lo tj3o R-933- .3ti31
s+i1- -35t3-7 3.1s-
i wim Shun lenuno
p-) 3
Y
-
-2
13 m
9-3
Y
-1 3
(3,3) Yhu 3)
Yu (3,1)=y bu ()-.
Yh
y buo (33) =Ybu (33) tja
V 6S-j1b:lo-St+io-2s 9-7s O
-S tlo 10-7-31.2-o.914913-614S -2St 1s
F-28 i3-25-0.4)ti:13 12-S7-j147lot3
-7+jS--+3 91639-49-I. s 3-2
2 i 37S 3-1s6 j3/
)Sigan hrana lor mauHon Mahad
ihau Shun
S
AA
C
Y S
1:23-j37s
2S-j7S
lo-j3
1-2-i3
AT YA
Page
bus
-SS 2s3:7S O
-StL lo.37-j312 09a H313167 7
-1.25 3-7 -OGs7F3.182 2-1S37.S3 i3o
fo j3 RI33--12j3-
-3-54 2413s 3.%-i1-2
w; n shun
3
A L
C0
-l
O.0 S5
SSo
4-
Page
Y=
9 25-1375
O .9)-3.73)
1:-S
1-13
23-7s 0
9.02
. o SS
00SSo
O O
Vaun A A
Page
T 5-Is 1-3ti3:7o
0.0)j3-14 -61-isSo-5
-25+13-75 -14|3.78 0
-.5+15 -2s375
.0SSo
j.y
-2s7-
tj
h9-A 386 2 3:2
3-7sJ).2)
wh Mh Tnpaoho
bw B anel
A
-
0 183-
o- 0.907-3-7T22) 0
Q O-
lo3
10-
O 100Sj»
jo-as
0.0
Yhia
Ay-Ss 12-3- s
0.437-3-73 6IS_ S75
-Stj-S
j0.0SSo
aa
+1030
1S-1375
O 34j3.-7 jo
6s-137 -SJo
-o.91 i 73
-S+lo 1o-07-.32
o ) + 8-79 RIS7.47
j3o
-2Stj7S
- fo 3 >
LO o3 jo.21
O2 %
.03 ojo2
0 2 . fa 2 jo 21
2(o) 0 24 0 )
Os2j3:6 -jo.1
o0011+j3-00
Zh
0 o.175 ho.%3
9 OD120 oy jo-13s
0-o7tjoos's 0.0392 2
Zh 0-0099 to-o 2
ti o-s3y 7SpoB
0-0 jo-o36 oYjo
oE.73
ol7s o-o
0O17sio-o53 o-0099 io-02 0.02S o.35
O 0 175 tja.S? s30.o75
t jo-
Zbua L o.613-ja.
co2 io2
.174jo.0s62 Doy3-0-314
-o2 tjo.072
O-0413-j./3Yf -9o4t3-jo.
9
1.Without shunt
Code:
clc
clear
bus_system=5;
[line_data]=databus(bus_system);
nbr=size(line_data,1);
nbus=max(max(line_data(:,1)),max(line_data(:,2)));
z=line_data(:,3)+j*line_data(:,4);
y=1./z;
ysh=j*line_data(:,5);
ybus=zeros(nbus);
for k=1:nbr
m=line_data(k,1);
n=line_data(k,2);
ybus(m,n)=ybus(m,n)-y(k);
ybus(n,m)=ybus(m,n);
ybus(m,m)=ybus(m,m)+y(k)
ybus(n,n)=ybus(n,n)+y(k)
end
ybus
function [line_data]=databus(bus_system)
switch bus_system
case 5
line_data=[1 2 0.02 0.06 0;
1 3 0.08 0.24 0.025;
2 3 0.06 0.25 0.020;
2 4 0.06 0.18 0.020;
2 5 0.04 0.12 0.015;
3 4 0.01 0.03 0.010;
4 5 0.08 0.24 0.025]
end
Output:
2.With Shunt:
Code:
%direct method
clc
clear
bus_system=5;
[line_data]=databus(bus_system);
nbr=size(line_data,1);
nbus=max(max(line_data(:,1)),max(line_data(:,2)));
z=line_data(:,3)+j*line_data(:,4);
y=1./z;
ysh=j*line_data(:,5);
ybus=zeros(nbus);
for k=1:nbr
m=line_data(k,1);
n=line_data(k,2);
ybus(m,n)=ybus(m,n)-y(k);
ybus(n,m)=ybus(m,n);
ybus(m,m)=ybus(m,m)+y(k)+ysh(k);
ybus(n,n)=ybus(n,n)+y(k)+ysh(k);
end
ybus
function [line_data]=databus(bus_system)
switch bus_system
case 5
line_data=[1 2 0.02 0.06 0;
1 3 0.08 0.24 0.025;
2 3 0.06 0.25 0.020;
2 4 0.06 0.18 0.020;
2 5 0.04 0.12 0.015;
3 4 0.01 0.03 0.010;
4 5 0.08 0.24 0.025]
end
Output:
3.With Mutual Impedance
Code:
clc
clear
[line_data]=databus();
nbr=size(line_data,1);
nbus=max(max(line_data(:,1)),max(line_data(:,2)));
z=line_data(:,3)+j*line_data(:,4);
y=1./z;
ysh=j*line_data(:,5);
ybus=zeros(nbus);
l=0;
for k=1:nbr
if line_data(k,6)~=0
l=k;
end
m=line_data(k,1);
n=line_data(k,2);
ybus(m,n)=ybus(m,n)-y(k);
ybus(n,m)=ybus(m,n);
ybus(m,m)=ybus(m,m)+y(k)+ysh(k);
ybus(n,n)=ybus(n,n)+y(k)+ysh(k);
end
if l~=0
l=l-1;
p=line_data(l,1);
q=line_data(l,2);
r=line_data(l+1,1);
s=line_data(l+1,2);
ym1=-j*1/line_data(l,6);
ym2=-j*1/line_data(l+1,6);
h=[p q r s];
adsh=[1 -1 0 0;
0 0 1 -1;];
yb=adsh'*[y(l) ym1;
ym2 y(l+1);]*adsh;
for x=1:2
for y=3:4
ybus(h(x),h(y))=ybus(h(x),h(y))+yb(x,y);
ybus(h(y),h(x))=ybus(h(y),h(x))+yb(y,x) ;
end
end
end
ybus
function [line_data]=databus()
line_data=[1 2 0.02 0.06 0.025 0;
1 3 0.08 0.24 0.025 0.2;
2 3 0.06 0.25 0.020 0.2;
2 4 0.06 0.18 0.020 0;
2 5 0.04 0.12 0.015 0;
3 4 0.01 0.03 0.010 0;
4 5 0.08 0.24 0.025 0;];
end
Output:
1.Without Shunt
Code:
end
end
Output:
2.With Shunt
Code:
function [line_data]=databus(bus_system)
switch bus_system
case 5
line_data=[1 2 0.02 0.06 0 0;
1 3 0.08 0.24 0.025 0.2;
2 3 0.06 0.25 0.020 0.2;
2 4 0.06 0.18 0.020 0;
2 5 0.04 0.12 0.015 0;
3 4 0.01 0.03 0.010 0;
4 5 0.08 0.24 0.025 0];
end
end
Output:
Code:
if line_data(k,6)~=0
flag=k-1;
end
else
a(k,k-nbr)=1;
ypr(k,k)=yshc(k-nbr,k-nbr);
end
end
ym=1/j*inv(line_data(flag,6));
ypr(flag,flag+1)=ypr(flag,flag+1)+ym;
ypr(flag+1,flag)=ypr(flag+1,flag)+ym;
line_data()
ybus=a'*ypr*a
function [line_data]=databus(bus_system)
switch bus_system
case 5
line_data=[1 2 0.02 0.06 0 0;
1 3 0.08 0.24 0.025 0.2;
2 3 0.06 0.25 0.020 0.2;
2 4 0.06 0.18 0.020 0;
2 5 0.04 0.12 0.015 0;
3 4 0.01 0.03 0.010 0;
4 5 0.08 0.24 0.025 0];
end
end
Output:
Zbus Formulation
Code:
clc
clear
[line_data]=databus()
nbr=size(line_data,1);
zbus=[0];
currentbusno=0;
for i=1:7
from=line_data(i,2);
to=line_data(i,3);
value=line_data(i,4)+j*line_data(i,5);
dim=size(zbus,1);
newbus=max(from,to);
ref=min(from,to);
if newbus>currentbusno && ref==1
zbus=[zbus zeros(dim,1);
zeros(1,dim) value;]
currentbusno=newbus;
continue
end
if newbus>currentbusno && ref~=1
zbus=[zbus zbus(:,ref);
zbus(ref,:) zbus(ref,ref)+value;]
currentbusno=newbus;
continue
end
if newbus<=currentbusno && ref==1
x=zbus(:,newbus)
y=zbus(newbus,:)
z=(zbus(newbus,newbus)+value)
z=1/z
zbus=zbus-x*z*y
continue
end
if newbus<=currentbusno && ref~=1
x=zbus(:,ref)-zbus(:,newbus)
y=zbus(ref,:)-zbus(newbus,:)
z=(zbus(ref,ref)+zbus(newbus,newbus)-(2*zbus(ref,newbus))+value);
z=1/z
zbus=zbus-x*z*y
continue
end
end
Output: