from __future__ import division
import math
import cmath
#initializing the variables:
R = 10;# in ohms
L = 0.005;# IN Henry
C = 0.25e-6;# IN fARADS
V = 50;#in volts
#calculation:
#Resonant frequency, for parallel
fr = ((1/(L*C) - ((R**2)/(L**2)))**0.5)/(2*math.pi)
#dynamic resistance
Rd = L/(C*R)
#Current at resonance
Ir = V/Rd
wr = 2*math.pi*fr
#Q-factor at resonance, Q = wr*L/R
Qr = wr*L/R
#Results
print "\n\n Result \n\n"
print "\n (a)Resonance frequency is ",round(fr,2)," Hz\n"
print "\n (b)dynamic resistance ",round(Rd,2)," ohm\n"
print "\n (c)Current at resonance, Ir is ",round(Ir,2)," A\n"
print "\n (d)Q-factor at resonance is ",round(Qr,2),"\n"
from __future__ import division
import math
import cmath
#initializing the variables:
RL1 = 0;# in ohms
RL2 = 30;# in ohms
L = 0.100;# IN Henry
C = 40e-6;# IN fARADS
V = 50;#in volts
#calculation:
#for RL1
#Resonant frequency,
wr1 = (1/(L*C))**0.5
fr1 = wr1/(2*math.pi)
#for RL2
#Resonant frequency,
wr2 = (1/(L*C) - ((RL2**2)/(L**2)))**0.5
fr2 = wr2/(2*math.pi)
#Results
print "\n\n Result \n\n"
print "\n (a)Resonance frequency at RL = 0 is ",round(fr1,2)," Hz"
print "\n (b)Resonance frequency at RL = 30 ohm is ",round(fr2,2)," Hz\n"
from __future__ import division
import math
import cmath
#initializing the variables:
R = 150;# in ohms
L = 0.120;# IN Henry
V = 20;#in volts
fr = 4000;# in Hz
#calculation:
#capacitance, C
C = 1/(L*((2*math.pi*fr)**2 + ((R**2)/(L**2))))
Rd = L/(C*R)
#Current at resonance
Ir = V/Rd
wr = 2*math.pi*fr
#Q-factor at resonance, Q = wr*L/R
Qr = wr*L/R
#bandwidth,.(f2 − f1)
bw = fr/Qr
#upper half-power frequency, f2
f2 = (bw + ((bw**2) + 4*(fr**2))**0.5)/2
#lower half-power frequency, f1
f1 = f2 - bw
#impedance at the −3 dB frequencies
Z = Rd/(2**0.5)
#Results
print "\n\n Result \n\n"
print "\n (a)the capacitance of the capacitor,C is ",round(C*1E6,2),"uF"
print "\n (b)dynamic resistance ",round(Rd,2),"ohm\n"
print "\n (c)Current at resonance, Ir is ",round(Ir*1000,2),"mA\n"
print "\n (d)Q-factor at resonance is ",round(Qr,2),"\n"
print "\n (e)bandwidth is ",round(bw,2)," Hz\n"
print "\n (f)the upper half-power frequency, f2 is ",round(f2,2)," Hz and "
print " the lower half-power frequency, f1 is ",round(f1,2)," Hz\n"
print "\n (g)impedance at the -3 dB frequencies is ",round(Z,2)," ohm\n"
from __future__ import division
import math
import cmath
#initializing the variables:
RL = 5;# in ohms
L = 0.002;# IN Henry
C = 25e-6;# IN fARADS
Rc = 3;# in ohms
#calculation:
#Resonant frequency, for parallel
fr = (1/(2*math.pi*((L*C)**0.5)))*((RL**2 - (L/C))/(Rc**2 - (L/C)))**0.5
#Results
print "\n\n Result \n\n"
print "\n resonant frequency, fr is ",round(fr,2)," Hz"
from __future__ import division
import math
import cmath
#initializing the variables:
RL = 3;# in ohms
fr = 1000;# in Hz
Xc = 10;# IN ohms
Rc = 4;# in ohms
#calculation:
XL1 = (((Rc**2 + Xc**2)/Xc) + ((((Rc**2 + Xc**2)/Xc)**2) - 4*(RL**2))**0.5)/2
XL2 = (((Rc**2 + Xc**2)/Xc) - ((((Rc**2 + Xc**2)/Xc)**2) - 4*(RL**2))**0.5)/2
wr = 2*math.pi*fr
#inductance
L1 = XL1/wr
L2 = XL2/wr
#Results
print "\n\n Result \n\n"
print "\n inductance is either ",round(L1*1000,2),"mH or ",round(L2*1000,2),"mH"
from __future__ import division
import math
import cmath
#initializing the variables:
QL = 60;# Q-factor
Qc = 300;# Q-factor
#calculation:
QT = QL*Qc/(QL + Qc)
#Results
print "\n\n Result \n\n"
print "\n the overall Q-factor is ",round(QT,2)
from __future__ import division
import math
import cmath
#initializing the variables:
C = 10.61E-9;# in Farad
bw = 500;# in Hz
fr = 150000;# in Hz
x = 0.004
#calculation:
#Q-factor
Q = fr/bw
wr = 2*math.pi*fr
#dynamic resistance, RD
Rd = Q/(C*wr)
de = x
Z = Rd/(1 + (2*de*Q*1j))
#Results
print "\n\n Result \n\n"
print "\n (a)Q-factor ",round(Q,2),""
print "\n (b)dynamic resistance ",round(Rd,2),"ohm"
print "\n (c)magnitude of the impedance ",round(abs(Z),2),"ohm"