NMiP FDTD
NMiP FDTD
NMiP FDTD
– 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⎠
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
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
and similarly
Bin +1 = Bin+1
[ ( ) ]
2
⎛ c Δt ⎞ ~
cos(ω Δt ) = ⎜ ⎟ cos k Δx − 1 + 1
⎝ Δx ⎠
1−
(ω Δt )2 ⎛ c Δt ⎞
≈⎜ ⎟
2 ⎡
⎢1 −
( )
~ 2 ⎤
k Δx
− 1⎥ + 1
~ ω
k = ü
2 ⎝ Δx ⎠ ⎢⎣ 2 ⎥⎦ c
~
In general (solve for k )
⎧ 2
⎫⎪
~ 1 −1 ⎪⎛ Δx ⎞
k = cos ⎨⎜⎜ ⎟⎟ [cos(ω Δt ) − 1] + 1⎬
Δx ⎪⎩⎝ c Δt ⎠ ⎪⎭
ω Δx 2π c
vp = ~ =
k λ0 ⎧
−1 ⎪⎛ Δx ⎞
2
⎫⎪
cos ⎨⎜⎜ ⎟⎟ [cos(ω Δt ) − 1] + 1⎬
⎪⎩⎝ c Δt ⎠ ⎪⎭
PEC
0 2.5 5 7.5 10 12.5
z (mm)
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
3D FDTD
The Yee method
Write out Maxwell curl equations
Electric and
magnetic field
grids are offset by
½ cell in all 3D to
permit centered
first-differences
of the curl
equations.
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
1
Δt
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
[
Δ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
∂ ! !
∂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
( −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
Boundary conditions
PEC and PMC
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
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
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)
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
⎢⎣ 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
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
rMur 1 = 0.0131
Incident Reflected
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
E (ω ) ≈ δ (ω − 2π f c ) -‐ 1
0 200 400 600 800 1000
n
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
ω Δ ⎛ k~ Δx1D ⎞
1 ⎛ t ⎞ 1 2⎜ ⎟
sin 2 ⎜ ⎟ = 2 sin ⎜
(c Δt )2
⎝ 2 ⎠ Δx1D
⎝
2 ⎟
⎠
= 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
+
µ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
Scattered Total
Pulse emerging
from boundary.
Note E and H in
phase = travelling
in +z.
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
! ⎡∂ ⎤!
∇ × 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:
∂ 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
⎡ 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
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.
m =0
ε∞ + χ 0 ε∞ + χ 0 m =0 ε Δx(ε + χ )
0 ∞
0
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 )
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>
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:
ψ (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
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
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
−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
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 ⎝ ⎠ !
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)
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.
Far-field projection
Comparison to MoM
Comparison with method of moments
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.
Far-field projection
Comparison to experiment
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):
− 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
⎭
(
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
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!