
Understanding the Finite-Difference Time-Domain
Method
John B. Schneider
November 14, 2013

ii

Contents
1 Numeric Artifacts 7
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Finite Precision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 Symbolic Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 Brief Review of Electromagnetics 13
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2 Coulomb’s Law and Electric Field . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3 Electric Flux Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 Static Electric Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.5 Gradient, Divergence, and Curl . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.6 Laplacian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.7 Gauss’s and Stoke s’ Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.8 Electric Field Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.9 Conductivity and Perfect Electric Conductors . . . . . . . . . . . . . . . . . . . . 25
2.10 Magnetic Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.11 Magnetic Field Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.12 Summary of Static Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.13 Time Varying Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.14 Summary of Time-Varying Fields . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.15 Wave Equation in a Source-Free Region . . . . . . . . . . . . . . . . . . . . . . . 29
2.16 One-Dimensional Solutions to the Wave Equation . . . . . . . . . . . . . . . . . 30
3 Introduction to the FDTD Method 33
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2 The Yee Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.3 Update Equations in 1D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.4 Computer Implementation of a One-Dimensional
FDTD Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.5 Bare-Bones Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.6 PMC Boundary in One Dimension . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.7 Snapshots of the Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.8 Additive Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.9 Terminating the Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.10 Total-Field/Scattered-Field Boundary . . . . . . . . . . . . . . . . . . . . . . . . 53
iii

iv
CONTENTS
3.11 Inhomogeneities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.12 Lossy Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4 Improving the FDTD Code 75
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.2 Arrays and Dynamic Memory Allocation . . . . . . . . . . . . . . . . . . . . . . 75
4.3 Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.4 Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.5 Improvement Number One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.6 Modular Design and Initialization Functions . . . . . . . . . . . . . . . . . . . . . 90
4.7 Improvement Number Two . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.8 Compiling Modular Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
4.9 Improvement Number Three . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5 Scaling FDTD Simulations to Any Frequency 115
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5.2 Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5.2.1 Gaussian Pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5.2.2 Harmonic Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
5.2.3 The Ricker Wavelet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5.3 Mapping Frequencies to Discrete Fourier Transforms . . . . . . . . . . . . . . . . 120
5.4 Running Discrete Fourier Transform (DFT) . . . . . . . . . . . . . . . . . . . . . 121
5.5 Real Signals and DFT’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
5.6 Amplitude and Phase from Two Time-Domain Samples . . . . . . . . . . . . . . 126
5.7 Conductivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.8 Transmission Coefficient for a Planar Interface . . . . . . . . . . . . . . . . . . . 132
5.8.1 Transmission through Planar Interface . . . . . . . . . . . . . . . . . . . . 134
5.8.2 Measuring the Transmission Coefficient Using FDTD . . . . . . . . . . . 135
6 Differential-Equation Based ABC’s 145
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
6.2 The Advection Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
6.3 Terminating the Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
6.4 Implementation of a First-Order ABC . . . . . . . . . . . . . . . . . . . . . . . . 148
6.5 ABC Expressed Using Operator Notation . . . . . . . . . . . . . . . . . . . . . . 153
6.6 Second-Order ABC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.7 Implementation of a Second-Order ABC . . . . . . . . . . . . . . . . . . . . . . 158
7 Dispersion, Impedance, Reflection, and Transmission 161
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
7.2 Dispersion in the Continuous World . . . . . . . . . . . . . . . . . . . . . . . . . 161
7.3 Harmonic Representation of the FDTD Method . . . . . . . . . . . . . . . . . . . 162
7.4 Dispersion in the FDTD Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
7.5 Numeric Impedance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
7.6 Analytic FDTD Reflection and Transmission Coefficients . . . . . . . . . . . . . . 169

CONTENTS
v
7.7 Reflection from a PEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
7.8 Interface Aligned with an Electric-Field Node . . . . . . . . . . . . . . . . . . . . 175
8 Two-Dimensional FDTD Simulations 181
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
8.2 Multidimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
8.3 Two Dimensions: TM
z
Polarization . . . . . . . . . . . . . . . . . . . . . . . . . 185
8.4 TM
z
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
8.5 The TFSF Boundary for TM
z
Polarization . . . . . . . . . . . . . . . . . . . . . . 202
8.6 TM
z
TFSF Boundary Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
8.7 TE
z
Polarization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
8.8 PEC’s in TE
z
and TM
z
Simulations . . . . . . . . . . . . . . . . . . . . . . . . . 224
8.9 TE
z
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
9 Three-Dimensional FDTD 241
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
9.2 3D Arrays in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
9.3 Governing Equations and the 3D Grid . . . . . . . . . . . . . . . . . . . . . . . . 244
9.4 3D Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
9.5 TFSF Boundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
9.6 TFSF Demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
9.7 Unequal Spatial Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
10 Dispersive Material 289
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
10.2 Constitutive Relations and Dispersive Media . . . . . . . . . . . . . . . . . . . . . 290
10.2.1 Drude Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
10.2.2 Lorentz Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
10.2.3 Debye Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
10.3 Debye Materials Using the ADE Method . . . . . . . . . . . . . . . . . . . . . . . 294
10.4 Drude Materials Using the ADE Method . . . . . . . . . . . . . . . . . . . . . . . 296
10.5 Magnetically Dispersive Material . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
10.6 Piecewise Linear Recursive Convolution . . . . . . . . . . . . . . . . . . . . . . . 301
10.7 PLRC for Debye Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
11 Perfectly Matched Layer 307
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
11.2 Lossy Layer, 1D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
11.3 Lossy Layer, 2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
11.4 Split-Field Perfectly Matched Layer . . . . . . . . . . . . . . . . . . . . . . . . . 312
11.5 Un-Split PML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
11.6 FDTD Implementation of Un-Split PML . . . . . . . . . . . . . . . . . . . . . . . 318