# Chapter4-AC Circuits¶

## Ex1-pg4.4¶

In [1]:
##AC Circuits:example 4.1:(pg4.4)
import math
i=15.;

t=3.375*10**-3;
f=40.;
pi=3.14;
Im=(i/math.sin(2.*pi*f*t));
print("i=15 Amp");
print("t=3.375 ms");
print("f=40 Hz");
print("i=Im*sin(2*pi*f*t)");
print'%s %.2f %s'%("Im= ",Im, "Amp");

i=15 Amp
t=3.375 ms
f=40 Hz
i=Im*sin(2*pi*f*t)
Im=  20.00 Amp


## Ex2-pg4.4¶

In [2]:
##AC Circuits:example 4.2:(pg4.4)
import math
f=50.;
Im=100.;
i1=86.6;
t=(1/600.);
pi=3.14;
print("f=50 c/s");
print("Im=100 A");
## part(a)
print("i=Im*sin(2*pi*f*t)");
i=Im*math.sin(2*pi*f*t);
print'%s %.2f %s'%("i= ",i," A");
## part (b)
print("i=Im*sin(2*pi*f*t1)");
t1=(math.asin(i1/Im)/(2.*pi*f));
print'%s %.2e %s'%("t1= ",t1," second");

f=50 c/s
Im=100 A
i=Im*sin(2*pi*f*t)
i=  49.98  A
i=Im*sin(2*pi*f*t1)
t1=  3.33e-03  second


## Ex3-pg4.5¶

In [1]:
##AC Circuits:example 4.3:(pg4.5)
f=50.;
import math
I=20.;
t1=0.0025;
t2=0.0125;
I1=14.14;
pi=3.14;
print("f=50 c/s");
print("I=20 A");
print("Im=I*sqrt(2)");
Im=(math.sqrt(2)*I);
print'%s %.2f %s'%("\nIm= ",Im," A");
print("\nEquation of current, \ni=Im*sin(2*pi*f*t)");
print("=28.28sin(2*pi*f*t)=28.28sin(100*pi*t)");
print("(a)At           t=0.0025 seconds");
i=(Im*math.sin(2.*pi*f*t1));
print'%s %.2f %s'%("i= ",i," A"); ##when t=0.0025seconds
print("(b)At           t=0.0125 seconds");
i=(Im*math.sin(2*pi*f*t2));
print'%s %.2f %s'%("i= ",i," A"); ##when t=0.0125seconds
print("(c)             i=28.28sin(100*pi*t) ");
t=(math.asin(I1/Im)/(2*math.pi*f));
print'%s %.2e %s'%("t= ",t," second");## when I=14.14A

f=50 c/s
I=20 A
Im=I*sqrt(2)

Im=  28.28  A

Equation of current,
i=Im*sin(2*pi*f*t)
=28.28sin(2*pi*f*t)=28.28sin(100*pi*t)
(a)At           t=0.0025 seconds
i=  19.99  A
(b)At           t=0.0125 seconds
i=  -19.96  A
(c)             i=28.28sin(100*pi*t)
t=  1.67e-03  second


## Ex4-pg4.5¶

In [3]:
##AC Circuits : example 4.4 :pg(4.5)
import math
pi=3.14;
Vm=200.;
print("v=200sin314t");
print("v=Vmsin(2*pi*f*t)");
print("(2*pi*f)=314");
f=(314./(2.*pi));
print'%s %.2f %s'%("f= ",f," Hz");
Vavg=((2.*Vm)/pi);
Vrms=(Vm/math.sqrt(2.));
print('\nFor a sinusoidal waveform, \nVavg=(2*Vm/pi) \nVrms=(Vm/sqrt(2))');
kf=(Vrms/Vavg);
kc=(Vm/Vrms);
print'%s %.2f %s'%('\nform fator=',kf,'');
print'%s %.2f %s'%('\ncrest factor=',kc,'');

v=200sin314t
v=Vmsin(2*pi*f*t)
(2*pi*f)=314
f=  50.00  Hz

For a sinusoidal waveform,
Vavg=(2*Vm/pi)
Vrms=(Vm/sqrt(2))

form fator= 1.11

crest factor= 1.41


## Ex5-pg4.6¶

In [4]:
##AC Circuits : example 4.5 :(pg 4.6)
kf=1.2;
import math
kp=1.5;
Vavg=10.;
print("kf=1.2");
print("kp=1.5");
print("Vavg=10");
print("form factor kf=(Vrms/Vavg)");
Vrms=(kf*Vavg);
print'%s %.2f %s'%("\nVrms= ",Vrms," V");
print("peak factor kp=(Vm/Vrms)");
Vm=(kp*Vrms);
print'%s %.2f %s'%("\nVm= ",Vm," V");

kf=1.2
kp=1.5
Vavg=10
form factor kf=(Vrms/Vavg)

Vrms=  12.00  V
peak factor kp=(Vm/Vrms)

Vm=  18.00  V


## Ex14-pg4.11¶

In [5]:
##AC Circuits: example 4.14 :(pg 4.11)
v1=0.;
import math
v2=40.;
v3=60.;
v4=80.;
v5=100.;
t=8.;
Vavg=((v1+v2+v3+v4+v5+v4+v3+v2)/t);
Vrms=math.sqrt((v1**2+v2**2+v3**2+v4**2+v5**2+v4**2+v3**2+v2**2)/t);
print("Vavg=((0.+40.+60.+80.+100.+80.+60.+40.)/8.)");
print'%s %.2f %s'%("\nVavg= ",Vavg," V");
print("Vrms=sqrt((0+(40)^2+(60)^2+(80)^2+(100)^2+(80)^2+(60)^2+(40)^2)/8)");
print'%s %.2f %s'%("\nVrms= ",Vrms," V");

