Sunteți pe pagina 1din 38

SINGLE PHASE TWO WIRE SYSTEM

clc; clear all; D=input('Enter the Distance'); d=input('Enter the Diameter'); R=d/2; Rm=0.7788*R; L=4e-4*log(D/Rm); c=(pi*(8.854e-9))/log(D/R); Xl=2*pi*50*L; Xc=1/(2*pi*50*c); fprintf('\t Inductive reactance is=%d Ohm/km \n',Xl); fprintf('\t Capacitive reactance is=%d Ohm/km \n',Xc);

OUTPUT
Enter the Distance 2 Enter the Diameter 5.789e-2 Inductive reactance is=5.636653e-001 Ohm/km Capacitive reactance is=4.846921e+005 Ohm/km

SYMMETRICAL AND UNSYMMTERICAL SYSTEM


clc; clear all; d=input('Enter the diameter'); R=d/2; Rm=0.7788*R; c=input('Enter case number'); if c==1 D=input('Enter distance'); else Dab=input('Enter distance between a,b'); Dbc=input('Enter distance between b,c'); Dca=input('Enter distance between c,a'); D=(Dab*Dbc*Dca)^(1/3); end L=2e-4*log(D/Rm); C=2*pi*8.854e-9/log(D/R); XL=2*pi*50*L; XC=1/(2*pi*50*C); fprintf('Inductive Reactance %d\n',XL); fprintf('Capacitive Reactance %d\n',XC);

OUTPUT
Enter the diameter 5.64e-2 Enter case number 1 Enter distance 2 Inductive Reactance 2.834710e-001 Ohm/km Capacitive Reactance 2.438380e+005 Ohm/km Enter case number 2 Enter distance between a,b 2 Enter distance between b,c 4 Enter distance between c,a 3 Inductive Reactance 3.064803e-001 Ohm/km Capacitive Reactance 2.647914e+005 Ohm/km

THREE PHASE HORIZONTAL CONDUCTOR


clc; clear all; d=input('Enter diameter'); R=d/2 Dab=input('Enter distance between a, b'); Dbc=input('Enter distance between b, c'); Dca=input('Enter distance between c, a'); Ds=input('Enter GMR value'); Dm=(Dab*Dbc*Dca)^(1/3); L=0.2*log(Dm/Ds) C=0.056/log(Dm/R) XL=2*pi*50*L XC=1/(2*pi*50*C) fprintf('Inductive reactance% d Ohm/km', XL); fprintf('capacitive reactance %d Ohm/km', XC);

OUTPUT
Enter diameter. 037 R= 0.0185 Enter distance between a, b 15 Enter distance between b, c 15 Enter distance between c, a 30 Enter GMR value .015 L= 1.4278 C= 0.0081 Inductive reactance 4.485443e+002 Ohm/km capacitive reactance 3.938564e-001 Ohm/km

THREE PHASE BUNDLED CONDUCTOR


clc; clear all; D=input('Enter diameter'); R=D/2 d=input ('Enter bundle space'); Dab=input('enter distance between a, b'); Dbc=input('Enter distance between b, c'); Dca=input('Enter distance between c, a;'); Ds=input('Enter GMR value'); Dm=(Dab*Dbc*Dca)^(1/3); Ds=1.09*(Ds*d^3)^(1/4); L=0.2*log(Dm/Ds); Dsc=1.09*(R*d^3)^(1/4); C=0.056/log(Dm/Dsc); XL=2*pi*50*L; XC=1/(2*pi*50*C); fprintf('Inductive % d H ',L); fprintf('Capacitance% d F', C); fprintf('Inductive reactance % d Ohm/km ', XL); fprintf('Capactive reactance % dOhm/km', XC);

OUTPUT
Enter diameter 0.035 R= 0.0175 Enter bundle space.045 enter distance between a, b14 Enter distance between b, c14 Enter distance between c, a;28 Enter GMR value.01417 Inductive 1.234781e+000 H Capacitance 9.148627e-003 F Inductive reactance 3.879179e+002 Ohm/km Capactive reactance 3.479319e-001 Ohm/km

