You are on page 1of 51

• FDTD ECE 6006 Numerical Methods in Photonics

– FD Basics

Finite Differences
Centered vs. forward/backwards
Consider the Taylor expansion of f(x+h) around x:
h2
f (x + h ) = f (x ) + h f ′(x ) + f ′′(x ) + …
2
From which we get the forward first difference
f (x + h ) − f (x )
f ′(x ) = + O(h ) Not very accurate
h
Now expand both f(x+h) and f(x) around f(x+h/2) and
subtract
⎛ h⎞ h ⎛ h ⎞ h2 ⎛ h ⎞ h3 ⎛ h⎞
f (x + h ) = f ⎜ x + ⎟ + f ′⎜ x + ⎟ + f ′′⎜ x + ⎟ + f ′′′⎜ x + ⎟ + …
⎝ 2⎠ 2 ⎝ 2⎠ 8 ⎝ 2 ⎠ 48 ⎝ 2⎠
⎛ h⎞ h ⎛ h ⎞ h2 ⎛ h ⎞ h3 ⎛ h⎞
f (x ) = f ⎜ x + ⎟ − f ′⎜ x + ⎟ + f ′′⎜ x + ⎟ − f ′′′⎜ x + ⎟ + …
⎝ 2⎠ 2 ⎝ 2⎠ 8 ⎝ 2 ⎠ 48 ⎝ 2⎠

To get the centered first difference


h ⎞ f (x + h ) − f (x )

f ′⎜ x + ⎟ =
2⎠ h
+ O h2 ( ) More accurate

f (x + h ) − f (x − h )
f ′(x ) =
2h
+ O h2 ( ) Alternate nodal version

f (x + h ) − 2 f (x ) + f (x − h )
f ′′(x ) =
h 2
( )
+ O h2 Centered 2nd difference

Robert R. McLeod, University of Colorado Computation Methods for EM & Microwaves, Booton 27
• FDTD ECE 6006 Numerical Methods in Photonics
– FD Basics

FDTD for the 1D wave equation


Derivation of the time-advancement formula

⎡ ∂2 1 ∂2 ⎤ 1D scalar wave equation


⎢ 2 − 2 2 ⎥ψ = 0
⎣ ∂x c ∂t ⎦
L+ L−ψ = 0 Factor operator into…
∂ 1 ∂ Forward and backwards
L± = ∓
∂x c ∂t propagation operators

Substitute centered 2nd difference operators


ψ in ≡ ψ (i Δx, n Δt )
ψ in+1 − 2ψ in +ψ in−1 ψ in+1 − 2ψ in +ψ in−1
− =0
Δx 2
c Δt
2 2

Solve forψ i to get explicit time-marching equation



n +1

c 2 Δt 2 n ⎛ c 2 Δt 2 ⎞ n
ψ i
n +1
=
Δx 2
ψ (
i +1 + ψ n
)
i −1 + 2⎜
⎜1 −
Δx
⎟ψ
2 ⎟ i
−ψ i
n −1

⎝ ⎠

Stencil:
n Δt
Note that something interesting
happens when cΔt = Δx i Δx
Robert R. McLeod, University of Colorado 28
• FDTD ECE 6006 Numerical Methods in Photonics
– FD Basics

FDTD for the 1D wave equation


Magic time step
Let cΔt = Δx in the advancement equation
ψ in +1 = ψ in+1 +ψ in−1 −ψ in −1

Substitute eigensolutions to operators L±


L+ F = 0 ∴ Fi n = f (i Δx − n cΔt )
L− B = 0 ∴ Bin = f (i Δx + n cΔt )
into the advancement equation above
Fi n +1 = Fi +n1 + Fi −n1 − Fi n −1
= f [(i + 1)Δx − n cΔt ] + f [(i − 1)Δx − n cΔt ] − f [iΔx − (n − 1)cΔt ]
= f [(i − 1)Δx − n cΔt ]
= Fi −n1

and similarly
Bin +1 = Bin+1

which are the exact solutions. Only possible in 1D


homogeneous spaces, but good for understanding.

Robert R. McLeod, University of Colorado 29


• FDTD ECE 6006 Numerical Methods in Photonics
– FD Basics

FDTD for the 1D wave equation


Dispersion in the sampled space
Plug continuous plane wave into 2nd order wave equation
j (ω t − k x )
⎡ ∂2 1 ∂2 ⎤ ω
ψ =e ⎢ 2 − 2 2 ⎥ψ = 0 k=
⎣ ∂x c ∂t ⎦ c

Phase and group velocity follow from dispersion relation


ω ∂ω
v p = = c vg = =c
k ∂k

Plug discrete plane wave into time-marching equation


c 2 Δt 2 n ⎛ c 2 Δt 2 ⎞ n
ψ =e (
~
j ω n Δt − k i Δx ) ψ i
n +1
=
Δx 2
(
ψ i +1 + ψ i
n
)
−1 + 2⎜
⎜1 − ⎟
Δx 2 ⎟⎠
ψ i −ψ i
n −1

Cancel out common terms to get


~ ~
⎛ c Δt ⎞ ⎡ e + e− jk Δx ⎤
jω Δt − jω Δt 2
jk Δx
e +e
=⎜ ⎟ ⎢ − 1⎥ + 1
2 ⎝ Δx ⎠ ⎣ 2 ⎦

which yields dispersion relation for discrete space:

[ ( ) ]
2
⎛ c Δt ⎞ ~
cos(ω Δt ) = ⎜ ⎟ cos k Δx − 1 + 1
⎝ Δx ⎠

Robert R. McLeod, University of Colorado 30


• FDTD ECE 6006 Numerical Methods in Photonics
– FD Basics

FDTD for the 1D wave equation


Dispersion in the sampled space (cont)

Check that this reduces to continuous as Δt → 0, Δx → 0

1−
(ω Δt )2 ⎛ c Δt ⎞
≈⎜ ⎟
2 ⎡
⎢1 −
( )
~ 2 ⎤
k Δx
− 1⎥ + 1
~ ω
k = ü
2 ⎝ Δx ⎠ ⎢⎣ 2 ⎥⎦ c

What about magic time step Δx = c Δt ?


~
[ ( ) ]
cos(ω Δt ) = cos k Δx − 1 + 1
~ ω
k =
c
ü

~
In general (solve for k )
⎧ 2
⎫⎪
~ 1 −1 ⎪⎛ Δx ⎞
k = cos ⎨⎜⎜ ⎟⎟ [cos(ω Δt ) − 1] + 1⎬
Δx ⎪⎩⎝ c Δt ⎠ ⎪⎭

From which we can write phase velocity of discrete space

ω Δx 2π c
vp = ~ =
k λ0 ⎧
−1 ⎪⎛ Δx ⎞
2
⎫⎪
cos ⎨⎜⎜ ⎟⎟ [cos(ω Δt ) − 1] + 1⎬
⎪⎩⎝ c Δt ⎠ ⎪⎭