Vavg=((0.+40.+60.+80.+100.+80.+60.+40.)/8.)

Vavg=  57.50  V
Vrms=sqrt((0+(40)^2+(60)^2+(80)^2+(100)^2+(80)^2+(60)^2+(40)^2)/8)

Vrms=  64.42  V


## Ex15-pg4.11¶

In [6]:
##AC Circuits : example 4.15 :pg(4.11 & 4.12)
v1=0.;
import math
v2=10.;
v3=20.;
t=3.;
Vavg=((v1+v2+v3)/t);
Vrms=(math.sqrt((v1**2+v2**2+v3**2)/t));
print("Vavg=((0+10+20)/3)");
print'%s %.2f %s'%("Vavg= ",Vavg, "V");
print("Vrms=(((0)^2+(10)^2+(20)^2)/3)");
print'%s %.2f %s'%("Vrms= ",Vrms," V");

Vavg=((0+10+20)/3)
Vavg=  10.00 V
Vrms=(((0)^2+(10)^2+(20)^2)/3)
Vrms=  12.91  V


## Ex33-pg4.27¶

In [7]:
##AC Circuits : example 4.33 :pg(4.27)
Vm=177.;
import math
Im=14.14;
phi=30.;
V=(Vm/math.sqrt(2));
I=(Im/math.sqrt(2));
pf=math.cos(30/57.3);
P=(V*I*pf);
print("v(t)=177sin(314t+10)");## value of 10 is in degrees
print("i(t)=14.14sin(314t-20)");##value of 20 is in degrees
print("\nCurrent i(t) lags behind voltage v(t) by 30degrees");
print("phi=30degrees");
print'%s %.2f %s'%("Power factor       pf=cos(30)= ",pf," (lagging)");
print'%s %.2f %s'%("\nPower consumed    P=V*I*cos(phi)= ",P," W");

v(t)=177sin(314t+10)
i(t)=14.14sin(314t-20)

Current i(t) lags behind voltage v(t) by 30degrees
phi=30degrees
Power factor       pf=cos(30)=  0.87  (lagging)

Power consumed    P=V*I*cos(phi)=  1083.76  W


## Ex42-pg4.32¶

In [8]:
##AC Circuits : example 4.42 :pg(4.32 & 4.33)
import math
PR=1000.;
VR=200.;
Pcoil=250.;
Vcoil=300.;
R=((VR**2)/PR);
I=(VR/R);
r=((Pcoil/(I**2)));
Zcoil=(Vcoil/I);
XL=math.sqrt((Zcoil**2)-(r**2));
RT=(R+r);
ZT=math.sqrt((RT**2)+(XL**2));
V=(ZT*I);
print("\nPR=1000 W \nVR=200 V \nPcoil=250 W \nVcoil=300 V \nPR=(VR^2/R)");
print'%s %.2f %s'%("\nR= ",R," Ohms");
print'%s %.2f %s'%("\nVR=R*I \nI= ",I," A");
print("Pcoil=(I^2)*r");
print'%s %.2f %s'%("\nResistance of coil      r= ",r," Ohm");
print'%s %.2f %s'%("\nImpedance of coil       Zcoil=(Vcoil/I)= ",Zcoil," Ohms");
print'%s %.2f %s'%("\nReactance of coil       XL=sqrt((Zcoil^2)-(r^2)) = ",XL," Ohms");
print'%s %.2f %s'%("\nCombined resistance     RT=R+r= ",RT,"Ohms");
print'%s %.2f %s'%("\nCombined impedance      ZT=sqrt(((R+r)^2)+(XL^2)) = ",ZT," Ohms");
print'%s %.2f %s'%("\nSupply voltage          V=ZT*I= ",V," V");

PR=1000 W
VR=200 V
Pcoil=250 W
Vcoil=300 V
PR=(VR^2/R)

R=  40.00  Ohms

VR=R*I
I=  5.00  A
Pcoil=(I^2)*r

Resistance of coil      r=  10.00  Ohm

Impedance of coil       Zcoil=(Vcoil/I)=  60.00  Ohms

Reactance of coil       XL=sqrt((Zcoil^2)-(r^2)) =  59.16  Ohms

Combined resistance     RT=R+r=  50.00 Ohms

Combined impedance      ZT=sqrt(((R+r)^2)+(XL^2)) =  77.46  Ohms

Supply voltage          V=ZT*I=  387.30  V


## Ex47-pg4.36¶

In [9]:
##AC Circuits : example 4.47 :pg(4.47)
import math
f1=60.;
V=200.;
P=600.;
I=5.;
f=50.;
Z=V/I;
r=(P/(I**2));
XL=math.sqrt((Z**2)-(r**2));
L=(XL/(2.*math.pi*f));
XL1=(2.*math.pi*f1*L);
Z1=math.sqrt((r**2)+(XL1**2));
I=(V/Z1);
print("\nI=5 A \nV=200 V \nP=600 W \nFor f=50 Hz,");
print'%s %.2f %s'%("\nZ=V/I = ",Z," Ohms");
print'%s %.2f %s'%("\nP=((I^2)*r) \nr= ",r," Ohms");
print'%s %.2f %s'%("\nXL=sqrt((Z^2)-(r^2)) \nXL= ",XL," Ohms");
print'%s %.2f %s'%("\nXL=(2*pi*f*L)\nL= ",L," H");
print'%s %.2f %s'%("\nFor  f=60 Hz \nXL= ",XL1," Ohm");
print'%s %.2f %s'%("\nr=24 Ohms \nZ=sqrt((r^2)+(XL^2))= ",Z1," Ohms");
print'%s %.2f %s'%("\nI=V/Z= ",I," A");

I=5 A
V=200 V
P=600 W
For f=50 Hz,

