# Chapter 5 : Cavity Resonators¶

## Example 5.1 Page No : 180¶

In [1]:
import math

#Given:
a = 3                         #in cm
c = 3*10**10                  #in cm/s
f = 10*10**9                  #in Hz
P_01 = 2.405

#calculations
d = math.pi/math.sqrt(f**2*4*math.pi**2/c**2-(P_01/a)**2)

#output
print 'Minimum distance (in cm) =', round(d,4)

Minimum distance (in cm) = 1.6236


## Example 5.2 Page No : 183¶

In [3]:
import math

#Given:
c = 3.*10**10                             #in cm/s
a = 2.                                    #in cm
b = 1.                                    #in cm
d = 3.                                    #in cm
m = 1.
n = 0
p = 1.

#calculations
f=(c/2)*((m/a)**2+(n/b)**2+(p/d)**2)**0.5

#---output---#
print 'Dominant mode is TE101'
print 'Lowest resonant frequency(in GHz) =',round(f/10**9,4)

Dominant mode is TE101
Lowest resonant frequency(in GHz) = 9.0139


## Example 5.3 Page No : 184¶

In [4]:
import math

#Given:
d = 12.5                           #diameter(in cm)
c = 3*10**10                       #in cm/s
l = 5                              #length(in cm)

#For TM012 mode:
n = 0
m = 1
p = 2
P = 2.405

#calculations
a = d/2
f = (c/(2*math.pi))*((P/a)**2+(p*math.pi/d)**2)**0.5

#---output---#
print 'Resonant frequency (in GHz) =',round(f/10**9,4)

#Answer in book in wrongly given as 6.27GHz

Resonant frequency (in GHz) = 3.0225


## Example 5.4 Page No : 191¶

In [5]:
import math

#Given:
c = 3.*10**10          #in cm/s
a = 3.                 #in cm
b = 2.                 #in cm
d = 4.                 #in cm
#For TE101:
m = 1.
n = 0
p = 1.

#calculations
f = (c/2)*((m/a)**2+(n/b)**2+(p/d)**2)**0.5

#---output---#
print 'Resonant frequency(in GHz) =',round(f/10**9,4)

Resonant frequency(in GHz) = 6.25