Está en la página 1de 5

clc

disp(' Salient pole synchronous motor ')


xd=input(' enter the direct axis reactance');
xq=input('enter the quadrature axis reatance');
vt=input('enter the KV rating of the machine');
p=input(' enter the rated power');
pf=input('enter the power factor');
vt_phase=vt/sqrt(3)
i=p/(1.732*vt*pf)
phi=acos(pf)
phi_d=acos(pf)* 180/pi
sinphi=sin(phi)
tanpsi=((vt_phase*sin(phi)+i*xq)/(vt_phase*cos(phi)))
psi=atan(tanpsi)
psi_d=atan(tanpsi)*180/pi
alpha_d=psi_d-phi_d
alpha=alpha_d*pi/180
id=i*sin(phi)
iq=i*cos(phi)
disp('excitation')
ef=vt_phase*cos(alpha)+id*xd;
ef
disp('realpower')
realpower=(vt_phase*vt_phase)*(xd-xq)/(2*xd*xq);
realpower
pmax=(ef*vt_phase)/xd;
pmax
disp('regulation')
reg=[(ef-vt_phase)/vt_phase]*100;
reg
disp('total power developed')
pe=((pmax*sin(alpha))+(realpower*sin(2*alpha)));
pe
alpha_dplot=[0:10:180];
alpha=alpha_dplot*pi/180;
pe=pmax*sin(alpha)+realpower*sin(2*alpha);
plot(alpha_dplot,pe)

clc
disp('non salient pole')
vt=input('enter kv rating')
Et=input('enter excitation voltage:')
disp('plot the power angle when the system is normal operation')
Xd1=input('enter the direct axis reactance value')
disp('the max power')
pmax1=(abs(vt)*abs(Et))/abs(Xd1)
subplot(3,1,1);
alpha=(0:10:180);
alpha1=alpha*pi/180;
pe=pmax1*sin(alpha1);
plot(alpha1,pe);
disp('plot the power angle when the transmission line 2 is shorted')
Xd2=input('enter the direct axis reactance value')
disp('the max power')
pmax2=(abs(vt)*abs(Et))/abs(Xd2)
subplot(3,1,2);
alpha=(0:10:180);
alpha2=alpha*pi/180;
pe=pmax2*sin(alpha2);
plot(alpha2,pe);
disp('plot the power angle when the transmission line 2 is open')
Xd3=input('enter the direct axis reactance value')
disp('the max power')
pmax3=(abs(vt)*abs(Et))/abs(Xd3)
subplot(3,1,3);
alpha=(0:10:180);
alpha3=alpha*pi/180;
pe=pmax3*sin(alpha3);
plot(alpha3,pe);

clc
disp(' transient stability analysis using point by point ')
t1=1.1;
t2=1.0;
r2=0.8422;
h=4;
x1=0.6067;
g=1;
f=50;
x3=0.72;
pm1=(t1*t2)/x1;
pm2=0;
pm3=(t1*t2)/x3;
v1=pm2/pm1;
v2=pm3/pm1;
sindel0=t2/pm1
del0=asin(t2/pm1)
del0
Del0=(del0*180)/pi
Del0
sendelm=(t2/pm3)
delm=asin(t2/pm3)
delm
Delm=(delm*180)/pi
delc=acos((((delm-del0)*sin(Del0)+r2*cos(Delm))))/r2
delc
Delc=(delc*180)/pi
m=(g*h)/(180*f)
m
pa0=0.5;
w0=0;
alpha=(pa0/m)
delt=[0.05 0.101 0.15 0.20 0.25 0.30];
for i=1:6
delwl(i)=alpha*delt(i);
w1(i)=w0+delwl(i);
del(i)=w1(i)*delt(i);
dell(i)=Del0+del(i);
end
plot(delt,dell);
delwl
w1
del
dell
alpha
delt

clc
disp('symmetrical fault')
zbus=[j*0.1688 j*0.1618 j*0.145; j*0.1618 j*0.1716 j*0.1506; j*0.145 j*0.1506 j*0.164];
z=[j*0.05 j*0.05 j*0.06 j*0.1]
vf=input('enter the fault bus voltage');
zf=input('enter the impedance');
nb=input('enter the no of buse');
k=input('enter the fault of the bus number');
nl=input('enter the number of the lines');
If=vf/(zbus(k,k));
nb=3;
for i=1:nb
v(i)=vf-(If*zbus(i,k));
end
nl=4;
sb=[1 1 2 1];
eb=[2 2 3 3];
for i=1:nl
k1=sb(i);
k2=eb(i);
Il(i)=(v(k1)-v(k2))/z(i);
end
g=[0.25*j 0.2*j];
t=[0.1*j 0.08*j];
ns=2;
for i=1:ns
Ig(i)=(vf-v(i))/(g(i)+t(i));
end
If
v
Il
Ig

clc
disp('gauss seidal')
nb=5;
nl=7;
sb=[1 1 2 2 2 3 4];
eb=[2 3 3 4 5 4 5];
y=[inv(0.02+0.06*j) inv(0.08+0.24*j) inv(0.06+0.18*j) inv(0.06+0.18*j) inv(0.04+0.12*j)
inv(0.01+0.03*j) inv(0.08+0.24*j)];
h=[0.03*j 0.025*j 0.02*j 0.02*j 0.015*j 0.01*j 0.035*j];
ybus=zeros(nb,nb);
for i=1:nl;
k1=sb(i);
k2=eb(i);
ybus(k1,k1)=ybus(k1,k1)+y(i)+h(i);
ybus(k2,k2)=ybus(k2,k2)+y(i)+h(i);
ybus(k1,k2)=-y(i);
ybus(k2,k1)=ybus(k1,k2);
end
ybus
v=[1.06; 1; 1; 1; 1];
grp=[0 0.6 0 0 0];
grcp=[0 0 0 0 0];
irp=[0 0 0.45 0.40 0.6];
ircp=[0 0.1 0.15 0.05 0.1];
Qmin=[0 -1 0 0 0];
Qmax=[0 1.5 0 0 0];
p=grp-irp;
tb=[0 1 2 2 2];
su=diag(0,1);
for a=1:nb
if(tb(a)==1)
for b=1:nb
su=diag(0,1);
su(a)=su(a)+(ybus(a,b)*v(b))
end
q=-imag(conj(v(a))*su(a));
for b=1:nb
vt(a)=(1/ybus(a,a))*(((p(a)-q*j)/(conj(v(a))))-(su(a)-(ybus(a,a)*v(a))));
end
A=(vt(a));
B=angle(vt(a));
v(a)=A+B*j;
else if(tb(a)==2)
for b=1:nb
su=0;
su(a)=su+(ybus(a,b)*v(b));
end
v(a)=(1/ybus(a,a))*(((p(a)-q*j)/(conj(v(a))))-(su(a)-(ybus(a,a)*v(a))));
end
end
v
q
vt

También podría gustarte