Robert R. McLeod, University of Colorado 31


• FDTD ECE 6006 Numerical Methods in Photonics
– FD Basics

FDTD for the 1D wave equation


Dispersion in the sampled space (example)

PEC
0 2.5 5 7.5 10 12.5
z (mm)

Robert R. McLeod, University of Colorado Jaques Loui, NMiP HW assignment 32


• FDTD ECE 6006 Numerical Methods in Photonics
– FD Basics

FDTD for the 1D wave equation


Choosing Δx and Δt

Procedure: Require that energy is bounded through the


2 2
condition ψ n+1 ψ n ≤ 1 . Find this condition by writing time-
stepping equation as matrix equation and solving for
eigenvalues. Result:

cΔt ≤ Δx 1D Courant stability limit

In 2 or 3D and/or problems with a dielectric, we can’t


operate right at this limit, which leads to numerical
dispersion:
1.00
cΔt = Δx
0.95
Δx = λ0 10
0.90 cΔt = Δx / 2
vp
Vpêc

v p = 0.9873 c
0.85
c cΔt = 9 / 10 Δx
0.80 Note that dispersion is not minimized for
small Δt at fixed Δx. Instead, dispersion cΔt
is minimized as they both approach zero
→0
0.75 cΔt = Δx / 2
at an optimal ratio of c Δt = Δx.
0.70
0.01 0.02 0.05 0.10 0.20 0.50 = Nyquist
Δx λ
dxêl limit

Limiting dispersion (phase error) requires Δx ≈ λ0 10

Robert R. McLeod, University of Colorado 33


• FDTD ECE 6006 Numerical Methods in Photonics
– Yee algorithm

3D FDTD
The Yee method
Write out Maxwell curl equations

And define discrete grid ψ (x, y, z , t ) = ψ (i Δx, jΔ y, k Δz , nΔt ) = ψ in, j , k

Electric and
magnetic field
grids are offset by
½ cell in all 3D to
permit centered
first-differences
of the curl
equations.

K. S. Yee, IEEE Trans. on Antennas and Propagation.,


Robert R. McLeod, University of Colorado Vol. 14, pp. 302-307, May 1966 34
• FDTD ECE 6006 Numerical Methods in Photonics
– Yee algorithm

3D FDTD
Time advancement equations
Ampere’s Law gives time advancement of electric fields at
edges of cell on integer time steps:
!
! ∂D !
∇×H = +J
∂t

Faraday’s Law gives time advancement of magnetic fields


at faces of cell on half-integer time steps:
!
! ∂B
∇× E = −
∂t

1
Δt

Robert R. McLeod, University of Colorado 35


• FDTD ECE 6006 Numerical Methods in Photonics
– Yee algorithm

3D FDTD
Derivation from integral equations
Δy
Ey

Ez Hx Ez Δz

Ey
(i,j,k)

∂ ! ! ! !
∫∫
∂t S
B ⋅ dS = − ∫ E ⋅ dl
C
Faraday’s law in integral form

Translate to difference equation w/ centered differences:

[
Δy Δz n +1 2
Δt
]
BX ,i , j +1 2,k +1 2 − BXn −,i1, j2+1 2,k +1 2 =

[
− Δy EYn,i , j +1 2,k + Δz EZn ,i , j +1,k +1 2 − Δy EYn,i , j +1 2,k +1 − Δz EZn ,i , j ,k +1 2 ]
Divide by Δy Δz and rearrange to get same update equation

Robert R. McLeod, University of Colorado 36


• FDTD ECE 6006 Numerical Methods in Photonics
– Yee algorithm

Does Yee scheme obey


Gauss’ Laws?
Only used Ampere’s and Faraday’s laws to derive. Does
scheme obey Gauss’ Laws? Start with integral form in
source free region:
! ! ?
∫∫ D ⋅ dS = ∫∫∫ ρ dV = 0
S V
Gauss’ Law

∂ ! !
∂t S∫∫ D ⋅ dS Differentiate with respect to time

6
∂ ! !
= ∑ ∫∫ D ⋅ dsm Apply to faces of Yee cell
m =1 ∂t S m

!6
= ∑ ∫ H ⋅ dl Use Ampere’s Law
m =1 Cm

Each edge of cube is used twice with opposite sign, so


! !
∫∫ D ⋅ dS = Q = constant
S
so if initially charge free (Q=0) stays charge free and
Gauss’ Law is satisfied.

Robert R. McLeod, University of Colorado 37


• FDTD ECE 6006 Numerical Methods in Photonics
– Yee algorithm

Stability and dispersion in 3D


Courant condition and 3D dispersion relation

Using same procedure as for 1D stability limit:

( −2
cΔt ≤ Δx + Δy + Δz −2
) 1
−2 − 2 3D Courant stability limit
Δx
= For cubical cells
3
Interpretation (drawn for 2D):
Δx
Time step must be shorter than
shortest propagation time between
adjacent nodes, which is on the
diagonal of the cell.
Δx / 2
As we saw in 1D, dispersion is minimized by operating as
close as possible to this limit. Unfortunately in 3D this is
quite far from the zero-dispersion condition cΔt = Δx

Dispersion relation in 3D:


~ ~ ~
1 2 ⎛ ω Δt ⎞ 1 ⎛
2 k x Δx
⎞ 1 ⎛ k Δy ⎞ 1
2⎜ y
⎛ k z Δz ⎞
sin ⎜ ⎟ = 2 sin ⎜⎜ ⎟ + 2 sin ⎟+ sin ⎜⎜
2

(cΔt )2
⎝ 2 ⎠ Δx 2 ⎟ Δy ⎜ 2 ⎟ Δz 2
2 ⎟
⎝ ⎠ ⎝ ⎠ ⎝ ⎠

Depends on direction so discrete space is anisotropic.


Robert R. McLeod, University of Colorado 38
• FDTD ECE 6006 Numerical Methods in Photonics
– Boundary conditions

Boundary conditions
PEC and PMC

PEC: For example, set Ex and Ez = 0:


Ex , Ez = 0 By definition (odd symmetry)

Dy = 0 By Gauss’ Law (even symmetry)
∂y
By = 0 By Faraday’s Law (odd symmetry)
∂ ∂
Hx = Hz = 0 By Ampere’s Law (even symmetry)
∂z ∂y
PMC: For example, set Hx and Hz = 0:
Hx, Hz = 0 By definition (odd symmetry)

By = 0 By Gauss’ Law (even symmetry)
∂y
Dy = 0 By Ampere’s Law (odd symmetry)
∂ ∂
Ex = Ez = 0 By Faraday’s Law (even symmetry)
∂z ∂y
Robert R. McLeod, University of Colorado 39
• FDTD ECE 6006 Numerical Methods in Photonics
– Boundary conditions

Radiation boundary condition