Z=V/I =  40.00  Ohms

P=((I^2)*r)
r=  24.00  Ohms

XL=sqrt((Z^2)-(r^2))
XL=  32.00  Ohms

XL=(2*pi*f*L)
L=  0.10  H

For  f=60 Hz
XL=  38.40  Ohm

r=24 Ohms
Z=sqrt((r^2)+(XL^2))=  45.28  Ohms

I=V/Z=  4.42  A


## Ex48-pg4.37¶

In [10]:
##AC Circuits : example 4.48 :(pg 4.37)
f=50.;
import math
pi=3.14;
Vdc=12.;
Idc=2.5;
Vac=230.;
Iac=2.;
Pac=50.;
R=(Vdc/Idc);
Z=(Vac/Iac);
Pi=(Pac-((Iac**2)*R));
RT=(Pac/(Iac**2));
XL=math.sqrt((Z**2)-(RT**2));
L=(XL/(2.*pi*f));
pf=(RT/Z);
i=(Pi/(Iac**2));
print("\nFor dc      V=12 V,      I=2.5 A  \nFor ac      V=230 V,      I=2 A,      P=50 W");
print("\nIn an iron-cored coil,there are two types of losses \n(i)Losses in core known as core or iron loss \n(ii)Losses in winding known as copper loss");
print("\nP=(I^2)*R+Pi \nP/(I^2)=R+((Pi)/(I^2)) \nRT=R+(Pi/(I^2)) \nwhere R is the resistance of the coil and (Pi/I^2) is the resistance which is equivalent to the effect of iron loss");
print("\nFor dc supply,   f=0 \nXL=0");
print'%s %.2f %s'%("\nR= ",R," Ohm");
print'%s %.2f %s'%("\nFor ac supply \nZ= ",Z," Ohms");
print'%s %.2f %s'%("\nIron loss     Pi=P-I^2*R= ",Pi," W");
print'%s %.2f %s'%("\nRT=(P/I^2)= ",RT," Ohm");
print'%s %.2f %s'%("\nXL=sqrt((Z^2)-(RT^2))= ",XL," Ohm");
print'%s %.2f %s'%("\nXL=2*pi*L \nInductance      L= ",L," H");
print'%s %.2f %s'%("\nPower factor      =RT/Z= ",pf," (lagging)");
print'%s %.2f %s'%("\nThe series resistance equivalent to the effect of iron loss= Pi/(I^2)= ",i," Ohms");

For dc      V=12 V,      I=2.5 A
For ac      V=230 V,      I=2 A,      P=50 W

In an iron-cored coil,there are two types of losses
(i)Losses in core known as core or iron loss
(ii)Losses in winding known as copper loss

P=(I^2)*R+Pi
P/(I^2)=R+((Pi)/(I^2))
RT=R+(Pi/(I^2))
where R is the resistance of the coil and (Pi/I^2) is the resistance which is equivalent to the effect of iron loss

For dc supply,   f=0
XL=0

R=  4.80  Ohm

For ac supply
Z=  115.00  Ohms

Iron loss     Pi=P-I^2*R=  30.80  W

RT=(P/I^2)=  12.50  Ohm

XL=sqrt((Z^2)-(RT^2))=  114.32  Ohm

XL=2*pi*L
Inductance      L=  0.36  H

Power factor      =RT/Z=  0.11  (lagging)

The series resistance equivalent to the effect of iron loss= Pi/(I^2)=  7.70  Ohms


## Ex49-pg4.37¶

In [11]:
##AC Circuits : example 4.49 :(pg 4.37 & 4.38)
import math
f=50.;
I1=4.;
pf1=0.5;
V1=200.;
I2=5.;
pf2=0.8;
V2=40.;
Z1=(V2/I2);
R=(Z1*pf2);
XL1=math.sqrt((Z1**2)-(R**2));
L1=(XL1/(2.*math.pi*f));
Z2=(V1/I1);
RT=(Z2*pf1);
XL2=math.sqrt((Z2**2)-(RT**2));
L2=(XL2/(2.*math.pi*f));
Pi=(V1*I1*pf1-(I1**2)*R);
print("\nWith iron core    I=4 A    pf=0.5,    V=200 V \nWithout iron core    I=5 A    pf=0.8,    V=40 V \nWhen the iron-core is removed,");
print'%s %.2f %s'%("\nZ=V/I= ",Z1," Ohms");
print'%s %.2f %s'%("\npf=R/Z \nR= ",R," Ohms");
print'%s %.2f %s'%("\nXL=sqrt((Z**2)-(RT**2))= ",XL1," Ohms");
print'%s %.2f %s'%("\nXL=(2*pi*f*L) \nInductance    L= ",L1," H");
print'%s %.2f %s'%("\nWith iron core, \nZ= ",Z2," Ohms");
print'%s %.2f %s'%("\npf=RT/Z \nRT= ",RT," Ohm");
print'%s %.2f %s'%("\nXL=sqrt((Z**2)-(RT**2))= ",XL2," Ohm");
print'%s %.2f %s'%("\nXL=(2*pi*f*L) \nInductance        L= ",L2," H");
print'%s %.2f %s'%("\nIron loss      Pi=P=(I**2)*R \n=VIcos(phi)-I**2*R \n= ",Pi," W");

With iron core    I=4 A    pf=0.5,    V=200 V
Without iron core    I=5 A    pf=0.8,    V=40 V
When the iron-core is removed,

Z=V/I=  8.00  Ohms

pf=R/Z
R=  6.40  Ohms

XL=sqrt((Z**2)-(RT**2))=  4.80  Ohms

XL=(2*pi*f*L)
Inductance    L=  0.02  H

With iron core,
Z=  50.00  Ohms

