Você está na página 1de 5

-------Exp 10 -----Multimachine infinite bus system---HS P 516-------Ex:11.

7-------

clear all;
clc;
format long
%step1 initialisation wiyh load flow &machince data
f=50;
tstep=0.01;
h=[12 9];
pgnetterm=[3.25 2.10];
qgnetterm=[0.6986 0.3110];
xg=[0.067 0.10];
%use of ; is to transpose without taking the conjugate of each element
v0=[1.0193+j*0.14753 1.012+j*0.12713];
%m is no of generators other than slack bus
m=2;
%step 2
v0conj=conj(v0);
ig0=conj((pgnetterm+j*qgnetterm)/v0);
edash=v0+j*(xg*ig0);
pg0=real(edash0*conj(ig0));
x1_r=angle(edash0);
%initialisation of state vector
pg_r=pg0;
%pg_rplus1=pg0;
x2_r=[0 0];
x1dot_r=[0 0];
x2dot_r=[0 0];
x1dotrplus1=[0 0];
x2dotrplus1=[0 0];
%step 3
ybusdf=[5.7986-j*35.6301 0 -0.0681+j*5.1661
0 -j*11.236 0
-0.0681+j*5.1661 0 0.1362-j*6.2737];
ybuspf=[1.3932-j*13.8731 -0.2214+j*7.6289 -0.0901+j*6.0975
-0.2214+j*7.6289 0.5+j*7.7898 0
-0.0901+j*6.0975 0 0.1591-j*6.1168];
%step 4
%set values for initial time t(occurance of %fault)and
%tc is time of fault clearance
t=0;
tc=0.08;
tfinal=1.0;
r=1;
edash_r=edash0;
edash_rplus1=edash0;
while t<tfinal
%step5 compute generator powers using appropriate ybus
%the ybus choosen in the following step is set accordind to the current
%time
if t<=tc
ybus=ybuspf;
end
i=ybus(2:m+1,:)*[1 edash_r];
pg_r=real(edash_r*conj(i));
%step6 compute x1dot_r and x2dot_r
x1dot_r=x2_r;
for k=1:m
x2dot_r(k,1)=(p1*f/h(k))*(pg0(k)-pg_r(k));
end
%step7 compute first state estimates for t=t(r+1)
x1_rplus1=x1_r+x1dot_r*tstep;
x2_rplus1=x2_r+x2dot_r*tstep;
%step8 compute first state estimates
edash_rplus1=abs(edash0)*(cos(x1_rplus1)+j*sin(x1_rplus1));
%step9 compute pg for t=t(r+1)
i=ybus(2:m)*[1 edash_rplus1];
pg_rplus1=real(edash_rplus1.conj(i));
%step10 compute state derivatives at t=t(r+1)
x1dot_rplus=[0 0];
x2dot_rplus=[0 0];
for k=1:m
x1dot_rplus1(k,1)=x2_rplus1(k,1);
x2dot_rplus1(k,1)=p1*f/h(k)*(pg0(k)-pg_rplus1(k));
end
%step11 compute average values of state derivaties
x1dotav_r=(x1dot_r+x1dot_rplus1)/2.0;
x2dotav_r=(x2dot_r+x12dot_rplus1)/2.0;
%step 12 compute final estimate for edash at t=t(r+1)
x1_rplus1=x1_r+x1dotav_r*tstep;
x2_rplus1=x2_r+x2dotav_r*tstep;
%step 13 compute final estimate for edash at t=t(r+1)
edash_rplus1=abs(edash0)*(cos(x1_rplus1)+j*sin(x1_rplus1));
%step14 print state vector
x2_r=x2_rplus1;
x1_r=x1_rplus1;
edash_r=edash_rplus1;
%step15
time(r)=t;
for k=1:m
ang(r,k)=(x1_r(k)*180)/pi;
end
t=t+tstep;
r=r+1;
end
plot(time,ang)

Você também pode gostar