# program to find the cut off frequency fo the first four propagating modes .
from math import pi,sqrt,log10,e
a=0.02286;
b=0.01016;
f=10*10**9;
k=209.44;
sigma =5.8*10**7;
mue =4*pi*10**-7;
c=3*10**8;
m=0;n=1;
fc=(c/(pi*2))*sqrt(((pi*m)/a)**2+((pi*n)/b)**2);
fc=fc/(10**9);
print "cut off frequency for TE01 mode in GHZ=",fc
m=1;n=0;
fc=(c/(pi*2))*sqrt(((pi*m)/a)**2+((pi*n)/b)**2);
fc=fc/(10**9);
print "cut off frequency for TE10 mode in GHZ=",fc
m=2;n=0;
fc=(c/(pi*2))*sqrt(((pi*m)/a)**2+((pi*n)/b)**2);
fc=fc/(10**9);
print "cut off frequency for TE20 mode in GHZ=",fc
m=1;n=1;
fc=(c/(pi*2))*sqrt(((pi*m)/a)**2+((pi*n)/b)**2);
fc=fc/(10**9);
print "cut off frequency for TE11 mode in GHZ=",fc
B=sqrt(k**2-(pi/a)**2) # for TE10 mode
Rs=sqrt(((2*pi*f)*mue)/(2*sigma)); # surface resistance .
print "surface resistance in ohm=",Rs
ac=(Rs/(a**3*b*B*k*377))*((2*b*pi**2)+(a**3*k**2)) # attenuation constant .
ac=-20*(-ac)*log10(e);
print "attenuation constant in dB/m=",ac
#program to find the cut off frequency of two propagating modes of a circular waveguide .
from math import pi,sqrt,e,log10
a=0.005;eipsilar=2.25;f=13*10**9;c=3*10**8;d=0.001; sigma=6.17*01**7;muo=4*pi*10**-7;
m=1;n=1;
p11 =1.841; p01 =2.405;
fc=(p11*c)/(2*pi*a*sqrt(eipsilar));
kc=p11/a;
fc=fc/(10**9);
print "cut off frequency for TE11 mode in GHZ=",fc
m=0;n=1;
fc=(p01*c)/(2*pi*a*sqrt(eipsilar));
fc=fc/(10**9);
print "cut off frequency for TE01 mode in GHZ=",fc
# so ,TE01 can ’ t be propagating mode. only TE11 will be.
k=(2*pi*f*sqrt(eipsilar))/c;
print "k in m1=",k
B=sqrt(k**2-kc**2);
print "propagation constant of TE11 mode =",B
ac=(k**2*d)/(2*B);
Rs=sqrt((2*pi*f*muo)/(2*sigma)); # surface resistance .
acm=(Rs/(a*k*377*B))*(kc**2+((k**2)/(p11**2-1)));
a=ac+acm;
a=-20*(-0.547*0.5)*log10(e);
print "total attenuation factor in dB=",a
#program to find out the highest usable frequency.
from math import sqrt,pi
a=0.000889;b=0.0029464;eipsilar=2.2;c=3*10**8;
# here (b/a)=3.3,so for this kc⇤a=0.47
kc=0.47/a;
fc=(c*kc)/(2*pi*sqrt(eipsilar))
fc=fc/(10**9);
fmax=0.95*fc;
print "maximum usable frequency in GHZ=",fmax
# program to calculate and plot the propagation constant of first three propagating surface wave mode .
%matplotlib inline
from pylab import plot,title,xlabel,ylabel,legend,xlim,ylim
from numpy import arange,sqrt,seterr
old_settings = seterr(all='ignore')
eipsilar=2.55;c=3*10**8; # x=d/lamdao ;
x=arange(0.001,1.2,0.01);
for n in range(0,4):
y=sqrt(eipsilar -((n**2)/(4.*(x**2)*(eipsilar -1))));# y=beta/lamdao;
plot(x,y)
x=arange(0.001,1.2,0.01);
for n in range(1,4):
y=sqrt(eipsilar -((((2.*n)-1)**2)/(16.*(x**2)*(eipsilar -1))))
plot(x,y)
title ('plot of propagation constant of first 4 mode');
xlabel('d/lamdao');
ylabel('beta/Ko');
xlim(0,1)
ylim(1,1.6);
# program to find width of a copper strip line conductor .
from math import pi,e,sqrt,log10
eipsilar=2.20;
Zo=50;b=0.0032;d=0.001;f=10**10;t =0.00001;
c=3*10**8;Rs=0.026;A=4.74;
x=(30*pi)/(sqrt(eipsilar)*Zo);
x=x-0.441;
w=b*x;
if ((sqrt(eipsilar)*Zo)<120):
print "width of copper strip line conductor is 0.00266m"
K=(2*pi*f*sqrt(eipsilar))/c;
ad=(K*d)/2;
ac=(2.7*(10**-3)*Rs*eipsilar*Zo*A)/(30*pi*(b-t));
a=ac+ad;
a=20*a*log10(e);
lamda=c/(sqrt(eipsilar)*f);
alamda=lamda*a;
print "wave number=",K
print "dielectric aattenuation=",ad
print "conductor attenuation=",ac
print "total attenuation constant=",a
print "attenuation in dB/lamda=",alamda
#program to calculate the width and length of microstrip line .
from math import sqrt,pi,e
eipsilae=1.87;# effective dielectric constant .
Zo=50;q=pi/2;c=3*10**8;
f=2.5*10**9;
ko=(2*pi*f)/c;
d=0.00127;
eipsilar =2.20;
# for w/d>2;
B=7.985;
w=3.081*d*100;
print "width in centi meter=",w
l=(q*100)/(sqrt(eipsilae)*ko);
print "length of microstrip in centi meter=",l
#program to calculate the group velocity.
from sympy import symbols,sqrt,diff
w,c,v,B,ko,kc=symbols('w,c,v,B,ko,kc');
ko=w/c;
B=sqrt(ko**2-kc**2);
v=diff(B,w);
vg=v**(-1);
vg=(c*B)/ko;
vp=w/B;
print "group velocity=",vg
print "phase velocity=",vp
print "conclusion:since B<ko,we have that vg<c<vp, which indicates that the phase velocity of a waveguide mode may be greater than the speed of light.but the group velocity will be lesser than the speed of light ."