pf=RT/Z
RT=  25.00  Ohm

XL=sqrt((Z**2)-(RT**2))=  43.30  Ohm

XL=(2*pi*f*L)
Inductance        L=  0.14  H

Iron loss      Pi=P=(I**2)*R
=VIcos(phi)-I**2*R
=  297.60  W


## Ex51-pg4.40¶

In [12]:
##AC Circuits : example 4.51 :(pg 4.40 & 4.41)
import math
P=2000.;
pf=0.5;
V=230.;
S=(P/pf);
phi=math.acos(pf)*57.3;
I=(P/(V*pf));
Q=(V*I*math.sin(phi/57.3));
print("P=2000 W");
print("pf=0.5 (leading)");
print("V=230 V");
print("P=V*I*cos(phi)");
print'%s %.2f %s'%("\nI= ",I," A");
print'%s %.2f %s'%("\nS=V*I=P/cos(phi)= ",S," VA");
print'%s %.2f %s'%("\nphi= ",phi," degrees");
print'%s %.2f %s'%("\nQ=V*I*sin(phi)= ",Q," VAR");

P=2000 W
pf=0.5 (leading)
V=230 V
P=V*I*cos(phi)

I=  17.39  A

S=V*I=P/cos(phi)=  4000.00  VA

phi=  60.00  degrees

Q=V*I*sin(phi)=  3464.10  VAR


## Ex52-pg4.41¶

In [13]:
##AC Circuits : example 4.52 :(pg 4.41)
import math
V=240.;
VR=100.;
P=300.;
f=50.;
R=((VR**2)/P);
I=math.sqrt(P/R);
Z=V/I;
XC=math.sqrt((Z**2)-(R**2));
C=(1./(2.*math.pi*f*XC));
VC=math.sqrt((V**2)-(VR**2));
VCmax=(VC*math.sqrt(2.));
Qmax=(C*VCmax);
Emax=((1./2.)*C*(VCmax**2));
print("\nV=240 V \nVR=100 V \nP=300 W \nf=50 Hz");
print'%s %.2f %s'%("\nP=(VR^2)/R \nR=((VR^2)/P)= ",R," Ohm");
print'%s %.2f %s'%("\nP=(I^2)*R \nI=sqrt((P/R)) \nI= ",I," A");
print'%s %.2f %s'%("\nZ=V/I=",Z," Ohm");
print'%s %.2f %s'%("\nXC=sqrt((Z^2)-(R^2))= ",XC," Ohm");
print'%s %.2e %s'%("\nXC=1/2*pi*f*C \nC= ",C," F");
print'%s %.2f %s'%("\nVoltage across capacitor VC=sqrt((V^2)-(VR^2))= ",VC," V");
print'%s %.2f %s %.2f %s '%("\nMaximum value of max charge \nVC= ",VCmax," V" and " \nQmax=C*VCmax= ",Qmax," C");
print'%s %.2f %s'%("\nMax stored energy Emax=((1/2)*C*(VCmax^2)) \n= ",Emax," J");

V=240 V
VR=100 V
P=300 W
f=50 Hz

P=(VR^2)/R
R=((VR^2)/P)=  33.33  Ohm

P=(I^2)*R
I=sqrt((P/R))
I=  3.00  A

Z=V/I= 80.00  Ohm

XC=sqrt((Z^2)-(R^2))=  72.72  Ohm

XC=1/2*pi*f*C
C=  4.38e-05  F

Voltage across capacitor VC=sqrt((V^2)-(VR^2))=  218.17  V

Maximum value of max charge
VC=  308.54
Qmax=C*VCmax=  0.01  C

Max stored energy Emax=((1/2)*C*(VCmax^2))
=  2.08  J


## Ex53-pg4.42¶

In [14]:
##AC Circuits : example 4.53 :(pg 4.42)
import math
C=35.*10**-6;
f=50.;
XC=(1./(2.*math.pi*f*C));
R=math.sqrt(3.*(XC**2));
R2=(3*(XC**2));
print'%s %.2f %s'%("\nC=35*10^-6 F \nf=50 Hz \nVC=1/2.V \nXC=1/(2*pi*f*C)= ",XC," Ohm");
print("\nVC=1/2.V \nXC.I=1/2.Z.I \nXC=1/2.Z \nZ=2.XC \nZ=sqrt((R^2)+(XC^2)) \n(2XC)^2=(R^2)+(XC^2) \n3XC^2=R^2");
print'%s %.2f %s %.2f %s '%("\nR^2=3*XC^2= ",R2," Ohm" and " \nR= ",R," Ohm");

C=35*10^-6 F
f=50 Hz
VC=1/2.V
XC=1/(2*pi*f*C)=  90.95  Ohm

VC=1/2.V
XC.I=1/2.Z.I
XC=1/2.Z
Z=2.XC
Z=sqrt((R^2)+(XC^2))
(2XC)^2=(R^2)+(XC^2)
3XC^2=R^2

R^2=3*XC^2=  24813.35
R=  157.52  Ohm


## Ex54-pg4.42¶

In [15]:
##AC Circuits : example 4.54 :(pg 4.42)
V=125.;
import math
I=2.2;
P=96.8;
f=50.;
Z=V/I;
R=(P/(I**2));
Xc=math.sqrt((Z**2)-(R**2));
C=(1./(2.*math.pi*f*Xc));
print("\nV=125 V \nP=96.8 W \nI=2.2 A \nf=50 Hz");
print'%s %.2f %s'%("\nZ=V/I= ",Z," A");
print'%s %.2f %s'%("\nP=(I^2)*R \nR= ",R," Ohm");
print'%s %.2f %s'%("\nXc=sqrt((Z^2)-(R^2))= ",Xc," Ohm");
print'%s %.2e %s'%("\nXc=1/(2*pi*f*C) \n C= ",C," F");