Engquist and Majda 1-way wave eq.
In 3D, the one-way wave operators for a wave traveling
in direction +x (for example) become:
∂ kx ∂
L±x = ∓
∂x ω ∂t
∂ k02 − k y2 − k z2 ∂ Using |k| = k0 at boundary
= ∓
∂x ω ∂t
1 − (k y k0 ) − (k y k0 ) ∂
2 2

= ∓
∂x c ∂t

Good news: Engquist and Majda showed that this will


absorb a wave at x=0 propagating at any angle.

Bad news: The square root makes it quite difficult to


implement.

Solution (Mur): Approximate square root as Taylor series.

Robert R. McLeod, University of Colorado B. Engquist and A. Majda, Math. Comput., vol. 31, pp. 629-651, 1977 40
• FDTD ECE 6006 Numerical Methods in Photonics
– Boundary conditions

Radiation boundary condition


First-order Mur condition
The first term in the Taylor expansion of the square root
is “1”, yielding the first-order Mur operator
∂ 1 ∂
L±x = ∓ Operator for wave traveling in ±x
∂x v p ∂t

If we knew phase velocity of the wave this would be


exact. But this would require there be only one plane
wave incident on the boundary. So, assume wave is
normal (vp=c). Difference equation:
Centered differences
2 (E1 + E1n ) − 12 (E0n +1 + E0n )
1 n +1 around i=1/2, n+1/2

Δx t
1
2 ( ) (
E0n +1 + E1n +1 − 12 E0n + E1n
=0
) n+1
c Δt
Solve for E0n +1

c Δt − Δx n +1 n x
E n +1
0 =E +
1
n

c Δt + Δx
(
E1 − E0n ) 0 1

Must store this value Can compute this value from Hn+1
G. Mur, IEEE Trans. on Electromagnetic Compatibility, Vol. EMC-23,
Robert R. McLeod, University of Colorado November 1981, pp. 377-382 41
• FDTD ECE 6006 Numerical Methods in Photonics
– Boundary conditions

Radiation boundary condition


First-order Mur condition (example)

Launch a Gaussian modulated sin from z=0 and operate


at the magic time step. The pulse propagates without
dispersion and approaches a 1st order Mur condition on
the z=max boundary.

Going: n=450
time steps
(t=37.5 fs)

Going: n=550
time steps
(t=45.8 fs)

Gone: n=650
time steps
(t=54.2 fs)

Robert R. McLeod, University of Colorado Jaques Loui, NMiP HW assignment 42


• FDTD ECE 6006 Numerical Methods in Photonics
– Boundary conditions

Radiation boundary condition


Second-order Mur condition
Keep next term in Taylor series:

1 − (k y k0 ) − (k z k0 ) ∂ ∂ 1 − 12 (k y k0 ) − 12 (k z k0 ) ∂
2 2 2 2

∓ ≈ ∓
∂x c ∂t ∂x c ∂t

Take time derivative


2
∂2 ∂2 ⎛ ⎞ ∂
∓ 2 2 − 12 (k y + k z )⎜⎜
2
1
= 2 2
⎟⎟ 2
c ∂x∂t c ∂t ⎝ c k0 ⎠ ∂t

And substitute from known solution to L operator


∂2 ∂2 ⎛ ∂ 2
∂ 2

0= ∓ 2 2 + 12 ⎜⎜ 2 + 2 ⎟⎟
c ∂x∂t c ∂t ⎝ ∂y ∂z ⎠
See Mur paper for discretization. Requires storage of
two previous time steps per boundary node to implement
second derivative in time.

Also, note that transverse derivatives can not be


implemented at corners, so must revert to a first-order
condition there.

Robert R. McLeod, University of Colorado 43


• FDTD ECE 6006 Numerical Methods in Photonics
– Boundary conditions

Radiation boundary condition


Performance of Mur 1st and 2nd

Point source at (5,5) of a


35 x 35 mesh. Dashed =
1st order, solid = 2nd order.
Time step = 141.

Same as above but source


at (3,3).

G. Mur, IEEE Trans. on Electromagnetic Compatibility, Vol. EMC-23,


Robert R. McLeod, University of Colorado November 1981, pp. 377-382 44
• FDTD ECE 6006 Numerical Methods in Photonics
– Boundary conditions

Radiation boundary condition


Reflectivity vs. angle
To find reflectivity assume an incident and reflected
plane wave on the boundary x = 0:
Eln,m = e
(
j ω n Δt − k y m Δy )
(e jk x l Δx
+ r e − jkx l Δx )
Plug into 1st order Mur update equation and solve for r:
Δx sin (ω Δt 2)cos(k x Δx 2) − c Δt cos(ω Δt 2)sin (k x Δx 2)
rMur 1 =
Δx sin (ω Δt 2)cos(k x Δx 2) + c Δt cos(ω Δt 2)sin (k x Δx 2)

Following same procedure for second-order BC:


a −b
rMur 2 =
a+b
⎡ 2 1 ⎛ c Δt ⎞
2

a = Δx ⎢sin (ω Δt 2) − ⎜⎜ ⎟⎟ sin (k y Δy 2)⎥ cos(k x Δx 2)
2

⎢⎣ 2 ⎝ Δy ⎠ ⎥⎦
b = c Δt cos(ω Δt 2)sin (ω Δt 2)sin (k x Δx 2)

K.S. Kunz, R. J. Luebbers, FDTD Method for EM, CRC Press, 1993
Robert R. McLeod, University of Colorado 45
• FDTD ECE 6006 Numerical Methods in Photonics
– Boundary conditions

Radiation boundary condition


Typical reflectivity in 2D
First vs. second-order at one cell size
1
First-order
0.1
Second-order
0.01
R

0.001
Δx =λ / 10
0.0001 c Δt = Δx / 2
0 20 40 60 80
θ [deg]
Second-order vs. cell size
1

0.1 Δx = λ / 5
Δx = λ / 10
0.01 Δx = λ / 20
R
0.001

0.0001

0.00001 c Δt = Δx / 2
0 20 40 60 80
θ [deg]
Robert R. McLeod, University of Colorado 46
• FDTD ECE 6006 Numerical Methods in Photonics
– Boundary conditions

Radiation boundary condition


Example

First order Mur condition operating at Δx = λ0/10, Δt = ½


Δx / c. The predicted reflectivity is:

rMur 1 = 0.0131

Sampling the field vs time step (n) at 125 space steps


(6.25 mm) into the space:

Incident Reflected

So the formula is roughly right, but not perfect.


Robert R. McLeod, University of Colorado Jaques Loui, NMiP HW assignment 47
• FDTD ECE 6006 Numerical Methods in Photonics
– Sources

Sources
Temporal shape
Since dispersion depends on smallest λ, must limit largest
ω in problem.
1
Gaussian: 0.8
2
⎛ t −t ⎞
−⎜ c ⎟
E (t ) = e ⎝ σ ⎠ 0.6
En

