Matlab Program

November 18, 2018 | Author: puneethkumarr | Category: Electromagnetism, Electrical Engineering, Quantity, Electricity, Electric Power
Share Embed Donate


Short Description

Download Matlab Program...

Description

1. To find ABCD constants of equivalent PI transmission line and hence

efficiency and regulation ALGORITHM: 1. Read length, impedance/km(zkm), admittance/km of transmission line(ykm) 2. Enter choice 1-for short line 2-for medium line 3-for long line 3. If choice=1 Read length Set B = Z A = D = 1 C = 0 If choice=2 Read length A=D=1 + yz/2 B = Z C = y (1 + yz/4) If choice=3 Read length Zeq zc = z/y  = z*y*length A = D = Cosh () Yeq Yeq B = Zc Sinh () C = 1/Zc Sinh () Find generalized equivalent circuit elements of  network zeq = z*length*sinh ()/  yeq = y*length/2*tanh (/2)/ (/2) Display Zeq & Yeq 4. Display A, B, C, & D constants 5. Read choice 1 – To read V r, I r and compute V s , I s 2 – To read V s, I s and compute V r, I r 6. If choice = 1 Find V s = A V r + B I r I s = C V r + D I r where V r & I r are in per ph ase Display V s & I s. if choice = 2 Find V r = D Vs – B Is I r = -C Vs+ A Is where Vs & Is are in per phase Display V r & I r. 7. Find (i) VS SV & Is SI (ii) Sending end Power factor Pf-send = cos (SV -SI) (iii) Sending end Power, PS = 3 VS x  I s x Pf-send 8. Find (i) V r rv & I r rI (ii) Receiving end power factor Pf-rec = cos (rV -rI) (iii) Receiving end power, Pr=3 V r x I r x Pf-rec 9. Find efficiency,  = Pr x 100 Ps 10.

Find voltage regulation VR = Vs

-

V r

X 100 V r 11. 12.

Display (i) efficiency,  (ii) Voltage regulation, VR Stop