V=125 V
P=96.8 W
I=2.2 A
f=50 Hz

Z=V/I=  56.82  A

P=(I^2)*R
R=  20.00  Ohm

Xc=sqrt((Z^2)-(R^2))=  53.18  Ohm

Xc=1/(2*pi*f*C)
C=  5.99e-05  F


## Ex57-pg4.46¶

In [16]:
##AC Circuits :example 4.57 :(pg 4.46)
import math
j=-math.sqrt(1);
f=50.;
L=0.22;
R1=3.;
Z=3.8+j*6.4;
XL=2.*math.pi*f*L;
R2=3.8;
R=R2-R1;
X=6.4;
XC=XL-X;
C=(1./(2.*math.pi*f*XC));
print("\nZ=(3.8+j*6.4) Ohm");
print'%s %.2f %s'%("\nXL=2*pi*f*L= ",XL," Ohm");
print("\nZ=(3+j69.12+R-jXC) \n=(3+R)+j(69.12-XC)");
print'%s %.2f %s'%("\n3+R=3.8 \nR= ",R," Ohm");
print'%s %.2f %s'%("\nXC= ",XC,"Ohm");
print'%s %.2e %s'%("\nXC=1/2.pi.f.C \nC= ",C," F");

Z=(3.8+j*6.4) Ohm

XL=2*pi*f*L=  69.12  Ohm

Z=(3+j69.12+R-jXC)
=(3+R)+j(69.12-XC)

3+R=3.8
R=  0.80  Ohm

XC=  62.72 Ohm

XC=1/2.pi.f.C
C=  5.08e-05  F


## Ex58-pg4.46¶

In [17]:
##AC Circuits : example 4.58 :(pg 4.46)
import math
R=20.;
phi=45.;
Z=R/math.cos(phi/57.3);
XC=math.sqrt((Z**2)-(R**2));
XL=(2.*XC);
w=1000.;
L=(XL/w);
C=(1./(w*XC));
print("\nvL=300sin(1000t) \nR=20 Ohm \nphi=45 \nVL(max)=2Vcc(max) \nsqrt(2)*VL=2*sqrt(2)*VC \nI*XL=2*I*XC \nXL=2*XC \ncos(phi)=R/Z");
print'%s %.2f %s'%("\nZ= ",Z," Ohm");
print'%s %.2f %s'%("\nZ=sqrt((R^2)+(XL-XC)^2) \nXC = ",XC," Ohm"); ##for series R-L-C ckt
print'%s %.2f %s'%("\nXL=2*XC = ",XL," Ohm");
print'%s %.2f %s'%("\nXL=w*L \nL= ",L," H");
print'%s %.2e %s'%("\nXC=1/w*C \nC= ",C," F");

vL=300sin(1000t)
R=20 Ohm
phi=45
VL(max)=2Vcc(max)
sqrt(2)*VL=2*sqrt(2)*VC
I*XL=2*I*XC
XL=2*XC
cos(phi)=R/Z

Z=  28.28  Ohm

Z=sqrt((R^2)+(XL-XC)^2)
XC =  20.00  Ohm

XL=2*XC =  40.00  Ohm

XL=w*L
L=  0.04  H

XC=1/w*C
C=  5.00e-05  F


## Ex59-pg4.47¶

In [18]:
##AC Circuits : example 4.59 :(pg 4.47)
import math
pf=0.5;
C=79.59*10**-6;
f=50.;
XC=(1./(2.*math.pi*f*C));
R=pf*XC;
Zcoil=XC;
XL=math.sqrt((Zcoil**2)-(R**2));
L=(XL/(2.*math.pi*f));
print("\npf=0.5 \nC=79.57uF \nf=50 Hz \nVcoil=VC ");
print'%s %.2f %s'%("\nXC=1/2*pi*f*C = ",XC," Ohm");
print'%s %.2f %s'%("\nVcoil=VC \nZcoil=XC= ",XC," Ohm");
print'%s %.2f %s'%("\npf of coil=cos(phi)=R/Zcoil \nResistance of coil R= ",R," Ohm");
print'%s %.2f %s'%("\nXL=sqrt((Zcoil^2)-(R^2))= ",XL," Ohm");
print'%s %.2f %s'%("\nXL=2*pi*f*L \nInductance of coil= ",L," H");

pf=0.5
C=79.57uF
f=50 Hz
Vcoil=VC

XC=1/2*pi*f*C =  39.99  Ohm

Vcoil=VC
Zcoil=XC=  39.99  Ohm

pf of coil=cos(phi)=R/Zcoil
Resistance of coil R=  20.00  Ohm

XL=sqrt((Zcoil^2)-(R^2))=  34.64  Ohm

XL=2*pi*f*L
Inductance of coil=  0.11  H


## Ex60-pg4.48¶

In [19]:
##AC Circuits : example 4.60 :(pg 4.48)
import math
f=50.;
V=250.;
R=5.;
L=9.55;
Vcoil=300.;
XL=2.*math.pi*f*L;
Zcoil=(math.sqrt((R**2)+(XL**2)));
I=Vcoil/Zcoil;
Z=V/I;
XC1=Zcoil-Z;
XC2=Zcoil+Z;
C1=(1./(2.*math.pi*f*XC1));
C2=(1./(2.*math.pi*f*XC2));
print("\nV=250 V \nR=5 Ohm \nL=9.55 H \nVcoil=300 V");
print'%s %.2f %s'%("\nXL=2*pi*f*L = ",XL," Ohm");
print'%s %.2f %s'%("\nZcoil=sqrt(R^2)+(XL^2) = ",Zcoil," Ohm");
print'%s %.2f %s'%("\nI=Vcoil/Zcoil = ",I," A");
print'%s %.2f %s'%("\nZ=V/I = ",Z," Ohm");##total impedance
print'%s %.2f %s'%("\nZ=sqrt((R^2)+(XL-XC)^2) \nXC= ",XC1," Ohm");##when XL>XC
print'%s %.2f %s'%("\nC=1/2*pi*f*XC = ",C1," F");
print'%s %.2f %s'%("\nZ=sqrt((R^2)+(XC-XL)^2) \nXC= ",XC2," Ohm");##when XC>XL
print'%s %.2e %s'%("\nC= ",C2," F");