2 0.4
⎛ ω ⎞
−⎜⎜ ⎟⎟
E (ω ) = σ π e ⎝2σ ⎠ 0.2

0
0 200 400 600 800 1000
n
1
Modulated Gaussian:
0.5
2
⎛ t −t ⎞
−⎜ c ⎟
E (t ) = e ⎝ σ ⎠
sin (2π f c t )
En

0
2
⎛ ω − 2π f c ⎞
−⎜⎜ ⎟⎟ -­‐ 0.5
E (ω ) = σ π e ⎝ 2σ ⎠

-­‐ 1
0 200 400 600 800 1000
n
1
“Single frequency”
0.5

2
⎛ t −t ⎞
−⎜ c ⎟

E (t ) = sin (2π f ct )⎨e
⎝ σ ⎠
t ≤ tc 0
En

⎪⎩ 1 t > tc -­‐ 0.5

E (ω ) ≈ δ (ω − 2π f c ) -­‐ 1
0 200 400 600 800 1000
n

Robert R. McLeod, University of Colorado 48


• FDTD ECE 6006 Numerical Methods in Photonics
– Sources

Total/scattered field formalism


Background
Various point sources within the mesh can be driven at
single grid points. Typically in optics we want an
extended source incident from free space. Define:
! ! !
ETot ≡ Einc + Escat
! ! !
H Tot ≡ H inc + H scat

Define that incident field propagates in free-space:


! !
∇ × ∇ × Einc − k0 Einc ≡ 0
2

In total field region use normal method for total field


! !
∇ × ∇ × Etot − k0 ε ⋅ Etot = 0
2

In free-space scattered field region propagate only scattered


fields ! !
∇ × ∇ × Escat − k02 Escat = 0
! + 2!
∇ × ∇ × Einc − k0 Einc ≡ 0
! !
∇ × ∇ × Etot − k0 Etot = 0
2
So still obeys Maxwell

Robert R. McLeod, University of Colorado 49


• FDTD ECE 6006 Numerical Methods in Photonics
– Sources

Total/scattered field formalism


Use
Surround interior region of total field with scattered field
region. Incident fields arise on boundary
RBC
RBC

RBC
Total field region
Scattered field region
RBC
Pluses:
•  RBCs only deal with scattered (outgoing) fields
•  Often want to know scattered fields, so produces naturally
•  Can use same update equation throughout entire grid, then
come back and add/subtract incident field on T/S boundary.

Minuses:
•  Incident field must be propagated in discrete space to
match numerical dispersion
•  Significant amount of storage is used in scattered region
Robert R. McLeod, University of Colorado 50
• FDTD ECE 6006 Numerical Methods in Photonics
– Sources

Total/scattered field formalism


Incident field propagation
•  Incident wave must be phase-matched to the anisotropic
dispersion of the 3D discrete grid.
•  Since temporal pulse shape must contain finite
bandwidth, must match dispersion at band of frequencies.
•  An easy way to do this is to propagate the incident field
in its own 1D FDTD space.
•  Begin with dispersion relations for 1D and 3D:
~
1 2 ⎛ ω Δt ⎞ 1 2 ⎛ k Δx ⎞
sin ⎜ ⎟ = 2 sin ⎜⎜ ⎟

(c Δt )2
⎝ 2 ⎠ Δx1D ⎝ 2 ⎠
~ ~ ~
1 2 ⎛ ω Δt ⎞ 1 ⎡ 2 ⎛ k x Δx ⎞ ⎛ k Δy ⎞
2⎜ y ⎟ + sin ⎜
⎛ k z Δz ⎞⎤
⎟ = 2 ⎢sin ⎜⎜ ⎟ + sin ⎟⎥
2
sin ⎜ ⎟ ⎜ ⎟⎥
(cΔt )2
⎝ 2 ⎠ Δx ⎢⎣ ⎝ 2 ⎠

⎝ 2 ⎟
⎠ ⎝ 2 ⎠⎦

If incident wave is along primary axis, can perfectly match


by setting 1D cell size equal to cell size in propagation
~
direction. Otherwise solve for magnitude of k at center
frequency ω and use this to pick the 1D cell size.
⎛ k~ kˆx Δx ⎞ ⎛ k~ kˆy Δy ⎞ ⎛ k~ kˆz Δz ⎞
1 2 ⎛ ω Δt ⎞ 1 2⎜ ⎟ + 1 sin 2 ⎜ ⎟ + 1 sin 2 ⎜ ⎟
sin ⎜ ⎟ = sin ⎜ ⎟ ⎜ ⎟ ⎜
(cΔt ) ⎝ 2 ⎠ Δx ⎜ 2 ⎟ Δy ⎜ 2 ⎟ Δz ⎜ 2 ⎟⎟
2 2 2 2
⎝ ⎠ ⎝ ⎠ ⎝ ⎠

ω Δ ⎛ k~ Δx1D ⎞
1 ⎛ t ⎞ 1 2⎜ ⎟
sin 2 ⎜ ⎟ = 2 sin ⎜
(c Δt )2
⎝ 2 ⎠ Δx1D

2 ⎟

Robert R. McLeod, University of Colorado 51


• FDTD ECE 6006 Numerical Methods in Photonics
– Sources

Total/scattered field formalism


y
Implementation x

Case 1: All fields in scattered zone: 1


scat
EYn,+i1,j + 1 = scat EYn,i , j + 1 −
2 2
1
ε 0ε i , j + 1
Δt
Δx
( scat n+ 1
2 2
n+ 1
H Z ,i +2 1 , j + 1 − scat H Z ,i −2 1 , j + 1
2 2
) 3

Case 2: All fields in total zone: 2


4
tot
EYn,+i1,j + 1 = totEYn,i , j + 1 −
2 2
1
ε 0ε i , j + 1
Δt
Δx
( tot n+ 1
2 2
n+ 1
H Z ,i +2 1 , j + 1 − totH Z ,i −2 1 , j + 1
2 2
) Scattered Total
2

Case 3: Field in scattered zone, portion of stencil in total zone


scat
E Xn +,i1+ 1 , j = scatE Xn ,i + 1 , j +
2 2
1
ε 0ε i + 1
Δt
Δy
[ scat n+ 1
H Z ,i +2 1 , j + 1 −
2 2
( tot n+ 1
2 2
n+ 1
H Z ,i +2 1 , j − 1 −incH Z ,i +2 1 , j − 1
2 2
)]
2
,j

= scatE Xn ,i + 1 , j +
2
1
ε 0ε i + 1
Δt
Δy
[ scat n+ 1
H Z ,i +2 1 , j + 1 −totH Z ,i +2 1 , j − 1 +
2 2
n+ 1
2 2
] 1
ε 0ε i + 1
Δt inc n + 12
Δy
H Z ,i + 1 , j − 1
2 2
2
,j 2
,j