FORMATION OF Y-BUS ADMITTANCE MATRIX


clear all; clc; n=input('enter the no of buses'); for i=1:n for j=1:n fprintf('enter the impedance value between %d & %dis',i,j); z(i,j)=input('='); y(i,j)=1/z(i,j); end end z y YB(n,n)=0; for i=1:n for j=1:n if i==j for k=1:n YB(i,j)=YB(i,j)+y(i,k); end else YB(i,j)=-y(i,j); end end end disp('Bus Admittance Matrix is::'); YB

OUTPUT
enter the no of buses 4 enter the impedance value between 1 & 1 is=inf enter the impedance value between 1 & 2 is=.02+.04j enter the impedance value between 1 & 3 is=inf enter the impedance value between 1 & 4 is=.03+.05j enter the impedance value between 2 & 1 is=.02+.04j enter the impedance value between 2 & 2 is=inf enter the impedance value between 2 & 3 is=.01+.005j enter the impedance value between 2 & 4 is=inf enter the impedance value between 3 & 1 is=inf enter the impedance value between 3 & 2 is=.01+.005j enter the impedance value between 3 & 3 is=inf enter the impedance value between 3 & 4 is=.0125+.025j enter the impedance value between 4 & 1 is=.03+.05j enter the impedance value between 4 & 2 is=inf enter the impedance value between 4 & 3 is=.0125+.025j enter the impedance value between 4 & 4 is=inf z= Inf 0.0200 + 0.0400i Inf 0.0300 + 0.0500i y= 0 10.0000 -20.0000i 0 8.8235 -14.7059i 10.0000 -20.0000i 0 80.0000 -40.0000i 0 0 80.0000 -40.0000i 0 0.1995 - 3.9900i 8.8235 -14.7059i 0 16.0000 -32.0000i 0 0.0200 + 0.0400i Inf 0.0100 + 0.0050i Inf Inf 0.0100 + 0.0050i Inf 0.0125 + 0.0250i 0.0300 + 0.0500i Inf 0.0125 + 0.0250i Inf

YB = 18.8235 -34.7059i -10.0000 +20.0000i 0 -8.8235 +14.7059i -10.0000 +20.0000i 90.0000 -60.0000i -80.0000 +40.0000i 0 0 -80.0000 +40.0000i 80.1995 -43.9900i -16.0000 +32.0000i -8.8235 +14.7059i 0 -0.1995 + 3.9900i 24.8235 -46.7059i

TWO AREA SYSTEM


clc; clear all; disp('two area system case'); pr1=input('enter the rated capacity of unit 1'); pd1=input('enter the operating load unit 1'); fr=input('norminal frequency'); r1=input('speed regulation droop unit 1'); pr2=input('enter the rated capacity unit 2'); pd2=input('enter the operating load unit 2') r2=input('speed regulation droop unit 2'); delpd1=input('change in demand on unit 1'); delpd2=input('change in demand on unit 2'); delpd1=delpd1/pr1; delpd2=delpd2/pr2; a12=pr1/pr2; B1=b1/pr1; b2=pd2/fr; B2=b2/pr2; R1=r1/100*Fr/pr1; R1=R1* pr1; R2=r2/100* fr/pr2; R2=R2*pr1; beta1=B1+(1/R1); beta2=B2+(1/R2); delpteil=(beta1*delpd2- beta2*delpd1)/(beta2+a12*beta ); delpteli1=delptiel*pr1; delfstat=[(delpd2+a12*delpd1)/(beta2+a12*beta1)]; f=fr+delfstat; fprintf('\n generator output at station 1 is % d',delptiel); fprintf('\n change in frequency=% d',delfstat); fprintf('\n operating frequency=% d',f);