V=250 V
R=5 Ohm
L=9.55 H
Vcoil=300 V

XL=2*pi*f*L =  3000.22  Ohm

Zcoil=sqrt(R^2)+(XL^2) =  3000.23  Ohm

I=Vcoil/Zcoil =  0.10  A

Z=V/I =  2500.19  Ohm

Z=sqrt((R^2)+(XL-XC)^2)
XC=  500.04  Ohm

C=1/2*pi*f*XC =  0.00  F

Z=sqrt((R^2)+(XC-XL)^2)
XC=  5500.41  Ohm

C=  5.79e-07  F


## Ex79-pg4.64¶

In [28]:
##AC Circuits : example 4.79 :(pg 4.64)
import math
R=10.;
L=0.01;
C=100.*10**-6;
f0=(1./(2.*math.pi*math.sqrt(L*C)));
BW=(R/(2.*math.pi*L));
f1=f0-(BW/2.);
f2=f0+(BW/2.);
print("\nR=10 Ohm \nL=0.01H \nC=100uF");
print'%s %.2f %s'%("\nf0=1/2*pi*sqrt(L*C)= ",f0," Hz");##resonant frequency
print'%s %.2f %s'%("\nBW=R/2*pi*L = ",BW," Hz"); ##bandwidth
print'%s %.2f %s'%("\nf1=f0-BW/2 \n= ",f1," Hz"); ##lower frequency
print'%s %.2f %s'%("\nf2=f0+BW/2 = ",f2," Hz"); ##higher frequency

R=10 Ohm
L=0.01H
C=100uF

f0=1/2*pi*sqrt(L*C)=  159.15  Hz

BW=R/2*pi*L =  159.15  Hz

f1=f0-BW/2
=  79.58  Hz

f2=f0+BW/2 =  238.73  Hz


## Ex80-pg4.65¶

In [37]:
##AC Circuits : example 4.80 :(pg 4.65)
import math
R=10.;
L=0.2;
C=40.*10**-6;
V=100.;
f0=(1./(2.*math.pi*math.sqrt(L*C)));
I0=(V/R);
P0=((I0**2)*R);
pf=1.;
Vr=(R*I0);
Vl=((2.*math.pi*f0*L)*I0);
Vc=((1/(2.*math.pi*f0*C))*I0);
Q=((1./R)*math.sqrt(L/C));
f1=(f0-(R/(4.*math.pi*L)));
f2=(f0+(R/(4.*math.pi*L)));
print("\nR=10 Ohm \nL=0.2 H \nC=40uF \nV=100 V");
print'%s %.2f %s'%("\n(i) f0= 1/2*pi*sqrt(LC) = ",f0," Hz"); ##resonant frequency
print'%s %.2f %s'%("\n(ii) I0= V/R = ",I0," A"); ##current
print'%s %.2f %s'%("\n(iii) P0=(I0^2)*R = ",P0," W");##power
print("\n(iv) pf=1");##power factor
print'%s %.2f %s'%("\n(v) Rv = R.I = ",Vr," V");##voltage across resistor
print'%s %.2f %s'%("\n Lv = XL.I = ",Vl," V");##voltage across inductor
print'%s %.2f %s'%("\n Cv = XC.I = ",Vc," V"); ##voltage across capacitor
print'%s %.2f %s'%("\n(vi) Q =1/R*sqrt(L/C)=",Q,"");##Quality factor
print'%s %.2f %s'%("\n(vii)f1 = f0-R/4.pi.L = ",f1," Hz"); ##half power points
print'%s %.2f %s'%("\nf2=f0+R/4.pi.L = ",f2," Hz");
## x initialisation
import math
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
from math import log
import numpy
from math import tan
import matplotlib
from matplotlib import pyplot
x=numpy.array([-1,0.1,6.28]);
##simple plot
y=numpy.sin(x)
pyplot.plot(x,y)

R=10 Ohm
L=0.2 H
C=40uF
V=100 V

(i) f0= 1/2*pi*sqrt(LC) =  56.27  Hz

(ii) I0= V/R =  10.00  A

(iii) P0=(I0^2)*R =  1000.00  W

(iv) pf=1

(v) Rv = R.I =  100.00  V

Lv = XL.I =  707.11  V

Cv = XC.I =  707.11  V

(vi) Q =1/R*sqrt(L/C)= 7.07

(vii)f1 = f0-R/4.pi.L =  52.29  Hz

f2=f0+R/4.pi.L =  60.25  Hz

Out[37]:
[<matplotlib.lines.Line2D at 0x5aad050>]

## Ex81-pg4.66¶

In [38]:
##AC Circuits : example 4.81 :(pg 4.66)
import math
V=200.;
Vc=5000.;
I0=20.;
C=4.*10**-6;
R=V/I0;
Xco=Vc/I0;
f0=(1./(2.*math.pi*Xco*C));
L=(Xco/(2.*math.pi*f0));
print("\nV=200 V \nI0= 20 A \nVc=5000 V \nC=4uF");
print'%s %.2f %s'%("\nR=V/I0 = ",R," Ohm");##resistance
print'%s %.2f %s'%("\nXco=Vco/Io = ",Xco," Ohm");
print'%s %.2f %s'%("\nXco=1/2*pi*f0*C \nf0=1/2*pi*Xco*C = ",f0," Hz");
print'%s %.2f %s'%("\nat resonance Xco=Xlo \nXlo= ",Xco," Ohm");
print'%s %.2f %s'%("\nXlo=2*pi*f0*L \nL= ",L," H");