Case 4: Field in total zone, portion of stencil in scattered zone


tot n+ 1
2 2
n− 1
H Z ,i +2 1 , j + 1 = totH Z ,i +2 1 , j + 1 −
2 2 µ0 µi +
1 Δt
Δx
[ tot
EYn ,i +1, j + 1 −
2
( scat
EYn ,i , j + 1 + incEYn ,i , j + 1
2 2
)]
1
2
, j + 12

+
µ0 µi +
1 Δt
Δy
[ tot
E Xn ,i + 1 , j +1 − totE Xn ,i + 1 , j
2 2
]
1
2
, j + 12

n− 1
= totH Z ,i +2 1 , j + 1 −
2 2 µ0 µi +
1 Δt
Δx
[ tot
EYn ,i +1, j + 1 − scatEYn ,i , j + 1
2 2
]
1
2
, j + 12

+
µ0 µi +
1 Δt
Δy
[ tot
E Xn ,i + 1 , j +1 − totE Xn ,i + 1 , j +
2 2
] µ0 µi +
1 Δt inc n
E
Δx Y ,i , j + 2
1
1
2
, j + 12 1
2
, j + 12

Update equations same throughout grid. Then come back and


add/subtract incident field on scattered/total field boundary.
Robert R. McLeod, University of Colorado 52
• FDTD ECE 6006 Numerical Methods in Photonics
– Sources

Total/scattered field formalism


Example

Scattered Total
Pulse emerging
from boundary.

Note E and H in
phase = travelling
in +z.

Scattered Total Pulse launched.

If the simulation was


continued and the
RHS was a PEC, the
pulse would reflect,
then travel back
through the S/T
boundary, eventually
reflecting off of z=0.

Robert R. McLeod, University of Colorado Jaques Loui, NMiP HW assignment 53


• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Isotropic, non-dispersive materials


Example (1/3)
Let ε vary in space and re-derive FDTD update equation.
You now need an ε grid, sampled on the same nodes as
the electric field. Ampere’s law (the update for E) is
modified:
E n +1
Y ,i , j + 12
=E
n
Y ,i , j + 12

1
ε 0ε i , j + 1 Δx
(
Δt n + 12
2 2
n + 12
H Z ,i + 1 , j + 1 − H Z ,i − 1 , j + 1
2 2
)
2

1st order Mur


ST Pulse emerging
from boundary.
Probe

Pulse transmitted
and reflected
from εr = 1.5,
204 nm thick
slab surrounded
by vacuum.

Transmitted
absorbed by BC,
reflected travels
through ST
boundary and to
probe point.
Robert R. McLeod, University of Colorado Jaques Loui, NMiP HW assignment 54
• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Isotropic, non-dispersive materials


Example (2/3)
E reflected vs time at the probe point:

Fourier transform of Reflection coefficient vs


incident pulse and frequency (ratio of
reflected pulse: reflected to incident).

Null is at 0.6 PHz or λ0 = 0.5 µm. Fresnel coefficients


from front and back have opposite sign, so stack needs to
be full wave round trip or .5 / 1.5 / 2 = .204 µm.
Robert R. McLeod, University of Colorado Jaques Loui, NMiP HW assignment 55
• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Isotropic, non-dispersive materials


Example (3/3)
E reflected vs time but with 104 nm slab thickness:

Fourier transform of Reflection coefficient vs


incident pulse and frequency (ratio of
reflected pulse: reflected to incident).

Now max reflection is at 0.6 PHz or λ0 = 0.5 µm. Fresnel


coefficients from front and back have opposite sign, quarter
wave stack inverts again to make constructive reflection.
Robert R. McLeod, University of Colorado Jaques Loui, NMiP HW assignment 56
• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Anisotropic materials (1)

⎡ εxx εxy εxz ⎤


! ! ⎢ ⎥!
D = ε0 ε ⋅ E = ε0 ⎢ε yx ε yy ε yz ⎥ E Constitutive relation
⎢⎣ εzx εzy εzz ⎥⎦

! ⎡∂ ⎤!
∇ × H = ⎢ ε + σ⎥E Substitute into Ampere’s Law
⎣ ∂t ⎦
∂ ∂
H y − H x = σ zx E x + σ zy E y + σ zz Ez z component
∂x ∂y
∂ ∂ ∂
+ ε zx E x + ε zy E y + ε zz Ez
∂t ∂t ∂t
Two problems:

1.  Off diagonal components of ε couple thee components


of Ampere’s Law so can’t simply solve for update
equation
2.  Don’t have all components of E at proper time and
space increments (Yee symmetry is broken).

J. B. Schneider and S. Hudson, IEEE Trans. Antennas Propagat., vol. 41,


Robert R. McLeod, University of Colorado pp. 994-999, July 1993 57
• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Anisotropic materials (2)


Introduction of tensors couples all field components such that the simple Yee
gridding of centered differences fundamentally breaks. We’ll stick with the
grid because of all the other good routines, but this will be tedious here. The
simplest way to understand the procedure is to consider it three times, once for
each E component. The following is for the Ex component. Repeat the entire
procedure for Ey and Ez. Begin by discretizing all three components of
Ampere’s law at the Ex location n+½, i+½,j,k. The z component, for
example, would be:

∂ n + 12 ∂ n+ 1 n+ 1 n+ 1 n+ 1
HY ,i + 1 , j ,k − H X ,i2+ 1 , j ,k = σ zx E X ,i2+ 1 , j ,k + σ zy EYi +21 , j ,k + σ zz EZ ,i +2 1 , j ,k
∂x 2 ∂y 2 2 2 2

∂ n+ 1 ∂ n+ 1 ∂ n+ 1
+ ε zx E X ,i2+ 1 , j ,k + ε zy EY ,i +2 1 , j ,k + ε zz EZ ,i +2 1 , j ,k
∂t 2 ∂t 2 ∂t 2

For terms on RHS involving conductivity (which are sampled at the wrong
time step), take time average to get E at n+½. Apply the normal centered
differences in t for terms on RHS involving ε.

= (σ zx
2 )
− εΔzxt E Xn ,i + 1 , j ,k +
2
( σ zx
2 )
+ εΔzxt E Xn +,i1+ 1 , j ,k
2

+ (σ zy
2 −
ε zy
Δt )E n
Y ,i + 12 , j ,k
+ (
σ zy
2 +
ε zy
Δt )E n +1
Y ,i + 12 , j ,k

+ (σ zz
2 )
− εΔzzt EZn ,i + 1 , j ,k +
2
(
σ zz
2 )
+ εΔzzt EZn +,i1+ 1 , j ,k
2

Repeat procedure for other two components of Ampere’s Law centered this
same location (n+½, i+½,j,k). We now have three equations in three
unknowns
EXn+,i1+ 1 , j ,k , EYn,+i1+ 1 , j ,k and EZn+,i1+ 1 , j ,k
2 2 2