OUTPUT two area system case enter the rated capacity of unit 1 1500 enter the operating unit load 1 750 normal frequency 50 speed regulation droop unit1 3 enter the rated capacity of unit 2 1500 enter the operating unit load 2 750 speed regulation droop unit1 3 change in demand on unit1 30 change in demand on unit2 0 generator output at station1 is -15 change in frequency=-1.477833e-0.002 operating frequency=4.998522e001

UNIT COMMITMENT
clc; clear all; n=input(Enter the number of units:); for i=1:n for j=1:n n(i,j)=input(Enter the heat rate characteristics value:); end end for i=1:n i pgmin(i)=input(Enter the minimum generating limit:); pgmax(i)=input(Enter the maximum generating limit:); fuelcost(i)=input(Enter the fuel cost:); end pd=input(Enter the load demand:); for i=1:n for j=1:n f(i,j)=h(i,j)*fuelcost(i); end end f for i=1:n prodcost(i)=((F(i,1)*pgmax(i)^2)+(f(I,2)*pgmax(i)+f(i,3)); end prodcost for i=1:n avg prodcost(i)=prodcost(i)/pgmax(i); end avg prodcost sortlist=sort(avg prodcost) for i=1:n for j=1:n if sortlist(i)==avg prodcost(j) k(i)=j; end end end k m=n; for i=1:n maxprodlist(i)=sum(pgmax(k(1:m))); m=m-1; end maxprodlist

z=n; for i=1:n if pd>max prodlist(z) z=z-1; end end disp(The units committed to satisfy the demand are:); k(1:z)

OUTPUT: Enter the num of units: 3 Enter the heat rate char value: 0.006 Enter the heat rate char value: 7 Enter the heat rate char value: 600 Enter the heat rate char value: 0.01 Enter the heat rate char value: 8 Enter the heat rate char value: 400 Enter the heat rate char value: 0.008 Enter the heat rate char value: 6 Enter the heat rate char value: 500 i=1 Enter the minimum generating limit: 100 Enter the maximum generating limit: 400 Enter the fuel cost: 1.1 i=2 Enter the minimum generating limit: 50 Enter the maximum generating limit: 300 Enter the fuel cost: 1.2 i=3 Enter the minimum generating limit: 150 Enter the maximum generating limit: 500 Enter the fuel cost: 1.0 Enter the fuel demand: 800 f= 0.0066 0.0120 0.0080 7.7000 9.6000 6.0000 660.0000 480.0000 500.0000

prodcost= 1.0e+0.03* 4.7960 4.4400 avg prodcost= 11.9900 Sortlist = 11.0000

5.500 14.8000 11.0000 14.80000

11.9900

k= 3 1 2 max prodlist = 1200

900

500

The unit committed to satisfy the demand are ans 3 1

ECONOMIC LOAD DISPATCH


clc; clear all; n= input (Enter the number of units:); pd= input (Enter the load demand:); for i=1:n a(i)= input(Enter the coefficient of Pgi^2:); b(i)= input (Enter the coefficient of Pgi:); c(i)= input(Enter the constant coefficient :); pgmax(i)= input (Enter the maximum generating limit:); pgmin(i)= input (Enter the minimum generating limit:); end x=0; y=0; for i= 1:n x= x+(b(i)/(2*a(i))); y=y+(1/(2*a(i))); end lambda= (pd+x)/y; for i=1:n pg(i)= (lambda-b(i))/(2*a(i)); end pg k(n)=0; for i=1:n if (pg(i)<pg min (i)) k(i)=1; pg(i)= pgmin(i); else if(pg(i)>pgmax(i)) k(i)=1; pg(i)=pg max(i); end end k for j=1:n pd= pd-k(j)* pg(j); end pd x1=0; y1=0; for i=1:n if(1~=k(i)) x1= x1+(b(i)/2*a(i))); y1= y1+(1/(2*a(i))); end end lambda new=(pd+x1)/y1;

for i=1:n if (1~= k(i)) pg(i)= (lambda new-b(i))/(2*a(i)); end end fprinf(The economic dispatch values:); pg