V=200 V
I0= 20 A
Vc=5000 V
C=4uF

R=V/I0 =  10.00  Ohm

Xco=Vco/Io =  250.00  Ohm

Xco=1/2*pi*f0*C
f0=1/2*pi*Xco*C =  159.15  Hz

at resonance Xco=Xlo
Xlo=  250.00  Ohm

Xlo=2*pi*f0*L
L=  0.25  H


## Ex82-pg4.66¶

In [39]:
##AC Circuits : example 4.82 :(pg 4.66)
import math
V=230.;
f0=50.;
I0=2.;
Vco=500.;
R=V/I0;
Xco=Vco/I0;
C=(1/(2.*math.pi*f0*Xco));
L=(Xco/(2.*math.pi*f0));
print("\nV = 230 V \nf0 = 50 Hz \nI0 = 2A \nVco = 500 V");
print'%s %.2f %s'%("\nR=V/I0 = ",R," Ohm");
print'%s %.2f %s'%("\nXco=Vco/I0 = ",Xco," Ohm");
print'%s %.2f %s'%("\nXco=1/2.pi.f0.C \nC=  ",C," F");##capacitance
print'%s %.2f %s'%("\nXco=Xlo \nXlo= ",Xco," Ohm");##at resonance
print'%s %.2f %s'%("\nXlo=2.pi.f0.L \nL= ",L," H");##inductance

V = 230 V
f0 = 50 Hz
I0 = 2A
Vco = 500 V

R=V/I0 =  115.00  Ohm

Xco=Vco/I0 =  250.00  Ohm

Xco=1/2.pi.f0.C
C=   0.00  F

Xco=Xlo
Xlo=  250.00  Ohm

Xlo=2.pi.f0.L
L=  0.80  H


## Ex83-pg4.67¶

In [41]:
##AC Circuits : example 4.82 :(pg 4.66)
import math
R=2.;
L=0.01;
V=200.;
f0=50.;
C=(1./(4.*(math.pi)**2*L*(f0**2)));
I0=V/R;
Vco=I0*(1./(2.*math.pi*f0*C));
print("\nR= 2 Ohm \nL= 0.01 H \nV=200 V \nf0=50 Hz \nf0=1/(2.pi.sqrt(LC)");
print'%s %.2f %s'%("\nC = ",C," F");##capacitance
print'%s %.2f %s'%("\nI0= V/R = ",I0," A");##current
print'%s %.2f %s'%("\nVco=I0.Xco \n= ",Vco," V"); ##voltage across capacitor

