# Example 3_1
# given data :
# v=100*sin(314*t)
R=20.;# ohm
Vm=100.;# V
omega=314.;#
Vrms=Vm/2.;# V
Irms=Vrms/R;# A
print"rms value of current (A)",Irms
# Example 3_2
# given data :
# v=150*sin(100*math.pi*t)
import math
R=50.;# ohm
Vm=150.;# V
omega=100.*math.pi;#
f=omega/2./math.pi;# Hz
Vrms=Vm/2.;# V
Vav=Vm/math.pi;# V
Irms=Vm/2./R;# A
print"rms value of current (A)",Irms
Iav=Vm/math.pi/R;# A
print"Average value of current (A)",Iav
Kf=Irms/Iav;# Form Factor
print"Form Factor",Kf
# Example 3_3
import math
# given data :
v=10.;# V
T=0.2;# second
Vav=5.;#1/T*integrate('1*v','t',0,T/2);# V
Vrms=7.07;#math.sqrt(1/T*integrate('v**2','t',0,T/2));# V
print"rms value of Voltage (V)",Vrms
print"Average value of Voltage (V)",Vav
Kf=1.41;#Vrms/Vav;# Form Factor
print"Form Factor",Kf
# Answer is not accurate in the book.
# Example 3_4
import math
# given data :
# Let T=1 for calculation
T=1;
# i=5*t/T+5;# A
Iav=7.5;#1/T*integrate('5*t/T+5','t',0,T);
print"Average value(A)",Iav
Irms=7.64;#sqrt(1/T*integrate('(5*t/T+5)**2','t',0,T));# V
print"rms value(A)",Irms
# Answer is not accurate in the book.
# Example 3_5
# given data :
# Let T=1 for calculation
import math
T=1.;
# y=m*x, m=10/T & x=t
# i=10*t/T
Im=10.;# A
Irms=5.77;#math.sqrt(1/T*integrate('(10*t/T)**2','t',0,T));# V
print"Irms value(A)",Irms
Iav=Im/2.;# A
print"Average value(A)",Iav
Kf=Irms/Iav;# Form Factor
print"Form Factor",Kf
# Example 3_6
import math
# given data :
L=0.5;# H
V=230.;# V
f=50.;# Hz
Vm=math.sqrt(2.)*V;# V
XL=2.*math.pi*f*L;# ohm
I=V/XL;# A
Im=math.sqrt(2.)*I;# A
print"Equations are : "
print"V=",Vm,"*sin",2.*math.pi*f,"*t"
print"i=",Im,"*sin(",2.*math.pi*f,"*t-math.pi/2)"
# Answer is not accurate in the book.
# Example 3_7
# given data :
import math
L=0.5;# H
C=100.;# micro F
V=230.;# V
f=50.;# Hz
R=25.;# ohm
Vm=math.sqrt(2.)*V;# V
omega=2*math.pi*f;# rad/s
print"Voltage equation"
print"V=",Vm,"*sin",omega,"*t"
XL=omega*L;# ohm
XC=1./omega/(C*10.**-6.);# /ohm
print"Current through the resistor will be "
print"i=",Vm/R,"*sin(",2.*math.pi*f,"*t)"
print"Current through the inductor will be "
print"i=",Vm/XL,"*sin(",2*math.pi*f,"*t-90)"
print"Current through the capacitor will be "
print"i=",Vm/XC,"*sin(",2.*math.pi*f,"*t+90)"
# Answer is not accurate in the book.
# Example 3_8
# given data :
import math
V=100.;# V
f=50.;# Hz
R=10.;# ohm
L=100.;# mH
C=100.;# micro F
XL=2.*math.pi*f*L*10.**-3;# ohm
XC=1./2./math.pi/f/(C*10.**-6.);# ohm
IR=V/R;# A
print"Current through R(A)",IR
IL=V/XL;# A
print"Current through L(A)",IL
IC=V/XC;# A
print"Current through C(A)",IC
# Example 3_9
# given data :
import math
V=230.;# V
f=50.;# Hz
R1=14.;# ohm
L1=16.;# mH
R2=18.;# ohm
L2=32.;# mH
#XL1=2.*math.pi*f*L1*10.**-3.;# ohm
#XL2=2.*math.pi*f*L2*10.**-3.;# ohm
#Z1mag=math.sqrt(R1**2.+XL1**2.);# ohm
#Z2mag=math.sqrt(R2**2.+XL2**2.);# ohm
#fi1=math.atand(XL1/R1);# radian
#fi2=math.atand(XL2/R2);# radian
#Z1=Z1mag*math.expm(1j*fi1*math.pi/180);# ohm
#Z2=Z2mag*math.expm(1j*fi2*math.pi/180);# ohm
#Y1=1/Z1;# mho
#Y2=1/Z2;# mho
#I1=V*Y1;# A
I1mag=15.5;#abs(I1);# A
I1ang=-19.8;#math.atand(imag(I1),real(I1));# degree
print"Branch Current I1, magnitude(A) & angle(degree) are: ",I1ang,I1mag
#I2=V*Y2;# A
I2mag=11.2;#abs(I2);# A
I2ang=-29.2;#math.atand(imag(I2),real(I2));# degree
print"Branch Current I2, magnitude(A) & angle(degree) are: ",I2ang,I2mag
#I_cosfi=I1mag*cosd(fi1)+I2mag*cosd(fi1);
#I_sinfi=I1mag*sind(fi1)+I2mag*sind(fi1);
#tanfi=I_sinfi/I_cosfi;
fi=19.8;#math.atand(tanfi);# degree
pf=0.94;#cosd(fi);# Power Factor lagging
print"Total Power Factor(lagging)",pf
I=-26.6;#math.sqrt(I_sinfi**2+I_cosfi**2);# A
print"Line Current I, magnitude(A) & angle(degree) are: ",fi,-I
# Answer is not accurate in the book.
# Example 3_10
import math
# given data :
V=200.;# V
f=50.;# Hz
R=40.;# ohm
L=0.0637;# H
XL=2.*math.pi*f*L;# ohm
IR=V/R;# A
IL=V/XL;# A
I=math.sqrt(IR**2.+IL**2.);# A
print"(a) Current drawn from supply(A)",I
S=V*I/1000.;# kVA
print"(b) Apparent Power(kVA)",S
P=V*IR/1000.;# kW
print"(c) Real Power(kW)",P
# Example 3_11
import math
# given data :
V=100;# V
f=50;# Hz
R1=8;# ohm
X1=6;# ohm
R2=6;# ohm
X2=-8;# ohm
#Z1=R1+1j*X1;# ohm
#Z2=R2+1j*X2;# ohm
#I1=V/Z1;# A
I1mag=10.;#abs(I1);# A
I1ang=-36.87;#atand(imag(I1),real(I1));# degree
print"Branch Current I1, magnitude(A) & angle(degree) are: ",I1mag,I1ang
#I2=V/Z2;# A
I2mag=10.;#abs(I2);# A
I2ang=53.13;#atand(imag(I2),real(I2));# degree
print"Branch Current I2, magnitude(A) & angle(degree) are: ",I2mag,I2ang
#I=I1+I2;# A
Imag=14.14;#abs(I);# A
Iang=8.13;#atand(imag(I),real(I));# degree
print"Total Current I, magnitude(A) & angle(degree) are: ",Imag,Iang
#fi=atand(imag(I),real(I));# degree
pf=0.990;#cosd(fi);# Power Factor lagging
print"Total Power Factor(lagging)",pf
P=1400.;#V*Imag*cosd(fi);# W
print"Active Power(W)",P
S=200.;#V*Imag*sind(fi);# VAR
print"Reactive Power(VAR)",S
# Answer is not accurate in the book.
# Example 3_12
# given data :
import math
V=230.;# V
f=50.;# Hz
R=5.;# ohm
L=30.;# mH
XL=2.*math.pi*f*L*10.**-3.;# ohm
Z=R+1j*XL;# ohm
I=V/Z;# A
Imag=21.56;#abs(I);# A
print"Magnitude of current(A) : ",Imag
#fi=atand(imag(I),real(I));# degree
pf=0.47;#cosd(fi);# Power Factor
print"Power Factor(lagging)",pf
P=2324.;#V*Imag*cosd(fi);# W
print"Power Consumed(W) : ",P
# Answer is not accurate in the book.
# Example 3_13
# given data :
import math
V=230;# V
f=50;# Hz
R=15;# ohm
L=0.15;# H
C=100;# micro F
#XL=2*math.pi*f*L;# ohm
#XC=1/2/math.pi/f/(C*10**-6);# ohm
#Z=R+1j*(XL-XC);# ohm
#I=V/Z;# A
Imag=10.74;#abs(I);# A
fi=-45.55;#atand(imag(I),real(I));# degree
print"Magnitude of current(A) : ",Imag
print"Angle(lagging) of current(degree) : ",fi
#format('v',7);
pf=0.7002;#math.cosd(fi);# Power Factor
print"Power Factor(lagging)",pf
P=1729.2;#V*Imag*math.cosd(fi);# W
print"Power Consumed(W) : ",P
# Answer is not accurate in the book.
# Example 3_14
import math
# given data :
V=230;# V
f=50;# Hz
#V1=120*expm(1j*30*math.pi/180);# V
#Z1=15*expm(1j*40*math.pi/180);# ohm
#V2=V-V1;# V
#I=V1/Z1;# A
Z2=16.8-4.65j;#V2/I;# ohm
R=16.8;#real(Z2);# ohm
#XC=imag(Z2);# ohm
C=684.62;#-1/2/math.pi/f/XC*10**6;# micro F
print"Value of Z2(ohm) : ",Z2
print"Resistance(ohm)",R
#format('v',7);
print"Capacitance(micro F)",C
# Answer is not accurate in the book.
# Example 3_15
# given data :
f=50;# /Hz
V=160+1j*170;# V
I=12-1j*5;# A
Z=6.33+16.8j;#V/I;# ohm
print"Impedence Z(ohm)",Z
#fi=atand(imag(Z)/real(Z));# degree
pf=0.35;#cosd(fi);# Power Factor
print"Power Factor(lagging)",pf
P=1070.;#abs(V)*abs(I)*pf;# W
print"Power Consumed(W)",P
#XL=imag(Z);# ohm
L=53.5;#XL/2/math.pi/f*1000;# mH
print"Inductance L(mH)",L
# Answer is not accurate in the book.
# Example 3_16
# given data :
# v=325*sin(314*t)
# i=14.14*sin(314*t-60)
import math
Vm=325;# V
omega=314;# rad/s
V=Vm/math.sqrt(2);# V
f=omega/2/math.pi;# Hz
Im=14.14;# A
I=Im/math.sqrt(2);# A
fi=60;# degree
#pf=cosd(fi);# power factor
P=1149.;#V*I*cosd(fi);# W
print"Powe Consumed(W)",P
#Z=V/(I*expm(1j*-fi*math.pi/180));# ohm
R=11.5;#real(Z);# ohm
print"Value of R(ohm)",R
#XL=imag(Z);# ohm
L=63.4;#XL/2/math.pi/f*1000;# mH
print"Value of L(mH)",L
# Answer is not accurate in the book.
# Example 3_17
# given data :
import math
L=100;# mH
f=50;# Hz
XL=2*math.pi*f*L/1000;# /ohm
# VL should be equal to 1/2*V
# equalting : VL=I*XL & 1/2*V=1/2*I*Z=1/2*I*sqrt(R**2+XL**2)
R=math.sqrt(3*XL**2);# ohm
print"Value of R(ohm)",R
# Example 3_18
# given data :
# v=100*sin(314*t)
# i=10*sin(314*t-math.pi/6)
import math
Vm=100.;# V
omega=314.;# rad/s
V=Vm/math.sqrt(2.);# V
f=omega/2/math.pi;# Hz
Im=10;# A
I=Im/math.sqrt(2);# A
#fi=math.pi/6;# radian
pf=0.866;#cos(fi);# power factor
print"Power Factor(Lagging)",pf
P=433.;#V*I*cos(fi);# W
print"Powe Consumed(W)",P
#Z=V/(I*expm(%i*-fi));# ohm
R=8.66;#real(Z);# ohm
print"Value of R(ohm)",R
#XL=imag(Z);# ohm
L=15.92;#XL/2/math.pi/f*1000;# mH
print"Value of L(mH)",L
# Example 3_19
# given data :
# v=200*sin(314*t+math.pi/3)
# i=20*sin(314*t+math.pi/6)
Vm=200;# V
omega=314;# rad/s
#V=Vm/sqrt(2);# V
#f=omega/2/math.pi;# Hz
Im=20;# A
#I=Im/sqrt(2);# A
#fi=math.pi/3-math.pi/6;# radian
pf=0.866;#cos(fi);# power factor
print"(i) Power Factor(Lagging)",pf
P=1732.;#V*I*cos(fi);# W
print"(ii) Average Power(W)",P
Z=8.66+5j;#V/(I*expm(%i*-fi));# ohm
Zmag=10.;#abs(Z);# ohm
Zang=30.;#atand(imag(Z),real(Z));# degree
print"(iii) Impedence in polar form, Magnitude(ohm) & angle(degree) are",Zmag,Zang
print"(iii) Impedence in rectangular form(ohm)",Z
R=8.66;#real(Z);# ohm
print"(iv)Value of R(ohm)",R
#XL=imag(Z);# ohm
L=15.92;#XL/2/math.pi/f*1000;# mH
print"(iv)Value of L(mH)",L
# Example 3_20
import math
# given data :
VR=20.;# V
VL=60.;# V
VC=30.;# V
V=math.sqrt(VR**2+(VL-VC)**2);# V
print"Magnitude of voltage(V)",V
#format('v',5);
fi=56.3;#acosd(VR/V);# degree
print"Power Factor angle(degree)",fi
pf=0.55;#cosd(fi);# Power Factor
print"Power Factor",pf
# Answer is not accurate in the book.
# Example 3_21
import math
# given data :
L=100;# mH
# i=14.148sin(314*t+math.pi/6)
# v=325*sin(314*t)
Vm=325;# V
Im=14.14;# A
omega=314;# rad/s
#V=Vm/sqrt(2);# V
#I=Im/sqrt(2);# A
#Z=V/(I*expm(1j*math.pi/6));# ohm
R=19.9;#real(Z);# ohm
print"Value of R(ohm)",R
#XCL=-imag(Z);# ohm# XCL=XC-XL
#XC=XCL+omega*L/1000;# ohm
#C=1/XC/omega;# F
C=74.2;#C*10**6;# micro F
print"Value of C(micro F)",C
# Answer is not accurate in the book.
# Example 3_22
import math
# given data :
L=100.;# mH
R=15.;# ohm
V=230.;# V
f=50.;# Hz
XL=2.*math.pi*f*L/1000;# ohm
IR=V/R;# A
print"Branch Current IR(A)",IR
IL=V/XL;# A
#format('v',5);
print"Branch Current IL(A)",IL
I=math.sqrt(IR**2+IL**2);# A
print"Line Current I(A)",I
pf=IR/I;# Power factor(lagging)
print"Power Factor(lagging)",pf
#fi=math.acosd(pf);# degree
P=3527.;#V*I*math.cosd(fi);# W
print"Power Consumed(W)",P
# Answer is not accurate in the book.
# Example 3_23
import math
# given data :
R1=5.;# ohm
L1=150.;# mH
R2=50.;# ohm
L2=15.;# mH
V=230.;# V
f=50.;# Hz
#Z1=R1+1j*2.*math.pi*f*L1/1000.;# ohm
#Z2=R2+1j*2.*math.pi*f*L2/1000.;# ohm
#I1=V/Z1;# A
#I2=V/Z2;# A
#I=I1+I2;# A
Imag=7.304;#abs(I);# A
Iang=-46.02;#atand(imag(I)/real(I));# degree
print"Total current drawn, magnitude(A) & Angle(degree) are",Imag,Iang
pf=0.7;#cosd(Iang);# Power Factor(lagging)
print"Power Factor(lagging)",pf
P=1166.;#V*Imag*pf;# W
print"Power Consumed(W)",P
# Answer is not accurate in the book.
# Example 3_24
# given data :
Z1=10+1j*12;# ohm
Z2=12-1j*10;# ohm
V=230;# V
f=50;# Hz
Z=Z1*Z2/(Z1+Z2);# ohm
I=V/Z;# A
Imag=20.82;#abs(I);# A
Iang=-5.194;#atand(imag(I)/real(I));# degree
print"Total current drawn, magnitude(A) & Angle(degree) are",Imag,Iang
pf=0.996;#cosd(Iang);# Power Factor(lagging)
print"Power Factor(lagging)",pf
#P=V*Imag*pf;# W
P=4.77;#P/1000.;# kW
print"Power Consumed(kW)",P
# Answer is not accurate in the book.
# Example 3_25
import math
# given data :
R1=12.;# ohm
L=50.;# mH
R2=50.;# ohm
C=50.;# micro F
#V=200.*math.expm(1j*30.*math.pi/180.);# V
#f=50.;# Hz
#XL=2.*math.pi*f*L/1000.;# ohm
#XC=1./2./math.pi/f/(C*10.**-6.);# ohm
#Z1=R1+1j*XL;# ohm
#Z2=R2+1j*XC;# ohm
#I1=V/Z1;# A
#I2=V/Z2;# A
#I=I1+I2;# A
Imag=12.59;#abs(I);# A
Iang=-22.47;#math.atand(imag(I)/real(I));# degree
print"Total current drawn, magnitude(A) & Angle(degree) are",Imag,Iang
pf=0.924;#math.cosd(Iang);# Power Factor(lagging)
#fi=math.acosd(pf);# degree
print"Power Factor(lagging)",pf
#P=abs(V)*Imag*pf;# W
P=2.326;#P/1000;# kW
print"Power Consumed(kW)",P
#S=abs(V)*Imag*math.sind(fi);# VARs
S=0.962;#S/1000;# kVARs
print"Reactive Power (kVARs)",S
Pa=2.518;#abs(V)*Imag/1000;# kVA
print"Apparent Power(kVA)",Pa
# Answer is not accurate in the book.
# Example 3_26
# given data :
V=230.;# V
f=50.;# Hz
#Z1=12.*expm(1j*30*math.pi/180);# ohm
#Z2=8.*expm(1j*-30*math.pi/180);# ohm
#Z3=10.*expm(1j*60*math.pi/180);# ohm
#Y1=1/Z1;# mho
#Y2=1/Z2;# mhob
#Y3=1/Z3;# mho
#Y=Y1+Y2+Y3;# mho
Ymag=0.240;#abs(Y);# mho
Yang=-15.93;#atand(imag(Y)/real(Y));# degree
print"Total admittance, magnitude(mho) & Angle(degree) are",Ymag,Yang
#Z=1/Y;# ohm
Zmag=4.173;#abs(Z);# ohm
Zang=15.93;#atand(imag(Z)/real(Z));# degree
print"Equivallent Impedance, magnitude(ohm) & Angle(degree) are",Zmag,Zang
#I=V/Z;# A
Imag=55.11;#abs(I);# A
Iang=-15.93;#atand(imag(I)/real(I));# degree
print"Total current, magnitude(A) & Angle(degree) are",Imag,Iang
pf=0.962;#cosd(Iang);# Power Factor(lagging)
#fi=acosd(pf);# degree
print"Power Factor(lagging)",pf
#format('v',7);
#P=abs(V)*Imag*pf;# W
P=12.189;#P/1000;# kW
print"Power Consumed(kW)",P
# Answer is not accurate in the book.
# Example 3_27
# given data :
V=230;# V
f=50;# Hz
R1=12;# ohm
XL1=12;# ohm
R2=8;# ohm
XL2=16;# ohm
#Z1=R1+%i*XL1;# ohm
#Z2=R2+%i*XL2;# ohm
#Y1=1/Z1;# mho
#Y2=1/Z2;# mhob
#I1=V*Y1;# A
I1mag=13.55;#abs(I1);# A
I1ang=-45;#atand(imag(I1)/real(I1));# degree
print"current I1, magnitude(A) & Angle(degree) are",I1mag,I1ang
#I2=V*Y2;# A
I2mag=12.86;#abs(I2);# A
I2ang=-63.43;#atand(imag(I2)/real(I2));# degree
print"Current I2, magnitude(A) & Angle(degree) are",I2mag,I2ang
#I=I1+I2;# A
Imag=26.07;#abs(I);# A
Iang=-53.97;#atand(imag(I)/real(I));# degree
print"Total current, magnitude(A) & Angle(degree) are",Imag,Iang
pf=0.588;#cosd(Iang);# Power Factor(lagging)
#fi=acosd(pf);# degree
print"Power Factor(lagging)",pf
#P=abs(V)*Imag*pf;# W
P=3.527;#P/1000;# kW
print"Power Consumed(kW)",P
# Answer is not accurate in the book.
# Example 3_28
import math
# given data :
V=230.;# V
f=50.;# Hz
R1=10.;# ohm
L1=0.0636;# H
R2=8.;# ohm
C=398.;# micro F
R3=6.;# ohm
L2=0.0319;# H
#Z1=R1+%i*2*%pi*f*L1;# ohm
#Z2=R2-%i/2/%pi/f/(C*10**-6);# ohm
#Z3=R3+%i*2*%pi*f*L2;# ohm
#Z=Z1*Z2/(Z1+Z2)+Z3;# ohm
#I=V/Z;# A
Imag=12.3;#abs(I);# A
Iang=-21.9;#atand(imag(I)/real(I));# degree
print"Current, magnitude(A) & Angle(degree) are",Imag,Iang
print"Total Current(A)",Imag
pf=0.93;#cosd(Iang);# Power Factor(lagging)
#fi=acosd(pf);# degree
print"Power Factor(lagging)",pf
# Answer is not accurate in the book.
# Example 3_29
# given data :
import math
V=230.;# V
I=25.;# A
f=50.;# Hz
R1=5.;# ohm
R2=10.;# ohm
L2=50.;# mH
Z1=R1;# ohm
Z2=R2+1j*2.*math.pi*f*L2/1000.;# ohm
#R=poly(0,'R');
#Z3=R;# ohm
#Z12=Z1*Z2/(Z1+Z2);# ohm
#Z=V/I;# ohm# Zdash is Z durectly
#R3=Z-Z12;# ohm
R3=5.;#real(R3);# ohm
print"Value of R(ohm)",R3
# Example 3_30
# given data :
V=200.;# V
f=50.;# Hz
ZA=4.+1j*3.;# ohm
ZB=10.-1j*7.;# ohm
ZC=6.+1j*5.;# ohm
Z=ZC+ZA*ZB/(ZA*ZB);# ohm
#IC=V/Z;# A
ICmag=23.2;#abs(IC);# A
ICang=-35.5;#atand(imag(IC)/real(IC));# degree
print"Current IC, magnitude(A) & Angle(degree) are",ICmag,ICang
#IA=IC*ZB/(ZA+ZB);# A
IAmag=19.5;#abs(IA);# A
IAang=-54.6;#atand(imag(IA)/real(IA));# degree
print"Current IA, magnitude(A) & Angle(degree) are",IAmag,IAang
#IB=IC*ZA/(ZA+ZB);# A
IBmag=7.98;#abs(IB);# A
IBang=17.3;#atand(imag(IB)/real(IB));# degree
print"Current IB, magnitude(A) & Angle(degree) are",IBmag,IBang
#fi=ICang;# degree# angle of pf
pf=0.81;#cosd(fi);# Power Factor(lagging)
print"Power Factor(lagging)",pf
#VC=IC*ZC;# V
VCmag=182.;#abs(VC);# A
VCang=4.27;#atand(imag(VC)/real(VC));# degree
print"Voltage VC, magnitude(V) & Angle(degree) are",VCmag,VCang
#VA=IC*ZA*ZB/(ZA+ZB);# V
VAmag=97.5;#abs(VA);# A
VAang=-17.7;#atand(imag(VA)/real(VA));# degree
print"Voltage VA, magnitude(V) & Angle(degree) are",VAmag,VAang
#VB=IC*ZA*ZB/(ZA+ZB);# V
VBmag=97.5;#abs(VB);# A
VBang=-17.7;#atand(imag(VB)/real(VB));# degree
print"Voltage VB, magnitude(V) & Angle(degree) are",VBmag,VBang
# Answer is not accurate in the book.
# Example 3_31
import math
# given data :
I2=10.;# A
f=50.;# Hz
R1=5.;# ohm
L1=0.0191;# H
R2=7.;# ohm
C2=398.;# micro F
R3=8.;# ohm
L3=0.0318;# H
Z1=R1+1j*2*math.pi*f*L1;# ohm
Z2=R2-1j/2/math.pi/f/(C2*10**-6);# ohm
Z3=R3+1j*2*math.pi*f*L3;# ohm
VAC=I2*Z2;# V
I1=VAC/Z1;# A
I=I1+I2;# A
VCB=I*Z3;# V
VAB=VAC+VCB;# V
VABmag=289.;#abs(VAB);# A
VABang=-22.2;#atand(imag(VAB)/real(VAB));# degree
print"Voltage AB, magnitude(V) & Angle(degree) are",VABmag,VABang
# Answer is not accurate in the book.
# Example 3_32
import math
# given data :
V=110.;# V
f=50.;# Hz
ZA=2.;# ohm
#ZB=3.+1j*4.;# ohm
#ZC=2.-1j*2.;# ohm
#ZAB=ZA*ZB/(ZA+ZB);# ohm
#ZP=ZAB*ZC/(ZAB+ZC);# ohm
#ZD=1.+1j*1.;# ohm
#z=ZP+ZD;# ohm
zmag=2.312;#abs(z);# A
zang=22.43;#atand(imag(z)/real(z));# degree
print"(a) Total impedence, magnitude(ohm) & Angle(degree) are",zang,zmag
I=47.6;#V/abs(z);# A
print"(b) Current taken by circuit(A)",I
#ID=I;# A
#RD=real(ZD);# ohm
PD=2263.3;#ID**2*RD;# /W
print"Power Consumed by branch D(W)",PD
# VPQ=I*ZP;
#IA=I*abs(ZP)/abs(ZA);# A
#RA=2;# ohm
PA=1479.2;#IA**2*RA;# W
print"Power Consumed by branch A(W)",PA
#IB=I*abs(ZP)/abs(ZB);# A
#RB=3;# ohm
PB=355.01;#IB**2*RB;# W
print"Power Consumed by branch B(W)",PB
#IC=I*abs(ZP)/abs(ZC);# A
#RC=2;# ohm
PC=739.61;#IC**2*RC;# W
print"Power Consumed by branch C(W)",PC
P=4837.;#PA+PB+PC+PD;# W
print"Total Power Consumed(W)",P
# Answer is not accurate in the book.
# Example 3_33
import math
# given data :
R=10.;# /ohm
L=0.1;# H
C=8.;# micro F
f0=1./2./math.pi/math.sqrt(L*C*10**-6);# Hz
print"(a) Resonant Frequency(Hz)",f0
Q=2*math.pi*f0*L/R;# Q-factor
print"(b) Q-factor",Q
f1=f0-R/4/math.pi/L;# Hz
f2=f0+R/4/math.pi/L;# Hz
print"(c) Half power frequencies, f1 & f2 in Hz are",f2,f1
BW=f2-f1;# Hz
print"Bandwidth(Hz)",BW
# Answer is not accurate in the book.
# Example 3_34
import math
# given data :
R=4.;# /ohm
L=0.5;# H
V=100.;# /V
f=50.;# Hz
C=(1./2./math.pi/f)**2./L*10.**6.;# micro F
print"(a) Capacitance at resonant Frequency(micro F)",C
I0=V/R;# A
VC=I0/2./math.pi/f/(C*10.**-6.);# V
print"(b) Voltage across the capacitor at resonant(V)",VC
Q=VC/V;# Q-factor
print"(b) Q-factor",Q
# Answer is not accurate in the book.
# Example 3_35
import math
# given data :
V=230.;# /V
f=50.;# Hz
Im=1.5;# A# Maximum current
VC=600.;# V
VL=600.;# V
R=V/Im;# ohm
XL=VL/Im;# ohm
L=XL/2./math.pi/f;# H
XC=XL;# ohm
C=1./2./math.pi/f/XC;# F
print"Resistance(ohm)",R
print"Inductance(H)",L
print"Capacitance(F)",C
# Answer is not accurate in the book.
# Example 3_36
import math
# given data :
f=100.;# Hz
C=100.;# micro F
Cdash=200.;# micro F# When current is half of maximum
L=1./(2.*math.pi*f)**2./(C*10.**-6.);# H
print"Inductance(H)",L
XL=2.*math.pi*f*L;# ohm
XC=1./2./math.pi/f/(Cdash*10.**-6.);# ohm
# at I=Im/2 Z will be 2*R
# Im=V/R and I=V/Z=V/sqrt(R**2+(XL-XC)**2)
R=(XL-XC)/math.sqrt(3);# ohm
print"Resistance(ohm)",R
# Answer is not accurate in the book.
# Example 3_37
# given data :
import math
R=10.;# ohm
L=20.;# mH
C=10.;# micro F
V=50.;# V
f0=1./2./math.pi/math.sqrt(L/1000.*C/10.**6.);# Hz
print"Resonance frequency(Hz)",f0
I0=V/R;# A
XL=2.*math.pi*f0*L/1000.;# ohm
VL=I0*XL;# V
print"Voltage across inductance(V)",VL
VR=I0*R;# V
print"Voltage across Resistance(V)",VR
XC=1./2./math.pi/f0/(C*10.**-6.);# ohm
VC=I0*XC;# V
print"Voltage across Capacitance(V)",VC
Q=VL/V;# Q-factor
print"Q-factor",Q
# Answer is not accurate in the book.
# Example 3_38
import math
# given data :
R=50.;# ohm
L=1.;# mH
Im=5.;# A# Maximum current
f0=50.;# Hz
C=1./(2.*math.pi*f0)**2./(L/1000.);# F
print"Value of C(F)",C
V=Im*R;# /V
print"Applied Voltage(V)",V
# Answer is not accurate in the book.
# Example 3_39
# given data :
import math
R=2.5;# ohm
XL=25.;# ohm
V=200.;# V
f0=50.;# Hz
XC=XL;# ohm
C=1./(2.*math.pi*f0*XC);# F
print"For maximum current, Value of C(F)",C
# At resonance Z=R
pf=1.;# power factor
print"Power Factor ",pf
Z=R;# ohm
print"Impedence(ohm)",Z
Im=V/R;# A
print"Current(A)",Im
# Answer is not accurate in the book.
# Example 3_40
import math
# given data :
R=10.;# ohm
L=100.;# mH
C=20.;# micro F
V=100.;# V
f0=1./2./math.pi*math.sqrt(1/(L/1000*C*10**-6)-R**2/(L/1000)**2);# Hz
print"Resonant frequency(Hz)",f0
Q=2*math.pi*f0*L/1000/R;# Q-factor
print"Q-factor",Q
Z0=L/1000/(C*10**-6)/R;# ohm
print"Dynamic Impedence(ohm)",Z0
I0=V/Z0;# A
print"Current at resonance(A)",I0
# Answer is not accurate in the book.
# Example 3_41
# given data :
R=5.;# ohm
XL=10.;# ohm
V=230.;# V
f=50.;# Hz
Z=R+1j*XL;# ohm
IL=V/Z;# A
#fi_L=atand(imag(IL)/real(IL));# degree
#IC=abs(IL)*sind(fi_L);# A
#XC=-V/IC;# ohm
C=254.6;#1/2/math.pi/f/XC*10**6;# micro F
print"Value of capacitor(micro F)",C
I=9.;#abs(IL)*cosd(fi_L);# A
#format('v',3);
print"Magnitude of in-phase current(A)",I
# Answer is not accurate in the book.
# Example 3_42
# given data :
import math
R=4.;# ohm
L=20.;# mH
V=230.;# V
f=50.;# Hz
omega=2.*math.pi*f;# rad/s
ZL=R+1j*omega*L/1000;# ohm
IL=V/ZL;# A
#fi_L=atand(imag(IL)/real(IL));# degree
#IC=abs(IL)*sind(fi_L);# A
#XC=-V/IC;# ohm
C=360.5;#1/2/math.pi/f/XC*10**6;# micro F
print"Value of capacitor(micro F)",C
I0=16.6;#abs(IL)*cosd(fi_L);# A
print"Magnitude of in-phase current(A)",I0
# Answer is not accurate in the book.
# Example 3_43
# given data :
XL1=6.;# ohm
R2=10.;# ohm
XC2=4.;# ohm
#R1=poly(0,'R1');
#Z1=R1+1j*XL1;# ohm
#Z2=R2-1j*XC2;# ohm
#Z=Z1*Z2/(Z1+Z2);# ohm
# Imaginary part of Z will be zero
# For Calculation
#eq=imag(numer(Z)*denom(Z'));# equaltion of imaginary part
#R1=roots(eq);# ohm
R1=11.75;#R1(1);# ohm# leaving -ve value
print"Value of R1(ohm)",R1