OUTPUT
Enter the number of units: 3 Enter the load demand 1100 i=1 Enter the coefficient of Pgi^2: 0.0085 Enter the coefficient of Pgi= 7.5 Enter the constant coefficient: 700.2 Enter the max generating limit: 600 Enter the min generating limit: 250 i=2 Enter the coefficient of Pgi^2: 0.009 Enter the coefficient of Pgi= 9.4 Enter the constant coefficient: 850 Enter the max generating limit: 300 Enter the min generating limit: 100 i=3 Enter the coefficient of Pgi^2: 0.015 Enter the coefficient of Pgi= 7.5 Enter the constant coefficient: 600 Enter the max generating limit: 750 Enter the min generating limit: 150 Pg = 480.0885 K= 0 Pd = 800 The economic dispatch value: Pg = 510.6383 300.0000 1 0 347.8614 272.0501

289.3617

GAUSS SEIDEL
clear all; clc; n=input('num of buses'); alpha=input('enter the acceleration factor alpha'); for i=1:n for j=1:n fprintf('enter the admittance between %d & %d',i,j); y(i,j)=input('='); end end YB(n,n)=0; for i=1:n for j=1:n if i==j for k=1:n YB(i,j)=YB(i,j)+y(i,k); end else YB(i,j)=-y(i,j); end end end for i=1:n Bus=i a(i)=input('enter the slackbus:0,loadbus=1,gen.bus=-1'); v(i)=input('enter the voltage'); th(i)=input('enter the theta value'); p(i)=input('enter the real power'); q(i)=input('enter the reactive power'); if a(i)==-1 d(i)=v(i); ql(i)=input('enter the lower limit'); qu(i)=input('enter the upper limit'); end end for m=1:5 iter=m for i=1:n v(i)=v(i)*complex(cos(th(i)),sin(th(i))); vl(i)=v(i); end for i=1:n if a(i)==-1 b=0;

c=0; for j=1:i-1 b=b+YB(i,j)*v(j); end for j=1:n c=c+YB(i,j)+v(j); end q(i)=-imag(v(i)*(b+c)); if q(i)<ql(i) q(i)=ql(i); a(i)=1; elseif q(i)>qu(i) q(i)=qu(i); a(i)=1; end fprintf('reactive power value of bus %d is %d',i,q(i)) end end for i=2:n b=0; c=0; for j=1:i-1 b=b+YB(i,j)*v(j); end for j=i+1:n c=c+YB(i,j)*v(j); end v(i)=((complex(p(i),-q(i))/v(i)-b-c))/YB(i,i); if a(i)==-1 v(i)=d(i)*complex(cos(th(i)),sin(th(i))); end v(i)=vl(i)+alpha*(v(i)-vl(i)); th(i)=angle(v(i)); end for i=1:n if a(i)==-1 v(i)=d(i); else v(i)=abs(v(i)); end end v th*180/pi end

OUTPUT:
num of buses 4 enter the acceleration factor alpha 1.6 enter the admittance between 1 & 1= 0 enter the admittance between 1 & 2= 2-8j enter the admittance between 1 & 3= 1-4j enter the admittance between 1 & 4= 0 enter the admittance between 2 & 1= 2-8j enter the admittance between 2 & 2=0 enter the admittance between 2 & 3=0.66-2.664j enter the admittance between 2 & 4=1-4j enter the admittance between 3 & 1=1-4j enter the admittance between 3 & 2=0.66-2.664j enter the admittance between 3 & 3=0 enter the admittance between 3 & 4=2-8j enter the admittance between 4 & 1=0 enter the admittance between 4 & 2=1-4j enter the admittance between 4 & 3=2-8j enter the admittance between 4 & 4=0 Bus = 1 enter the slackbus:0,loadbus=1,gen.bus=-1 0 enter the voltage 1.06 enter the theta value 0 enter the real power 0 enter the reactive power 0 Bus =2 enter the slackbus:0,loadbus=1,gen.bus=-1 1 enter the voltage 1 enter the theta value 0 enter the real power -0.5 enter the reactive power -0.2 Bus =3 enter the slackbus:0,loadbus=1,gen.bus=-1 1 enter the voltage 1 enter the theta value 0 enter the real power -0.4 enter the reactive power -0.3