R= 2 Ohm
L= 0.01 H
V=200 V
f0=50 Hz
f0=1/(2.pi.sqrt(LC)

C =  0.00  F

I0= V/R =  100.00  A

Vco=I0.Xco
=  314.16  V


## Ex84-pg4.67¶

In [42]:
##AC Circuits : example 4.84 :(pg 4.67)
import math
BW=400.;
Vco=500.;
R=100.;
Vm=10.;
V=(Vm/math.sqrt(2.));
I0=V/R;
L=R/BW;
Q0=Vco/V;
C=(L/(Q0*R)**2);
f0=(1/(2.*math.pi*math.sqrt(L*C)));
f1=(f0-(R/(4.*math.pi*L)));##lower cut-off frequency
f2=(f0+(R/(4.*math.pi*L)));##upper cut-off frequency
print("\nv(t)=10sinwt \nVco=5000V \nBW=400rad/s \nR=100 Ohm");
print'%s %.2f %s'%("\nV= ",V," V");
print'%s %.2f %s'%("\nI0=V/R= ",I0," A");
print'%s %.2f %s'%("\nBW=R/L \nL= ",L," H");
print'%s %.2f %s'%("\nQ0=Vco/V =",Q0,"");
print'%s %.2e %s'%("\nQ0=1/R*sqrt(L/C) \nC= ",C," F");
print'%s %.2f %s'%("\nf0=1/2.pi.sqrt(LC)= ",f0," Hz");
print'%s %.2f %s'%("\nf1=f0-R/4.pi.L = ",f1," Hz");##lower cut-off frequency
print'%s %.2f %s'%("\nf2=f0+R/4.pi.L = ",f2," Hz"); ##upper cut-off frequency

v(t)=10sinwt
Vco=5000V
BW=400rad/s
R=100 Ohm

V=  7.07  V

I0=V/R=  0.07  A

BW=R/L
L=  0.25  H

Q0=Vco/V = 70.71

Q0=1/R*sqrt(L/C)
C=  5.00e-09  F

f0=1/2.pi.sqrt(LC)=  4501.58  Hz

f1=f0-R/4.pi.L =  4469.75  Hz

f2=f0+R/4.pi.L =  4533.41  Hz


## Ex85-pg4.68¶

In [43]:
##AC Circuits : example 4.85 :(pg 4.68)
import math
R=500.;
f1=100.;
f2=10.*10**3;
BW=f2-f1;
f0=((f1+f2)/2.);
L=(R/(2.*math.pi*BW));
XL0=(2.*math.pi*f0*L);
C=(1/(2.*math.pi*f0*XL0));
Q0=((1./R)*(math.sqrt(L/C)));
print'%s %.2f %s'%("\nR= 500 Ohm \nf1 = 100 Hz \nf2=10kHz \nBW= f2-f1 = ",BW," Hz");
print'%s %.2f %s'%("\nf1=f0-BW/2 ------(i) \nf2=f0+BW/2 ------(ii) \nf1+f2 =2f0 \nf0=(f1+f2)/2 = ",f0," Hz");
print'%s %.2f %s'%("\nBW=R/2.pi.f0.L \nL= ",L," H");
print'%s %.2f %s'%("\nXL0=2.pi.f0.L = ",XL0," Ohm");
print'%s %.2f %s'%("\nXL0=XC0 = ",XL0," Ohm");##at resonance
print'%s %.2e %s'%("\nXC0 =1/2.pi.f0.C \nC= ",C," F");
print'%s %.2f %s'%("\nQ0=(1/R*sqrt(L/C)) =",Q0,"");

R= 500 Ohm
f1 = 100 Hz
f2=10kHz
BW= f2-f1 =  9900.00  Hz

f1=f0-BW/2 ------(i)
f2=f0+BW/2 ------(ii)
f1+f2 =2f0
f0=(f1+f2)/2 =  5050.00  Hz

BW=R/2.pi.f0.L
L=  0.01  H

XL0=2.pi.f0.L =  255.05  Ohm

XL0=XC0 =  255.05  Ohm

XC0 =1/2.pi.f0.C
C=  1.24e-07  F

Q0=(1/R*sqrt(L/C)) = 0.51


## Ex87-pg4.69¶

In [44]:
##AC Circuits : example 4.87 :(pg 4.69 & 4.70)
import math
f0=10**6;
C1=500.*10**-12;
C2=600.*10**-12;
C=500.*10**-12;
x=((2.*math.pi*f0)**2);
L=(1./(x*C));
XL=(2.*math.pi*f0*L);
y=2.*math.pi*f0*C2;
XC=(1./y);
R=math.sqrt(((XL-XC)**2)/3.);
x=math.sqrt(L/C);
Q0=((1./R)*x);
print("\nf0= 1MHz \nC1=500pF \nC2=600pF \nC=500pF");##At resonance
print'%s %.2e %s'%("\nf0=1/2.pi.sqrt(LC)\nL= ",L," H");
print'%s %.2f %s'%("\nXL=2.pi.f0.L = ",XL," Ohm");
print'%s %.2f %s'%("\nXC=1/2.pi.f0.C \nXC= ",XC," Ohm");
print("\nI=1/2.I0 \nV/Z=1/2.V/R \nZ=2R");
print'%s %.2f %s'%("\nsqrt((R^2)-(XL-XC)^2)=2R \nR= ",R," Ohm");##Resistance of Inductor
print'%s %.2f %s'%("\nQ0=1/R.sqrt(L/C) \n=",Q0,"");

f0= 1MHz
C1=500pF
C2=600pF
C=500pF

f0=1/2.pi.sqrt(LC)
L=  5.07e-05  H

XL=2.pi.f0.L =  318.31  Ohm

XC=1/2.pi.f0.C
XC=  265.26  Ohm

I=1/2.I0
V/Z=1/2.V/R
Z=2R

sqrt((R^2)-(XL-XC)^2)=2R
R=  30.63  Ohm

Q0=1/R.sqrt(L/C)
= 10.39


## Ex88-pg4.72¶

In [45]:
##AC Circuits : example 4.88 :(pg 4.72)
import math
R=20.;
C=100.*10**-6;
L=0.2;
DR=(L/(C*R));
x=(1./(L*C));
y=((R/L)**2);
f0=((1./(2.*math.pi))*math.sqrt(x-y));
DR=(L/(C*R));
print("\nR=20 Ohm \nL=0.2 H \nC=100uF");
print'%s %.2f %s'%("\nf0=1/2.pi.sqrt(1/LC-R^2/L^2) \n= ",f0," Hz");
print'%s %.2f %s'%("\n dynamic resistance =L/CR \n=  ",DR," Ohm");

R=20 Ohm
L=0.2 H
C=100uF

f0=1/2.pi.sqrt(1/LC-R^2/L^2)
=  31.83  Hz

dynamic resistance =L/CR
=   100.00  Ohm


## Ex89-pg4.72¶

In [46]:
##AC Circuits : example 4.89 :(pg 4.72 & 4.73)
import math
R=20.;
L=200.*10**-6;
f=10**6;
V=230.;
Rs=8000.;
XL=2.*math.pi*f*L;
x=((2.*math.pi*f)**2);
y=((R/L)**2);
C=(1./((x+y)*L));
Q=((2.*math.pi*f*L)/R);
Z=(L/(C*R));
ZT=(Rs+Z);
IT=(V/ZT);
print'%s %.2f %s'%("\nR=20 Ohm \nL=200uH \nf=10^6 \nV=230 V \nRs=8000 Ohm \nXL=2.pi.f.L = ",XL,"Ohm");
print'%s %.2f %s'%("\nf0=1/2.pi.sqrt(1/LC-R^2/L^2) \nC= ",C," F");
print'%s %.2f %s'%("\nQ0=2.pi.f.L/R =",Q,"");##quality factor
print'%s %.2f %s'%("\nZ=L/CR \n ",Z," Ohm");##dynamic impedance
print'%s %.2f %s'%("\nZt= ",ZT," Ohm");##total equivalent Z at resonance
print'%s %.2e %s'%("\nIt= ",IT," A");##total ckt current

R=20 Ohm
L=200uH
f=10^6
V=230 V
Rs=8000 Ohm
XL=2.pi.f.L =  1256.64 Ohm

f0=1/2.pi.sqrt(1/LC-R^2/L^2)
C=  0.00  F

Q0=2.pi.f.L/R = 62.83

Z=L/CR
78976.84  Ohm

Zt=  86976.84  Ohm

It=  2.64e-03  A