import math
#Variable declaration
foo=2.05*10**6 #Hz
fc=2*10**6 #cut-off frequency,Hz
Zo=75 #nominal impedance,ohms
#Calculations
Wc=2*math.pi*2*10**6
L=Zo/Wc*2 #H
C=2/(Zo*Wc) #F
m=math.sqrt(1-(fc/foo)**2)
#Results
print "m=%.4f"%m
print "m*L/2=%.2e H"%(m*L/2)
print "m*C=%.3e F"%(m*C)
print "(1-m**2)*L/4/m=%.2e"%((1-m**2)*L/4/m)
import math
#Variable declaration
Zo=75 #image impedance,ohms
Wc=2*math.pi*2*10**6
foo=2.05*10**6 #Hz
#Calculations
L=Zo/Wc*2
m=0.6
C=2/(Zo*Wc)
#Results
print "m*L/2=%.2e H"%(m*L/2)
print "m*C=%.3e F"%(m*C/2)
print "(1-m^2)*L/4/m=%.2e"%((1-m**2)*L/2/m)
import math
#Variable declaration
Zo=75 #nominal impedance,ohms
Wc=2*math.pi*2*10**6
foo=1.95*10**6 #Hz
fc=2*10**6 #Hz
#Calculations
L=Zo/Wc/2
C=1./2/(Zo*Wc)
m=math.sqrt(1-(foo/fc)**2)
#Results
print "L=%.3e H"%L
print "C=%.3e F"%C
print "m=%.4f"%m
print "2*C/m=%.4e F"%(2*C/m)
print "L/m=%.4e H"%(L/m)
print "4*m*C/(1-m^2)=%.4e F"%((4*m*C)/(1-m**2))
import math
#Variable declaration
Le=3. #dB
E=10**(Le/10)-1
L=15. #dB
Wc=1
W=1.3*Wc
#Calculations
n=1./2*(math.log10(10**(L/10)-1)-math.log10(E))/math.log10(W/Wc)
m=math.acosh(math.sqrt(10**(0.1*L)-1))/math.acosh(W/Wc)
#Results
print "n=%.2f"%n
print "m=%.2f"%m
import math
#Variable declaration
L=30. #dB
W=40*10**6 #Hz
Wc=10*10**6 #Hz
Le=3. #dB
E=10**(Le/10)
Zo=50. #ohms
#Calculations&Results
Wc=2*math.pi*10**6*10
L=Zo/Wc
C=2./(Zo*Wc)
n=1./2*(math.log(10**(L/10)-1)-math.log(E-1))/math.log(W/Wc)
print "n=%.2f"%n
print "g1=%.0f\ng2=%.0f\ng3=%.0f"%(2*math.sin(math.pi/6),2*math.sin(math.pi/2),2*math.sin(math.pi*5/6))
print "L1=L3=%.4e H"%L
print "C2=%.3e F"%C
Zo=50 #ohms
Wc=2*math.pi*10**6*10
L=Zo*2/Wc
C=1/(Zo*Wc)
print "L2=%.4e H"%L
print "C1=C3=%.4e F"%C
import math
#Variable declaration
Gr=0.01 #dB
L = 5. #dB
W = 400.*10**6 #Hz
Wc = 100.*10**6 #Hz
#Calculations&Results
m = math.degrees(math.acosh(math.sqrt((10**(0.1*L)-1)/(10**(0.1*Gr)-1))))/math.degrees(math.acosh(W/Wc))
print "m=%.f"%m
m=3
E=math.log(1/math.tanh(Gr/17.37))
X=math.sinh(E/2/m)
n=3
gp=1
for p in range(1,n+1):
ap=math.sin((2*p-1)*math.pi/2/m)
bp=X**2+math.sin(p*math.pi/m)**2
print "ap=%.1f\nbp=%.4f\n"%(ap,bp)
gp=0.62425
print "g0=g4=1"
print "p=1\tgp=0.62425"
for p in range(2,n+1):
gp=4*math.sin((2*(p-1)-1)*math.pi/2/m)*math.sin((2*p-1)*math.pi/2/m)/(X**2+math.sin((p-1)*math.pi/m)**2)/gp
print "p=%.0f\tgp=%.5f"%(p,gp)
print "L1=L3=%.4e H\nC1=%.4e F"%(75*0.62425/(2*math.pi*10**8),0.9662/(75*2*math.pi*10**8))
import math
#Variable declaration
Gr=3 #dB
#Calculations&Results
m=3
for p in range(1,4):
ap=math.sin((2*p-1)*math.pi/2/m)
print "p=%.0f\tap=%.1f"%(p,ap)
E=math.log(1/math.tanh(Gr/17.37))
X=math.sinh(E/2/m)
print "\nE=%.4f\nX=%.4f\n"%(E,X)
for p in range(1,4):
bp=X**2+math.sin(p*math.pi/m)**2
print "p=%.0f\tbp=%.4f"%(p,bp)
gp=3.349
print "\ng0=g4=1\ng1=3.349"
for p in range(2,4):
gp=4*math.sin((2*(p-1)-1)*math.pi/2/m)*math.sin((2*p-1)*math.pi/2/m)/(X**2+math.sin((p-1)*math.pi/m)**2)/gp
print "gp=%.4f"%gp
print "\nL1=L3=%.1e H\nC2=%.4e F"%(75*3.349/(2*math.pi*10**8),0.7116/(75*2*math.pi*10**8))
import math
#Variable declaration
#From example 9.7
gL=0.62425
gc=0.9662
m=3
#Calculations&Results
Wc=2*math.pi*100*10**6
CHP=1/(Wc*gL)
LHP=1/(Wc*gc)
print "CHP=%.3e F\nLHP=%.3e H"%(CHP,LHP)
C1=2.5495/75*10**3
L2=75*1.6472
print "C1=C3=%.0f pF\nL2=%.1f nH"%(C1,L2)
import math
#Variable declaration
fl=10*10**6 #Hz
fu=40*10**6 #Hz
#Calculations&Results
Wu=2*math.pi*40*10**6
Wl=2*math.pi*10*10**6
gc=0.9662
gL=0.62425
Wo=2*math.pi*20*10**6
fo=math.sqrt(fl*fu)
print "fo=%.e Hz"%fo
CBP1=(Wu-Wl)/(Wo**2*gL)
LBP1=gL/(Wu-Wl)
print "CBP1=%.3f nF\nLBP1=%.4f nH"%(CBP1/10**-9,LBP1/10**-9)
CBP2=(Wu-Wl)/(Wo**2*gc)
LBP2=gc/(Wu-Wl)
print "\nCBP2=%.3f nF\nLBP2=%.4f nH"%(CBP2/10**-9,LBP2/10**-9)
print "\nC1=C3=%.2f pF"%(19.122*1000/75)
print "L1=L3=%.4f nH"%(75*3.3116)
print "\nL2=%.4f uH"%(75*12.354/1000)
print "C2=%.3f pF"%(5.1258/75*1000)
import math
#Variable declaration
fl=10*10**6 #Hz
fu=40*10**6 #Hz
#Calculations&Results
Wu=2*math.pi*40*10**6
Wl=2*math.pi*10*10**6
gc=2
gL=1
Wo=2*math.pi*20*10**6
fo=math.sqrt(fl*fu)
print "fo=%.e Hz"%fo
LBS1=(Wu-Wl)/(Wo**2*gL)
CBS1=gL/(Wu-Wl)
print "CBS1=%.3f nF\nLBS1=%.2f nH"%(CBS1/10**-9,LBS1/10**-9)
CBS2=1./gc/(Wu-Wl)
LBS2=(Wu-Wl)*gc/(Wo**2)
print "\nCBS2=%.2f nF\nLBS2=%.3f nH"%(LBS2/10**-9,CBS2/10**-9)
print "\nC1=C3=%.2f pF"%(5.305/75*1000)
print "L1=L3=%.1f nH"%(75*11.94)
print "L2=%.1f uH"%(75*2.653/1000)
print "C2=%.1f pF"%(23.87/75*1000)
import math
#Variable declaration
print "go=g4=1"
n=3.
#Calculations&Results
for p in range(1,3):
gp=2*math.sin((2*p-1)*math.pi/2/n)
print "gp=%.f"%gp
print "Q1=Q3=%.4f rad=%.1f degree"%(50./150,50./150*180/math.pi)
print "Q2=%.2f rad=%.2f degree"%(30*2./50,30*2./50*180/math.pi)
import math
#Variable declaration
n=3
print "go=g4=1"
#Calculations&Results
for p in range(1,n+1):
gp=2*math.sin((2*p-1)*math.pi/2/n)
print "gp=%.f"%gp