Bus =4 enter the slackbus:0,loadbus=1,gen.bus=-1 1 enter the voltage 1 enter the theta value 0 enter the real power -0.3 enter the reactive power -0.1 iter = 1 v= 1.0600 1.0201 0.9917 0.9842 theta = 0 -2.5964 -2.7059 -6.3638

NEWTON RAPHSON
clear all; clc; n=input('Enter the number of buses'); for i=1:n for j=1:n y(i,j)=input('Enter the admittance value:'); end end YB (n,n)=0; for i=1:n for j=1:n if i==j for k=1:n YB(i,j)= YB (i,j)+y(i,k); end else YB (i,j)=-y(i,j); end end end mag(1)=1.05; for i=2:n mag(i)=1; end th(1:n)=0; for i=1:n acp(i)=input('enter real power value:'); end for i=1:n acq(i)=input('enter reactive power value:'); end my=abs(YB);an=angle(YB); g=real(YB);b=imag(YB); YB mag th acp acq Pp(n)=0;Qq(n)=0; for i=2:n for j=1:n Pp(i)=Pp(i)+mag(i)*my(i,j)*mag(j)*cos(an(i,j)-th(i)+th(j)); Qq(i)=Qq(i)-mag(i)*my(i,j)*mag(j)*sin(an(i,j)-th(i)+th(j)); end

end Pp Qq for i=2:n for j=2:n if i~=j j1(i,j)=mag(i)*mag(j)*(g(i,j)*sin(th(i)-th(j))-b(i,j)*cos(th(i)-th(j))); j3(i,j)=-mag(i)*mag(j)*(g(i,j)*cos(th(i)-th(j))+b(i,j)*sin(th(i)-th(j))); j2(i,j)=-j3(i,j); j4(i,j)=j1(i,j); else j1(i,j)=-Qq(i)-b(i,j)*(mag(i)^2); j2(i,j)=Pp(i)+g(i,j)*(mag(i)^2); j3(i,j)=Pp(i)-g(i,j)*(mag(i)^2); j4(i,j)=Qq(i)-b(i,j)*(mag(i)^2); end end end ja1(1:n-1,1:n-1)=j1(2:n,2:n); ja2(1:n-1,1:n-1)=j2(2:n,2:n); ja3(1:n-1,1:n-1)=j3(2:n,2:n); ja4(1:n-1,1:n-1)=j4(2:n,2:n); jacob=[ja1 ja2;ja3 ja4] delp(1:n-1)=acp(2:n)-Pp(2:n); delq(1:n-1)=acq(2)-Qq(2); Char=inv(jacob)*[delp delq]'; Chth(2:n)=Char(1:n-1); Chmag(2:n)=Char(n:2*n-2); mag=mag+Chmag; th=th+Chth; fprintf('the voltage values for buses'); mag fprintf('The angle values for buses'); th

OUTPUT
Enter the number of buses 4 Enter the admittance value:0 Enter the admittance value:2-8j Enter the admittance value:1-4j Enter the admittance value:0 Enter the admittance value:2-8j Enter the admittance value:0 Enter the admittance value:0.66-2.664j Enter the admittance value:1-4j Enter the admittance value:1-4j Enter the admittance value:0.66-2.664j Enter the admittance value:0 Enter the admittance value:2-8j Enter the admittance value:0 Enter the admittance value:1-4j Enter the admittance value:2-8j Enter the admittance value:0 enter real power value:0 enter real power value:-0.5 enter real power value:-0.4 enter real power value:-0.3 enter reactive power value:0 enter reactive power value:-0.2 enter reactive power value:-0.3 enter reactive power value:-0.1 YB = 3.0000 -12.0000i -2.0000 + 8.0000i -1.0000 + 4.0000i 0 -2.0000 + 8.0000i 3.6600 -14.6640i -0.6600 + 2.6640i -1.0000 + 4.0000i -1.0000 + 4.0000i -0.6600 + 2.6640i 3.6600 -14.6640i -2.0000 + 8.0000i 0 -1.0000 + 4.0000i -2.0000 + 8.0000i 3.0000 -12.0000i

