PHYS 542 L56: Cavities

advertisement
PHYS 542 L56: Cavities
Yen Lee Loh, 2016-2-25
In these notes, Ε0 = Μ0 = c = 1.
1
Cuboidal cavity
Consider a cuboidal cavity of dimensions a ´ b ´ c. You can treat this as a rectangular waveguide terminated by flat plates at both ends. At the surface of a good conductor,
Eþ = 0
B¦ = 0
¶¦ E¦ = 0
¶¦ Eþ = 0.
Hence Ez Hx, y, z, tL satisfies Dirichlet boundary conditions on the side walls and Neumann conditions on
the end walls, whereas Bz Hx, y, z, tL satisfies Neumann conditions at the sides and Dirichlet conditions at
the ends:
When x = 0 or x = a, Ez = 0 and
¶ x Bz = 0
Wheny = 0 or y = b,
Ez = 0 and
¶ y Bz = 0
When z = 0 or z = c,
¶z Ez = 0 and Bz = 0.
Hence there are TMmnl modes such that
Ez = sin
mΠx
a
sin
nΠy
b
cos
lΠz
c
Bz = 0
m, n = 1, 2, 3, … ,
l = 0, 1, 2, …
Ez = 0
m, n = 0, 1, 2, … ,
l = 1, 2, 3, …
There are also TEmnl modes such that
Bz = cos
mΠx
a
cos
nΠy
b
sin
lΠz
c
Note that the “TE001 mode”would correspond to a uniform magnetic field in the z direction, which is not
a propagating mode.
In order to calculate the other components of E and B, write the standing wave in the z direction as a sum
of two traveling waves, and apply L55 eqs. (7–10) to each traveling wave component. (You should try
this as an exercise.)
2
Cylindrical cavity
This can be treated as a cylindrical waveguide terminated with flat plates, and analyzed similarly.
3
Spherical harmonics and spherical Bessel functions
First let us tabulate some of the scalar spherical harmonics Ylm HΘ, ΦL, vector spherical harmonics
Xlm HΘ, ΦL, and spherical Bessel functions jl HxL, to get a feel for how they behave. (See other notes for
plots.)
2
L56-Cavities.nb
H*8n,l,m<=81,1,0<;
SphericalHarmonicY@l,m,Θ,ΦD
sphericalGradžSphericalHarmonicY@l,m,Θ,ΦD
Cross@8r,0,0<,sphericalGradžSphericalHarmonicY@l,m,Θ,ΦDD
Cross@8r,0,0<,sphericalGradžSphericalHarmonicY@l,m,Θ,ΦDD’
lHl+1L *L
TableA9
l,
m,
IYlmΘΦ@l, m, Θ, ΦD E-ImΦ  TrigExpandM . 8Cos@ΘD ® c, Sin@ΘD ® s<  Simplify,
IXlmΘΦ@l, m, Θ, ΦD E-ImΦ  TrigExpandM . 8Cos@ΘD ® c, Sin@ΘD ® s<  Simplify
=, 8l, 0, 2<, 8m, 0, l<E  Flatten@ð, 1D & 
TableFormAð, TableDepth ® 2, TableHeadings ® 9None, 9"l", "m", "Ylm e-imΦ ", "Xlm e-imΦ "==E &
l
0
m
Ylm e-imΦ
Xlm e-imΦ
1
0
2
80, 0, 0<
Π
1
0
1
2
c
3
Π
1
1
-
1
2
3
2Π
2
0
1
4
I- 1 + 3 c2 M
2
1
-
1
2
2
2
1
4
:0, 0, -
s
15
2Π
c
15
2Π
:0,
5
Π
1
4
:0,
s2
1
4
:0, -
3
2Π
3
Π
ä
:0, 0, -
s
1
2
1
2
,-
s>
1
4
15
2Π
c
äc
5
Π
,
1
4
5
Π
s,
ä
3
Π
c
>
s>
1
4
5
Π
1
4
c
I- c2 + s2 M>
5
Π
s>
Table@8
l,
j€lx@l, xD  Expand,
jprime€lx@l, xD  Expand
<, 8l, 0, 4<D 
TableForm@ð, TableDepth ® 2, TableHeadings ® 8None, 8"l", "jl HxL", "jl 'HxL"<<D &
l
0
1
2
4
jl HxL
jl 'HxL
Sin@xD
x
Cos@xD
Sin@xD
+
x
x2
3 Cos@xD
3 Sin@xD
Cos@xD
Sin@xD
x
x2
2 Cos@xD
2 Sin@xD
-
3
-
4
-
+
x2
15 Cos@xD
+
x3
105 Cos@xD
x4
Sin@xD
x
x3
Cos@xD
15 Sin@xD
6 Sin@xD
+
x
x4
x2
10 Cos@xD
105 Sin@xD
45 Sin@xD
+
x2
+
x5
-
x3
x2
9 Cos@xD
-
x3
60 Cos@xD
+
Sin@xD
x
-
x4
525 Cos@xD
x5
Sin@xD
+
x
x3
Cos@xD
9 Sin@xD
4 Sin@xD
+
x
x4
x2
7 Cos@xD
60 Sin@xD
27 Sin@xD
-
-
x2
65 Cos@xD
x3
+
x5
Cos@xD
x
+
-
x3
525 Sin@xD
x6
+
Sin@xD
x
240 Sin@xD
x4
-
11 Sin
Quantum particle in spherical cavity
Consider a quantum mechanical particle in a spherical cavity. Assume that the cavity walls behave as an
infinitely high potential barrier. The wavefunction satisfies the Schrö
dinger equation, -Ik2 + !2 M Ψ = 0.
Separation of variables leads to product solutions of the form ΨHr, Θ, ΦL = jl HkrL Ylm HΘ, ΦL. The wavefunction satisfies Dirichlet boundary conditions Ψ = 0 when r = a. Thus jl HkaL = 0. Tabulate the
“eigenvalues”of the Helmholtz equation 8knl <, where knl is the nth zero of jl HkaL:
Clear@k€nlD;
k€nl€table = Table@N ž BesselJZero@l + 1  2, nD, 8n, 1, 20<, 8l, 0, 20<D;
k€nl@n_, l_D := k€nl€tablePn, 1 + lT;
x2
L56-Cavities.nb
grE = ListPlotBTableA9l, k€nl@n, lD2 ‘ 2=, 8n, 1, 20<, 8l, 0, 20<E,
PlotRange ® 88- .5, 5.5<, 80, 130<<,
PlotMarkers ® "—", PlotStyle ® Black,
Enl
Joined ® False, FrameLabel ® :"l", "
">,
J
Ñ2
N
2
2ma
FrameTicks ® 8Range@0, 20D, Automatic, Automatic, Automatic<,
ImageSize ® 256F
120
100
Enl
80
60
Ñ2
J 2 m a2 N 40
20
0
—
—
—
—
—
—
—
—
—
0
—
—
—
1
—
—
—
—
—
—
—
—
3
4
2
—
—
5
l
The plot above shows the energy levels (eigenvalues of the Hamiltonian) Enl for a quantum particle of
mass m in a spherical cavity of radius a. Note that a level with quantum number l has a degeneracy of
H2 l + 1L.
Ÿ Applet
5
Sound in spherical cavity
Consider pressure waves in air in a spherical cavity. The pressure satisfies the Helmholtz equation,
-Ik2 + !2 M Ψ = 0.
Separation of variables leads to product solutions of the form
ΨHr, Θ, ΦL = jl HkrL Ylm HΘ, ΦL. The wavefunction satisfies Neumann boundary conditions:
¶r Ψ = 0 when r = a
\
jl ' HkaL = 0.
Tabulate 8knl < where knl is the nth zero of jl ' HkaL. Graphically, we can see that
j0 ' HkL has zeroes at
2k
Π
» 1, 3, 5, …
j1 ' HkL has zeroes at
2k
Π
» 2, 4, 6, …
j1 ' HkL has zeroes at
2k
Π
» 3, 5, 7, …
(actually the zero near 1 is at 0)
3
4
L56-Cavities.nb
Clear@k, lD;
PlotB
Π
TableBSphericalBesselJPrime@l, kD . k ®
kk, 8l, 0, 3<F  Evaluate
2
, 8kk, 0, 10<, PlotRange ® 8- .5, .4<, FrameLabel ® 8"2kΠ", "jl 'HkL"<,
GridLines ® 8Range ž 10, 80<<
F
0.4
0.2
jl 'HkL
0.0
-0.2
-0.4
0
2
4
6
8
10
2kΠ
This suggests that we can find knl using FindRoot with appropriate bracketing intervals. I don’t know a
“random access”way to estimate the zero, but we can use the interleaving property. Once we have
found knl , we can more or less assume that kn,l+1 Î Hknl , knl + Π  2L or something like that. Indeed this
allows us to tabulate the knl:
nmax = 20;
lmax = 20;
k€nl€table = Table@- 999, 8n, 1, nmax<, 8l, 0, lmax<D;
DoB
IfBl Š 0,
H* Choose brackets H-0.5,1.1L, H1.5,3.1L, H3.5,5.1L, etc., which works ok *L
Π
kmin = H2 n - 2.5L ;
2
Π
kmax = H2 n - 0.9L ;
2
,
H* Choose bracket based on previous root *L
kmin = k€nl€tablePn, 1 + Hl - 1LT;
kmax = k€nl€tablePn, 1 + Hl - 1LT + Π  2;
F;
k€nl€tablePn, 1 + lT = FindRoot@SphericalBesselJPrime@l, kD, 8k, kmin, kmax<D  Last  Last;
, 8n, 1, nmax<, 8l, 0, lmax<F;
k€nl@n_, l_D := k€nl€tablePn, 1 + lT;
L56-Cavities.nb
5
TableForm@
Map@NumberForm@Chop ž ð, 84, 2<D &,
k€nl€table * H2  ΠL
, 82<D
, TableHeadings ® 8Range@1, nmaxD, Range@0, lmaxD<D  Labeled@ð, 8"n", "l"<, 8Left, Top<D &
1
2
3
4
5
6
7
8
9
n 10
11
12
13
14
15
16
17
18
19
20
0
0.00
2.86
4.92
6.94
8.95
10.96
12.97
14.97
16.98
18.98
20.98
22.98
24.98
26.98
28.99
30.99
32.99
34.99
36.99
38.99
1
1.33
3.78
5.86
7.90
9.92
11.93
13.94
15.95
17.95
19.96
21.96
23.97
25.97
27.97
29.97
31.97
33.98
35.98
37.98
39.98
2
2.13
4.64
6.76
8.81
10.85
12.87
14.89
16.90
18.91
20.92
22.93
24.93
26.94
28.94
30.95
32.95
34.95
36.96
38.96
40.96
3
2.87
5.46
7.62
9.70
11.76
13.79
15.82
17.84
19.86
21.87
23.88
25.89
27.90
29.91
31.91
33.92
35.92
37.93
39.93
41.93
4
3.59
6.26
8.46
10.57
12.64
14.69
16.73
18.76
20.78
22.80
24.82
26.83
28.85
30.86
32.86
34.87
36.88
38.89
40.89
42.90
5
4.30
7.05
9.29
11.43
13.52
15.58
17.63
19.67
21.70
23.73
25.75
27.77
29.78
31.80
33.81
35.82
37.83
39.84
41.84
43.85
6
5.00
7.82
10.10
12.26
14.37
16.45
18.52
20.56
22.60
24.64
26.66
28.69
30.71
32.73
34.74
36.76
38.77
40.78
42.79
44.80
7
5.69
8.58
10.90
13.09
15.22
17.32
19.39
21.45
23.50
25.54
27.57
29.60
31.63
33.65
35.67
37.69
39.70
41.72
43.73
45.74
8
6.37
9.33
11.69
13.90
16.05
18.17
20.25
22.32
24.38
26.43
28.47
30.51
32.54
34.57
36.59
38.61
40.63
42.65
44.66
46.68
2
grk = ListPlotBTableB:l, k€nl@n, lD
>, 8n, 1, nmax<, 8l, 0, lmax<F,
Π
PlotRange ® 88- 1, lmax + .5<, 8- 1, 35<<,
PlotStyle ® Black, PlotMarkers ® 8 Graphics@Line@88- 1, 0<, 81, 0<<DD, 1  lmax
knl
Joined ® False, FrameLabel ® :"l", "
">,
А2a
GridLinesStyle ® LightGray, GridLines ® 8None, Range ž 40<,
FrameTicks ® 8Range@0, 20D, Automatic, Automatic, Automatic<,
ImageSize ® 512F
35
30
25
knl
20
Π  2 a 15
10
5
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
l
Ÿ Applet
<,
9
7.05
10.07
12.47
14.71
16.88
19.01
21.11
23.19
25.26
27.31
29.36
31.40
33.44
35.47
37.50
39.53
41.55
43.57
45.59
47.61
l
10
7.73
10.81
13.24
15.51
17.70
19.84
21.96
24.05
26.13
28.19
30.25
32.29
34.34
36.37
38.41
40.44
42.46
44.49
46.51
48.53
6
L56-Cavities.nb
6
Light in spherical cavity
Ÿ 6.1
Maxwell’s equations and spherical standing wave ansatz
Consider electromagnetic waves in a spherical cavity with perfectly conducting walls. The fields satisfy
Maxwell’s equations. Make an ansatz involving electric and magnetic spherical multipole standing
waves,
D = Ú @Dlm ! ´ H j XL + Blm ik j XD
lm
B = Ú @Blm ! ´ H j XL - Dlm ik j XD
lm
where j º jl HkrL are spherical Bessel functions and X º Xlm HΘ, ΦL =
1
lHl+1L
r ´ !Ylm HΘ, ΦL are normal-
ized vector spherical harmonics. It can be shown that this ansatz satisfies Maxwell’s equations in vacuum,
! ×D = 0
! ×B = 0
! ´ D = -¶t B
! ´ B = ¶t D.
We will find it useful to work with the radial components Dr and Br . In fact, it will be even better to
work with the scalar fields r × D and r × B:
r × D = Ú @Dlm r × ! ´ H j XL + Blm ik j r × XD
lm
= Ú ADlm Hr ´ !L × J j
lm
= Ú Dlm
lm
= - Ú Dlm
j
lHl+1L
1
lHl+1L
r ´ !YN + Blm ik j r × r ´ !Y E
Hr ´ !L × Hr ´ !YL
(permuting triple product)
(since r ´ ! doesn’t contain ¶r , it doesn’t act on j)
lHl + 1L j Y.
lm
Similarly,
r × B = - Ú Blm
lHl + 1L j Y.
lm
It will be extremely useful to visualize r × D and r × B as functions of r (for a fixed k).
For a magnetic mode (when only one Blm is nonzero), we have r × B = rBr µ jl HkrL for all Θ and Φ.
For an electric mode (when only one Dlm is nonzero), we have r × D = rDr µ jl HkrL for all Θ and Φ.
This means that the radial fields have nodes (antinodes) on spherical surfaces.
We just need to choose the wavelength appropriately so that the nth spherical node (in the case of a
magnetic mode) coincides with the cavity wall!
L56-Cavities.nb
7
Plot@j€lx@3, krD  Evaluate, 8kr, 0.001, 20<,
ImageSize ® 8650, 128<, PlotRange ® 8- .2, .3<, FrameLabel ® 8"kr", "j3 HkrL"<D
0.3
0.2
j3 HkrL 0.1
0.0
-0.1
-0.2
0
5
10
15
20
kr
“In the picture above, suppose k=1. Then we could place the cavity wall at r=7 or r=14... and then the
b.c. will be satisfied.”
“But if we are given the cavity radius r=1, that means we have tp choose =7 or k=14...
Ÿ 6.2
Boundary conditions
We now need to take the spherical waves above and fit them into a cavity!
At the surface of a perfect conductor, the fields must satisfy the boundary conditions
Dþ = B¦ = 0.
If the perfect conductor is a sphere of radius a, then
DΘ = DΦ = Br = 0 when r = a (for any Θ and Φ).
In Maxwell I, write the divergence in spherical polars, and use DΘ = DΦ = 0 "Θ,Φ:
1
r2
\
¶r Ir2 Dr M +
1
r sin Θ
¶Θ Hsin Θ DΘ L +
1
r sin Θ
¶Φ DΦ = 0
¶r Ir2 Dr M = 0.
Thus the boundary conditions may be written
Br = 0 and ¶r Ir2 Dr M = 0 when r = a (for any Θ and Φ)
\
Ÿ 6.3
r × B = 0 and ¶r Hr r × DL = 0 when r = a (for any Θ and Φ).
Magnetic modes: frequencies
First consider a “magnetic”or “transverse electric (TE)”mode described by one nonzero Blm ,
r × B = - lHl + 1L jl HkrL Ylm HΘ, ΦL.
Imposing the boundary condition gives
jl HkaL = 0.
Thus the magnetic modes in a spherical cavity have exactly the same wavenumbers as a quantum particle
in a spherical well! (Of course, for electromagnetism Ω µ k, whereas for the quantum particle E µ k2 .)
kMAG€nl€table = Table@N ž BesselJZero@l + 1  2, nD, 8n, 1, 20<, 8l, 0, 20<D;
kMAG€nl@n_, l_D := kMAG€nl€tablePn, 1 + lT;
Ÿ 6.4
Electric modes: frequencies
Now consider
r × D = - lHl + 1L jl HkrL Ylm HΘ, ΦL.
Imposing the boundary condition gives
¶r Hr jl HkrLL = 0 at r = a
\
jl HkaL + ka jl ' HkaL = 0
\
fl HkaL = 0
where
fl HkL = ¶k Hk jl HkLL
º jl HkL + k jl ' HkL
8
\
jl HkaL + ka jl ' HkaL = 0
\
f HkaL = 0
L56-Cavities.nb l
where
fl HkL = ¶k Hk jl HkLL
º jl HkL + k jl ' HkL
º jl HkL + k A jl-1 HkL -
l+1
k
jl HkLE
º k jl-1 HkL - l jl HkL.
Implement this function:
f€lk@l_Integer, k_D := k SphericalBesselJ@l - 1, kD - l SphericalBesselJ@l, kD;
Clear@k, lD;
PlotB
Π
TableBf€lk@l, kD . k ®
kk, 8l, 0, 3<F  Evaluate
2
, 8kk, 0, 10<, PlotRange ® 8- 1.1, 1.1<, ImageSize ® 8600, 128<, FrameLabel ® 8"2kΠ", "fl HkL"<,
GridLines ® 8Range ž 10, 80<<
F
1.0
0.5
fl HkL 0.0
-0.5
-1.0
0
2
4
6
8
2kΠ
The allowed wavenumbers are given by the zeroes of the function fl HkL:
nmax = 20;
lmax = 20;
kELEC€nl€table = Table@- 999, 8n, 1, nmax<, 8l, 0, lmax<D;
DoB
IfBl Š 0,
H* Choose brackets H-0.5,1.1L, H1.5,3.1L, H3.5,5.1L, etc., which works ok *L
Π
kmin = H2 n - 2.5L ;
2
Π
kmax = H2 n - 0.9L ;
2
,
H* Choose bracket based on previous root *L
kmin = kELEC€nl€tablePn, 1 + Hl - 1LT;
kmax = kELEC€nl€tablePn, 1 + Hl - 1LT + Π  2;
F;
kELEC€nl€tablePn, 1 + lT = FindRoot@f€lk@l, kD, 8k, kmin, kmax<D  Last  Last;
, 8n, 1, nmax<, 8l, 0, lmax<F;
kELEC€nl@n_, l_D := kELEC€nl€tablePn, 1 + lT;
10
L56-Cavities.nb
9
2
grk = ListPlotBTableB:l, kELEC€nl@n, lD
>, 8n, 1, nmax<, 8l, 0, lmax<F,
Π
PlotRange ® 88- 1, lmax + .5<, 8- 1, 35<<,
PlotStyle ® Black, PlotMarkers ® 8 Graphics@Line@88- 1, 0<, 81, 0<<DD, 1  lmax
knl
Joined ® False, FrameLabel ® :"l", "
">,
А2a
GridLinesStyle ® LightGray, GridLines ® 8None, Range ž 40<,
FrameTicks ® 8Range@0, 20D, Automatic, Automatic, Automatic<,
<,
ImageSize ® 512F
35
30
25
20
knl
Π  2 a 15
10
5
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
l
Compare both. Note that l=0 is NOT ALLOWED. The lowest
Grid ž :8"Magnetic mode frequencies", Spacer ž 64, "Electric mode frequencies"<, :
2
TableFormBTableBkMAG€nl@n, lD
, 8n, 1, 3<, 8l, 1, 3<F,
Π
TableHeadings ® 8Range@1, 3D, Range@1, 3D<F  Labeled@ð, 8"n", "l"<, 8Left, Top<D &,
Spacer ž 64,
2
TableFormBTableBkELEC€nl@n, lD
, 8n, 1, 3<, 8l, 1, 3<F,
Π
TableHeadings ® 8Range@1, 3D, Range@1, 3D<F  Labeled@ð, 8"n", "l"<, 8Left, Top<D &
>>
n
1
2
3
Magnetic mode frequencies
l
1
2
3
2.86059
3.66913
4.44866
4.91805
5.79006
6.63174
6.94178
7.84503
8.72043
n
1
2
3
Electric mode frequencies
l
1
2
3
1.7467
2.46387
3.16618
3.89405
4.73842
5.55244
5.93114
6.82011
7.67992
The lowest mode in a spherical cavity of radius a = 1 has wavenumber k = 1.7467 ´
f =
k
2Π
= 0.437.
1.7467 * Π  2
1.7467  4
2.74371
0.436675
Π
2
=, i.e., frequency
10
L56-Cavities.nb
Ÿ 6.5
Eigenfunctions: Magnetic modes
Now that we have calculated the wavenumbers, let us now attempt to visualize the first few electric and
magnetic modes in a spherical cavity. For a magnetic mode we have
DHr, Θ, ΦL = ik jl HkrL Xlm HΘ, ΦL
BHr, Θ, ΦL = ! ´ @ jl HkrL Xlm HΘ, ΦLD
= ! jl HkrL ´ Xlm HΘ, ΦL + jl HkrL ! ´ Xlm HΘ, ΦL
`
= k jl ' HkrL r ´ Xlm HΘ, ΦL + jl HkrL 1 ! ´ @r ´ !Ylm HΘ, ΦLD
lHl+1L
= k jl ' HkrL Wlm HΘ, ΦL + ?? ? -k2 r Y - 2 !Y - r × ! !Y ??
In principle, we could write jl ' in terms of j, and Ylm in terms of Plm , and then ¶Θ Plm in terms of Plm , and
work out all the derivatives to get IBr , BΘ , BΦ M as functions of jl and Plm .
Then, for given values of l and m, we could work out explicit expressions for IBr , BΘ , BΦ M in terms of
sines and cosines.
In actual fact I think it is easier just to let Mathematica do brute-force calculus for each value of l and m,
as below.
8n, l, m< = 82, 2, 0<;
8n, l, m< = 82, 1, 0<;
Clear@r, Θ, Φ, kD;
DrΘΦrΘΦ@r_, Θ_, Φ_D = I * k * j€lx@l, k rD XlmΘΦ@l, m, Θ, ΦD  Chop  FunctionExpand  Simplify
BrΘΦrΘΦ@r_, Θ_, Φ_D =
sphericalCurl@j€lx@l, k rD XlmΘΦ@l, m, Θ, ΦDD  Chop  FunctionExpand  Simplify
k = kMAG€nl@n, lD;
ä
3
2Π
Hk r Cos@k rD - Sin@k rDL Sin@ΘD
:0, 0,
>
2 k r2
3
2Π
3
2Π
Cos@ΘD Hk r Cos@k rD - Sin@k rDL
Ik r Cos@k rD + I- 1 + k2 r2 M Sin@k rDM Sin@ΘD
,
:
k2 r3
, 0>
2 k2 r3
L56-Cavities.nb
Row ž 8
Plot@Im ž DrΘΦrΘΦ@r, Θ, ΦD . 8Θ ® .2, Φ ® .5<  Evaluate, 8r, 0.0001, 1<, PlotRange ® 8- 1, 1<D,
Plot@Re ž BrΘΦrΘΦ@r, Θ, ΦD . 8Θ ® .2, Φ ® .5<  Evaluate, 8r, 0.0001, 1<, PlotRange ® 8All, 1<D<
1.0
0.5
0.0
-0.5
-1.0
0.0
0.2
0.4
0.6
0.8
1.0
1.0
0.5
0.0
-0.5
-1.0
-1.5
0.0
0.2
0.4
0.6
0.8
1.0
H* could substitute by VectorAnalysis package functions *L
11
12
L56-Cavities.nb
rΘΦ€from€xyz@x_, y_, z_D := :
x2 + y2 + z2 , ArgBz + I
x2 + y2 F, Arg@x + I yD>;
Bxyzxyz@x_, y_, z_D := ModuleB8r, Θ, Φ, Fr, FΘ, FΦ<,
r=
x2 + y2 + z2 ; Θ = ArgBz + I
x2 + y2 F; Φ = Arg@x + I yD;
8Fr, FΘ, FΦ< = BrΘΦrΘΦ@r, Θ, ΦD;
8
Sin@ΘD Cos@ΦD Fr + Cos@ΘD Cos@ΦD FΘ - Sin@ΦD FΦ,
Sin@ΘD Sin@ΦD Fr + Cos@ΘD Sin@ΦD FΘ + Cos@ΦD FΦ,
Cos@ΘD Fr - Sin@ΘD FΘ
<
F;
Dxyzxyz@x_, y_, z_D := ModuleB8r, Θ, Φ, Fr, FΘ, FΦ<,
r=
x2 + y2 + z2 ; Θ = ArgBz + I
x2 + y2 F; Φ = Arg@x + I yD;
8Fr, FΘ, FΦ< = DrΘΦrΘΦ@r, Θ, ΦD;
8
Sin@ΘD Cos@ΦD Fr + Cos@ΘD Cos@ΦD FΘ - Sin@ΦD FΦ,
Sin@ΘD Sin@ΦD Fr + Cos@ΘD Sin@ΦD FΘ + Cos@ΦD FΦ,
Cos@ΘD Fr - Sin@ΘD FΘ
<
F;
a = 1;
xmax = 1.05;
vecpts = 40;
SetOptionsAVectorPlot, ImageSize ® 256, AspectRatio ® Automatic,
BaseStyle ® 14, RotateLabel ® False, VectorStyle ® "PinDart",
VectorPoints ® vecpts,
VectorScale ® 92  vecpts, .5, FunctionA8x, y, fx, fy, nrm<, nrm.8 E=,
PlotRange ® xmax,
PlotRangePadding ® 0E;
8¶min, ¶max, n¶max< = 8- 1.00001, 1., 24<;
SetOptions@ArrayPlot,
ColorFunction ® HcolorFromComplex2@ðD &L,
ColorFunctionScaling ® False, DataRange ® 88¶min, ¶max<, 8¶min, ¶max<<,
Frame ® False, PlotRangePadding ® 0, ImageSize ® 256D;
H*-------- VectorPlot of Re HBx,BzL --------*L
grB = VectorPlotA
Re ž Bxyzxyz@x, 0, zDP81, 3<T * UnitStepA1 - x2 - z2 E, 8x, - xmax, xmax<, 8z, - xmax, xmax<,
Epilog ® Circle@80, 0<, aD, Frame ® False,
PlotLabel ® "Re HBx ,Bz L"E;
H*-------- ArrayPlot of Im Dy --------*L
f@x_Real, z_RealD := Im ž Dxyzxyz@x, 0, zDP2T * UnitStepA1 - x2 - z2 E * .2;
grD =
ArrayPlotA
Reverse ž
Transpose ž Table@f@x, yD, 8x, ¶min, ¶max, ¶max  n¶max<, 8y, ¶min, ¶max, ¶max  n¶max<D,
Epilog ® Circle@80, 0<, aD,
PlotLabel ® "Im Dy Hx,y=0,zL"
E;
H*-------- VectorPlot of Im HDx,DyL --------*L
z = 0.3;
grDxyplane = VectorPlotA
Im ž Dxyzxyz@x, y, zDP81, 2<T * UnitStepA1 - x2 - y2 - z2 E, 8x, - xmax, xmax<, 8y, - xmax, xmax<,
Epilog ® Circle@80, 0<, aD, Frame ® False,
PlotLabel ® "Im HDx ,Dy L Hx,yL"E;
Clear@x, y, zD;
Row ž 8grB, grD, grDxyplane<
L56-Cavities.nb
Re HBx,BzL
Im DyHx,y=0,zL
Ÿ 6.6
Im HDx,DyL Hx,yL
Eigenfunctions: Electric modes
nmax = 20;
lmax = 20;
kELEC€nl€table = Table@- 999, 8n, 1, nmax<, 8l, 0, lmax<D;
DoB
IfBl Š 0,
H* Choose brackets H-0.5,1.1L, H1.5,3.1L, H3.5,5.1L, etc., which works ok *L
Π
kmin = H2 n - 2.5L ;
2
Π
kmax = H2 n - 0.9L ;
2
,
H* Choose bracket based on previous root *L
kmin = kELEC€nl€tablePn, 1 + Hl - 1LT;
kmax = kELEC€nl€tablePn, 1 + Hl - 1LT + Π  2;
F;
kELEC€nl€tablePn, 1 + lT = FindRoot@f€lk@l, kD, 8k, kmin, kmax<D  Last  Last;
, 8n, 1, nmax<, 8l, 0, lmax<F;
kELEC€nl@n_, l_D := kELEC€nl€tablePn, 1 + lT;
13
14
L56-Cavities.nb
8n, l, m< = 82, 2, 0<;
Clear@r, Θ, Φ, kD;
BrΘΦrΘΦ@r_, Θ_, Φ_D = - I * k * j€lx@l, k rD XlmΘΦ@l, m, Θ, ΦD  Chop  FunctionExpand  Simplify
DrΘΦrΘΦ@r_, Θ_, Φ_D =
sphericalCurl@j€lx@l, k rD XlmΘΦ@l, m, Θ, ΦDD  Chop  FunctionExpand  Simplify
k = kELEC€nl@n, lD;
ä
15
2Π
Cos@ΘD I3 k r Cos@k rD + I- 3 + k2 r2 M Sin@k rDM Sin@ΘD
:0, 0, -
>
2 k2 r3
15
2Π
H1 + 3 Cos@2 ΘDL I3 k r Cos@k rD + I- 3 + k2 r2 M Sin@k rDM
,
:
4 k3 r4
1
15
3
4
2k r
Cos@ΘD Ik r I- 6 + k2 r2 M Cos@k rD - 3 I- 2 + k2 r2 M Sin@k rDM Sin@ΘD, 0>
2Π
a = 1;
xmax = 1.05;
vecpts = 40;
SetOptionsAVectorPlot, ImageSize ® 256, AspectRatio ® Automatic,
BaseStyle ® 14, RotateLabel ® False, VectorStyle ® "PinDart",
VectorPoints ® vecpts,
VectorScale ® 92  vecpts, .5, FunctionA8x, y, fx, fy, nrm<, nrm.8 E=,
PlotRange ® xmax,
PlotRangePadding ® 0E;
8¶min, ¶max, n¶max< = 8- 1.00001, 1., 24<;
SetOptions@ArrayPlot,
ColorFunction ® HcolorFromComplex2@ðD &L,
ColorFunctionScaling ® False, DataRange ® 88¶min, ¶max<, 8¶min, ¶max<<,
Frame ® False, PlotRangePadding ® 0, ImageSize ® 256D;
H*-------- VectorPlot of Re HDx,DzL --------*L
grD = VectorPlotA
Re ž Dxyzxyz@x, 0, zDP81, 3<T * UnitStepA1 - x2 - z2 E, 8x, - xmax, xmax<, 8z, - xmax, xmax<,
Epilog ® Circle@80, 0<, aD, Frame ® False,
PlotLabel ® "Re HDx ,Dz L"E;
H*-------- ArrayPlot of Im By --------*L
f@x_Real, z_RealD := Im ž Bxyzxyz@x, 0, zDP2T * UnitStepA1 - x2 - z2 E * .2;
grB =
ArrayPlotA
Reverse ž
Transpose ž Table@f@x, yD, 8x, ¶min, ¶max, ¶max  n¶max<, 8y, ¶min, ¶max, ¶max  n¶max<D,
Epilog ® Circle@80, 0<, aD,
PlotLabel ® "Im By Hx,y=0,zL"
E;
H*-------- VectorPlot of Im HBx,ByL --------*L
z = 0.3;
grBxyplane = VectorPlotA
Im ž Bxyzxyz@x, y, zDP81, 2<T * UnitStepA1 - x2 - y2 - z2 E, 8x, - xmax, xmax<, 8y, - xmax, xmax<,
Epilog ® Circle@80, 0<, aD, Frame ® False,
PlotLabel ® "Im HBx ,By L Hx,yL"E;
Row ž 8grD, grB, grBxyplane<
L56-Cavities.nb
Re HDx,DzL
Im ByHx,y=0,zL
Im HBx,ByL Hx,yL
Appendix: Some properties of spherical Bessel functions
Automatic setup
15
Download