summaryrefslogtreecommitdiff
path: root/Working_Examples/154/CH11
diff options
context:
space:
mode:
authorSiddharth Agarwal2019-09-03 18:27:40 +0530
committerSiddharth Agarwal2019-09-03 18:27:40 +0530
commit8ac15bc5efafa2afc053c293152605b0e6ae60ff (patch)
treee1bc17aae137922b1ee990f17aae4a6cb15b7d87 /Working_Examples/154/CH11
parent52a477ec613900885e29c4a0b02806a415b4f83a (diff)
downloadXcos_block_examples-master.tar.gz
Xcos_block_examples-master.tar.bz2
Xcos_block_examples-master.zip
Xcos examples from textbooks and for blocksHEADmaster
Diffstat (limited to 'Working_Examples/154/CH11')
-rwxr-xr-xWorking_Examples/154/CH11/EX11.1/ch11_1.sce19
-rwxr-xr-xWorking_Examples/154/CH11/EX11.1/ch11_11.jpegbin0 -> 22030 bytes
-rwxr-xr-xWorking_Examples/154/CH11/EX11.1/ch11_12.jpegbin0 -> 20549 bytes
-rwxr-xr-xWorking_Examples/154/CH11/EX11.10/ch11_10.sce56
-rwxr-xr-xWorking_Examples/154/CH11/EX11.11/ch11_11.sce27
-rwxr-xr-xWorking_Examples/154/CH11/EX11.12/ch11_12.sce29
-rwxr-xr-xWorking_Examples/154/CH11/EX11.13/ch11_13.sce20
-rwxr-xr-xWorking_Examples/154/CH11/EX11.14/ch11_14.sce25
-rwxr-xr-xWorking_Examples/154/CH11/EX11.16/ch11_16.sce46
-rwxr-xr-xWorking_Examples/154/CH11/EX11.17/ch11_17.sce80
-rwxr-xr-xWorking_Examples/154/CH11/EX11.2/ch11_2.sce37
-rwxr-xr-xWorking_Examples/154/CH11/EX11.2/ch11_21.jpegbin0 -> 67285 bytes
-rwxr-xr-xWorking_Examples/154/CH11/EX11.4/ch11_4.sce15
-rwxr-xr-xWorking_Examples/154/CH11/EX11.5/ch11_5.sce14
14 files changed, 368 insertions, 0 deletions
diff --git a/Working_Examples/154/CH11/EX11.1/ch11_1.sce b/Working_Examples/154/CH11/EX11.1/ch11_1.sce
new file mode 100755
index 0000000..b2eb628
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.1/ch11_1.sce
@@ -0,0 +1,19 @@
+clc
+disp("Problem 11.1")
+printf("\n")
+
+printf("Given")
+disp("Resistance =1000ohm")
+t=0:0.5:1;
+i=ones(length(t),1) ;i1=-1;
+figure
+a=gca()
+plot(t,i,t+1,i1,t+2,i,t+3,i1)
+xtitle("i vs t",'t in ms','i in mA')
+i=1*10^-3;R=1000;
+//p=i^2*R
+p=i^2*R*ones(length(t),1) ;
+figure
+a=gca()
+plot(t,p)
+xtitle("p vs t",'t in ms','p in mW') \ No newline at end of file
diff --git a/Working_Examples/154/CH11/EX11.1/ch11_11.jpeg b/Working_Examples/154/CH11/EX11.1/ch11_11.jpeg
new file mode 100755
index 0000000..9cdc252
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.1/ch11_11.jpeg
Binary files differ
diff --git a/Working_Examples/154/CH11/EX11.1/ch11_12.jpeg b/Working_Examples/154/CH11/EX11.1/ch11_12.jpeg
new file mode 100755
index 0000000..c6ee408
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.1/ch11_12.jpeg
Binary files differ
diff --git a/Working_Examples/154/CH11/EX11.10/ch11_10.sce b/Working_Examples/154/CH11/EX11.10/ch11_10.sce
new file mode 100755
index 0000000..0fd8a45
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.10/ch11_10.sce
@@ -0,0 +1,56 @@
+clc
+disp("Problem 11.10")
+printf("\n")
+
+printf("Given")
+disp("Veff=10V v=10*sqrt(2)*cos(w*t)");
+Veff=10;vmag=10*1.414
+
+disp("a)")
+Z1=1+%i
+[R,Theta]=polar(Z1)
+printf("i1=%d*cos(w*t-%d)\n",(vmag/R),Theta)
+I1eff=(vmag/R)/1.414
+//p1(t)=100*sqrt(2)*cos(wt)*cos(wt-45)
+//On solving
+disp("p1(t)=50+50*sqrt(2)*cos(2*w*t-45) W")
+P1=Veff*I1eff*cos(Theta)
+Q1=Veff*I1eff*sin(Theta)
+S1=P1+%i*Q1
+S1mag=sqrt(P1^2+Q1^2)
+pf1=P1/S1mag
+printf("P1=%dW\nQ1=%dvar\npf1=%0.4f(lag)\n",P1,Q1,pf1)
+
+
+disp("b)")
+Z2=1-%i
+[R,Theta]=polar(Z2)
+printf("i2=%d*cos(w*t%d)\n",(vmag/R),Theta)
+I2eff=(vmag/R)/1.414
+//p2(t)=100*sqrt(2)*cos(wt)*cos(wt+45)
+//On solving
+disp("p2(t)=50+50*sqrt(2)*cos(2*w*t+45) W")
+P2=Veff*I2eff*cos(Theta)
+Q2=Veff*I2eff*sin(Theta)
+S2=P2+%i*Q2
+S2mag=sqrt(P2^2+Q2^2)
+pf2=P2/S2mag
+printf("P2=%dW\nQ2=%dvar\npf2=%0.4f(lag)\n",P2,Q2,pf2)
+
+disp("c)")
+Zmag=(Z1*Z2)/(Z1+Z2)
+printf("i=%d*cos(w*t)\n",(vmag/Zmag))
+Ieff=(vmag/Zmag)/1.414
+//p(t)=100*sqrt(2)*sqrt(2)*cos(wt)*cos(wt)
+//On solving
+disp("p2(t)=200*cos(w*t)^2 W")
+P=Veff*Ieff
+Q=0
+S=P+%i*Q
+Smag=sqrt(P^2+Q^2)
+pf=P/Smag
+printf("P=%dW\nQ=%dvar\npf=%0.4f\n",P,Q,pf)
+
+
+
+
diff --git a/Working_Examples/154/CH11/EX11.11/ch11_11.sce b/Working_Examples/154/CH11/EX11.11/ch11_11.sce
new file mode 100755
index 0000000..143b3cf
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.11/ch11_11.sce
@@ -0,0 +1,27 @@
+clc
+disp("Problem 11.11")
+printf("\n")
+
+printf("Given")
+disp("v=42.5*cos(1000*t+30 deg)V Z=3+i4 ohm")
+Vmag=42.5;
+Z=3+%i*4;
+R=sqrt(3^2+4^2)
+Theta=atan(4/3)*(180/%pi)
+Veffm=Vmag/sqrt(2)
+Veffph=30
+Ieffm=Veffm/R
+Ieffph=30-Theta
+
+Smag=Veffm*Ieffm
+Sph=Veffph-Ieffph
+x=Smag*cos((Sph*%pi)/180)
+y=Smag*sin((Sph*%pi)/180)
+z=complex(x,y)
+pf=cos((Theta*%pi)/180);
+
+printf("Real Power is %fW\n",x)
+printf("Reactive Power is %fvar(inductive)\n",y)
+printf("Complex Power is %fVA\n",Smag)
+printf("Power factor is %3.1f(lag)\n",pf)
+
diff --git a/Working_Examples/154/CH11/EX11.12/ch11_12.sce b/Working_Examples/154/CH11/EX11.12/ch11_12.sce
new file mode 100755
index 0000000..346fdf4
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.12/ch11_12.sce
@@ -0,0 +1,29 @@
+clc
+disp("Problem 11.12")
+printf("\n")
+
+printf("Given")
+disp("pf1=1 ; pf2=0.5 ; pf3=0.5")
+disp("P1=10kW;P2=20kW;P3=15kW")
+disp("Power supply is 6kV")
+P1=10000;P2=20000;P3=15000;
+Veff=6000;
+pf1=1 //implifies that theta1=0
+t1=0
+Q1=P1*t1
+
+pf2=0.5 //implifies that theta1=60
+t2=1.73;
+Q2=P2*t2
+
+pf3=1 //implifies that theta1=53.13
+t3=1.33;
+Q3=P3*t3
+
+PT=P1+P2+P3
+QT=Q1+Q2+Q3
+ST=sqrt(PT^2+QT^2)
+pfT=PT/ST
+Ieff=ST/Veff
+Ieffph=acos(pfT)*(180/%pi)
+printf("PT=%dW\nQT=%dvar\nST=%dVA\npf=%0.2f(lag)\nIeff=%3.1f(%3.2f deg)\n",PT,QT,ST,pfT,Ieff,Ieffph)
diff --git a/Working_Examples/154/CH11/EX11.13/ch11_13.sce b/Working_Examples/154/CH11/EX11.13/ch11_13.sce
new file mode 100755
index 0000000..63dcd76
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.13/ch11_13.sce
@@ -0,0 +1,20 @@
+clc
+disp("Problem 11.13")
+printf("\n")
+
+printf("Given")
+disp("Power factor is 0.95(lag)")
+vmag=240;Zmag=3.5;Zph=25;
+I1mag=vmag/Zmag;iph=0-Zph;
+//Smag=Veff*Ieff
+Smag=(vmag/sqrt(2))*(I1mag/sqrt(2))
+Sph=0+abs(iph)
+x=Smag*cos((Sph*%pi)/180)
+y=Smag*sin((Sph*%pi)/180)
+z=complex(x,y)
+pf=0.95
+theta=acos(0.95)*(180/%pi)
+//From fig 11.11
+//Solving for Qc
+Qc=y-(tan((theta*%pi)/180)*x)
+printf("\n Qc=%dvar(Capacitive )\n",Qc)
diff --git a/Working_Examples/154/CH11/EX11.14/ch11_14.sce b/Working_Examples/154/CH11/EX11.14/ch11_14.sce
new file mode 100755
index 0000000..8b28778
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.14/ch11_14.sce
@@ -0,0 +1,25 @@
+clc
+disp("Problem 11.14")
+printf("\n")
+
+printf("Given")
+disp("Power =1000kW ; pf=0.5(lag)")
+disp("Voltage source is 5kV")
+disp("Improved power factor is 0.8")
+
+//Before improvement
+P=1000*10^3;
+pf=0.5;V=5*10^3;
+S=(P/pf)*10^-3
+I=S/V
+
+//After improvement
+P=1000*10^3;
+pf=0.8;V=5*10^3;
+S=(P/pf)*10^-3
+I1=S/V
+
+disp("Current is reduced by ")
+red=((I-I1)/I)*100
+printf("Percentage reduction in current is %3.1fpercent\n",red)
+
diff --git a/Working_Examples/154/CH11/EX11.16/ch11_16.sce b/Working_Examples/154/CH11/EX11.16/ch11_16.sce
new file mode 100755
index 0000000..1389705
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.16/ch11_16.sce
@@ -0,0 +1,46 @@
+clc
+disp("Problem 11.16")
+printf("\n")
+
+printf("Given")
+disp("Vg=100V(rms)")
+disp("Zg=1+i Z1=2")
+Vg=100;
+
+disp("a)")
+Zg=1+%i;
+Z1=2
+Z=Z1+Zg
+Zmag=sqrt(real(Z)^2+imag(Z)^2)
+I=Vg/Zmag
+PZ1=real(Z1)*(I^2)
+Pg=real(Zg)*(I^2)
+PT=PZ1+Pg
+printf("PZ=%dW\n Pg=%dW\n PT=%dW\n",PZ1,Pg,PT);
+
+disp("b)")
+//If Z2=a+i*b
+//Zg*=1-i
+//Given that
+//(Z1*Z2)/(Z1+Z2)=1-i
+//As Z1=2 and solving for Z2
+ disp(-%i,"Z2=")
+
+disp("c)")
+//If Z2 is taken the value as calculated in b) then Z=1-i
+Zg=1+%i;
+Z1=2;
+Z=1-%i;
+Zt=Z+Zg
+Zmag=sqrt(real(Zt)^2+imag(Zt)^2)
+I=Vg/Zmag
+PZ=real(Z)*(I^2)
+Pg=real(Zg)*(I^2)
+//To calculate PZ1 and PZ2 we need to first calculate IZ1 nad IZ2
+VZ=I*(1-%i)
+IZ1=VZ/Z1
+IZ1mag=sqrt(real(IZ1)^2+imag(IZ1)^2)
+PZ1=real(Z1)*(IZ1mag^2)
+PZ2=PZ-PZ1
+PT=PZ1+PZ2+Pg
+printf("PZ=%dW\n Pg=%dW\n PT=%dW\n",PZ,Pg,PT);
diff --git a/Working_Examples/154/CH11/EX11.17/ch11_17.sce b/Working_Examples/154/CH11/EX11.17/ch11_17.sce
new file mode 100755
index 0000000..3fdef1c
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.17/ch11_17.sce
@@ -0,0 +1,80 @@
+clc
+disp("Problem 11.17")
+printf("\n")
+
+printf("Given")
+disp("v1=5*cos(w1*t) v2=10*cos(w2*t+60)")
+//The circuit is modeled as
+disp("Resistance is 10ohm and inductance is 5mH")
+R=10;L=5*10^-3;
+//Let V be phasor voltage between the terminals
+Vmag=10;
+Vph=60;
+x=Vmag*cos((Vph*%pi)/180);
+y=Vmag*sin((Vph*%pi)/180);
+z=complex(x,y)
+
+disp("a)")
+w1=2000;w2=4000;
+//Let Z be the impedance of the coil
+Z1=R+%i*L*w1
+Z2=R+%i*L*w2
+V1=5;
+//By applying superposition i=i1-i2
+I1=V1/Z1
+[R1,Theta]=polar(I1)
+printf("i1=%0.2f*cos(%dt%d deg)\n",R1,w1,(Theta*180)/%pi);
+P1=(R*R1^2)/2
+
+V2mag=10;V2ph=60;
+I2=z/Z2
+[R2,Theta1]=polar(I2)
+printf("i2=%0.2f*cos(%dt%3.2f deg)\n",R2,w2,(Theta1*180)/%pi);
+P2=(R*R2^2)/2
+
+//i=i1-i2
+printf("i=%0.2f*cos(%dt%d deg)-%0.2f*cos(%dt%3.2f deg)\n",R1,w1,(Theta*180)/%pi,R2,w2,(Theta1*180)/%pi)
+
+printf("P1=%0.3fW\nP2=%3.1fW\nTotal power(P)=%3.3fW\n",P1,P2,(P1+P2))
+
+disp("b)")
+//From problem 10.7
+imagn=0.61
+P=(R*imagn^2)/2
+printf("Power dissipated in the coil=%3.3fW\n",P)
+
+disp("c)")
+w1=2000;w2=1414;
+//Let Z be the impedance of the coil
+Z1=R+%i*L*w1
+Z2=R+%i*L*w2
+V1=5;
+//By applying superposition i=i1-i2
+I1=V1/Z1
+[R1,Theta]=polar(I1)
+printf("i1=%0.2f*cos(%dt%d deg)\n",R1,w1,(Theta*180)/%pi);
+P1=(R*R1^2)/2
+
+V2mag=10;V2ph=60;
+x1=V2mag*cos((V2ph*%pi)/180);
+y1=V2mag*sin((V2ph*%pi)/180);
+z1=complex(x1,y1)
+I3=z1/Z2
+[R3,Theta3]=polar(I3)
+printf("i2=%0.2f*cos(%dt+%3.2f deg)\n",R3,w2,(Theta3*180)/%pi);
+P3=(R*R3^2)/2
+
+//i=i1-i2
+printf("i=%0.2f*cos(%dt%d deg)-%0.2f*cos(%dt+%3.2f deg)\n",R1,w1,(Theta*180)/%pi,R3,w2,(Theta3*180)/%pi)
+
+printf("P1=%0.3fW\nP2=%3.1fW\nTotal power(P)=%3.3fW\n",P1,P3,(P1+P3))
+
+
+
+
+
+
+
+
+
+
diff --git a/Working_Examples/154/CH11/EX11.2/ch11_2.sce b/Working_Examples/154/CH11/EX11.2/ch11_2.sce
new file mode 100755
index 0000000..8ce67ad
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.2/ch11_2.sce
@@ -0,0 +1,37 @@
+clc
+disp("Problem 11.2")
+printf("\n")
+
+t=0:0.5:1;
+i=ones(length(t),1);i1=-1;
+figure
+a=gca()
+plot(t,i,t+1,i1)
+xtitle("i vs t",'t in ms','i in mA')
+//Voltage across capacitor vC=(1/C)*integrate(i*dt)
+//On integration
+t=0:0.0005:0.001
+v=2000*t
+v1=2-v;
+figure
+a=gca()
+plot(t,v,t+0.001,v1,t+0.002,v,t+0.003,v1)
+xtitle("v vs t",'t in ms','v in V')
+
+//Power is p=v*i
+t=0:.0005:.001
+p=2000*t
+p1=p-2;
+figure
+a=gca()
+plot(t,p,t+0.001,p1,t+0.002,p,t+0.003,p1)
+xtitle("p vs t",'t in ms','p in W')
+
+//Work is (C*v^2)/2
+t=0:.0005:.001
+w=t.^2
+w1=t.^2+1*10^-6-(2*10^-3*t);
+figure
+a=gca()
+plot(t,w,t+0.001,w1,t+0.002,w,t+0.003,w1)
+xtitle("w vs t",'t in ms','w in J') \ No newline at end of file
diff --git a/Working_Examples/154/CH11/EX11.2/ch11_21.jpeg b/Working_Examples/154/CH11/EX11.2/ch11_21.jpeg
new file mode 100755
index 0000000..40336d2
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.2/ch11_21.jpeg
Binary files differ
diff --git a/Working_Examples/154/CH11/EX11.4/ch11_4.sce b/Working_Examples/154/CH11/EX11.4/ch11_4.sce
new file mode 100755
index 0000000..cdf0690
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.4/ch11_4.sce
@@ -0,0 +1,15 @@
+clc
+disp("Problem 11.4")
+printf("\n")
+
+printf("Given")
+disp("Veff=110V Z=10+i8 ohm")
+Veff=110;
+Z=10+%i*8;
+R = 10;
+Zmag=sqrt(10^2+8^2)
+Zph=(atan(8/10)*180)/%pi
+P=(Veff^2*R)/(Zmag^2)
+pf=cos((Zph*%pi)/180)
+
+disp(pf,"Power factor is") \ No newline at end of file
diff --git a/Working_Examples/154/CH11/EX11.5/ch11_5.sce b/Working_Examples/154/CH11/EX11.5/ch11_5.sce
new file mode 100755
index 0000000..220644b
--- /dev/null
+++ b/Working_Examples/154/CH11/EX11.5/ch11_5.sce
@@ -0,0 +1,14 @@
+clc
+disp("Problem 11.5")
+printf("\n")
+
+printf("Given")
+disp("Veff=110V Ieff=20(-50 deg)")
+Imagn=20;Iph =-50;
+Veff=110;
+
+P=Veff*Imagn*cos((abs(Iph)*%pi)/180)
+Q=Veff*Imagn*sin((abs(Iph)*%pi)/180)
+printf("Average power is %3.1fW\n",P)
+printf("Reactive power is %3.1fvar\n",Q)
+