jacob = 15.0640 -2.6640 -4.0000 -3.7600 0.6600 1.0000 -2.6640 14.8640 -8.0000 0.6600 -3.7100 2.0000 -4.0000 -8.0000 12.0000 1.0000 2.0000 -3.0000 3.5600 -0.6600 -1.0000 14.2640 -2.6640 -4.0000 -0.6600 3.6100 -2.0000 -2.6640 14.4640 -8.0000 -1.0000 -2.0000 3.0000 -4.0000 -8.0000 12.0000

the voltage values for buses mag = 1.0500 1.0245 1.0345 1.0410 The angle values for buses th = 0 -0.0806 -0.1076 -0.1261 th*180/pi ans = 0 -4.6199 -6.1674 -7.2244

FAST DECOUPLED
clear all; clc; n=input('enter the number of buses:'); for i=1:n for j=1:n y(i,j)=input('Enter the admittance value:'); end end YB (n,n)=0; for i=1:n for j=1:n if i==j for k=1:n YB (i,j)= YB (i,j)+y(i,k); end else YB (i,j)= -y(i,j); end end end th(n)=0; for i=1:n Bus=i mag(i)=input('Enter the voltage value:'); acp(i)=input('Enter real power value:'); acq(i)=input('Enter reactive power'); end j=1; for i=1:n if(mag(i)==1) k(j)=i; j=j+1; end end my=abs(YB);an=angle(YB);g=real(YB);b=imag(YB); YB mag th acp acq Chmag(n)=0;Chth(n)=0;Pp(n)=0;Qq(n)=0; for i=1:n for j=1:n Pp(i)=Pp(i)+mag(i)*my(i,j)*mag(j)*cos(an(i,j)-th(i)+th(j));

Qq(i)=Qq(i)-mag(i)*my(i,j)*mag(j)*sin(an(i,j)-th(i)+th(j)); end Pp Qq end for i=2:n for j=2:n if i~=j j1(i,j)=mag(i)*mag(j)*(g(i,j)*sin(th(i)-th(j))-b(i,j)*cos(th(i)-th(j))); j3(i,j)=0; j2(i,j)=0; j4(i,j)=j1(i,j); else j1(i,j)=-Qq(i)-b(i,j)*(mag(i)^2); j2(i,j)=0; j3(i,j)=0; j4(i,j)=Qq(i)-b(i,j)*(mag(i)^2); end end end ja1(1:n-1,1:n-1)=j1(2:n,2:n); ja2(1:n-1,1:n-1)=j2(2:n,2:n); ja3(1:n-1,1:n-1)=j3(2:n,2:n); ja4(1:n-1,1:n-1)=j4(2:n,2:n); jacob=[ja1 ja2;ja3 ja4] bb(1:n-1, 1:n-1)=b(2:n,2:n) for i=2:n j=1; if(i==k(j)) bbb(j,:)=b(i,i); j=j+1; end end bbb delp(2:n)=acp(2:n)-Pp(2:n) delq(2:n)=acq(2:n)-Qq(2:n) for i=2:n x(i)=delp(i)/abs(mag(i)); y(i)=delq(i)/abs(mag(i)); end Chth(2:n)=-inv(bb)*x(2:n)'; for i=2:n j=1; if(i==k(j)) Chmag(i)=-inv(bbb)*y(i)'; end

end mag=mag+Chmag; th=th+Chth; fprintf('the voltage value for buses'); mag fprintf('the angle values for buses'); th

