import math
#Variable Declaration
C=0.005*10**-6 #in farad
Rs=8*10**3 #in ohm
f=1*10**3 #in Hz
#Calculations
Xs=1/(2*math.pi*f*C) #Capacitvie Reactance in ohm
Rp=(Rs**2+Xs**2)/Rs #in ohm
Xp=(Rs**2+Xs**2)/Xs #in ohm
Cp=1/(2*math.pi*f*Xp) #in farad
#Result
print "Since the measured terminal resistance is 134 kilo ohm, the circuit must consist of a"
print round(Cp*10**6,3),"micro farad capacitor connected in parallel with a",int(Rp/1000),"kilo ohm resistor"
print "For a series connected circuit, the terminal resistance will be much higher than 134 kilo ohm"
import math
#Variable Declaration
C1=0.1*10**-6 #in farad
#Calculation
#For R3:R4=100:1
ratio=100.0/1
Cx=C1*ratio #in farad
print "For R3/R4=100:1, Cx=",round(Cx*10**6),"micro farad"
#For R3:R4=1/100
ratio=1.0/100.0
Cx=C1*ratio #in farad
print "For R3/R4=1:100, Cx=",round(Cx*10**6,3),"micro farad"
import math
#Variable Declaration
R3=10*10**3 #in ohm
f=100 #in Hz
R1=125 #in ohm
R4=14.7*10**3 #in ohm
C1=0.4*10**-6 #in farad
#Calculations
Cs=C1*R3/R4 #in farad
Rs=R1*R4/R3 #in ohm
D=2*math.pi*f*Cs*Rs #Dissipation factor
#Results
print "Cs=",round(Cs*10**6,3),"micro farad"
print "Rs=",round(Rs,1),"ohm"
print "Disspiation factor(D)=",round(D,3)
#****************************Note**********************************************
# The value for C1 as per the problem statement is 0.4 micro farad
#But while calculating, 0.1 micro farad value has been considered in text book
#C1 is taken to be 0.4 microfarad
import math
#Variable Declaration
C1=0.1*10**-6 #in farad
R3=10*10**3 #in ohm
R1=375*10**3 #in ohm
R4=14.7*10**3 #in ohm
f=100 #in farad
#Calculations
Cp=C1*R3/R4 #in farad
Rp=R1*R4/R3 #in resistance
D=1/(2*math.pi*f*Cp*Rp) #Dissipation factor
#Results
print "Cp=",round(Cp*10**6,3),"micro farad"
print "Rp=",round(Rp/1000,1),"kilo ohm"
print "Dissipation Factor(D)=",'%.2e' % D
import math
#Variable Declaration
#From Example 8-3,
Cs=0.068*10**-6 #in farad
Rs=183.8 #in ohm
f=100 #in Hz
R3=10*10**3 #in ohm
R1=10*10**3 #in ohm
#Calculations
Xs=1/(2*math.pi*f*Cs) #in ohm
Rp=(Rs**2+Xs**2)/Rs #in ohm
Xp=(Rs**2+Xs**2)/Xs #in ohm
Cp=1/(2*math.pi*f*Xp) #in farad
R4=C1*R3/Cp #in ohm
R1=R3*Rp/R4 #in ohm
#Results
print "Rp=",round(Rp*10**-6,2),"mega ohm"
print "Cp=",round(Cp*10**6,3),"micro farad"
print "R4=",round(R4/1000,1),"kilo ohm"
print "R1=",round(R1*10**-6,2),"mega ohm"
import math
#Variable Declaration
L1=100*10**-3 #in henry
R4=5*10**3 #in ohm
Ls=500*10**-3 #in henry
Rs=270 #in ohm
#Calculations
R3=R4*L1/Ls #in ohm
R1=Rs*R3/R4 #in ohm
#Results
print "R3=",R3/1000,"kilo ohm"
print "R1=",R1,"ohm"
import math
#Variable Declaration
C3=0.1*10**-6 #in farad
R1=1.26*10**3 #in ohm
R3=470 #in ohm
R4=500 #in ohm
f=100 #in Hz
#Calculations
Ls=C3*R1*R4 #in henry
Rs=R1*R4/R3 #in ohm
Q=(2*math.pi*f*Ls)/Rs
#Results
print "Ls=",round(Ls*1000),"mH"
print "Rs=",round(Rs/1000,2),"kilo ohm"
print "Q factor(Q)=",round(Q,2)
import math
#Variable Declaration
C3=0.1*10**-6 #in farad
R1=1.26*10**3 #in ohm
R3=75 #in ohm
R4=500 #in ohm
f=100 #in Hz
#Calculations
Lp=C3*R1*R4 #in henry
Rp=R1*R4/R3 #in ohm
Q=Rp/(2*math.pi*f*Lp) #Quality factor
#Results
print "Lp=",round(Lp*1000),"mH"
print "Rp=",round(Rp/1000,2),"kilo ohm"
print "Q factor(Q)=",round(Q)
import math
#Variable Declaration
Lp=63*10**-3 #in henry
Rp=8.4*10**3 #in ohm
f=100 #in Hz
#Calculations
Xp=2*math.pi*f*Lp #in ohm
Rs=Rp*Xp**2/(Xp**2+Rp**2) #in ohm
Xs=Xp*Rp**2/(Xp**2+Rp**2) #in ohm
Ls=Xs/(2*math.pi*f) #in henry
R1=Ls/(C3*R4) #in ohm
R3=R1*R4/Rs #in ohm
#Results
print "Rs=",round(Rs,3),"ohm"
print "Ls=",round(Ls*10**3),"mH"
print "R1=",round(R1/1000,2),"kilo ohm"
print "R3=",round(R3*10**-6,2),"mega ohm"
import math
#Variable Declaration
R1=369.3*10**3 #in ohm
R3=10*10**3 #in ohm
R4=14.66*10**3 #in ohm
Rp=553.1*10**3 #in ohm
C1=0.1*10**-6 #in farad
Cp=0.068*10**-6 #in farad
#Calcultions
Ceq=round(C1*R3/R4,10) #Cx+Cp, Equivalent parallel capacitance, in farad
Cx=Ceq-Cp #in farad
Req=R1*R4/R3 #Equivalent resitance in ohm
Rx=1/(1/Req-1/Rp) #in ohm
#Results
print "Cx=",round(Cx*10**12),"pF"
print "Rx=",round(Rx*10**-8,1)*100,"mega ohm"
import math
#Variable Declaration
E=100*10**-3 #in V
R=5 #in ohm
Xl=100 #in ohm
Xc=100 #in ohm
#Calculations
I=E/R #At resonance, I is dependent only on R(A)
Vl=I*Xl #in V
Vc=I*Xc #in V
Q=Vl/E #Quality Factor
print "When R=5 ohm, Xl=100 ohm"
print "Vl=",Vl,"V"
print "Q=",Q
#For the second coil
R=10 #in ohm
Xl=100 #in ohm
Xc=100 #in ohm
I=E/R #At resonance, I is dependent only on R(A)
Vl=I*Xl #in V
Vc=I*Xc #in V
Q=Vl/E #Quality Factor
print
print "When R=10 ohm, Xl=100 ohm"
print "V=",Vl
print "Q=",Q
import math
#Variable Declaration
C=147*10**-12 #in farad
f=1.25*10**6 #in Hz
Q=98.0 #Q Factor
#Calculations
L=1/(C*(2*math.pi*f)**2) #in henry
R=(2*math.pi*f*L)/Q #in ohm
#Results
print "L=",round(L*10**6),"micro henry"
print "R=",round(R,1),"ohm"