which we can therefore solve. We’ll only keep the Ex term since it’s at the
right location. To get equations for Ey and Ez, center the derivation at the
approriate location for those fields.
Robert R. McLeod, University of Colorado 58
• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Anisotropic materials (3)


The result for the procedure centered at i+½,j,k is:
This component is at the right location. The others aren’t.

⎡ E n +1 1 ⎤ ⎧⎡ ∂ H n + 12 1 − ∂ H n + 12 1 ⎤ ⎡E n 1 ⎤⎫
⎪ ∂y Z ,i1+ 2 , j ,k ∂z Y ,i +1 2 , j ,k ⎥
−1 ⎪ ⎢ ⎢ Xn ,i + 2 , j ,k ⎥ ⎪⎪
⎢ Xn +,i1+ 2 , j ,k ⎥
⎢ EY ,i + 12 , j ,k ⎥ = [
σ
2 + Δεt ] ∂ n+ ∂ n+
⎨⎢ ∂z H X ,i2+ 12 , j ,k − ∂x H Z ,i +2 12 , j ,k ⎥ + (
σ
2 − Δεt )
⎢ EY ,i + 12 , j ,k ⎥ ⎬
⎢ E n +1 ⎥ ⎪⎢ ∂ n + 12 n + 12 ⎥ ⎢En ⎥⎪
⎪⎩⎢⎣ ∂x H Y ,i + 12 , j ,k − ∂y H X ,i + 12 , j ,k ⎥⎦

⎢⎣ Z ,i + 2 , j ,k ⎥⎦
1
⎢⎣ Z ,i + 2 , j ,k ⎥⎦ ⎪⎭
1

Good news: Can now write EXn+,i1+ , j ,k in terms of quantities at 1


2
previous times.
Bad news: Nearly every field component on the RHS is at the
wrong spatial sampling location.
Solution: Interpolate as necessary. For example:

EYn,i + 1 , j ,k =
2
1 n
4
(
EY ,i , j + 1 ,k + EYn,i +1, j + 1 ,k + EYn,i , j − 1 ,k + EYn,i +1, j − 1 ,k
2 2 2 2
)
Repeat the entire procedure for EYn,+i1, j + ,k and EZn+,i1, j ,k + to derive 1
2
1
2
the other two E-field update equations.

Note that the stencil is now spatially large, which will play
hell with boundary conditions. Typical solution: don’t use
anisotropic materials near boundaries.

Robert R. McLeod, University of Colorado 59


• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Dispersive materials (1)


Write the scalar relative permittivity as an instantaneous (non-
dispersive) and dispersive term:
ε r (t ) = ε ∞δ (t ) + χ (t ) Can make χ(0)=0 or not (see last line)

Which modifies the constitutive relation


! ! t
!
D(t) = ε0ε∞ E(t) + ε0 ∫ χ(τ) ⋅ E(t − τ) dτ
0
To difference Ampere’s Law, we need expressions for D at
time steps n and n+1. Take τ = m Δt , t = n Δt
n −1 (m +1)Δt n −1
D = ε 0ε ∞ E + ε 0 ∑ E
n n n −m
∫ χ (τ )dτ = ε 0ε ∞ E + ε 0 ∑ χ m E n −m
n
mΔt
m =0 m =0
n (m +1)Δt n
D n +1
= ε 0ε ∞ E n +1
+ ε0 ∑ E n +1− m
∫ χ (τ )dτ = ε 0ε ∞ E n +1
+ ε 0 ∑ χ m E n +1−m
mΔt
m =0 m =0

where the discrete χ is defined by


(m +1)Δt
χ ≡∫ m
χ (τ )dτ
mΔt

Take the difference to get the time derivative of D


( ) χ + ε 0 ∑ E n −m (χ m+1 − χ m )
n −1
D n +1
− D = ε 0ε ∞ E
n n +1
− E + ε0E n n +1 0

m =0

Arbitrary division between two terms at t=0


Robert R. McLeod, University of Colorado R. Luebbers et al., IEEE Trans. on EM Compat, V 32, N 3, Aug 1990 60
• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Dispersive materials (2)


Define
Δχ m ≡ χ m − χ m+1
And substitute into the discrete Ampere’s Law to find update
equation for E New term
ε∞
(Δt
H )
n −1
1
∑ E n−mΔχ m − ∑
n +1 n + 12
E = E +
n

ε∞ + χ 0 ε∞ + χ 0 m =0 ε Δx(ε + χ )
0 ∞
0

where ΣHn+½ represents the sum of the four H fields in the


discrete sum of of the loop integral H . dl
Good news: Have expression for updating E.
Bad news: Appears to require storage of history of E as long
as the time interval of χ
Solution: Difference the differential equation for P = χ E:

t
ε −ε εs − ε∞ −
χ (ω ) = s ∞ χ (t ) = e U (t )
t0 Polar dielectric
1 + jω t 0 t0
2
⎛ − ⎞
Δt

mΔt
⎛ − ⎞
Δt
χ 0 = (ε s − ε ∞ )⎜1 − e t0 ⎟ Δχ m = (ε s − ε ∞ )e t0 ⎜1 − e t0 ⎟ Discrete form
⎜ ⎟ ⎜ ⎟
⎝ ⎠ ⎝ ⎠
n −1
P = ∑ E n − m Δχ m
n
Definition
m=0
Δt

P n = E n Δχ 0 + e t0
P n −1 Update equation

D = ε0E + P Now use this in Ampere’s Law


Robert R. McLeod, University of Colorado 61
• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Nonlinear materials
Simple method
For an instantaneous Kerr nonlinearity
D(t ) = ε 0ε ∞δ (t )E (t ) + ε 0 χ (1)δ (t )E (t ) + ε 0 χ (3 )δ (t )E 3 (t )

Avoid problems with nonlinear equation by assuming En+1 is


not too different from En in the calculation of the nonlinear
permittivity

2
[ (
DXn +,i1+ 1 , j , k = ε 0 ε x + α1 E Xn ,i + 1 , j , k
2
) + α (E
2
2
n
) + α (E
Y ,i + 2 , j , k
1
2
2
n
) ]E
Z ,i + 2 , j , k
1
2 n +1
X , i + 12 , j , k

Notes
1.  Notation and tensor form of nonlinearity follow [1], but
could be generalized to complete third-order tensor
nonlinearites, through the use of a matrix inversion step
similar to Schneider and Hudson
2.  Requires interpolation to get the field components at the
proper locations
3.  Only valid for instantaneous nonlinearities
4.  Will require very fine time steps to make assumption valid.
This will in turn require very fine space steps to avoid
dispersion. Thus typically only useful for 1D problems.

1G. W. Zheng and K. S. Chen, Int. J. Infrared Millim. Waves, vol. 13, no.
Robert R. McLeod, University of Colorado 8, pp. 1127-1137, 1992. 62
• FDTD ECE 6006 Numerical Methods in Photonics
– Materials

