from math import pi,sqrt
# Calculate the resonant frequency for an 8-H inductance and a 20-uF capacitance.
# Given data
L = 8.# # L=8 Henry
C = 20.*10**-6# # C=20 uFarad
fr = 1./(2.*pi*sqrt(L*C))#
print 'The resonant frequency = %0.2f Hertz'%fr
print 'approx 12.6 Hertz'
# Calculate the resonant frequency for a 2-uH inductance and a 3-pF capacitance.
# Given data
L = 2.*10**-6# # Inductor=2 uHenry
C = 3.*10**-12# # Capacitor=3 pFarad
pi = 3.14#
fr = 1./(2.*pi*sqrt(L*C))#
print 'The resonant frequency = %0.2f Hertz'%fr
print 'i.e 65 MHz'
from math import pi
# What value of C resonates with a 239-uH L at 1000 kHz?
# Given data
L = 239.*10**-6# # Inductor=239 uHenry
fr = 1000.*10**3# # Resonant frequency=1000 kHertz
A = pi*pi# # pi square
B = fr*fr# # Resonant frequency square
C = 1./(4.*A*B*L)#
print 'The value of Capacitor = %0.2e Farads'%C
print 'i.e 106 pF'
from math import pi
# What value of L resonates with a 106-pF C at 1000 kHz, equal to 1 MHz?
# Given data
C = 106.*10**-12# # Capacitor=106 pFarad
fr = 1.*10**6# # Resonant frequency=1 MHertz
A = pi*pi# # pi square
B = fr*fr# # Resonant frequency square
C = 1./(4*A*B*C)#
print 'The value of Inductor = %.2e Henry'%C
print 'i.e 239 uF'
# A series circuit resonant at 0.4 MHz develops 100 mV across a 250-uH L with a 2-mV input. Calculate Q .
# Given data
Vo = 100.*10**-3# # Output voltage=100 mVolts
Vi = 2*10**-3# # Input voltage=2 mVolts
L = 250*10**-6# # Inductor=250 uHenry
f = 0.4*10**6# # Frequency=0.4 MHertz
Q = Vo/Vi#
print 'The Magnification factor Q =%0.2f'%Q
from math import pi
# What is the ac resistance of the coil in A series circuit resonant at 0.4 MHz develops 100 mV across a 250-uH L with a 2-mV input.
# Given data
Vo = 100.*10**-3# # Output voltage=100 mVolts
Vi = 2.0*10**-3# # Input voltage=2 mVolts
L = 250.0*10**-6# # Inductor=250 uHenry
f = 0.4*10**6# # Frequency=0.4 MHertz
Q = Vo/Vi#
Xl = 2*pi*f*L#
rs = Xl/Q#
print 'The Ac Resistance of Coil = %0.2f Ohms'%rs
# In Fig. 25–9, assume that with a 4-mVac input signal for VT, the voltage across R1 is 2 mV when R1 is 225-kOhms. Determine Zeq and Q.
# Given data
vin = 4.*10**-3# # Input AC signal=4 mVac
R1 = 225.*10**3# # Resistance1=225 kOhms
vR1 = 2.*10**-3# # Voltage across Resistor1=2 mVac
xl = 1.5*10**3# # Inductive Reactance=1.5 kOhms
print 'Because they divide Vt equally'
Zeq = R1#
print 'The Equivalent Impedence = %0.f Ohms'%Zeq
print 'i.e 225 kOhms'
Q = Zeq/xl#
print 'The Q =%0.2f'%Q
from math import pi
# A parallel LC circuit tuned to 200 kHz with a 350-uH L has a measured ZEQ of 17,600. Calculate Q.
# Given data
L = 350.*10**-6# # Inductor=350 uHenry
f = 200.*10**3# # Frequency=200 kHertz
Zeq = 17600.# # Equivalent Impedence=17600 Ohms
Xl = 2*pi*f*L#
Q = Zeq/Xl#
print 'The Magnification factor Q = %0.2f'%Q
# An LC circuit resonant at 2000 kHz has a Q of 100. Find the total bandwidth delta f and the edge frequencies f1 and f2.
# Given data
fr = 2000.*10**3# # Resonant frequency=2000 kHertz
Q = 100.# # Magnification factor=100
Bw = fr/Q#
print 'The Bandwidth BW or Delta f = %0.f Hertz'%Bw
print 'i.e 20 kHz'
f1 = fr-Bw/2#
print 'The Edge Frequency f1 = %0.f Hertz'%f1
print 'i.e 1990 kHz'
f2 = fr+Bw/2#
print 'The Edge Frequency f2 = %0.f Hertz'%f2
print 'i.e 2010 kHz'
# An LC circuit resonant at 6000 kHz has a Q of 100. Find the total bandwidth delta f and the edge frequencies f1 and f2.
# Given data
fr = 6000.*10**3# # Resonant frequency=6000 kHertz
Q = 100.# # Magnification factor=100
Bw = fr/Q#
print 'The Bandwidth BW or Delta f = %0.f Hertz'%Bw
print 'i.e 60 kHz'
f1 = fr-Bw/2#
print 'The Edge Frequency f1 = %0.f Hertz'%f1
print 'i.e 5970 kHz'
f2 = fr+Bw/2.0#
print 'The Edge Frequency f2 = %0.f Hertz'%f2
print 'i.e 6030 kHz'