diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /2372/CH2 | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '2372/CH2')
-rw-r--r-- | 2372/CH2/EX2.1/ex1.sce | 34 | ||||
-rw-r--r-- | 2372/CH2/EX2.2/ex2.sce | 24 | ||||
-rw-r--r-- | 2372/CH2/EX2.3/ex3.sce | 37 | ||||
-rw-r--r-- | 2372/CH2/EX2.4/ex4.sce | 33 | ||||
-rw-r--r-- | 2372/CH2/EX2.5/ex5.sce | 19 | ||||
-rw-r--r-- | 2372/CH2/EX2.6/ex6.sce | 28 | ||||
-rw-r--r-- | 2372/CH2/EX2.7/ex7.sce | 27 | ||||
-rw-r--r-- | 2372/CH2/EX2.8/ex8.sce | 21 |
8 files changed, 223 insertions, 0 deletions
diff --git a/2372/CH2/EX2.1/ex1.sce b/2372/CH2/EX2.1/ex1.sce new file mode 100644 index 000000000..98bcadee0 --- /dev/null +++ b/2372/CH2/EX2.1/ex1.sce @@ -0,0 +1,34 @@ +clc;
+clear;
+vm=100;thetav=0; //voltage amplitude and phase angle
+z=1.25;gama=60; //impedance magnitude and phase angle
+thetai=thetav-gama; //curent phase angle in degree
+theta=(thetav-thetai)*%pi/180;
+im=vm/z;
+wt=0:0.05:2*%pi;
+v=vm*cos(wt);//instantaneous voltage
+i=im*cos(wt+thetai*%pi/180);//instantaneous current
+mprintf("instantaneous current,i(t)=%d cos(wt+(-%d))\n",im,thetai);
+p=v.*i;//instantaneous power
+mprintf("instantaneous power,p(t)=v(t)*i(t)=%d cos(wt)cos(wt+(%d))",vm*im,thetai);
+V=vm./sqrt(2);I=im/sqrt(2); //rms current and voltage
+P=V*I*cos(theta);//average power
+Q=V*I*sin(theta);//reactive power
+S=P+%i*Q;//complex power
+pr=P*(1+cos(2*(wt+thetav)));
+px=Q*sin(2*(wt+thetav));
+PP=P*ones(1,length(wt));//average power of length w for plot
+xline=zeros(1,length(wt));//generates a 0 vector
+wt=180/%pi*wt;//converting radian to degree
+subplot(2,2,1),plot(wt,v,wt,i,wt,xline);
+title("v(t)=vm cos(wt),i(t)=im cos(wt-60)");
+xlabel("wt,degrees");
+subplot(2,2,2),plot(wt,p,wt,xline);
+title("p(t)=v(t)*i(t)");
+xlabel("wt,degree");
+subplot(2,2,3),plot(wt,pr,wt,PP,wt,xline);
+title("active power,pr(t)");
+xlabel("wt,degree");
+subplot(2,2,4),plot(wt,px,wt,xline);
+title("reactive power,px(t)");
+xlabel("wt,degree");
diff --git a/2372/CH2/EX2.2/ex2.sce b/2372/CH2/EX2.2/ex2.sce new file mode 100644 index 000000000..af08c39eb --- /dev/null +++ b/2372/CH2/EX2.2/ex2.sce @@ -0,0 +1,24 @@ +clc;
+clear;
+v=1200; thetav=0;
+z1=60;
+z2=6+12*%i;
+z3=30-30*%i;
+i1=v/z1;
+i2=v/z2;
+i3=v/z3;
+s1=v*i1';
+s2=v*i2';
+s3=v*i3';
+s=s1+s2+s3;
+mprintf("voltage=%d angle %d\n",v,thetav);
+mprintf("impedance1,Z1=%d+%dj ohms\n",real(z1),imag(z1));
+mprintf("impedance1,Z2=%d+%dj ohms\n",real(z2),imag(z2));
+mprintf("impedance1,Z3=%d+(%d)j ohms\n",real(z3),imag(z3));
+mprintf("current,i1=%d+%dj A\n",real(i1),imag(i1));
+mprintf("current,i2=%d+(%d)j A\n",real(i2),imag(i2));
+mprintf("current,i3=%d+%dj A\n",real(i3),imag(i3));
+mprintf("s1=v i1*=%d W+%dj var \n",real(s1),imag(s1));
+mprintf("s2=v i2*=%d W+%dj var \n",real(s2),imag(s2));
+mprintf("s3=v i3*=%d W+(%d)j var \n",real(s3),imag(s3));
+mprintf("total complex power,s=s1+s2+s3=%d W+%dj var \n",real(s),imag(s));
diff --git a/2372/CH2/EX2.3/ex3.sce b/2372/CH2/EX2.3/ex3.sce new file mode 100644 index 000000000..38b73c0cc --- /dev/null +++ b/2372/CH2/EX2.3/ex3.sce @@ -0,0 +1,37 @@ +clc;
+clear;
+z1=complex(100,0);
+z2=complex(10,20);
+v=200;
+mprintf("voltage,v=%d V\n",v);
+f=60;
+mprintf("frequence,f=%d Hz\n",f);
+i1=v/z1;
+mprintf("current,i1=%d+%dj A\n",real(i1),imag(i1));
+i2=v/z2;
+mprintf("current,i2=%d+(%d)j A\n",real(i2),imag(i2));
+s1=v*i1';
+s2=v*i2';
+s=s1+s2;
+mprintf("total complex power,s=s1+s2=%d W+%dj Var \n",real(s),imag(s));
+i=s'/v';
+mprintf("complex current,i=%d+(%d)j A\n",real(i),imag(i));
+pf=cos(atan(imag(i),real(i)));
+mprintf("power factor,pf=%2.1f lagging\n",pf);
+theta=acos(0.8);
+mprintf("required power factor angle,theta=%4.2f degrees\n",theta*180/%pi);
+p=real(s);
+mprintf("active power,p=%d W\n",p);
+qnew=p*tan(theta);
+qc=imag(s)-qnew;
+mprintf("capacitor reactive power,qc=%d var\n",qc);
+zc=v*v/qc/%i;
+mprintf("capacitive reactance,Zc=%4.2fj ohms\n",imag(zc));
+c=10^6/(2*%pi*f*abs(zc));
+mprintf("capacitance,c=%4.2f uF\n",c);
+snew=p+(qnew*%i);
+mprintf("total power,snew=%d + %dj =%d angle %4.2f\n",real(snew),imag(snew),abs(snew),atan(imag(snew),real(snew))*180/%pi);
+inew=snew'/v';
+mprintf("new current,inew=%2.1f angle -%4.2f\n",abs(inew),atan(imag(snew),real(snew))*180/%pi);
+
+mprintf("note reduction in the supply current from 10A to 7.5A\n");
diff --git a/2372/CH2/EX2.4/ex4.sce b/2372/CH2/EX2.4/ex4.sce new file mode 100644 index 000000000..a70bff9fb --- /dev/null +++ b/2372/CH2/EX2.4/ex4.sce @@ -0,0 +1,33 @@ +clc;
+clear;
+v=1400;//rms voltage
+f=60;//frequency
+kva1=125; pf1=0.28; //inductive load and lagging power factor
+kw2=10; kvar2=-40; //active and reactive power of a capacitive load
+kw3=15;//resistive load
+theta1=acos(pf1);
+s1=complex(125*cos(theta1),125*sin(theta1));
+s2=complex(kw2,kvar2);
+s3=complex(kw3,0);
+s=s1+s2+s3;//total apparent power
+mprintf("total apparent power,s=%d kW+%d kvar=%d angle%4.2f kVA \n",real(s),imag(s),abs(s),atan(imag(s),real(s))*180/%pi);
+i=s'*1000/v';//total current
+mprintf("total current,i=%4.2f angle %4.2f A\n",abs(i),atan(imag(i),real(i))*180/%pi);
+thetai=atan(imag(i),real(i));
+pf=cos(thetai);//lagging power factor
+mprintf("power factor,PF= %2.1f lagging\n",pf);
+p=real(s);//total active power
+q=imag(s);//total reactive power
+pfnew=0.8;//required power factor
+mprintf("required pf,pfnew=%2.1f lagging\n",pfnew);
+thetanew=acos(pfnew);
+qnew=p*tan(thetanew);
+qc=q-qnew;//capacitor kVar required
+mprintf("required capacitor kvar,qc=%d kvar\n",qc)
+xc=v*v/%i/qc/1000;
+c=10^6/(2*%pi*f*abs(xc));
+mprintf("capacitance,c=%4.2f uF\n",c);
+snew=complex(p,qnew);
+inew=snew'*1000/v';
+mprintf("new current, inew=%4.2f angle %4.2f A\n",abs(inew),atan(imag(inew),real(inew))*180/%pi);
+mprintf("note the reduction in supply current from 71.43 A to 53.57 A\n");
diff --git a/2372/CH2/EX2.5/ex5.sce b/2372/CH2/EX2.5/ex5.sce new file mode 100644 index 000000000..f1255f9a9 --- /dev/null +++ b/2372/CH2/EX2.5/ex5.sce @@ -0,0 +1,19 @@ +clc;
+clear;
+ang1=-5*%pi/180;
+v1=complex(120*cos(ang1),120*sin(ang1));
+v2=100;
+z=complex(1,7);//line impedance
+i12=(v1-v2)/z;
+i21=(v2-v1)/z;
+s12=v1*i12';
+s21=v2*i21';
+sl=s12+s21;//line loss
+mprintf("since p1 is negative and p2 is positive,source1 receives %3.1f W and source 2 generates %4.1f W and the real power loss in the line is %2.1f W. the real power loss in the line can be checked by:\n",abs(real(s12)),real(s21),real(sl));
+r=real(z);//resistance of line
+x=imag(z);//impedance of line
+pl=r*abs(i12)*abs(i12);
+mprintf("verifying active power loss in line,pl=%2.1f W\n",pl);
+mprintf("also q1 is positive and q2 is negative, source1 delivers %4.1f var and source2 receives %4.1f var, and reactive power loss in line is %3.1f var. the reactive power loss in the line can be checked by :\n",imag(s12),abs(imag(s21)),imag(sl));
+ql=x*abs(i12)*abs(i12);
+mprintf("verifying reactive power loss in line, ql=%3.1f var\n",ql);
diff --git a/2372/CH2/EX2.6/ex6.sce b/2372/CH2/EX2.6/ex6.sce new file mode 100644 index 000000000..be53f2564 --- /dev/null +++ b/2372/CH2/EX2.6/ex6.sce @@ -0,0 +1,28 @@ +clc;
+clear;
+e1=input("source #1 voltage mag. =");
+a1=input("source #1 phase angle =");
+e2=input("source #2 voltage mag. =");
+a2=input("source #2 phase angle =");
+r=input("line resistance =");
+x=input("line reactance =");
+z=r+(%i*x);
+a1=((-30+a1):5:(30+a1))';
+a1r=a1*%pi/180;
+k=length(a1);
+a2=ones(k,1)*a2;
+a2r=a2*%pi/180;
+v1=e1.*cos(a1r)+%i*e1.*sin(a1r);
+v2=e2.*cos(a2r)+%i*e2.*sin(a2r);
+i12=(v1-v2)./z;
+i21=-i12;
+s1=v1.*conj(i12);p1=real(s1);q1=imag(s1);
+s2=v2.*conj(i21);p2=real(s2);q2=imag(s2);
+sl=s1+s2;pl=real(sl);ql=imag(sl);
+result1=[a1,p1,p2,pl];
+disp("delta 1 p-1 p-2 p-l");
+disp(result1);
+plot(a1,p1,a1,p2,a1,pl);
+xlabel("source #1 voltage phase angle");
+ylabel("P,watts");
+plotframe;
diff --git a/2372/CH2/EX2.7/ex7.sce b/2372/CH2/EX2.7/ex7.sce new file mode 100644 index 000000000..40cba3f0e --- /dev/null +++ b/2372/CH2/EX2.7/ex7.sce @@ -0,0 +1,27 @@ +clc;
+clear;
+z=complex(2,4);//line impedance
+zy=complex(30,40);//impedance per phase of Y connected load
+zdel=complex(60,-45);//impedance of delta connected load
+vl=207.85;//line voltage
+z2=zdel/3;//impedance per phase of equivalent Y network
+v1=vl/sqrt(3);//phase voltage
+mprintf("phase voltage,v1=%d V\n",v1);
+zt=z+(zy*z2/(zy+z2));//total impedance
+mprintf("total impedance,z=%d ohms\n",zt);
+i=v1/abs(zt);//current in phase a
+s=3*v1*i';//3 phase power supplied
+mprintf("three phase power supplied,s=%d W\n",s);
+v2=v1-(z*i);//load terminal voltage
+v2ab=complex(sqrt(3)*cos(%pi/6),sqrt(3)*sin(%pi/6))*v2;//line voltage at load terminal
+mprintf("line voltage at load terminal,v2ab=%5.2f angle %3.1f V\n",abs(v2ab),atan(imag(v2ab),real(v2ab))*180/%pi);
+i1=v2/zy;//current per phase in Y connected load
+i2=v2/z2;//current per phase in equivalent Y of the delta load
+iab=i2/complex(sqrt(3)*cos(-%pi/6),sqrt(3)*sin(-%pi/6));//phase current in original delta connected load
+mprintf("phase current in original delta connection,iab= %4.3f angle %4.2f A\n",abs(iab),atan(imag(iab),real(iab))*180/%pi);
+s1=3*v2*i1';
+s2=3*v2*i2';
+sl=3*z*abs(i)*abs(i);
+stotal=s1+s2+sl;
+mprintf("total power absorbed by loads plus power consumed at line losses,stotal=%d W + %dvar\n",real(stotal),imag(stotal));
+mprintf("it is clear that the sum of load powers and line losses is equal to the power delivered from the supply.\n");
diff --git a/2372/CH2/EX2.8/ex8.sce b/2372/CH2/EX2.8/ex8.sce new file mode 100644 index 000000000..06e65d440 --- /dev/null +++ b/2372/CH2/EX2.8/ex8.sce @@ -0,0 +1,21 @@ +clc;
+clear;
+z=complex(0.4,2.7);//line impedance
+r=real(z);
+x=imag(z);
+s1=560.1; pf1=0.707; ang1=acos(pf1);//load 1 lagging power factor
+s2=132;pf2=1;ang2=acos(pf2);//load 2 unity power factor
+v2l=3810.5;//line to line voltage at load end
+v2=v2l/sqrt(3);//phase voltage
+s3p=complex(s1*cos(ang1),s1*sin(ang1))+s2;//total complex power
+i=s3p'*1000/3/v2';//line current
+v1=v2+z*i;//sending end voltage
+v1l=sqrt(3)*abs(v1);
+mprintf("magnitude of line voltage at source end = %d V\n",v1l);
+sl3p=3*r*abs(i)*abs(i)+%i*3*x*abs(i)*abs(i);//3phase power loss in line
+mprintf("three phase power loss in line,sl3p=%d kW + j%d kvar\n",real(sl3p)/1000,imag(sl3p)/1000);
+ss3p=3*v1*i';
+mprintf("three phase sending end power,ss3p=%d kW+ j%d kvar\n",real(ss3p)/1000,imag(ss3p)/1000);
+st=s3p+(sl3p/1000);
+mprintf("total power consumed,st=%d kW+ %dkvar\n",real(st),imag(st));
+mprintf("it is clear that the sum of laod powers and the line losses is equal to the power delivered from the supply\n");
|