Nonlinear materials
More complex method
To deal with both dispersive and tensor, dispersive
nonlinearities, define
! ! ! !
D = ε 0 E + PL + PNL
Treat linear dispersive part as before. Following that
approach, for a particular physical system that generates the
nonlinearity, write the differential equation that describes the
evolution of PNL and use FDs to find an update equation for
PNL. For example (see ref)

Kerr Raman
The Raman term, for example, follows the following DE

Robert R. McLeod, University of Colorado P. M. Goorjian and A. Taflove, Optics Lett., B 17, pp. 180-182, Feb. 1992. 63
• FDTD ECE 6006 Numerical Methods in Photonics
– Maxwell-Bloch

Maxwell-Bloch Equations
1D FDTD simultion
Atoms in 1 of 2
Field eigenstates

|2>

|1>

Maxwell Curl Equations: Schrodinger Equation:


! 1 ! !
∂t H = − ∇× E
µo i!∂t ψ = Hˆ ( E(t )) ψ
! 1 ! ! 1 !
∂t E = ∇ × H − ∂t P
εo εo

Coupling:
! ! ! !
p = ψ µˆ ψ µˆ = erˆ
! !
P = Np

Robert R. McLeod, University of Colorado Matt Stowe, NMiP 2004 final project 64
• FDTD ECE 6006 Numerical Methods in Photonics
– Maxwell-Bloch

Atomic Polarization in
Quantum Mechanics
Schrodinger Equation:

i!∂t ψ = Hˆ ( E(t )) ψ w/ state space { 1 , 2 }

yields solutions of form:

ψ (t ) = c~(t )1 1 + c~(t ) 2 2 1
|2>
ω = (E2 − E1 )
! |1>
Free atom: c1=c2=1/sqrt(2):

ψ (t ) =
1
2
[ 1 +e −iωt
2 ]
2
ψ (t ) =
1
2
[
1 1 + 2 2 + e−iωt 1 2 + eiωt 2 1 ]
Notice cosine cross term:

ψ (t ) =
2 1
2
[ ]
1 1 + 2 2 + cos(ωt ) 1 2

Oscillates at atomic frequency

Robert R. McLeod, University of Colorado 65


• FDTD ECE 6006 Numerical Methods in Photonics
– Maxwell-Bloch

Example
Hydrogen electron wavefunctions
Ground state: 1
Y-Z Plane

1S
3/ 2
! ⎛1⎞
ψ 100 (r ) = 2⎜ ⎟ e−r / a
⎝a⎠

Excited state: 2

Y-Z Plane
z

2P,m=0
p 3/ 2⎛ ⎡ ⎤
ao ! ⎛ 1 ⎞ ⎞
y ψ 210 (r ) = ⎜ ⎟ ⎜ r ⎟e − r / 2a ⎢ 1 3 cos(θ )⎥
⎝ 2a ⎠ ⎜a 3⎟ ⎢⎣ 2 π ⎥⎦
⎝ ⎠

x
ao
Oscillating dipole moment in z direction:
!
p = ekˆ cos(ωt ) 1 z 2

Robert R. McLeod, University of Colorado 66


• FDTD ECE 6006 Numerical Methods in Photonics
– Maxwell-Bloch

Liouville Equation
How to handle ensemble of atoms
Limitations to Schrodinger Equation:
•  Doesn’t model an ensemble of atoms
•  Can not easily include decoherence
•  No spontaneous emission

Expectation value of
the positive or
Density Matrix: Ensemble averages negative frequency
⎡ c1c1* c1c2* ⎤⎥
component of ρ
⎡ ρ11 ρ12 ⎤ ⎢
ρˆ = ⎢ ⎥=⎢
ρ ρ * ⎥
⎣ 21 22 ⎦ ⎢ c2c1* c2c2 ⎥ Population
⎣ ⎦ probabilities in
ground and excited
states
Liouville Equation:

ρ" nm =
−i ˆ
!
[ ] (eq
H , ρˆ nm − γ nm ρ nm − ρ nm )
From Schrodinger Phenomenological decay terms

Robert R. McLeod, University of Colorado 67


• FDTD ECE 6006 Numerical Methods in Photonics
– Maxwell-Bloch

Derivation of Bloch equations


Writing out each term of the Liouville equations

−i
ρ"11 = µE (t )[ρ12 − ρ 21] + γ 22 ρ22 Population in state 1
!
−i γ
ρ"12 = [!ωρ12 − µE (t )[ρ 22 − ρ11]] + 22 ρ12
! 2
ρ12 = ρ21* Coherence between 1&2
Large rate change of coherences
ρ11 + ρ 22 = 1

Conservation of population

Bloch vector representation:


Substitute:
r1 = 2 Re[ ρ12 ]
r2 = −2 Im[ρ12 ]
r3 = ρ 22 − ρ11 Bloch Equations
1
r!1 = − r1 + ωr2
T2
1 µ
r"2 = − r2 − ωr1 + 2 E (t )r3
T2 !
1 µ
r"3 = − ⎛⎜ r3 − r3eq ⎞⎟ − 2 E (t )r2
T2 ⎝ ⎠ !
Robert R. McLeod, University of Colorado 68
• FDTD ECE 6006 Numerical Methods in Photonics
– Maxwell-Bloch

Final set of DEs


Substitute polarization in Maxwell:
p x = − Nµr1

1
H! y = − ∂ z Ex
µo
1 Nµ Nµω
E! x = − ∂ z H y − r1 + r2
εo ε oT2 εo
1
r!1 = − r1 + ωr2
T2
1 µ
r"2 = − r2 − ωr1 + 2 E (t )r3 Bloch sphere:
T2 !
1 µ 2
r"3 = − ⎛⎜ r3 − r3eq ⎞⎟ − 2 E (t )r2 r3
T2 ⎝ ⎠ !

r2

r1
1
[1 + 2 ]
2

1
Robert R. McLeod, University of Colorado 69
• FDTD ECE 6006 Numerical Methods in Photonics
– Maxwell-Bloch

Numerical problem
Need to advance state vector by dt:
C
y! 0 = C1 + C2 y2 + 3 y1
T2
1 ⎡Ex ⎤
y!1 = − y1 + ωy2 ⎢ ⎥
T2 ! ⎢ r1 ⎥
w/ y =
1 2µ ⎢ r2 ⎥
"y2 = − y2 − ωy1 + y0 y3 ⎢ ⎥
T2 ! ⎢⎣ r3 ⎥⎦
1 2µ
y"3 = − ⎛⎜ y3 − y3eq ⎞⎟ − y0 y2
T1 ⎝ ⎠ !

FDTD update stencil:


r1 r1
r2 r2
r3 r3
Ex Hy Ex
z
n n+1/2 n+1 n+3/2

Robert R. McLeod, University of Colorado 70