PROGRAM: % ABCD of eqt. PI Network zkm = 0.2+0.408i ; ykm= 0+3.14e-6i; k1=input ('\n Enter 1-for short line 2-for medium line 3-for long line switch k1 case 1, length = input ('\n Enter length of short line '); Z=zkm*length; Y=ykm*length; A=1; B=Z; C=0; D=1; case 2, length = input ('\n Enter length of medium line '); Z=zkm*length; Y=ykm*length; A=1+Y*Z/2; B=Z; C=Y*(1+Y*Z/4); D=A; case 3, length = input ('\n Enter length of long line '); zc=sqrt(zkm/ykm); gam=sqrt(zkm*ykm)*length; A=cosh (gam); D=A; B=zc*sinh(gam); C=1/zc*sinh(gam); fprintf ('\n The equivalent PI circuit constants :'); zeq = zkm*length*sinh (gam)/gam; yeq = ykm*length/2*tanh (gam/2) / (gam/2); fprintf ('\n Zeq = %15.4f %+15.4fi',real(zeq),imag(zeq)); fprintf ('\n Yeq/2= %15.4f %+15.4fi',real(yeq),imag(yeq)); otherwise disp('wrong choice of tr.line'); end fprintf('\nA,B,C and D constants : \n'); fprintf('----------------------------------------'); fprintf('\nA = %15.4f %+15.4fi',real(A),imag(A)); fprintf('\nB = %15.4f %+15.4fi',real(B),imag(B)); fprintf('\nC = %15.4f %+15.4fi',real(C),imag(C)); fprintf('\nD = %15.4f %+15.4fi',real(D),imag(D)); fprintf('\n The product AD-BC=%f',A*D-B*C); k2=input('\n Enter 1 - To read Vr, Ir and compute Vs , Is \n 2 To read Vs, Is and compute Vr, Ir '); switch k2, case 1, vr=input('enter Vr/line '); ir=input('enter Ir/phase '); vr=vr*1e3/sqrt(3); vs = (A*vr+B*ir)/1e3; is = C*vr+D*ir; fprintf('\nSending end Voltage/ph=%f %+fi KV',real(vs),imag(vs)); fprintf('\nSending end Current/ph=%f %+fi AMP',real(is),imag(is)); vs=vs*1e3; case 2, vs=input('enter Vs/line '); is=input('enter Is/phase '); vs=vs*1e3/sqrt(3.0); vr=(D*vs-B*is)/1e3; ir= -C*vs+A*is; fprintf('\nReceiving end Voltage/ph=%f %+fi KV',real(vr),imag(vr));

');

fprintf('\nReceiving 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 Receiving end power=%.2f KVA',rec_pow); fprintf('\n Sending end power=%.2f KVA',send_pow); fprintf('\n Efficiency=%.2f %%',eff); fprintf('\n Voltage Regulation=%.2f%%',reg); 2. To find ABCD constants of equivalent T transmission line and hence efficiency and regulation ALGORITHM: 1. Read length, impedance/km, admittance/km of transmission line 2. Enter choice 1-for short line 2-for medium line 3-for long line 3. If choice=1 Read length Set B = Z Zeq A = D = 1 C = 0 If choice=2 Read length Set A=D=1 + YZ/2 B = Z* (1 + YZ/4) C =YZ If choice=3 Read length zc = z/y  = (z*y)*length A = D = Cosh () B = zc Sinh () C = 1/zc Sinh () zeq=z*length/2*tanh(/2)/( /2); yeq=y*length*sinh()/; Display Zeq & Yeq 4. Display A, B, 5. Read choice 1 2 – To read V s, I s 6. If choice = 1 Find V

Zeq Yeq

C, & D constants – To read V r, I r and compute V s , I s and compute V r, I r s = A V r + B I r I s = C V r + D I r

where V r & I r are in per p

hase Display V s & I s. if choice = 2

7. 8.

Find V r = D Vs – B Is I r = -C Vs+ A Is where Vs & Is are in per phase Display V r & I r. Find (i) VS SV & Is SI (ii) Sending end Power factor Pf-send = Cos (SV -SI) (iii) Sending end Power, PS = 3 VS x  I s x Pf-send Find (i) V r rv & I r rI (ii) Receiving end power factor Pf-rec = Cos (rV -rI)

9. 10.

(iii) Receiving end power, Pr=3 V r x I r Find efficiency,  = Pr x 100 Ps Find voltage regulation VR = Vs - V r

x Pf-rec

X 100 V r 11. 12.

Display (i) efficiency,  (ii) Voltage regulation, VR STOP

PROGRAM: %ABCD of eqt. T Network zkm =0.2+0.408i; ykm=0+3.14e-6i; k1=input('\n Enter 1-for short line 2-for medium line 3-for long line switch k1 case 1, length=input('\n Enter length of short line '); Z=zkm*length; Y=ykm*length; A=1;B=Z;C=0;D=1; case 2, length=input('\n Enter length of medium line '); Z=zkm*length; Y=ykm*length; A=1+Y*Z/2; B=Z; C=Y*(1+Y*Z/4); D=A; case 3, length=input('\n Enter length of long line '); zc=sqrt(zkm/ykm); gam=sqrt(zkm*ykm)*length; A=cosh(gam); D=A; B=zc*sinh(gam); C=1/zc*sinh(gam); otherwise disp('wrong choice of tr.line'); end fprintf('\nA,B,C and D constants : \n'); fprintf('----------------------------------------------------'); fprintf('\nA = %15.4f %+15.4fi',real(A),imag(A)); fprintf('\nB = %15.4f %+15.4fi',real(B),imag(B)); fprintf('\nC = %15.4f %+15.4fi',real(C),imag(C)); fprintf('\nD = %15.4f %+15.4fi',real(D),imag(D)); k2=input('\n Enter 1 - To read Vr, Ir and compute Vs , Is \n 2 To read Vs, Is and compute Vr, Ir '); switch k2, 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('\nSending end Voltage/ph=%f %+fi KV',real(vs),imag(vs)); fprintf('\nSending 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('\nReceiving end Voltage/ph=%f %+fi KV',real(vr),imag(vr)); fprintf('\nReceiving end Current/ph=%f %+fi AMP',real(ir),imag(ir)); vr=vr*1e3; 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 Receiving end power=%.2f KVA',rec_pow); fprintf('\n Sending end power=%.2f KVA',send_pow); fprintf('\n Efficiency=%.2f %%',eff); fprintf('\n Voltage Regulation=%.2f%%\n',reg); 3. Power Angle Characteristics of Cylindrical Rotor Generator ALGORITHM: 1. Read x, V and Ia 2. E = V + j x Ia Pm =  E   V / Xd 3. Plot power angle characteristics from delta 0 to pi Indicate Pmax and corresponding delta E - V 4. Regulation R = ---------x 100 V Display R 4. Stop PROGRAM: %power angle characteristics cylindrical rotor syn.m/c % enter the values of x,v,Ia; x=0.3; v=1.0; ia=0.5000-0.375i; e=v+x*ia*i; pm=abs(e)*abs(v)/x; del=0:0.1:pi; plot(del,pm*sin(del),'r'); title('power angle characteristics cylindrical rotor syn.m/c'); xlabel('Delta'); ylabel('power ,p'); legend('pm*sin(delta)'); del=0:0.01:pi/2; line(del,pm); y=0:0.01: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); 4. Power Angle characteristics of salient rotor generator ALGORITHM: 1. Read Xd, Xq, Xd1, V, P & Pf 2. Ө = Cos-1(pf)  I  = P / (V x pf) Ia =  I  cosӨ - j I  SinӨ delta = tan((XE)  Ia  CosӨ ) / (IV) + Xq  Ia  SinӨ))  E  = V Cos(delta) + Xd /  Ia  Sin (delta + Ө) P = E V / Xd

Pr =  V 2 (Xd – Xq) / (2 x d x q) Pe = P Sm(delta) + Pr Sin ( 2 delta) 3. Plot P, Pr, Pe from delta = 0 to Pi Find max Pe and the corresponding delta and indicate the same E - V 4. Regulation R = --------------- x 100 V Display  E  , maxPe, delta ,Reluctance power (Pr) & R 5. Stop PROGRAM: %power angle characteristics salient pole rotor syn.m/c % enter the values of xd,xq,xdd,v,Ia; xd=1.0 ; xq=0.6; v=1.0; ia=0.5000-0.375i; 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), 'r',del,pr*sin(2*del),'m',del,p*sin(del)+pr*sin(2*del),'b'); title('power angle characteristics salient pole syn.m/c'); xlabel('Delta'); ylabel('power ,p'); legend('p*sin(delta)','pr*sin(2delta)','p*sin(delta)+pr*sin(2delta)'); [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 voltage regulation=%f%%',reg); fprintf('\n Reluctance power= %f p.u\n',pr); 5. Swing curve under sustained fault ALGORITHM: 1. Read Input power (P s), voltages (e & v), M, External reactance (xe), line reactance (xl) 2. Pre fault reactance,x1=xe+xL/2 3. Read choice 1-for fault at the beginning 2-for fault at the middle if choice=1 x2=infinity if choice=2 x2= (xe*xL+xe*xL/2+xl*xL/2)/(xL/2); 4. Set dt=0.001 r r=180/ (required to convert deg into radius etc) f=(dt)2 / M Iteration Count, it=1 Time, t(1)=0 =0 5. Find Pm1 = e1*e2/X1 0 = sin-1(Ps/Pm1) Pm2 = Pm=e1*e2/X2 Pe = Pm Sin(0)

Pa = (Ps-Pe)/2 Repeat step no. i to step no. vi from time=0sec to 1 sec in steps of 0.0

6. 5 sec I. Find ft = f*Pa/rr II.  = +ft III. Display time (t), Pmax (Pm),  in degrees. IV. Increment iteration count it=it + 1 V. Find t(it)=t(it-1) + dt VI. (it) =  (it-1)+  VII. Set Pm=Pm2 VIII. Find Pe=Pm Sin IX. Pa=Ps-Pe 7. Plot swing curve 8. Find critical clearing angle c=cos-1(ps(m-o)+pm3*cos(m)-pm2*cos(o)) / (pm3-pm2) Where pm3=e*v/x3, x3=xe+x1, m=pi-o. 9. Find the critical clearing time(Tc), corresponding to c and dislay Tc 10. Stop PROGRAM: %swing curve for sustained fault and critical clearing angle & time. %ps=mech.power input xe=xg+xt, x1=reactance before fault x2=reactance after %fault clc; clear all; % ps = 0.9; e1 = 1.1; v = 1.0; m = 0.00028; x1 = 0.45; x2 = 1.25; x3 = 0.55; data = input( ‘ps = , e1= , v= , m= , x1= , x2= , x3= in matrix form’); ps = data(1); e1 = data(2); v = data(3); m = data(4); x1 = data(5); x2 = data(6); x3= data(7); rr = 180/pi; dt = 0.05; rr=180/pi; f=dt^2/m; it=1; t(it)=0; deld=0; pm1=e1*v/x1; del(it)=asin(ps/pm1); pm2=e1*v/x2; pm=pm2; pe=pm*sin(del(it)); pa=(ps-pe)/2; fprintf( \n SUSTAINED FAULT ); fprintf( \n---------------------------- ); fprintf( \n TIME PMAX DELTA ); fprintf( \n---------------------------- ); t1=0; while(t(it)
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF