from __future__ import division
import scipy
#Variable Declaration
a=2.5*10**-2 #in m
b=1*10**-2 #in m
c=0
Ur=1 #relative permeability
Er=4 #relative permittivity
C=3*10**8 #speed of wave in m/s
fc=0
m=0
n=0
#Calculations
while (fc*10**-9 < 15.1) :
fc = (C/(4*a))*scipy.sqrt(m**2+(a*n/b)**2)
if (( fc*10**-9) < 15.1) :
n=n+1
else:
print 'Maximum value of n is ',n-1
nmax=n-1
fc=0
m=0
n=0
while(fc*10**-9 < 15.1):
fc =(C/(4*a))*scipy.sqrt(m**2+(a*n/b)**2)
if((fc*10**-9) < 15.1):
m=m+1
else:
print 'Maximum value of m is ',m-1
mmax=m-1
m=0
while(m<mmax+1):
n=0
while(n<nmax+1):
p=(C/(4*a))*scipy.sqrt(m**2+(a*n/b)**2)
if((p*10**-9) < 15.1) :
print m,n,'transmission mode is possible'
print 'frequency is',round(p*10**-9,2),'GHz'
else:
print m,n,'transmission mode is not possible'
n=n+1
m=m+1
import scipy
import cmath
from numpy import *
#Variable Declaration
a=1.5*10**-2 #in m
b=0.8*10**-2 #in m
c=0
Uo=4*scipy.pi*10**-7 #permeability of free space
Ur=1 #relative permeability
Eo=10**-9/(36*scipy.pi) #permittivity of free space
Er=4 #relative permittivity
C=3*10**8 #speed of light in m/s
w=scipy.pi*10**11 #omega in rad/s
m=1
n=3
u=C/2 #speed of wave in m/s
#Calculations
f=w/(2*scipy.pi) #frequency of wave in Hz
fc=u*((m*m)/(a*a)+(n*n)/(b*b))**0.5/2 #cutoff frequency in Hz
B=w*scipy.sqrt(1-(fc/f)**2)/u #phase constant in rad/m
eta=377/scipy.sqrt(Er)*scipy.sqrt(1-(fc/f)**2) #intrinsic wave impedance in ohm
#Results
print 'The cutoff frequency =',round(fc*10**-9,2),'GHz'
print 'The phase constant =',round(B,2),'rad/m'
print 'The propagation constant =',round(B,2),'j /m'
print 'The intrinsic wave impedance =',round(eta,1),'ohms'
import scipy
#Variable Declaration
a=8.636*10**-2 #in m
b=4.318*10**-2 #in m
f=4*10**9 #in Hz
u=3*10**8 #speed of wave in m/s
#Calculations
fc=u/(2*a)
if(f>fc):
print 'As f>fc, TE10 mode will propogate'
else:
print 'It will not propogate'
Up=u/scipy.sqrt(1-(fc/f)**2) #phase velocity in m/s
Ug=u*u/Up #group velocity in m/s
#Results
print 'Phase velocity =',round(Up*10**-6,0),'Mm/s'
print 'Group velocity =',round(Ug*10**-6,1),'Mm/s'
import scipy
#Variable Declaration
f=10*10**9 #frequency of operation in Hz
a=4*10**-2 #in m
b=2*10**-2 #in m
u=3*10**8 #velocity in m/s
Pavg=2*10**-3 #average power in W
#Calculations
fc=u/(2*a) #cutoff frequency in Hz
n=377/scipy.sqrt(1-(fc/f)**2) #intrinsic wave impedance in ohms
E=scipy.sqrt(4*n*Pavg/(a*b)) #peak value of electric field in V/m
#Result
print 'Peak value of electric field =',round(E,2),'V/m'
import scipy
#Variable declaration
cc=5.8*10**7 #in S/m
f=4.8*10**9 #in Hz
c=10**-17 #in S/m
Uo=4*scipy.pi*10**-7 #permeability of free space
Eo=10**-9/(36*scipy.pi) #permittivity of free space
Er=2.55 #relative permittivity
z=60*10**-2 #in m
l=4.2*10**-2 #in m
b=2.6*10**-2 #in m
P=1.2*10**3 #in W
#Calculations
n=377/scipy.sqrt(Er)
u=3*10**8/scipy.sqrt(Er)
fc=u/(2*l)
ad=c*n/(2*scipy.sqrt(1-(fc/f)**2))
Rs=scipy.sqrt(scipy.pi*f*Uo/cc)
ac=2*Rs*(0.5+(b/l)*(fc/f)**2)/(b*n*scipy.sqrt(1-(fc/f)**2))
a=ac
Pd=P*(scipy.e**(2*a*z)-1)
#Result
print 'power dissipated =',round(Pd,3),'W'
import scipy
#Variable Declaration
a=5*10**-2 #in m
b=4*10**-2 #in m
c=10*10**-2 #in m
C=5.8*10**7 #in mhos/m
Uo=4*scipy.pi*10**-7 #permeability of free space
u=3*10**8 #speed of wave in m/s
#Calculations
def f(m,n,p):
fr=scipy.sqrt((m/a)**2+(n/b)**2+(p/c)**2)*u/2 #resonant frequency in Hz
print round(fr*10**-9,3)
f101=3.35*10**9
d=scipy.sqrt(1/(scipy.pi*f101*Uo*C))
Q=(a*a+c*c)*a*b*c/(d*(2*b*(a**3+c**3)+a*c*(a*a+c*c))) #quality factor
#Results
print 'Thus the five lowest order modes in ascending order are '
print 'TE101, frequency in GHz ='
f(1,0,1)
print 'TE011, frequency in GHz ='
f(0,1,1)
print 'TE102, frequency in GHz ='
f(1,0,2)
print 'TE110, frequency in GHz ='
f(1,1,0)
print 'TE111 or TM111, frequency in GHz ='
f(1,1,1)
print 'Quality factor =',round(Q,0)