• FDTD ECE 6006 Numerical Methods in Photonics
– Maxwell-Bloch

Soliton pulse results


2π Sech Pulse
8.00E+008 1.00

6.00E+008 0.75

4.00E+008 0.50

2.00E+008 0.25
E Field

0.00E+000 0.00

R3
-2.00E+008 -0.25

-4.00E+008 -0.50

-6.00E+008 -0.75

-8.00E+008 -1.00
-50 -40 -30 -20 -10 0 10 20 30 40 50

Position (µm)

6π Sech Pulse
1.00
2.00E+009
0.75
1.50E+009

0.50
1.00E+009

5.00E+008 0.25
E Field

0.00E+000 0.00
R3

-5.00E+008 -0.25

-1.00E+009
-0.50

-1.50E+009
-0.75
-2.00E+009
-1.00
-40 -30 -20 -10 0 10 20 30 40
Position (µm)

Robert R. McLeod, University of Colorado 71


• FDTD ECE 6006 Numerical Methods in Photonics
– Far-field projection

Far-field projection
If the problem is a scattering object surrounded by empty space,
FDTD is an inefficient algorithm for the empty space. Radar is a
good example in the RF domain. Microscopy is an example in the
optical domain.

Define a surface “C” which


contains the scattering object.
This surface will typically be
outside the total/scattered
field boundary so it contains
only scattered fields but inside
the radiation BCs (it’s in the
grid).

Scattering sources inside the surface can be


replaced by surface electric and magnetic currents
which radiate the same fields outside:
Each tangential field is now a dipole with a known radiation pattern
at any point in exterior space:
Time domain Frequency domain

M.J. Barth, R. R. McLeod, R. W. Ziolkowski, J. EM Waves and


Robert R. McLeod, University of Colorado Apps, V6, N1, 1992 72
• FDTD ECE 6006 Numerical Methods in Photonics
– Far-field projection

Far-field projection
Comparison to MoM
Comparison with method of moments

Comparison with simple analytical case

M.J. Barth, R. R. McLeod, R. W. Ziolkowski, J. EM Waves and


Robert R. McLeod, University of Colorado Apps, V6, N1, 1992 73
• FDTD ECE 6006 Numerical Methods in Photonics
– Far-field projection

Far-field projection
Comparison to Mie theory
Note that FDTD Comparison vs. time
predicts existence and
magnitude of
whispering gallery
mode but not shape
due to discrete surface.

Computational space
using PEC and PMC
Comparison vs. angle at one w

boundary conditions as
symmetry planes.

Robert R. McLeod, University of Colorado 74


• FDTD ECE 6006 Numerical Methods in Photonics
– Far-field projection

Far-field projection
Comparison to experiment

Scattering from 1 meter cube. FDTD expected to do well in this


case since object fits rectangular grid.

Robert R. McLeod, University of Colorado 75


• Validation ECE 6006 Numerical Methods in Photonics
– Stability

Stability
How to keep the code from exploding
A general method to determine the stability limits is to substitute an assumed
solution that includes the instability, then solve for the conditions in which the
instability does not grow (von Neumann analysis). For example, starting with our
FD representation of the 3D wave equation (generalized from previous 1D version):

ψ li,m,n ≡ ψ (l Δx, m Δx, n Δx, i Δt )


ψ li+1,m,n − 2ψ li,m,n + ψ li−1,m,n ψ li,m+1,n − 2ψ li,m,n + ψ li,m−1,n ψ li,m,n +1 − 2ψ li,m,n + ψ li,m,n −1
+ +
Δx 2 Δy 2 Δz 2
ψ li,+m1,n − 2ψ li,m,n + ψ li,−m1,n
− =0
c 2 Δt 2
Assume a solution of the form
[
α i Δt + j ω i Δt − (k x l Δx + k y m Δy + k z n Δz ) ]
ψ i
l ,m,n =e
Substitute into the FD equation and divide by ψ l ,m,n
i

− j k Δy + j k Δy
e − j k x Δx − 2 + e + j k x Δx e y − 2 + e y e − j k z Δz − 2 + e + j k z Δz e α Δt + jω Δt − 2 + e −α Δt − jω Δt
+ + =
Δx 2 Δy 2 Δz 2 c 2 Δt 2
2
Δx 2
[ cos (k x Δx ) − 1 ] + [
2
Δy 2
cos(k y Δ y ) − 1 ]
+
2
Δz 2
[cos (k z Δz ) − 1 ] =
2
c 2 Δt 2
{cosh[(α + jω )Δt ] − 1}

cosh[(α + jω )Δt ] = c 2 Δt 2 ⎨ +
[
⎧ [cos(k x Δx ) − 1] cos(k y Δy ) − 1 [cos(k z Δz ) − 1]⎫
+
]
⎬ +1
⎩ Δ x 2
Δ y 2
Δ z 2

The exponential growth a will be identically zero if Re[Cosh-1(x)]


the RHS is between -1 and +1. The dangerous
case is -1 when kx = 2 π / (2 Δx) which is Nyquist.

(
cΔt ≤ Δx + Δy −2 −2
+ Δz
1
−2 − 2
)
which is the Courant condition!
Robert R. McLeod, University of Colorado 76
• Validation ECE 6006 Numerical Methods in Photonics
– Convergence

Consistency & Convergence


How we know the answers are right
Recall our expressions for centered first and second-order FDs.
f (x + h ) − f (x − h )
f ′(x ) =
2h
( )
+ O h2
Truncation error
f (x + h ) − 2 f (x ) + f (x − h )
f ′′(x ) = + O ( )
h 2

h2
A FD equation is consistent with the original PD equation when the
truncation error goes to zero as the mesh size goes to zero. An example
of an inconsistent FD scheme is a centered-difference version of the heat
diffusion equation (DuFort-Frankel scheme):
∂ ∂2 uli +1 − uli −1 uli+1 − uli +1 − uli −1 + uli−1
u=k 2u =k
∂t ∂x 2Δt Δx 2
By simply writing the Taylor series for the FDs we find the leading terms
of the truncation error are:
2
k ∂ 4 u li ∂ 2 u li ⎛ Δt ⎞ 1 ∂ 3u li 2 Doesn’t go to zero if Δt/
Δx − 2 ⎜ ⎟ −
2
Δt + ...
12 ∂x 4
∂t ⎝ Δx ⎠ 6 ∂t 3
Δx is a constant!

A FD approximation is said to converge when the solution of the FD


equation converges to the solution of the PDE as the mesh size goes to
zero.

Lax equivalence theorem


Given a properly posed linear initial value problem and a finite
difference approximation to it that satisfies the consistency condition,
stability is the necessary and sufficient condition for convergence.

PARTIAL DIFFERENTIAL EQUATIONS


Robert R. McLeod, University of Colorado www1.gantep.edu.tr/~kablan/partial%20differantial%20equ..pdf 77

You might also like