from __future__ import division
import math
#initializing the variables:
L1 = 2*100E-3;# in Henry
C1 = 0.2E-6;# in Fareads
L2 = 0.4;# in Henry
C2 = 2*200E-12;# in Fareads
#calculation:
#cut-off frequency
fc1 = 1/(math.pi*(L1*C1)**0.5)
#nominal impedance
R01 = (L1/C1)**0.5
#cut-off frequency
fc2 = 1/(math.pi*(L2*C2)**0.5)
#nominal impedance
R02 = (L2/C2)**0.5
#Results
print "\n\n Result \n\n"
print "\n cut-off frequency ",round(fc1,2)," Hz and the nominal impedance is ",round( R01,2)," ohm "
print "\n cut-off frequency ",round(fc2,2)," Hz and the nominal impedance is ",round( R02,2)," ohm "
from __future__ import division
import math
import cmath
#initializing the variables:
R0 = 600;# in ohm
fc = 5E6;# in Hz
#calculation:
#capacitance
C = 1/(math.pi*R0*fc)
#inductance
L = R0/(math.pi*fc)
#Results
print "\n\n Result \n\n"
print "A low-pass T section filter capcitance is ",round(C*1E12,2),"pfarad and inductance is",round( L/2*1E6,2),"uHenry"
print "A low-pass pi section filter capcitance is ",round(C/2*1E12,2),"pfarad and inductance is",round( L*1E6,2),"uHenry"
from __future__ import division
import math
import cmath
#initializing the variables:
R0 = 500;# in ohm
fc = 100000;# in Hz
f = 90000;# in Hz
#calculation:
#characteristic impedance of the pi section
Zpi = R0/(1 - (f/fc)**2)**0.5
#characteristic impedance of the T section
Zt = R0*(1 - (f/fc)**2)**0.5
#Results
print "\n\n Result \n\n"
print "\ncharacteristic impedance of the pi section is ",round(Zpi,2)," ohm"
print "\ncharacteristic impedance of the T section is ",round(Zt,2)," ohm"
from __future__ import division
import math
import cmath
#initializing the variables:
R0 = 600;# in ohm
fc = 2E6;# in Hz
Z1 = 600;# in ohm
Z2 = 1000;# in ohm
Z3 = 10000;# in ohm
#calculation:
#frequency
f1 = fc*(1 - (R0/Z1)**2)**0.5
f2 = fc*(1 - (R0/Z2)**2)**0.5
f3 = fc*(1 - (R0/Z3)**2)**0.5
#Results
print "\n\n Result \n\n"
print "frequency at which the characteristic impedance of the section is 600 ohm is ",f1," Hz "
print "and 1000 Ohm is ",f2*1E-3,"kHz and 10000 ohm is ",round(f3*1E-3,2),"kHz "
from __future__ import division
import math
#initializing the variables:
L1 = 100*1E-3;# in Henry
C1 = 0.2*1E-6;# in Fareads
L2 = 200*1E-6;# in Henry
C2 = 4000*1E-12;# in Fareads
#calculation:
#cut-off frequency
fc1 = 1/(4*math.pi*(L1*C1/2)**0.5)
#nominal impedance
R01 = (L1*2/C1)**0.5
#cut-off frequency
fc2 = 1/(4*math.pi*(L2*C2/2)**0.5)
#nominal impedance
R02 = (L2/(C2*2))**0.5
#Results
print "\n\n Result \n\n"
print "\n cut-off frequency ",round(fc1,0)," Hz and the nominal impedance is ",round( R01,0)," ohm"
print "\n cut-off frequency ",round(fc2/1000,0),"KHz and the nominal impedance is ",round( R02,0)," ohm "
from __future__ import division
import math
import cmath
#initializing the variables:
R0 = 600;# in ohm
fc = 25000;# in Hz
#calculation:
#capacitance
C1 = 2/(4*math.pi*R0*fc)
#inductance
L1 = R0/(4*math.pi*fc)
#capacitance
C2 = 1/(4*math.pi*R0*fc)
#inductance
L2 = 2*R0/(4*math.pi*fc)
#Results
print "\n\n Result \n\n"
print "\n A low-pass T section filter capcitance is ",round(C1*1E9,2),"nfarad and inductance is",round(L1*1E3,2),"mHenry"
print "\n A high-pass pi section filter capcitance is ",round(C2*1E9,3),"nfarad and inductance is",round(L2*1E3,2),"mHenry"
from __future__ import division
import math
import cmath
#initializing the variables:
R0 = 600;# in ohm
fc = 500;# in Hz
Z1 = 0;# in ohm
Z2 = 300;# in ohm
Z3 = 590;# in ohm
#calculation:
#frequency
f1 = fc
f2 = fc/(1 - (Z2/R0)**2)**0.5
f3 = fc/(1 - (Z3/R0)**2)**0.5
#Results
print "\n\n Result \n\n"
print "requency at which the characteristic impedance of the section is 0 ohm is ",f1," Hz "
print "and 300 Ohm is ",round(f2,2)," Hz and 590 ohm is ",round(f3,2)," Hz "
from __future__ import division
import math
import cmath
#initializing the variables:
r1 = 1.25 + 0.52j;# propagation coefficients
rr = 1.794;# propagation coefficients
thetar = -39.4;# in ddegrees
#calculation:
#r
r2 = rr*math.cos(thetar*math.pi/180) + 1j*rr*math.sin(thetar*math.pi/180)
#attenuation coefficient
a1 = r1.real
a2 = r2.real
#phase shift coefficient
b1 = r1.imag
b2 = r2.imag
#Results
print "\n\n Result \n\n"
print "\nattenuation coefficient are for (a) is ",a1," N and for (b) is ",round(a2,2)," N "
print "\nphase shift coefficient are for (a) is ",b1," rad and for (b) is ",round(b2,2)," rad "
from __future__ import division
import math
import cmath
#initializing the variables:
ri1 = 0.024;# in amperes
ri2 = 0.008;# in amperes
thetai1 = 10;# in ddegrees
thetai2 = -45;# in ddegrees
#calculation:
#currents
I1 = ri1*math.cos(thetai1*math.pi/180) + 1j*ri1*math.sin(thetai1*math.pi/180)
I2 = ri2*math.cos(thetai2*math.pi/180) + 1j*ri2*math.sin(thetai2*math.pi/180)
#ir
ir = I1/I2
irmag = ri1/ri2
thetai = thetai1-thetai2
#attenuation coefficient
a = math.log(irmag)
#phase shift coefficient
b = thetai*math.pi/180
#propagation coefficient
r = a + 1j*b
#output current of the fifth stage
I6 = I1/(ir**5)
x = ir**5
xmg = abs(x)
#overall attenuation coefficient
ad = math.log(xmg)
#overall phase shift coefficient
bd = cmath.phase(complex(x.real,x.imag))
#Results
print "\n\n Result \n\n"
print "\nattenuation coefficient is ",round(a,3)," N "
print "\nphase shift coefficient is ",round(b,3)," rad "
print "\npropagation coefficient is ",round(a,3)," + (",round(b,3),")i "
print "\nthe output current of the fifth stage is ",round(abs(I6*1E6),1),"/_",round(cmath.phase(complex(I6.real,I6.imag))*180/math.pi,2),"deg mA "
print "and the overall propagation coefficient is ",round(ad,2)," + (",round(bd+(2*math.pi),2),")i"
from __future__ import division
import math
import cmath
#initializing the variables:
XL = 5j;# in ohms
Xc = -1j*10;# in ohms
RL = 12;# in ohms
I1 = 1;# in amperes (lets say)
#calculation:
#current I2
I2 = (Xc/(Xc + XL + RL))*I1
#current ratio
Ir = I1/I2
Irmg = abs(Ir)
#attenuation coefficient
a = math.log(Irmg)
#phase shift coefficient
b = cmath.phase(complex(Ir.real, Ir.imag))
#propagation coefficient
r = a + 1j*b
#Results
print "\n\n Result \n\n"
print "\nattenuation coefficient is ",round(a,2)," N "
print "\nphase shift coefficient is ",round(b,2)," rad "
print "\npropagation coefficient is ",round(a,2)," + (",round(b,2),")i "
from __future__ import division
import math
#initializing the variables:
L = 2*0.5;# in Henry
C = 2E-9;# in Farad
#calculation:
#time delay
t = (L*C)**0.5
#time delay at the cut-off frequency
tfc = t*math.pi/2
#Results
print "\n\n Result \n\n"
print "\n time delay is ",round(t*1E6,2),"usec "
print "\ntime delay at the cut-off frequency is ",round(tfc*1E6,2),"usec"
from __future__ import division
import math
#initializing the variables:
fc = 500000;# in Hz
t1 = 9.55E-6;# in secs
R0 = 1000;# in ohm
#calculation:
#for a low-pass filter section, capacitance
C = 1/(math.pi*R0*fc)
#inductance
L = R0/(math.pi*fc)
#time delay
t2 = (L*C)**0.5
#number of cascaded sections required
n = t1/t2
#Results
print "\n\n Result \n\n"
print "\n for low-pass T section inductance is ",round(L/2*1E6,2),"uH and capacitance is ",round(C*1E12,2),"pF"
print "\n for low-pass pi section inductance is ",round(L*1E6,2),"uH and capacitance is ",round(C/2*1E12,2),"pF"
print "\nnumber of cascaded sections required is ",round(n,2)
from __future__ import division
import math
import cmath
#initializing the variables:
n = 8;# sections in cascade
R0 = 1000;# in ohm
t1 = 4E-6;# in secs
#calculation:
#time delay
t2 = t1/n
#capacitance
C = t2/R0
#inductance
L = t2*R0
#Results
print "\n\n Result \n\n"
print "\n for low-pass T section inductance is ",L/2*1E6,"uH and capacitance is ",C*1E12,"pF"
print "\n for high-pass pi section inductance is ",2*L*1E6,"uH and capacitance is ",C*1E12,"pF"
from __future__ import division
import math
import cmath
#initializing the variables:
R0 = 600;# in ohm
fc = 5000; # in Hz
finf = 5500; #in Hz
#calculation:
m = (1 - (fc/finf)**2)**0.5
C = 1/(math.pi*R0*fc)
L = R0/(math.pi*fc)
LT = m*L/2
CT = m*C
Ls = (1- m**2)*L/(4*m)
Cpi = m*C/2
Lpi = m*L
Cp = (1- (m**2))*C/(4*m)
#Results
print "\n\n Result \n\n"
print "\n for mderived T section inductance is ",round(Ls*1000,2),"mH and capacitance is ",round(CT*1E9,2),"nF"
print "\n for mderived pi section inductance is ",round(Lpi*1000,2),"mH and capacitance is ",round(Cp*1E9,2),"nF"
from __future__ import division
import math
import cmath
#initializing the variables:
R0 = 500;# in ohm
fc = 20000; # in Hz
finf = 16000; #in Hz
#calculation:
m = (1 - (finf/fc)**2)**0.5
C = 1/(4*math.pi*R0*fc)
L = R0/(4*math.pi*fc)
LT = L/m
CT = 4*m*C/(1- m**2)
Csa = 2*C/m
Cpi = C/m
Lpi = 4*m*L/(1- m**2)
Lsa = 2*L/m
#Results
print "\n\n Result \n\n"
print "\n For an 'm-derived' high-pass T section: series arm contains a capacitance of ",round(Csa*1E9,2),"nF"
print "the shunt arm contains an inductance of",round(LT*1000,3)," mH in series with a capacitance of",round(CT*1E9,2),"nF"
print "\n For an 'm-derived' high pass pi section: shunt arms each contain inductance of ",round(Lsa*1000,2),"mH"
print "series arm contains a capacitance of ",round(Cpi*1E9,2),"nF in parallel with an inductance of",round(Lpi*1E3,3),"mH"
from __future__ import division
import math
import cmath
#initializing the variables:
R0 = 600;# in ohm
fc = 10000; # in Hz
finf = 11800; #in Hz
#calculation:
m = (1 - (fc/finf)**2)**0.5
C = 1/(math.pi*R0*fc)
L = R0/(math.pi*fc)
LmT = (1- m**2)*L/(4*m)
mH = 0.6
LmH = (1- mH**2)*L/(2*mH)
#Results
print "\n\n Result \n\n"
print "\n For an Prototype T section: series arm contains a Inductance of ",round(L*1000/2,1),"mH"
print "the shunt arm contains an Capacitance of",round(C*1E6,4)," uF"
print "\n For an 'm-derived' T section: Series arms each contain inductance of ",round(m*L*1000/2,2),"mH "
print "Shunt arm contains a capacitance of ",round(m*C*1E6,4),"uF in Series with an inductance of",round(LmT*1E3,2),"mH"
print "\n For an 'm-derived' Half section: Series arms each contain inductance of ",round(mH*L*1000/2,1),"mH"
print "Shunt arm contains a capacitance of ",round(mH*C*1E6/2,4),"uF in Series with an inductance of",round(LmH*1E3,2),"mH"