Program:: '/N Medium Line T Network')
Program:: '/N Medium Line T Network')
length=140
Z=(0.2+0.408i)*length;
Y=(0+3.14e-6i)*length;
check=(A*D)-(B*C)
case 1
vr=input('enter Vr/phase=');
ir=input('enter ir/phase=');
vr=vr*1e3/sqrt(3);
vs=(A*vr+B*ir)/1e3;
is=C*vr+D*ir;
fprintf('\n Sending end voltage/ph=%f%+fi KV',
real(vs),imag(vs));
fprintf('\n Sending end current/ph=%f%+fi Amp',
real(is),imag(is));
vs=vs*1e3;
case 2,
vs=input('enter Vs/phase=');
is=input('enter is/phase=');
vs=vs*1e3/sqrt(3.0);
vr=(D*vs-B*is)/1e3;
ir=-C*vs+D*is;
fprintf('\n Receiving end voltage/ph=%f%+fi KV',
real(vr),imag(vr));
fprintf('\n Receiving end current/ph=%f%+fi Amp',
real(ir),imag(ir));
vr=vr*1e3;
2
Exp: 1 Date: / /
PROCEDURE:
Note 1:
Note 2:
3
otherwise
disp('wrong choice');
end
rec_pow=3*real(vr*conj(ir))/1e6;
send_pow=3*real(vs*conj(is))/1e6;
eff=rec_pow/send_pow*100;
reg=(abs(vs)/abs(A)-abs(vr))/abs(vr)*100;
fprintf('\n Recieving end power=%.2fKVA',rec_pow);
fprintf('\n sending end power=%.2fKVA',send_pow);
fprintf('\n efficiency=%.2f%%',eff);
fprintf('\n voltage regulation=%.2f%%',reg);
A = 0.9874 + 0.0062i
B = 27.6485 +56.8476i
C = 0 +4.3960e-004i
D = 0.9874 + 0.0062i
enter Vr/phase=132
enter ir/phase=174.96-131.22i
efficiency=91.63%
voltage regulation=16.69%
4
EXPECTED RESULT for Pi network:
length = 140
A = 0.9874 + 0.0062i
B = 28.0000 +57.1200i
C = -1.3527e-006 +4.3684e-004i
D = 0.9874 + 0.0062i
enter Vs/phase=132+0i
enter is/phase=174.96-131.22i
efficiency=88.97%
voltage regulation=22.25%
5
PROGRAM:
%program to calculate ABCD parameters for long line network
clc
clear all
length=300;
Z=(0.2+0.408i)*length;
Y=(0+3.14e-6i)*length;
zc=sqrt(Z/Y);
gam=sqrt(Z*Y);
A=cosh(gam)
B=zc*sinh(gam)
C=1/zc*sinh(gam)
D=A
check=(A*D)-(B*C)
case 1
vr=input('enter Vr/phase=');
ir=input('enter ir/phase=');
vr=vr*1e3/sqrt(3);
vs=(A*vr+B*ir)/1e3;
is=C*vr+D*ir;
fprintf('\n Sending end voltage/ph=%f%+fi KV',
real(vs),imag(vs));
fprintf('\n Sending end current/ph=%f%+fi Amp',
real(is),imag(is));
vs=vs*1e3;
case 2,
vs=input('enter Vs/phase=');
is=input('enter is/phase=');
vs=vs*1e3/sqrt(3.0);
vr=(D*vs-B*is)/1e3;
ir=-C*vs+D*is;
fprintf('\n Receiving end voltage/ph=%f%+fi KV',
real(vr),imag(vr));
fprintf('\n Receiving end current/ph=%f%+fi Amp',
real(ir),imag(ir));
vr=vr*1e3;
otherwise
disp('wrong choice');
end
rec_pow=3*real(vr*conj(ir))/1e6;
send_pow=3*real(vs*conj(is))/1e6;
eff=rec_pow/send_pow*100; reg=(abs(vs)/abs(A)-
abs(vr))/abs(vr)*100; fprintf('\n Recieving end
power=%.2fKVA',rec_pow); fprintf('\n sending end
power=%.2fKVA',send_pow); fprintf('\n
efficiency=%.2f%%',eff); fprintf('\n voltage
regulation=%.2f%%',reg);
6
Exp: 2 Date: / /
PROCEDURE:
7
PROGRAM:
%FORMATION OF Ybus USING SINGULAR TRANSFORMATION
METHOD %WITHOUT MUTUAL COUPLING:
% p q Z hlcY(ADM)
z=[5 4 0.02+0.06i 0.03i
5 1 0.08+0.24i 0.025i
4 1 0.06+0.18i 0.02i
4 2 0.06+0.18i 0.02i
4 3 0.04+0.12i 0.015i
1 2 0.01+0.03i 0.01i
2 3 0.08+0.24i 0.025i];
fb=z(:,1);
tb=z(:,2);
Z=z(:,3);
hlcy=z(:,4);
y=1./Z;
nbus=max(max(fb),max(tb));
Y=zeros(nbus);
nline=length(fb);
nlb=nline+nbus;
A=zeros(nlb,nbus);
for k=1:nbus
A(k,k)=1;
end
for k=1:nline
A(nbus+k,fb(k))=1;
A(nbus+k,tb(k))=-1;
end
sh=zeros(nbus);
for k=1:nline
sh(fb(k))=sh(fb(k))+hlcy(k);
sh(tb(k))=sh(tb(k))+hlcy(k);
end
ypr=zeros(nlb,nlb);
for k=1:nbus
ypr(k,k)=sh(k);
end
for k=1:nline
ypr(nbus+k,nbus+k)=y(k);
end
format short;
Ybus=A'*ypr*A
V(1) =1.024532-0.08729i;
V(2)=1.02394-0.931i;
V(3)=1.01825-0.1074i;
V(4)=1.0476-0.049i;
V(5)=1.06+0i;
I=Ybus*V'
8
Exp: 3 Date: / /
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.
Generalized Y-bus = Yii ……….. Yid
Ydi ……… Ydd
.
PROCEDURE:
9
%FORMATION OF Ybus USING SINGULAR TRANSFORMATON METHOD
%WITH MUTUAL COUPLING & WITHOUT LINE CHARGING:
% p qZmno mutual(imp)
z=[0 1 0.6i 0 0
0 2 0.5i 1 0.1i
2 3 0.5i 0 0
0 1 0.4i 1 0.2i
1 3 0.2i 0 0];
p=z(:,1);
q=z(:,2);
Z=z(:,3);
mno=z(:,4);
zmc=z(:,5);
nbus=max(max(p),max(q));
Y=zeros(nbus);
nline=length(p);
A=zeros(nline,nbus);
for k=1:nline,
if(q(k)==0)
A(k,p(k))=1;
elseif(p(k)==0)
A(k,q(k))=-1;
end
if(p(k)~=0&q(k)~=0)
A(k,p(k))=1;
A(k,q(k))=-1;
end
end
zpr=zeros(nline,nline);
for k=1:nline
zpr(k,k)=Z(k);
if(mno(k))
zpr(k,mno(k))=zmc(k);
zpr(mno(k),k)=zmc(k);
end
end
ypr=inv(zpr);
format short;
Ybus=A'*ypr*A
10
EXPECTED RESULT:
FORMATION OF Ybus USING SINGULAR TRANSFORMATION METHOD WITHOUT
MUTUAL COUPLING:
Ybus =
I=
-24.8742 - 7.9772i
32.7204 +11.1076i
-2.7353 - 0.6013i
-4.2194 - 1.6135i
-0.9560 - 0.6148i
11
PROGRAM:
% p q z hlc(ADM) a
12
Exp: 4 Date: / _/
PROCEDURE:
EXPECTED RESULT:
Ybus =
-1.6667 + 5.0000 -1.6667 + 5.0000i -2.500 + 7.5000i 10.8333 -32.4150i -5.5556 -16.6667i
13
PROGRAM:
%Zprim=[Element no. from to Value]
clc
clear all
Z= [ 1 1 0 0.25
2 2 10.1
3 3 10.1
4 2 00.25
5 2 30.1];
[m n]= size(Z);
Zbus=[ ] ;%Let Zbus be a null matrix to begin with
currentbusno=0;
for count = 1:m,
[rows cols]=size(Zbus);
fb=Z(count,2);
tb=Z(count,3);
value=Z(count,4);
newbus=max(fb,tb);
ref=min(fb,tb);
% Type 1 Modification
if newbus>currentbusno & ref==0
Type=1
Zbus=[Zbus zeros(rows,1)
zeros(1,cols) value]
currentbusno=newbus;
continue
end
% Type 2 Modification
if newbus>currentbusno & ref~=0
Type=2
Zbus=[Zbus Zbus(:,ref)
Zbus(ref,:) value+Zbus(ref,ref)]
currentbusno=newbus; continue
end
% Type 3 Modification
if newbus<=currentbusno & ref==0
Zbus=Zbus-
1/(Zbus(newbus,newbus)+value)*Zbus(:,newbus)*Zbus(newbus,:)
continue
end
% Type 4 Modification
if newbus<=currentbusno & ref~=0 Zbus=Zbus-
1/(value+Zbus(fb,fb)+Zbus(tb,tb)-
2*Zbus(fb,tb))*((Zbus(:,fb)-Zbus(:,tb))*((Zbus(fb,:)-
Zbus(tb,:))))
continue
end
end
14
Exp:5 Date: / /
PROCEDURE:
EXPECTED RESULT
Type = 1
Zbus = 0.2500
Type = 2
Zbus =
0.2500 0.2500
0.2500 0.3500
Type = 2
Zbus =
0.2500 0.2500 0.2500
0.2500 0.3500 0.2500
0.2500 0.2500 0.3500
Zbus =
0.1458 0.1042 0.1458
0.1042 0.1458 0.1042
0.1458 0.1042 0.2458
Zbus =
0.1397 0.1103 0.1250
0.1103 0.1397 0.1250
0.1250 0.1250 0.1750
15
PROGRAM:
%power angle characteristics cylindrical rotor syn.m/c
%enter the values of x,v,Ia; clc
clear all
x=0.3;
v=1.0;
e=1.2;
pm=abs(e)*abs(v)/x;
del=0:0.1:pi;
plot(del,pm*sin(del),'r');
title('power angle characteristics of cylindrical rotor
syn.m/c');
xlabel('Delta');
ylabel('power,p');
legend('pm*sin(delta)');
del=0:0.1:pi/2;
line(del,pm);
y=0:0.1:pm;
line(pi/2,y);
reg=(abs(e)-abs(v))/abs(v)*100;
fprintf('\n the excitation Voltage = %f%%\n',e);
fprintf('\n the peak power = %f%%\n',pm);
fprintf('\n the Voltage regulation = %f%%\n',reg);
16
Exp:6 Date: / /
AIM: To determine the power angle diagram , reluctance power, excitation, emf and
regulation for non- salient pole synchronous machines,.
PROCEDURE:
EXPECTED RESULT:
2.5
1.5
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5
Delta
17
PROGRAM:
clc
clear all
xd=1;
xq=0.6;
v=1.0;
ia=0.5000-0.3750i;
theta=abs(angle(ia));
del=atan((xq*abs(ia)*cos(theta))/(abs(v)+xq*abs(ia)*sin(theta))
);
e=abs(v)*cos(del)+xd*abs(ia)*sin(del+theta);
p=(e)*abs(v)/xd;
pr=abs(v)^2*(xd-xq)/(2*xd*xq);
del=0:0.01:pi;
line(del,0);
hold on;
pe=p*sin(del)+pr*sin(2*del);
plot(del,p*sin(del),del,pr*sin(2*del),del,p*sin(del)+pr*sin(2*d
el));
title('power angle characteristics of salient pole syn.m/c');
xlabel('Delta');
ylabel('power,p');
legend('p*sin(delta)','pr*sin(2*del)','p*sin(del)+pr*sin(2*del)
');
[pmax,k]=max(pe);
fprintf('\n maximum power = %f and the corresponding angle=
%f',pmax,del(k)*180/pi);
del=0:0.01:del(k);
line(del,pmax);
y=0:0.01:pmax;
line(del(k),y);
reg=(abs(e)-abs(v))/abs(v)*100;
text(-0.4,pmax,'pmax');
text(del(k),-0.1,'deltamax');
fprintf('\n the excitation Voltage = %f pu',abs(e));
fprintf('\n the Reluctance power = %f pu\n',pr);
fprintf('\n the Voltage regulation = %f%%\n',reg);
18
Exp:7 Date: / /
AIM: To determine the power angle diagram , reluctance power, excitation, emf and
regulation for salient pole synchronous machines,.
PROCEDURE:
EXPECTED RESULT:
1
power,p
0.8
0.6
0.4
0.2
0
deltamax
-0.2
19
PROGRAM:
clc
clear all
%program for swing curve when the fault is
cleared ps=0.9;e=1.1;v=1.0;m=0.00028;
xe=0.35;xL=0.2;
%function swing2(ps,e,v,m,xe,xL)
x1=xe+xL/2;
ch=input('enter 1-for fault at the beginning of line
\n 2-for fault at the middle of line '); switch ch
case 1,
x2=inf;
case 2,
x2=(xe*xL+xe*xL/2+xL*xL/2)/(xL/2);
otherwise
disp('wrong input');
end
x3=xe+xL;
dt=0.05;
%ct=ct/50; //conversion from cycles to sec
ct=input('\n enter clearing time in secs ');
k=ct/dt;
r=ct-floor(k)*dt;
if(r==0)
fprintf('FAULT IS CLEARED AT THE BEGINNING OF
AN INTERVEL');
else
fprintf('FAULT IS CLEARED AT THE MIDDLE OF AN
INTERVEL');
end
rr=180/pi;
f=dt^2/m;
deld=0;
it=1; t(it)=0;
pm1=e*v/x1;
del(it)=asin(ps/pm1);
pm2=e*v/x2;
pm3=e*v/x3;
fprintf('\n TIME PMAX DELTA'); pm=pm1;
pe=pm*sin(del(it));
pa=(ps-pe);
20
Exp: 8 Date: / /
PROCEDURE:
21
fprintf('\n %5.3f %5.2f %5.2f',
t(it),pm,del(it)* rr);
pm=pm2;
pe=pm*sin(del(it));
pa=(ps-pe)/2;
while(t(it)<=0.5)
ft=f*pa/rr;
deld=deld+ft;
fprintf('\n %5.3f %5.2f %5.2f',
t(it),pm,del(it)* rr);
it=it+1;
t(it)=t(it-1)+dt;
del(it)=del(it-1)+deld;
pm=pm2;
if(t(it)==ct)
pm=(pm2+pm3)/2;
elseif(t(it)>ct)
pm=pm3;
end
pe=pm*sin(del(it));
pa=ps-pe;
end
plot(t,del*rr,'r');
title('swing curve');
xlabel('Time');
ylabel('Delta');
EXPECTED RESULT:
swing curve swing curve
45 60
40
50
35
40
30
Delta
Delta
25 30
20
20
15
10
22
enter clearing time in secs 0.05 2-for fault at the middle of line 2
FAULT IS CLEARED AT THE enter clearing time in secs 0.125
BEGINNING OF AN INTERVEL FAULT IS CLEARED AT THE
TIME PMAX DELTA MIDDLE OF AN INTERVEL
0.000 2.44 21.60 TIME PMAX DELTA
0.000 0.00 21.60 0.000 2.44 21.60
0.050 1.00 25.62 0.000 0.88 21.60
0.100 2.00 33.81 0.050 0.88 24.17
0.150 2.00 40.10 0.100 0.88 31.56
0.200 2.00 42.93 0.150 2.00 42.88
0.250 2.00 41.62 0.200 2.00 50.07
0.300 2.00 36.50 0.250 2.00 51.61
0.350 2.00 28.78 0.300 2.00 47.19
0.400 2.00 20.51 0.350 2.00 37.70
0.450 2.00 14.01 0.400 2.00 25.33
0.500 2.00 11.23 0.450 2.00 13.35
0.500 2.00 5.29
enter 1-for fault at the beginning of line
23
PROGRAM:
clc
clear all
%swing curve for sustained fault and critical clearing
time.
%ps=mech. power input xe=xg+xt, x1=reactance before
fault x2=reactance after fault
ps=0.9;e=1.1;v=1.0;m=0.00028;xe=0.35;xLi=0.2;
%function swing(ps,e,v,m,xe,xLi) x1=xe+xLi/2;
24
Exp: 9 Date: / /
AIM: To determine swing curve for sustained fault and critical clearing angle & time.
PROCEDURE:
25
end
it=it+1;
t(it)=t(it-1)+dt;
del(it)=del(it-1)+deld;
pm=pm2;
pe=pm*sin(del(it));
pa=ps-pe;
end
x3=xe+xLi;
%x3=0.55;
pm3=e*v/x3;
delm=pi-del(1);
cdc=(ps*(delm-del(1))+pm3*cos(delm)-
pm2*cos(del(1)))/(pm3-pm2);
delc=acos(cdc);
fprintf('\n critical clearing angle-%f',delc*rr);
it=1;
while(t(it)<0.5)
if(del(it)>=delc)
break;
end
it=it+1;
end
fprintf('\n critical clearing time-%f',t(it));
plot(t,del,'r');
title('swing curve');
xlabel('TIME');
ylabel('DELTA');
EXPECTED RESULT:
8
3
7
2.5
6
5 2
DELTA
DELTA
4
1.5
3
1
2
1 0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0
TIME 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
TIME
26
enter 1-for fault at the beginning
2-for fault at the middle1
SUSTAINED FAULT
TIME PMAX DELTA
----------------
0.000 2.44 21.60
0.000 0.00 21.60
0.050 0.00 25.62
0.100 0.00 37.67
0.150 0.00 57.76
0.200 0.00 85.89
0.250 0.00 122.05
0.300 0.00 166.25
0.350 0.00 218.48
0.400 0.00 278.75
0.450 0.00 347.05
0.500 0.00 423.39
critical clearing angle-81.684989
critical clearing time-0.200000
SUSTAINED FAULT
TIME PMAX DELTA
----------------
0.000 2.44 21.60
0.000 0.88 21.60
0.050 0.88 24.17
0.100 0.88 31.56
0.150 0.88 42.88
0.200 0.88 56.88
0.250 0.88 72.34
0.300 0.88 88.34
0.350 0.88 104.53
0.400 0.88 121.15
0.450 0.88 139.08
0.500 0.88 159.89
critical clearing angle-118.182332
critical clearing time-0.400000
27
PROGRAM:
% Formation of Jacobian
matrix clc
clear all
nb=3;
Y=[65-45j -40+20i -25+25i; -
40+20i 60-60i -20+40i; -
25+25i -20+40i 45-65i];
V = [1.0 0;1.0 0.0 ;1.0 0.0 ];
J1 = zeros(nb-1,nb-1) ;
J2 = zeros(nb-1,nb-1) ;
J3 = zeros(nb-1,nb-1) ;
J4 = zeros(nb-1,nb-1) ;
for p = 2:nb
Vp = V(p,1);
delta_p = V(p,2) * pi/180;
Ypp = abs(Y(p,p));
theta_pp = angle(Y(p,p));
V1 = V(1,1);
delta_1 = V(1,2) * pi/180;
Yp1 = abs( Y(p,1) );
theta_p1 = angle( Y(p,1));
J1 (p-1,p-1) = Vp * V1 * Yp1 * sin( theta_p1 - delta_p + delta_1 );
J2 (p-1,p-1) = 2*Vp*Ypp*cos(theta_pp) + V1*Yp1*cos(theta_p1 - delta_p + delta_1);
J3 (p-1,p-1) = Vp*V1*Yp1*cos(theta_p1 - delta_p + delta_1);
J4 (p-1,p-1) = -2*Vp*Ypp*sin(theta_pp) - Vp*Yp1*sin(theta_p1 - delta_p + delta_1);
for q = 2:nb
Vq = V(q,1) ;
delta_q = V(q,2) * pi/180;
if q ~= p
J1(p-1,q-1) = temp1 ;
J1(p-1,p-1) = J1(p-1,p-1) - temp1 ;
J2(p-1,q-1) = temp2 ;
J2(p-1,p-1) = J2(p-1,p-1) + temp2 ; cont…
28
Exp:10 Date: / /
Aim: A Three-Bus system is given. Form a Jacobian matrix for the system in polar coordinates.
PROCEDURE:
cont…
J3(p-1,q-1) = temp3 ;
J3(p-1,p-1) = J3(p-1,p-1) - temp3 ;
J4(p-1,q-1) = temp4 ;
J4(p-1,p-1) = J4(p-1,p-1) + temp4 ;
end
end
end
EXPECTED RESULT
J=
29
PROGRAM:
clc
clear all
% enter Y-bus of the system
Y=[3-12i -2+8i -1+4i 0
-2+8i 3.66-14.664i -0.666+2.664i -1+4i
-1+4i -0.666+2.664i 3.66-14.664i -2+8i
0 -1+4i -2+8i 3-12i];
%enter no. of buses, slack bus no, no.of pq buses, no of pv buses
nbus=4;
sbno=1;
npq=2;
npv=1;
% assume bus no 1 as slack bus, next npq buses as pq buses and the
remaining as pv buses
%enter slack bus voltage
v(1)=1.06+0i;
%assume voltages at all other buses as 1+j0
v(2)=1;v(3)=1;v(4)=1;
%enter p & q at all pq buses P(2)=-
0.5;P(3)=-0.4;Q(2)=-0.2;Q(3)=-0.3;
%enter p ,vsp and q limits at pv buses
P(4)=0.3;
vsp(4)=1.04;Qmin(4)=0.1;Qmax(4)=1.0;
%enter accuracy of convergence
acc=0.001;
for it=1:5
%to find voltages at pq buses
for p=2:npq+1,
v1(p)=v(p); pq=(P(p)-
Q(p)*i)/conj(v(p)); ypq=0;
for q=1:nbus
if(p==q) continue;
end
ypq=ypq+Y(p,q)*v(q)
;
end v(p)=(pq-
ypq)/Y(p,p);
end
%to find voltages at pv buses
for p=npq+2:nbus,
v1(p)=v(p);
s=0;
for q=1:nbus,
if(p~=q)
s=s+Y(p,q)*v(q);
else
vp=v(q);
29
Exp:11 Date: / /
GAUSS-SEIDEL METHOD
AIM: To perform load flow analysis using Gauss- Seidel method (only pq bus)
PROCEDURE:
30
ang=angle(v(q));
v(q)=complex(vsp(q)*cos(ang),vsp(q)*sin(ang));
s=s+Y(p,q)*v(q);
end
end
Qc(p)=-1*imag(conj(v(p))*s);
if(Qc(p)>=Qmin(p)& Qc(p)<=Qmax(p))
pq=(P(p)-Qc(p)*i)/conj(v(p));
ypq=0;
for q=1:nbus
if(p==q) continue;
end
ypq=ypq+Y(p,q)*v(q);
end
v(p)=(pq-ypq)/Y(p,p);
ang=angle(v(p));
v(p)=complex(vsp(p)*cos(ang),vsp(p)*sin(ang));
else
if(Qc(p)<Qmin(p))
Q(p)=Qmin(p);
else
Q(p)=Qmax(p);
end
pq=(P(p)-Q(p)*i)/conj(vp);
ypq=0;
for q=1:nbus
if(p==q) continue;
end
ypq=ypq+Y(p,q)*v(q);
end
v(p)=(pq-ypq)/Y(p,p);
end
end
%to find the votages at all buses and Q at pv busses
fprintf('\nThe votages at all buses and Q at pv busses after
iteration no %d',it);
for p=1:npq+1
fprintf('\nV(%d)=%.4f
at%.2fdeg',p,abs(v(p)),angle(v(p))*180/pi);
end
for p=npq+2:nbus
fprintf('\nV(%d)=%.4f at%.2fdeg
Q(%d)=%+.3f\n',p,abs(v(p)),angle(v(p))*180/pi,p,Qc(p));
end
%to check for convergence
for p=2:nbus
diff(p)=abs(v(p)-v1(p));
end
err=max(diff);
if(err<=acc)
31
break;
end
end
EXPECTED RESULT:
32
Case study:
256.6 + j 110.2
G1
(1) (2)
0.02 + j 0.04
1.05<0 0.98183<-3.5
(3)
1.00125<-2.8624
138.6 + j 45.2
Program:
clc;
clear;
linedata = [1 20.02 0.04 0
1 30.01 0.03 0
2 30.0125 0.025 0];
fr=linedata(:,1);
to=linedata(:,2);
R=linedata(:,3);
X=linedata(:,4);
B_half=linedata(:,5);
nb=max(max(fr),max(to));
nbr=length(R);
bus_data = [1 1.05 0
2 0.98183 -3.5
3 1.00125 -2.8624];
bus_no=bus_data(:,1);
volt_mag=bus_data(:,2);
angle_d=bus_data(:,3);
33
Exp: 12 Date: / /
AIM: Determination of bus currents, bus power and line flow for a
specified system voltage (Bus) Profile
PROCEDURE:
34
2017-2018
Sfr(k)=Vbus(fr(k))*Ifr(k)';
Sto(k)=Vbus(to(k))*Ito(k)';
end
%line losses
for k=1:nbr
SL(k)=Sfr(k)+Sto(k);
end
%bus power
Sbus=zeros(nb,1);
for n=1:nb
for k=1:nbr
if fr(k)==n
Sbus(n)=Sbus(n)+Sfr(k);
elseif to(k)==n
Sbus(n)=Sbus(n)+Sto(k);
end
end
end
%Bus current
%P+jQ=V*I'
Ibus=(Sbus./Vbus)';
fprintf(' OUTPUT DATA \n');
fprintf('------------------------------\n');
fprintf(' Line Currents\n');
fprintf('------------------------------\n');
for k=1:nbr
fprintf(' I%d%d= %4.3f (+) %4.3f \n',fr(k),to(k),real(Ifr(k)),imag(Ifr(k)));
fprintf(' I%d%d= %4.3f (+) %4.3f \n', to(k),fr(k),real(Ito(k)),imag(Ito(k)));
end
fprintf('------------------------------\n');
35
2017-2018
EXPECTED RESULT:
OUTPUT DATA
------------------------------
Line Currents
------------------------------
I12= 1.899 (+) -0.801
I21= -1.899 (+) 0.801
I13= 2.000 (+) -1.000
I31= -2.000 (+) 1.000
I23= -0.638 (+) 0.481
I32= 0.638 (+) -0.481
------------------------------
Line Flows
------------------------------
S12= 1.994 (+) 0.841
S21= -1.909 (+) -0.671
S13= 2.100 (+) 1.050
S31= -2.050 (+) -0.900
S23= -0.654 (+) -0.433
S32= 0.662 (+) 0.449
------------------------------
Line Losses
------------------------------
SL12= 0.085 (+) 0.170
SL13= 0.050 (+) 0.150
SL23= 0.008 (+) 0.016
------------------------------
Bus Power
------------------------------
P1= 4.094 (+) 1.891
P2= -2.563 (+) -1.104
P3= -1.388 (+) -0.451
Bus Current
------------------------------
I1= 3.899 (+) -1.801
I2= -2.537 (+) 1.282
I3= -1.362 (+) 0.519
------------------------------
36