From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 3793/CH9/EX9.1/exp_9_1.sce | 33 ++++++++++++++++++++ 3793/CH9/EX9.2/exp_9_2.sce | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 3793/CH9/EX9.3/exp_9_3.sce | 46 ++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 3793/CH9/EX9.1/exp_9_1.sce create mode 100644 3793/CH9/EX9.2/exp_9_2.sce create mode 100644 3793/CH9/EX9.3/exp_9_3.sce (limited to '3793/CH9') diff --git a/3793/CH9/EX9.1/exp_9_1.sce b/3793/CH9/EX9.1/exp_9_1.sce new file mode 100644 index 000000000..78bfc7043 --- /dev/null +++ b/3793/CH9/EX9.1/exp_9_1.sce @@ -0,0 +1,33 @@ +clear; +clc; +S=100; +p=50; +pf=.95; +v=11; +Z=complex(0,(.15*.5)/(.15+.5)); +disp(Z); +V=1; +If=V/Z; + +mprintf("Subtransient fault currnt is %.4f pu\n",imag(If)); +Ig=If*(.15/(.15+.5)); +Im=If*(.5/(.15+.5)); +mprintf("Subtransient fault currnt in motor is %.4f pu\n",imag(Im)); +mprintf("Subtransient fault currnt in generator is %.4f pu\n",imag(Ig)); +Ibm=(S)/(sqrt(3)*v); + +function [A] = p2z(R,Theta) + if argn(2) <> 2 then + error("incorrect number of arguments."); + end + if ~and(size(R) == size(Theta)) then + error("arguments must be of the same dimension."); + end + A = R.*exp(%i*%pi*Theta/180.); +endfunction +Ipm=p2z((p)/(sqrt(3)*v*pf*Ibm),-(acosd(pf))); +disp(Ipm); +Igg=complex(0,-2)+Ipm; +Imm=Im-Ipm; +mprintf("Subtransient fault currnt in generator including pre fault is %f%f pu\n",real(Igg),imag(Igg)); +mprintf("Subtransient fault currnt in motor including pre fault is %f%f pu\n",real(Imm),imag(Imm)); diff --git a/3793/CH9/EX9.2/exp_9_2.sce b/3793/CH9/EX9.2/exp_9_2.sce new file mode 100644 index 000000000..fd8852cb7 --- /dev/null +++ b/3793/CH9/EX9.2/exp_9_2.sce @@ -0,0 +1,76 @@ +clear; +clc; +function [Zbus]=zeebus(nelemnt,ind,node); + if ind==1; + Zbus=input('Partial matrix Zbus'); + ind=0; + else + end + if ind==0; + for l=1:nelemnt; + p=input('bus number p'); + q=input('bus number q'); + zb=input('impedence'); + typee=input('type of bus'); + if typee==1; + for k=1:q; + if k==q; + Zbus(k,k)=zb; + else + Zbus(k,q)=0; + end + end + end + if typee==2; + for k=1:q; + if k==q; + Zbus(q,q)=zb+Zbus(p,p); + else + if k==p; + Zbus(p,q)=Zbus(p,p); + Zbus(q,p)=Zbus(p,q); + else + Zbus(k,q)=0; + Zbus(q,k)=0; + end + end + end + end + if typee==3; + y=1/(zb+Zbus(p,p)-2*Zbus(p,q)+Zbus(q,q)); + for k=1:node; + X(k,1)=Zbus(k,p)-Zbus(k,q); + Xt(1,k)=(k:1); + end + Zbus=Zbus-(-y)*X*X'; + end + if typee==4; + y=1/(zb+Zbus(q,q)); + for k=1:node; + X(k,1)=-Zbus(k,q); + Xt(1,k)=(k:1); + end + Zbus=Zbus-(-y)*X*X'; + end + end + else + + + end + +endfunction +nelemnt=3; +ind=0; +node=2; +[Zbus]=zeebus(nelemnt,ind,node); +mprintf("Zbus = \n"); +disp(imag(Zbus)); +V=1.02; +X21=complex(0,.31); +If=V/Zbus(1,1); +V1=(1-(Zbus(1,1)/Zbus(1,1)))*V; +V2=(1-(Zbus(2,1)/Zbus(1,1)))*V; +I21=(V2-V1)/X21; +mprintf("Fault current is %.3f j pu\n",imag(If)); +mprintf("Transmission current is %.3f j pu\n",imag(I21)); + diff --git a/3793/CH9/EX9.3/exp_9_3.sce b/3793/CH9/EX9.3/exp_9_3.sce new file mode 100644 index 000000000..e1157047f --- /dev/null +++ b/3793/CH9/EX9.3/exp_9_3.sce @@ -0,0 +1,46 @@ +clear; +clc; +function fault3faze (Zbus,nfbuses,loc,elemz,col,locs,Zf); + for n=1:nfbuses + p=input('number of bus to be faulted'); + Vf=input('fault bus voltage'); + If=Vf/(Zbus(p,p)+Zf); + mprintf("Bus no. Fault current\n"); + mprintf("%2i\",p); + mprintf(" %15.4f\",real(If)); + mprintf(" %15.4f\n",imag(If)); + for k=1:3 + V(k)=Vf-Zbus(k,p)*If; + mprintf("Bus no. Bus Voltage\n"); + mprintf("%2i\",k); + mprintf(" %15.4f\",real(V(k))); + mprintf(" %15.4f\n",imag(V(k))); + end + kk=1; + for k=1:locs-1 + add=loc(k+1)-loc(k); + for m=1:add + j=col(kk); + I(k,j)=(V(k)-V(j))/elemz(kk); + kk=kk+1; + mprintf("Bus no. Bus No. Current\n"); + mprintf("%2i\",k); + mprintf("......%10i\",j); + mprintf(" %15.4f\",real(I(k,j))); + mprintf(" %15.4f\n",imag(I(k,j))); + end + end + + + + end +endfunction +nfbuses=2; +loc=[1 3 4]; +elemz=[.2 .3 .25]*%i; +col=[2 3 3]; +locs=3; +Zf=%i*.2; +Zbus=[.0776 .0448 .0597;.0448 .1104 .0806;.0597 .0806 .2075]*%i; + +fault3faze (Zbus,nfbuses,loc,elemz,col,locs,Zf); -- cgit