OUTPUT
enter the number of buses:4 Enter the admittance value:0 Enter the admittance value:2-8j Enter the admittance value:1-4j Enter the admittance value:0 Enter the admittance value:2-8j Enter the admittance value:0 Enter the admittance value:0.66-2.664j Enter the admittance value:1-4j Enter the admittance value:1-4j Enter the admittance value:0.66-2.664j Enter the admittance value:0 Enter the admittance value:2-8j Enter the admittance value:0 Enter the admittance value:1-4j Enter the admittance value:2-8j Enter the admittance value:0 Bus = 1 Enter the voltage value:1.06 Enter real power value:0 Enter reactive power0 Bus = 2 Enter the voltage value:1 Enter real power value:-0.5 Enter reactive power-0.2 Bus = 3 Enter the voltage value:1 Enter real power value:-0.4 Enter reactive power-0.3 Bus = 4 Enter the voltage value:1 Enter real power value:-0.3 Enter reactive power-0.1

YB = 3.0000 -12.0000i -2.0000 + 8.0000i -1.0000 + 4.0000i 0 -2.0000 + 8.0000i 3.6600 -14.6640i -0.6600 + 2.6640i -1.0000 + 4.0000i -1.0000 + 4.0000i -0.6600 + 2.6640i 3.6600 -14.6640i -2.0000 + 8.0000i 0 -1.0000 + 4.0000i -2.0000 + 8.0000i 3.0000 -12.0000i jacob = 15.1440 -2.6640 -4.0000 0 0 0 -2.6640 14.9040 -8.0000 0 0 0 -4.0000 -8.0000 12.0000 0 0 0 0 0 0 14.1840 -2.6640 -4.0000 0 0 0 -2.6640 14.4240 -8.0000 0 0 0 -4.0000 -8.0000 12.0000

the voltage value for buses mag = 1.0600 1.0191 1.0000 1.0000

the angle values for buses th = 0 -0.0767 -0.1017 -0.1183

SHORT CIRCUIT FAULT


clc; clear all; g1=[.2j .2j .04j .5j]; g2=g1; t1=[.08j .08j .08j 0]; t2=t1; l1=[.15j .15j .5j]; l2=l1; v=1; sysv=20; bmva=100; a0=(l1(1)*l2(1))/(l1(1)+l2(1)); a1=(l1(3)*l2(3))/(l1(3)+l2(3)); b=3*g1(4)+g1(3); z0=((t1(3)+b+a1+t2(3))*b)/(t1(3)+b+a1+t2(3)+b); z1=((g1(1)+t1(1)+a0+t2(1))*g2(1))/(g1(1)+t1(1)+a0+t2(1)+g2(1)); z2=z1; A=menu('enter the type of fault','symmetrical fault','L-G fault','L-L fault','L-L-G fault'); ib=bmva/(sqrt(3)*sysv); a=1*cosd(120)+1*sind(120)*j; if A==1 ifpu=v/z1; ifa1=ifpu*ib; elseif A==2 ia1=v/(z0+z1+z2); ifpu=3*ia1; ifa1=ifpu*ib; elseif A==3 ia1=v/(z1+z2); ia2=-ia1; ib0=(a*a*ia1)+(a*ia2); ifa1=abs(ib0)*ib; elseif A==4 z=(z0*z2)/(z0+z2); ia1=v/(z+z1); ia2=(-v/z2)+((ia1*z1)/z2); ia0=-(ia1+ia2); ib1=ia0+(a*a*ia1)+(a*ia2); ic1=ia0+(a*ia1)+(a*a*ia2); ifpu=ib1+ic1; ifa1=ifpu*ib; end ifa1=abs(ifa1); fmva=sqrt(3)*sysv*ifa1;

fprintf('fault current %d KA\n',ifa1); fprintf('fault MVA is %d MVA \n',fmva);

OUTPUT
enter the type of fault symmetrical fault fault current 2.106997e+001 KA fault MVA is 7.298851e+002 MVA

L-G fault fault current 7.633716e+000 KA fault MVA is 2.644397e+002 MVA

L-L fault fault current 1.824713e+001 KA fault MVA is 6.320990e+002 MVA

L-L-G fault fault current 4.661251e+000 KA fault MVA is 1.614705e+002 MVA

TRANSIENT STABILITY ANALYSIS OF SMIB


clc; clear all; pm=input('generator output power in pu MW:'); E=input('generator emf in pu v:'); v=input('infinite bus bar voltage in pu V:'); x1=input('reactance before fault in pu x1:'); x2=input('reactance during fault in pu x2:'); x3=input('reactance after fault is cleared in pu x3:'); pe1max=E*v/x1; pe2max=E*v/x2; pe3max=E*v/x3; delta=0:0.01:pi; pe1=pe1max*sin(delta); pe2=pe2max*sin(delta); pe3=pe3max*sin(delta); d0=asin(pm/pe1max); dmax=pi-asin(pm/pe3max); cosdc=(pm*(dmax-d0)+pe3max*cos(dmax)-pe2max*cos(d0))/(pe3max-pe2max); if abs(cosdc)>1 fprintf('No critical clearing could be found\n'); fprintf('system can remain stable during this disturbance \n\n'); return else end dc=acos(cosdc); if dc>dmax fprintf('No critical clearing could be found\n'); fprintf('system can remain stable during this disturbance \n\n'); return else end d0=d0*180/pi; dmax=dmax*180/pi; dc=dc*180/pi; if x2==inf fprintf('For this case tc can be found from analytical formula\n'); H=input('To find tc enter Inertia constant H,(or 0 to skip)H:'); if H~=0 d0r=d0*pi/180; dcr=dc*pi/180; tc=sqrt(2*H*(dcr-d0r)/(pi*60*pm)); else end else

end fprintf('\n Initial power angle=%7.3f\n',d0); fprintf('\n maximum angle swing=%7.3f\n',dmax); fprintf('\n Critical clearing angle=%7.3f\n\n',dc); if x2==inf&H~=0 fprintf('\n Critical clearing time=%7.3fsec \n\n',tc); else end pmx=[0 pi-d0]*180/pi; pmy=[pm pm]; x0=[d0 d0]*180/pi; y0=[0 pm]; xc=[dc dc]*180/pi; yc=[0 pe3max*sin(dmax)]; xm=[dmax dmax]*180/pi; ym=[0 pe3max*sin(dmax)]; x=(d0:0.1:dc); y=pe2max*sin(x*pi/180); y1=pe2max*sin(d0*pi/180); y2=pe2max*sin(d0*pi/180); x=[d0 x dc]; y=[pm y pm]; xx=dc:0.1:dmax; h=pe3max*sin(xx*pi/180); xx=[dc xx dmax]; hh=[pm h pm]; delta=delta*180/pi; h=figure; figure(h); fill(x,y,'m') hold; fill(xx,hh,'c') plot(delta,pe1,'-',delta,pe2,'r-',delta,pe3,'g-',pmx,pmy,'b-',x0,y0,xc,yc,xm,ym),grid Title('Application of equal area criterion to a critically cleared system') xlabel('Power angle,degree'),ylabel('Power,perunit') text(5,1.07*pm,'pm') text(50,1.05*pe1max,['Critical clearing angle=',num2str(dc)]) axis([0 180 0 1.1*pe1max]) hold off;

OUTPUT
(A) generator output power in pu MW: 0.8 generator emf in pu v:1.17 infinite bus bar voltage in pu V:1 reactance before fault in pu x1:0.65 reactance during fault in pu x2:inf reactance after fault is cleared in pu x3:0.65 For this case tc can be found from analytical formula To find tc enter Inertia constant H,(or 0 to skip)H:5 Initial power angle= 26.388 maximum angle swing=153.612 Critical clearing angle= 84.775 Critical clearing time= 0.260sec Current plot held

(B) generator output power in pu MW: 0.8 generator emf in pu v:1.17 infinite bus bar voltage in pu V:1 reactance before fault in pu x1:0.65 reactance during fault in pu x2:1.8 reactance after fault is cleared in pu x3:0.8 Initial power angle= 26.388 maximum angle swing=146.838 Critical clearing angle= 98.834 Current plot held

S-ar putea să vă placă și