EE 541 Lecture #1

advertisement
Computational
Electromagnetics
computational
electromagnetics
rigorous methods
High frequency
IE
TD
DE
VM
FD
TD
MoM
FDTD
TLM
FEM
FD
field based
GO/GTD
current
based
PO/PTD
Computational
Electromagnetics
Electromagnetic problems are mostly described by three methods:
Differential Equations (DE)  Finite difference (FD, FDTD)
Integral Equations (IE)  Method of Moments (MoM)
Minimization of a functional (VM)  Finite Element (FEM)
less
Theoretical
effort
more
more
Computational
effort
less
Numerical Differentiation
“FINITE DIFFERENCES”
Introduction to differentiation
•
Conventional Calculus
– The operation of diff. of a
function is a well-defined
procedure
– The operations highly depend
on the form of the function
involved
– Many different types of rules
are needed for different
functions
– For some complex function it
can be very difficult to find
closed form solutions
•
Numerical differentiation
– Is a technique for approximating
the derivative of functions by
employing only arithmetic
operations (e.g., addition,
subtraction, multiplication, and
division)
– Commonly known as “finite
differences”
Taylor Series
Problem: For a smooth function f(x),
Given: Values of f(xi) and its derivatives at xi
Find out: Value of f(x) in terms of f(xi), f(xi),
f(xi), ….
y
f(x)
xi
f(xi)
x
Taylor’s Theorem
If the function f and its n+1 derivatives are
continuous on an interval containing xi and
x, then the value of the function f at x is
given by
f ( x )  f ( x i )  f ' ( x i )( x  x i ) 
 ... 
f
(n)
( xi )
n!
n
f ' ' ( xi )
2!
( x  xi )  R n
2
( x  xi ) 
f
(3)
( xi )
3!
( x  xi )
3
Finite Difference Approximations
of the First Derivative using the Taylor Series
(forward difference)
Assume we can expand a function f(x) into a Taylor Series about the
point xi+1
y
f(x)
h
xi
xi+1
x
f(xi)
f(xi+1)
f ( x i  1 )  f ( x i )  f ' ( x i )( x i  1  x i ) 
 ... 
f
(n)
( xi )
n!
f ' ' ( xi )
( x i 1  x i )  R n
2!
( x i 1  x i ) 
2
n
h
f
(3)
( xi )
3!
( x i 1  x i )
3
Finite Difference Approximations
of the First Derivative using the Taylor Series (forward
difference)
Assume we can expand a function f(x) into a Taylor Series
about the point xi+1
f ( x i 1 )  f ( x i )  f ' ( x i ) h 
f ' ( xi ) 
f ( x i 1 )  f ( x i )
h

f " ( xi )
f
h 
2
(3)
2!
f
h  
3
(n)
3!
f " ( xi )
2!
( xi )
h 
f
(3)
( xi )
h  
2
3!
f ( x i 1 )  f ( x i )
h
h 
n
n!
f
(n)
( xi )
n!
Ignore all of these terms
f ' ( xi ) 
( xi )
h
n 1

Finite Difference Approximations
of the First Derivative using the Taylor
Series (forward difference)
f ' ( xi ) 
f ( x i 1 )  f ( x i )
h
y
f(x)
h
xi
xi+1
f(xi)
f(xi+1)
x
Finite Difference Approximations
of the First Derivative using the
forward difference: What is the error?
f ' ( xi ) 
f ( x i 1 )  f ( x i )

f " ( xi )
h
f
h 
2!
(3)
( xi )
h  
2
3!
f
(n)
( xi )
h
n 1

n!
The first term we ignored is of power h1. This is defined as first order accurate.
f ' ( xi ) 
First forward
difference
f ( x i 1 )  f ( x i )
 O (h)
h
 f i  f ( x i 1 )  f ( x i )
f ' ( xi ) 
fi
h
 O (h)
Finite Difference Approximations
of the First Derivative using the Taylor
Series (backward difference)
Assume we can expand a function f(x) into a Taylor Series about the
point xi-1
y
f(x)
h
xi-1 xi
x
f(xi-1)
f(xi)
f ( x i 1 )  f ( x i )  f ' ( x i )( x i 1  x i ) 
 ... 
f
(n)
( xi )
n!
f ' ' ( xi )
( x i 1  x i )  R n
2!
( x i 1  x i ) 
2
n
-h
f
(3)
( xi )
3!
( x i 1  x i )
3
Finite Difference Approximations
of the First Derivative using the Taylor Series
(backward difference)
f " ( xi )
f ( x i 1 )  f ( x i )  f ' ( x i ) h 
f ' ( xi ) 
f ( x i )  f ( x i 1 )
h
h 
2
f
(3)
2!

f " ( xi )
( xi )
f
h  
3
3!
h 
f
(3)
2!
( xi )
h  
2
f
3!
First backward
difference
f ( x i )  f ( x i 1 )
f ' ( xi ) 
h
(n)
( xi )
n!
 O (h )
h
 f i  f ( x i )  f ( x i 1 )
 fi
( xi )
h 
n
n!
Ignore all of these terms
f ' ( xi ) 
(n)
 O (h)
h
n 1

Finite Difference Approximations
of the First Derivative using the Taylor
Series (backward difference)
f ' ( xi ) 
f ( x i )  f ( x i 1 )
 O (h )
h
y
f(x)
h
xi-1
xi
f(xi-1)
f(xi)
x
Finite Difference Approximations
of the Second Derivative using the Taylor Series
(forward difference)
y
f(x)
h
xi+1 xi+2
xi
f(xi)
f(xi+2)
f(xi+1)
(1)
(2)
f ( x i 1 )  f ( x i )  f ' ( x i ) h 
f ( xi  2 )  f ( xi )  f ' ( xi ) 2 h 
(2)-2* (1)
f " ( xi ) 
f " ( xi )
2!
f " ( xi )
h 
2
4h 
2
2!
f
(3)
( xi )
3!
(3)
f ( xi )
h  
3
8h   
f ( x i  2 )  2 f ( x i 1 )  f ( x i 1 )
h
f
(n)
( xi )
h 
n
n!
3
3!
2
x
f
(n)
( xi )
n!
 hf
(3)
( xi )  
2 h 
n
n
Finite Difference Approximations
of the Second Derivative using the Taylor Series
(forward difference)
y
f(x)
h
xi+1 xi+2
xi
f(xi)
f(xi+1)
f " ( xi ) 
f ( x i  2 )  2 f ( x i 1 )  f ( x i 1 )
h
 fi
2
2
f " ( xi ) 
h
2
 O (h) 
 fi
2

n
x  xi
h
2
(3)
( xi )  
 O (h)
n
d f
dx
 (fi )
h
2
Recursive formula for
any order derivative
 hf
 O (h)
f(xi+2)
x
Higher Order Finite Difference Approximations
f ' ( xi ) 
f ( x i 1 )  f ( x i )

f " ( xi )
h
h 
2!
f
(3)
( xi )
h  
f
3!
f ( x i  2 )  2 f ( x i 1 )  f ( x i 1 )
f " ( xi ) 
2
h
2

(3)
( xi )
h  
2
f
(n)
3!
( xi )
h
n 1
( xi )
h
n 1
 hf
(3)
( xi )  
(3)

( x i )  ... 


n!
f ' ( xi ) 
 f ( x i  2 )  4 f ( x i 1 )  3 f ( x i )
f ' ( xi ) 
2h

h
2
f ' ' ' ( x )  ...
3
 f ( x i  2 )  4 f ( x i 1 )  3 f ( x i )
2h

n!
 f ( x i  2 )  2 f ( x i 1 )  f ( x i )
 hf
f ( x i  1 )  f ( x i ) 
h
f ' ( xi ) 

h
2!
f
(n)
 O (h )
2
h
Centered Difference Approximation
(1)
(2)
(1)-(2)
f ( x i 1 )  f ( x i )  f ' ( x i ) h 
f " ( xi )
f ( x i 1 )  f ( x i )  f ' ( x i ) h 
f " ( xi )
h 
2
(3)
2!
h 
2
(3)
f
2!
h 
3
( xi )
h 
3
3!
f ( x i  1 )  f ( x i 1 )
f
2
2h
f ' ( xi ) 
( xi )
3!
f ( x i  1 )  f ( x i 1 )  2 f ' ( x i ) h  2
f ' ( xi ) 
f
(3)
( xi )
h 
3!
f
(3)
( xi )
3!
f ( x i  1 )  f ( x i 1 )
2h
3
 O (h )
2
h 
2
Finite Difference Approximations
of the First Derivative using the Taylor
Series (central difference)
f ' ( xi ) 
f ( x i  1 )  f ( x i 1 )
 O (h )
2
2h
y
f(x)
h
xi-1
xi xi+1
f(xi-1)
f(xi)
f(xi+1)
x
Second Derivative Centered
Difference Approximation (central
difference)
(1)
(2)
(1)+(2)
f ( x i 1 )  f ( x i )  f ' ( x i ) h 
f " ( xi )
f ( x i 1 )  f ( x i )  f ' ( x i ) h 
f " ( xi )
h 
2
f
2!
(3)
( xi )
h 
2
f
2!
(3)
( xi )
f  ( x i ) 
h 
3
3!
f ( x i  1 )  2 f ( x i )  f ( x i 1 )
h
3
3!
2
f ( x i 1 )  f ( x i 1 )  2 f ( x i )  f ( x i ) h  2
f ( x i ) 
h 
2
2
f
(4)
( xi )
h 
4
4!
f
(4)
( xi )
h 
2
4!
f ( x i  1 )  2 f ( x i )  f ( x i 1 )
h
2
 O (h )
2
Using Taylor Series Expansions we found
the following finite-differences equations
f ' ( xi ) 
f ' ( xi ) 
f ' ( xi ) 
f  ( x i ) 
f ( x i 1 )  f ( x i )
 O (h)
FORWARD DIFFERENCE
h
f ( x i )  f ( x i 1 )
 O (h)
BACKWARD DIFFERENCE
h
f ( x i  1 )  f ( x i 1 )
 O (h )
2
CENTRAL DIFFERENCE
2h
f ( x i  1 )  2 f ( x i )  f ( x i 1 )
h
2
 O (h )
2
CENTRAL DIFFERENCE
Forward finite-difference formulas
Centered finite difference formulas
Finite Difference Approx. Partial Derivatives
Problem: Given a function u(x,y) of two independent
variables how do we determine the derivative
numerically (or more precisely PARTIAL
DERIVATIVES) of u(x,y)
U ( x, y )
x
?
or
U ( x, y )
y
 U ( x, y )
2
?
or
x
2
 U ( x, y )
2
?
or
y
2
 U ( x, y )
2
?
or
xy
?
Pretty much the same way
STEP #1: Discretize (or sample) U(x,y) on a 2D grid of evenly
spaced points in the x-y plane
2D GRID
y axis
yj+
u(xi-1,yj+1)
u(xi,yj+1)
u(xi+1,yj+1)
u(xi+2,yj+1)
u(xi-1,yj)
u(xi,yj)
u(xi+1,yj)
u(xi+2,yj)
u(xi-1,yj-1)
u(xi,yj-1)
u(xi+1,yj-1)
u(xi+2,yj-1)
u(xi+1,yj-2)
u(xi+2,yj-2)
1
y
j
yj-1
yj-2
u(xi-1,yj-2)
xi-1
u(xi,yj-2)
xi
xi+1
xi+2
x axis
SHORT HAND NOTATION
y axis
ui,j+1
j+1
j
ui-1,j
ui,j
ui+1,j
ui,j-1
j-1
j-2
i-1
i
i+1
i+2
x axis
Partial First Derivatives
Problem: FIND
u ( x, y )
x
?
or
u ( x, y )
y
?
recall:
f ' ( xi ) 
f ( x i  1 )  f ( x i 1 )
2h
Partial First Derivatives
u ( x, y )
Problem: FIND
x
?
or
u ( x, y )
y
u ( xi , y j )
x
u ( xi , y j )
y
y
?


u ( x i  1 , y j )  u ( x i 1 , y j )
2x
u ( x i , y j  1 )  u ( x i , y j 1 )
2y
These are central difference formulas
Are these the only formulas
we could use?
x
Could we use forward or backward
difference formulas?
Partial First Derivatives: short hand notation
Problem: FIND
u ( x, y )
x
?
or
u ( x, y )
y
u i, j
x
u i, j
y
y
x
?


u i  1 , j  u i 1 , j
2x
u i , j  1  u i , j 1
2y
Partial Second Derivatives
 u ( x, y )
2
Problem: FIND
x
2
 u ( x, y )
2
?
or
y
2
?
recall:
f ( x i ) 
f ( x i  1 )  2 f ( x i )  f ( x i 1 )
h
2
Partial Second Derivatives
 u ( x, y )
 u ( x, y )
2
Problem: FIND
x
2
2
?
or
y
 u ( xi , y j )
2
x
2
 u ( xi , y j )

2
y
y
x
2

2
?
u ( x i  1 , y j )  2 u ( x i , y j )  u ( x i 1 , y j )
x
2
u ( x i , y j  1 )  2 u ( x i , y j )  u ( x i , y j 1 )
y
2
Partial Second Derivatives: short hand notation
 u ( x, y )
2
Problem: FIND
x
2
 u ( x, y )
2
?
or
y
 ui, j
2
2
x
2
 ui, j

2
y
y
x
2

?
u i  1 , j  2 u i 1 , j  u i 1 , j
x
2
u i , j  1  2 u i , j  u i , j 1
y
2
FINITE DIFFERENCE
ELECTROSTATICS
Electrostatics deals with voltages and charges that do no vary as a function
of time.
  ( x, y, z )    ( x, y, z ) / 
2
  ( x, y, z )  0
2
Poisson’s equation
Laplace’s equation
Where,  is the electrical potential (voltage),  is the charge density and
 is the permittivity.

E   
FINITE DIFFERENCE
ELECTROSTATICS: Example
3
o
  ( x, y )  0
2
2
1
Find (x,y) inside the box due to the voltages applied to its boundary. Then
find the electric field strength in the box.

E   
Electrostatic Example using FD
  ( x, y )
2
Problem: FIND
x
2
  ( x, y )
2

y
2
  i, j
2
x
2
  i, j

2
y
y
x
2

0
 i  1 , j  2  i , j   i 1 , j
x
2
 i , j  1  2  i , j   i , j 1
y
2
Electrostatic Example using FD
  ( x, y )
2
Problem: FIND
x
 i , j  1  2  i , j   i , j 1
y
2

2
  ( x, y )
2

y
2
0
 i  1, j  2  i , j   i 1, j
x
2
0
If x = y
 i , j  1  2  i , j   i , j 1   i  1 , j  2  i , j   i 1 , j  0
 i , j  1   i , j 1   i  1 , j   i 1 , j  4  i , j  0
 i, j 
1
4

i , j 1
  i , j 1   i  1 , j   i 1 , j

Electrostatic Example using FD
  ( x, y )
2
Problem: FIND
 i, j 
x
1
4

i , j 1
2
  ( x, y )
2

y
2
0
  i , j 1   i  1 , j   i 1 , j
Iterative solution technique:
(1) Discretize domain into a grid of points
(2) Set boundary values to the fixed boundary values
(3) Set all interior nodes to some initial value (guess at it!)
(4) Solve the FD equation at all interior nodes
(5) Go back to step #4 until the solution stops changing
(6) DONE

Electrostatic Example using FD
MATLAB CODE EXAMPLE
FINITE DIFFERENCE
Waveguide TM modes: Example
=0
=0
=0
2
  ( x, y )  kt  ( x, y )  0
2
=0
~
Where for TM modes E z ( x , y , z )   ( x , y ) e
and k t
2
 k  k z     k z  k z 
If k  
t
2

2
2
2
 jk z z
   k t
2
2
then kz becomes imaginary and the mode does not
propagate.
FINITE DIFFERENCE
Waveguide TM modes: Example
=0
=0
2
  ( x, y )  kt  ( x, y )  0
2
=0
=0
Goal: Find all permissible values of kt and the corresponding
mode shape ((x,y)) for that mode.
Waveguide Example using FD
  ( x, y )
2
Problem: FIND
x
2
  ( x, y )
2

y
2
  i, j
 k z ( x, y )  0
2
x
2
  i, j

2
y
y
x
2

 i  1 , j  2  i , j   i 1 , j
x
2
 i , j  1  2  i , j   i , j 1
y
2
Waveguide Example using FD
  ( x, y )
2
Problem: FIND
 i , j  1  2  i , j   i , j 1
y
2
x

2
  ( x, y )
2

y
2
 i  1 , j  2  i , j   i 1, j
x
2
 k z ( x, y )  0
2
 k z  i, j  0
If x = y=h
 i , j  1  2  i , j   i , j 1   i  1, j  2  i , j   i 1, j  h k z  i , j  0
2
 i , j  1   i , j 1   i  1 , j   i 1 , j  ( 4  h k z )  i , j  0
2
2
2
Waveguide Example using FD
 i , j  1   i , j 1   i  1, j   i 1, j  ( 4  h k z )  i , j  0
2
2
=0
=0
 1

2

let  
 ...

 N






=0
=0
where N is the number of interior nodes (i.e. not on a boundary)
If we now apply the FD equation at all interior nodes we can
form a matrix equation
2 2
Where I is the identity matrix
( A  k h I )  0
Waveguide Example using FD
 i , j  1   i , j 1   i  1, j   i 1, j  ( 4  h k z )  i , j  0
2
2
2
( A  k z h I )   0 is an eigenvalue equation usually cast in the form
2
A   
The eigenvalues will provide the permissible values for the transverse wavenumber
kt and the eigenvectors are the corresponding mode shapes ((x,y))
Waveguide Example using FD
 i , j  1   i , j 1   i  1, j   i 1, j  ( 4  h k z )  i , j  0
2
=0
=0
3
=0
2
4
=0
W
1
=0
2
h
=0
=0
W
=0
Waveguide Example using FD
  i , j  1   i , j 1   i  1 , j   i 1 , j  4  i , j    i , j
=0
Node #1:   3  0   2  0  4  1    1
Node #2:
Node #3:
Node #4:
  4  0  0   1  4 2   2
0   1   4  0  4 3    3
3
=0
1
1
4
0
0
4
1
1
Solve using the Matlab “eig” function
4
=0
W
1
=0
2
h
0   2  0   3  4 4    4
 4

1

 1

 0
=0
0 1 
1 




2
1  2
  


 3 
 1   3 





4   4 
 4
=0
=0
W
=0
Waveguide Example using FD
 i , j  1   i , j 1   i  1, j   i 1, j  ( 4  h k z )  i , j  0
2
2
2
( A  k z h I )   0 is an eigenvalue equation usually cast in the form
2
A   
The eigenvalues will provide the permissible values for the transverse wavenumber
kt and the eigenvectors are the corresponding mode shapes ((x,y))
HOMEWORK: WRITE A MATLAB PROGRAM THAT CALCULATES THE
TRANSVERSE WAVENUMBERS AND MODE SHAPES FOR A RECTANGULAR
WAVEGUIDE FOR TM MODES
Finite Difference Time Domain
Method
(FDTD)
Some big advantages
•
•
•
•
Broadband response with a single excitation.
3D models easily.
Frequency dependent materials accommodated.
Most parameters can be generated e.g.
Scattered fields
antenna patters
RCS
S-parameters
etc…..
How does it work?
Based on the 2 Maxwell curl equations in derivative form. These
are linearized by central finite differencing. We only consider
nearest neighbor interactions because all the fields are advanced
temporally in discrete time steps over spatial cells.
ie we sample in space & time
embedding of an antenna
in a FDTD space lattice
(note that the whole volume
is meshed!)
closed & open problems
FDTD is especially suitable for computing transients for closed
geometries. When an open geometry is required, such as when
we are dealing with an antenna, we need a boundary condition to
simulate infinity. In this case the FDTD requires an absorbing boundary
condition (ABC) at the grid truncation.
This means there is no reflection from the boundary where the
mesh ends.
FDTD: The Basic Algorithm
• Maxwell’s Equations in the TIME Domain:
X E  
H
 t
X H   E  
E
 t
Equate Vector Components:
Six E and H-Field Equations
1  E y E z

 
y
  z
 t




E x
1  E z E x 

 

z 
  x
 t
E y
1  E x E y

 
x
  y
 t
E z
H x
H y
H z





1  H z H y
 

  E x 
 t
  y
z

1  H x H z

 

 E y 
 t
  z
x


1  H y H x
 

  E z 
 t
  x
y

2-D Equations:
Assume that all fields are uniform in y
direction (i.e. d/dy = 0)
2D - TE
H
2D - TM
1  E z E x 




 t
  x
z 
H x
E x

1  H y
  
  E x 
 t
  z

H z

1  H y
  
  E z 
 t
  x

E y
E z
y
1  E y


 t
   z




1  E y
  
 t
  x




1  H x H z

 

 E y 
 t
  z
x

1-D Equations:
Assume that all fields are uniform in y
and x directions (i.e. d/dy =d/dx= 0)
1D - TE
1D - TM
1  E y


 t
   z
H
1  E x 
y
 

 t
  z 
H x

1  H y
  
  E x 
 t
  z

E y
E x




1  H x

 
 E y 
 t
  z

Discretize Objects in Space
using Cartesian Grid
3D Discretization
2D Discretization
z
x
1D Discretization
Z
z0
Ex ( z, t)
zZ
Define Locations of Field
Components:
FDTD Cell called Yee Cell
•
Finite-Difference
– Space is divided into small cells
One Cell: (dx)(dy)(dz)
– E and H components are
distributed in space around the
Yee cell (note: field components
are not collocated)
FDTD: Yee, K. S.: Numerical solution of initial boundary value problems involving
Maxwell's equations in isotropic media. IEEE Transactions on Antennas
Propagation, Vol. AP-14, pp. 302-307, 1966.
Replace Continuous
Derivatives with Differences
•
f
x
Derivatives in time and space are approximated as DIFFERENCES
 f '  slope of curve
Central Difference
f i  f ' ( xi ) 
'
Formula :
f i  1  f i 1
2h
 Error ( h )
2
Solution then evolves by timemarching difference equations
– Time is Discretized
• One Time Step: dt
– E and H fields are
distributed in time
– This is called a
“leap-frog”
scheme.
1-D FDTD
Assuming that field values can only vary in the z-direction (i.e.
all spatial derivatives in x and z direction are zero), Maxwell’s
Equations reduce to:
H
 t
y
 
1  E x 


  z 

1  H y
  
  E x 
 t
  z

E x
z
Hy
Ex
(z), (z)
1-D FDTD – Staggered Grid in Space
Interleaving of the Ex and Hy field components in space and time in the 1-D FDTD formulation
Time plane
Ex
H
1

 nz  
2

3

n

 z

2

( nz
( nz
 2
 1
3

 nz  
2

1

n

 z

2

( nz
( nz 
 1
( nt 
y
Ex
3

 nz  
2

1

 nz  
2

1

 nt  
2

1

 nz  
2

3

 nz  
2

1

n

 t

2

1-D FDTD
H
y
 t
 
1  E x 


  z 

1  H y
  
  E x 
 t
  z

E x
Replace all continuous derivatives with finite differences
H y
t
E x
 z
n 1

H y (i )  H y (i )
n 1 / 2

Ex
n
E x
t
t
n 1 / 2
(i  1 / 2 )  E x
z
(i  1 / 2 )
H y
 z
n 1 / 2

Ex
(i  1 / 2 )
n 1 / 2
(i  1 / 2 )
t
H y ( i )  H y ( i  1)
n

n 1 / 2
(i  1 / 2 )  E x
n
z
n 1 / 2
E x  
Ex
(i  1 / 2 )  E x
2
1-D FDTD
H
y
 t
 
1  E x 


  z 
E x
 t


1  H y




E
x 

  z

Substitution of difference equations in above yields:
H
n 1
y
(i )  H y (i )
n
t
n 1 / 2
n 1 / 2
(i  1 / 2 )  E x
(i  1 / 2 ) 
1  Ex

  

 
z

 H yn ( i )  H yn ( i  1)




n 1 / 2
n 1 / 2
Ex
(i  1 / 2 )  E x
(i  1 / 2 )
1
z


t
  E xn  1 / 2 ( i  1 / 2 )  E xn 1 / 2 ( i  1 / 2 ) 


2


1-D FDTD
H
y
 t
 
1  E x 


  z 
E x
 t


1  H y




E
x 

  z

After some simple algebra:
E
n 1 / 2
x
(i  1 / 2 ) 
H
n 1
y
2   t
2   t
(i )  H (i ) 
n
y
E
n 1 / 2
x
(i  1 / 2 ) 
t
(E
 z
n 1 / 2
x
2t
 z (2   t  
n 1 / 2
(i  1 / 2 )  E x
(H
n
y
( i )  H y ( i  1)
(i  1 / 2 )
n


1-D FDTD Algorithm – Flow Chart
Start
nt  1
Compute 1-D Faraday’s FDTD equation: For all nodes n inside the simulation region:
H
( n , nt )
y
 H
( n , nt  1)
y
( n  1, nt  1 / 2 ) 
 ( n , nt 1 / 2 )
 t E x
 Ex


Compute 1-D Ampère-Maxwell’s FDTD equation: For all nodes n inside the simulation region:
( n , nt  1 / 2 )
Ex
( n , nt 1 / 2 )
 Ex
 ( n  1, nt )
 t H y

H
( n , nt )
y


Electric current density excitation: For all excitation nodes n:
( n , n 1 / 2 )
( n , n 1 / 2 )
(n,n )
Eˆ y t
 Eˆ y t
  t Jˆ e y t
Boundary condition: For all PEC boundary nodes n:
( n , nt  1 / 2 )
Eˆ
0
y
nt  nt  1
No
Yes
nt 66
 Nt
Stop
FDTD Solution of 1-D Maxwell’s Equations (EXAMPLE)
FDTD equations
n 1 / 2
Ex
(i  1 / 2 ) 
2   t
n 1 / 2
Ex
2   t
n 1
H y (i )  H y (i ) 
n
t
 z
(i  1 / 2 ) 
(E
n 1 / 2
x
2t
 z (2   t  
n 1 / 2
(i  1 / 2 )  E x
(H
n
y
( i  1)  H y ( i )
(i  1 / 2 )
n


initial-boundary-value
problem
Initial conditions
1
Ex
2
  (  x ( i  io 
(i  1 )  E o e
2
H (i ) 
1
y
Eo
e
  (  x ( i  i o ))
1 )) 2
4
For all values of i
2
Zo
Boundary condition for a perfectly electrically conducting (PEC) material
E x (0, t )  0 

E x (Z , t)  0
t
Z
Ex ( z, t)
E x (0, t )  0
z0
E x (Z , t)  0
zZ
FDTD Solution of the First Two 1-D Scalar Maxwell’s Equations
Amplitude RC2(t)
Excitation pulse: RC2(t) – Time Domain
Magntiude |RC2(f)|
Excitation pulse: RC2(f) – Frequency Domain
FDTD Solution of 1-D Maxwell’s Equations
FDTD Solution of 1-D Maxwell’s Equations
SOME OPEN QUESTIONS??
•
•
•
•
How do we determine what t and z
should be?
How do we implement real sources?
How do we simulate open boundaries?
How accurate is the solution?
Potential Source of Error: Numerical Dispersion
• In implementing any numerical technique, it is essential to understand the
origin and nature of errors that are introduced as a result of the
computational approach.
• In the FDTD errors arise from the discretization of the computational space
and finite difference approximations to Maxwell’s equations.
• One particularly important source of error is call numerical dispersion.
• To see this consider the continuous wave equation in ID:
 U
2
t
2
 U
2
c
2
x
2
0
Which has a solution of the form we have looked at before:
U (x, t   e
j ( wt  kx )
If we substitute this expression into the wave equation, we get:
( jw 2 e j ( wt  kx )
 c ( jk ) e
( jw )  c ( jk )
2
2
2
2
j ( wt  kx )
2
 w  ck
•From this we see that the wave number is linearly proportional to the
frequency.
•This is more widely known as the phase velocity, when expressed as np
= w/k np=c
•To determine how the FDTD effects this relationship, we repeat the
same procedure using the difference equations.
Let’s now look at the discrete wave equation
•Represent the second order difference equation (for both time and
space) in terms of:
 U
n
2
x
2

n
n
U i  1  2U i  U i  1
x
2
•Doing the same for the time derivative, we get:
 U in 1  2U in  U in1

2


x

U
n 1
i
 (c  t 
2
 U in  1  2U in  U in 1

0
2

(c  t 

 U in 1  2U in  U in1

2


x


  2U in  U in 1


•Now defining the solution from e j ( wt  kx ) in difference form:
U
n
i
 e
 e
~
j ( wn  t  k i  x )
j ( wt  kx )
•Substituting this into the difference form of the wave equation we get:
e
(
~
j w ( n 1)  t  k i x
2


(
~
~
~
 c t 
j ( wn  t  k ( i  1 )  x 
j ( wn  t  k i  x 
j ( wn  t  k ( i  1 )  x )
 2e
e

  e
 x 
~
~
j ( wn  t  k i  x )
j ( w ( n 1 )  t  k i  x 
 2e
e
Factor out:
e
~
j ( wn  t  k i  x )

e
(
~
j w ( n 1)  t  k i x
2


(
~
~
~
 c t 
j ( wn  t  k ( i  1 )  x 
j ( wn  t  k i  x 
j ( wn  t  k ( i  1 )  x )
 2e
e

  e
 x 
~
~
j ( wn  t  k i  x )
j ( w ( n 1 )  t  k i  x 
 2e
e
Factor out:
2
e
j (wt 
e
(
~
j ( wn  t  k i  x )

~
~
 c t 
 j (k  x 
jk  x
 jw  t


e

2

e

2

e

 x 

We get:
2
e
jw  t
(
 (
~
 c  t   j k~ x
jk  x
 jw  t

2e
 2e
 e
 x 

Group time and space terms and divide both sides by 2
e
jw  t
e
2
 jw  t
 c  t   e


  x  
Use Euler’s Identity:
2
cos( x ) 
~
 jk  x
e
2
e
jx
e
~
jk  x

 1  1


 jx
2
2
 (
 
~
 c t 
cos( w  t )  
cos
k
 x  1  1 (FDTD)

 x 
w  ck
(continuous)
~
•This is a nonlinear equation that represents the relationship between the wave number, k
and the frequency, w. It is a function of the time step t, spatial step x and frequency
w
•This means that as a simulated wave propagate through the solution space it undergoes
phase errors because the numerical wave either slows down or accelerates relative to the
actual wave propagation in physical space.
•To examine the implication we consider 3 special cases:
Case 1
Consider Δt  and Δx  0
•In this case, use the first two terms of the Taylor series expansion of terms 
1
( w  t 2
2
( w  t 2

2
~
k w
2
(
~
 c t  

 1  k  x
 x  
(
c t ~
k x
x

2
 1   1


2
c
Same as in real space
Case 2
Use the relation cΔt = Δx
•This is often referred to as the magic time step!
•Plugging in we get:
2
 (
 
~
 c t 
cos ( w  t   
 cos k  x  1  1
 x 
~
cos ( w  t   cos k  x
(

~
 Implies that w  t  k  x
~ x ~
wk
 kc
t
c t   x
~
 w  kc
No dispersion
Unfortunately the relation cΔt = Δx is unstable!
Case 3
•In this case we consider the general case where there is no assumed relation
between Δt and Δx.
•Therefore we need to solve for a general expression that can tell us the effect of
numerical dispersion for a given relationship.
•To do this, we solve in terms of the wave number.
~
1
k 
cos
x
2



x




1
 cos ( w  t  1
1  


  c t 

•Using this equation we can determine the numerical wave number for any
relation between Δt and Δx for a given sampling rate.
•Substitute in the appropriate parameters and determine the effects of discretizing
the computational space.
c t 
x
, x  
2
10
x
~
1
k 
cos
x
1

1 



 k x 
4  cos 
  1 
 2 


Where we have used k= w/c, use the sampling note of
x  
~ 1
 k
cos
w
x
1
(0 . 8042  
Now define numerical phase velocity as
w
~
 p  ~  V p  0 . 987 c
k
0 . 6364
x
•Over a distance of 10λ, which is in this case in no computational cells
•The numerical wave would only propagate 98.73 cells  phase error of 45.72º
•If we repeat this analysis for
x  
20
 p  0 . 9968 c
•Now the phase error at wλ is 11.19º
•The conclusion to draw from this is that the larger the solution space, the greater
the phase error is going to be.
(MATLAB DEMO)
Stability
•As stated before, the FDTD method approximates M.E.’s as a set of
completed difference equations.
•As such this method is useful only when the solution of the difference
equations are convergent and stable.
•Convergence means that as time stepping continues, the solution of the
difference equations asymptomatically approach the solution given by
Maxwell’s equations.
•On the other hand, stability is basically stated as a set of condition under
which the error generated does not grow in an unbounded fashion.
In order for the FDTD equations to remain stable the following
relationship (called the Courant stability criteria must be met)
c t   x
•This is the stability condition for 1D case
•For higher dimensional cases we have the form
c t 
x
,where
D
D=1, 2, 3 depending on the number of dimensions used
(MATLAB DEMO)
•So far we have considered a sample 1D FDTD formulation, that
physically represents the propagation of a plane wave.
•More often than not, EM BVP’s cannot be accurately represented as
a 1D problem.
2D FDTD Formulation
•In the formulation of the two-dimensional
FDTD, one can assume

either TE ( electric field is
to the plane of incidence, or TM;
magnetic field is  to the plane of incidence).
•This results from the fact that in 2D neither the fields nor the object
contain any variations in the z-direction,consequently at   0
z
So in this context, Maxwell’s Equations can be reduced to:
1  H y H x
H 
 E 
 

 E z
t
t
  x
y
E
E  
H x
t
H

y
t
 TE

E z
H
t
1 E z
 y
1 E z
 x
polarizati on , E z




For TM polarization we have:

t

t
Ex 
Ey 
H z
t
1 H z
 y
1 H z
 x
1  E x E y




  y
x
 TM
pol ., H z




field
Applying the central difference expression, for TE mode, we get:
n  12
Hx
H
n  12
y
(i , j  1 2   H
(i  1 2 , j   H
n  12
x
(i , j  1 2   E~
n  12
y
n
z
(i  1 2 , j   E~

~n
( i , j )  E z ( i , j  1)
n
z
~ n 1
~n
E z ( i , j )  Ca (   E z ( i , j )  Cb (    H
~n
( i  1, j )  E z ( i , j )
n  12
y
(i  1 2 , j   H
n  12
y
(i  1 2 , j   H
n  12
x
(i , j  1 2   H
n  12
x
(i , j  1 2 
For the TM case, we have:
n  12
Hx
(i  1 2 , j  1 2   H
~ n 1
E x (i 
1
n  12
x
~n
(

,
j
)

Ca

E
(i 
2
x
~ n 1
E y (i, j 
1
2
(i  1 2 , j  1 2   E~
1

n
x
~n
~n
~n
( i  1 , j  1)  E x ( i  1 , j )  E y ( i , j  1 )  E y ( i  1, j  1 )
2
2
2
2
2 , j )  Cb (    H z
~n
)  Ca (   E y ( i , j 
1
2

n  12
)  Cb (    H z
n  12
(i 
1
2, j 
(i  1 2 ,
j
1
n
(i 
2 H z
1
2
  H zn  (i 
1
1
2
2
1
2
1
2
, j
, j
1
2
1
2


Numerical Dispersion 2D case
Using same procedure as for the 1D case we obtain:
2
2
~
~
 1 
 k y y 
 1 
 k xx 
 1
  t 



   

sin

sin
sin









 2 
 2 
c

t
2

x

y
















2
~
~



 s



t

s

k

cos(

)

s

k
 sin(  ) 


2
2
  sin 

sin 
   sin 




2
2
 2 
 c t




2
~
~
~
~
k x  k  cos(  ), k y  k  sin(  )
Numerical Dispersion 2D case
Plot of the normalised phase velocity vs. travelling
wave angle.
Writing a 2D FDTD Program
1.
Defining physical constants
 ,  ( x , y ,  ( x , y )
2.
Define program constants
E 0  magnitude of electric field
t
x
N t : total # of time steps
N x , N y : # of nodes in the x, y direction
3.
If using a pulse source, define Ez and Hx, or we can implement a hard
source.
4.
Start time marching nΔt, time value n = 1 : Nt
5.
Increment the spatial index
First apply the absorbing boundary conditions
Apply the ABC along the edges of the computational region
(MATLAB DEMO)
Yee’s 3D Mesh
Transition to 3D
The 1D formulation involved 2 degrees of freedom (one field
quantity E or H and one time variable). In 3D we have 4 degrees
of freedom (3 in space and 1 in time). The following notation is
somewhat standard
( i,
j, k   ( i x , j y , k  z 
where the increment is the lattice space increments and i,j,k are
integers. Any field may be represented as
u (i  y , j  y , k  z , n  t )  u
n
i , j ,k
The Yee Cell seen in a more Macroscopic view –
Faraday's and Ampere’s law

D  dS

t
S1
Fall 2007
1

 H  dl
1
C1
mp@es.aau.dk
95
General 3D Formation
•So far we have considered the 1D and 2D formulations.
•Now we will do the 3D formulation.
•Recall that Maxwell’s curl equations are:
E  

t
 
H
t
(i, j, k)
H  

 (i , j , k 
D
t
E
t
J
 E
(i, j, k)
•For simplicity, consider a linear and isotropic medium.
•In Cartesian coordinates, the curl equations reduce to:
H x
E z E y
~
x 

 
y
z
t
H y
E x E z
~
y 

 
z
x
t
~z   E y   E x     H z
x
y
t
E 
tˆ
E z
y

i
j
k
/x
/y
/z
Ex
Ey
Ez
E y
z
 

t
Hx
Also, for Ampere’s Law:
H z
y
H x
z
H
x
y



H
y
z
H z
x
H x
y



E x
t
E y
t
E z
t
 E x
 E y
 E z
3D Discretization
Given a function f(x, y, z, t) we write it in discrete form as:
f(x, y, z, t) = f(iΔx, jΔy, kΔz, nΔt)
=f
n
(i , j , k )
In general, we let: Δx = Δy = Δz = d
3D formulation
H x
t
H y
t
H z
t

1  E y E z





H

x 
  z
y

E x
1  E z E x






H
y 

  x
z

E y

1  E x E y



  Hz

  y
x

E z
t
t


1  H z H y



E

x 
  y
z


1  H x H z




E
y 

  z
x


1  H y H x
 

  Ez 
t
  x
y

These six coupled equations form the basis for the FDTD
algorithm.
3D Discretization
Given a function f(x, y, z, t) we write it in discrete form as:
f(x, y, z, t) = f(iΔx, jΔy, kΔz, nΔt)
=f
n
(i , j , k )
In general, we let: Δx = Δy = Δz = d
FDTD Discretization of 3D Curl Equations
n  12
Hx
n  12
Hx
(i , j 
(i 
n  12
Hz
1
,k 
1
2 , j, k 
1
1
2
 H x
n  12
2
2 H x
n  12
 E yn (i , j 
(i , j  1 2 , k  1 2  

 0  r (i , j  1 2 , k  1 2  
1
n 1
1
2
(i  1 2 , j , k   E xn (i  1 2 , j , k 
t
 E xn  1 (i 
 (i  2 , j , k  

2
1
 H n  1 2 (i 

 z
 0  r (i  1 2 , j , k  
, j , k   E x (i 
2
 E n (i 

 x
 0  r (i  1 2 , j  1 2 , k  
1
n
1
,k 
1
2
  E yn (i , j  1 2 , k 
z
1
1
(i  1 2 , j  1 2 , k   H zn  (i  1 2 , j  1 2 , k 
1
2
 E zn (i  1, j , k  1 2   E zn (i , j , k 
(i  2 , j  2 , k  

 0  r (i  1 2 , j , k  1 2  
x
1
t
Ex
1
1
2
1
2, j 
1
, j  1, k   E x (i 
n
1
2
2,k  H z
n  12
y
, j, k 


Where we have used time interpolation
(i  1 2 , j  1 2 , k 
2

2
n


E x (i 
n  12

2
,k 
1
2
  E zn (i , j , k  1 2  


, j , k  1   E x (i 
n
1
, j , k  E y (i  1, j 

Hy
1
y
n
n
1
y
1
E z (i , j 
2
z
, k   E y (i , j 
n
1
2
x
1
2
1
2
, j, k 


, k 


(i  1 2 , j , k  1 2   H yn  (i  1 2 , j , k  1 2  
1
2
z


E y (i , j  1 2 , k   E y (i , j  1 2 , k 
n 1
n
t
 H xn  2 (i , j  1 2 , k  1 2   H xn  2 (i , j  1 2 , k  1 2  H zn  2 (i  1 2 , j  1 2 , k   H zn  2 (i  1 2 , j  1 2 , k  




 0  r (i , j  1 2 , k  
z
x

1
1
1
1
1
 E yn 1 (i , j  1 2 , k   E yn (i , j  1 2 , k  
 (i , j  1 2 , k  

2


E z (i , j , k  1 2   E z ( i , j , k  1 2 
n 1
n
t
 H yn  2 (i  1 2 , j , k  1 2   H yn  2 (i  1 2 , j , k  1 2  H n  1 2 (i , j  1 , k  1   H n  1 2 (i , j  1 , k  1  
2
2
2
2
x


 x

 0  r (i , j , k  1 2  
x
y

1
1
 Ez yn 1 (i , j , k  1 2   E zn (i , j , k  1 2  
 (i , j , k  1 2  

2


1
We can simplify these expressions if we set:  r  1;  x   y   z  d
And we can define the material constants:
R 
Rb 
t
0
, Ra 
t
d  0 0
2
t
 0d
Ca ( m  
Cb ( m  
1 R d ( m 
1 R d ( m 
 r (m 
 r (m 
Ra
 r (m   R d (m 
, (m  i , j , k 
Substituting in we get:
~
~
~
~
~
~
~
~
n  12
(i , j  1 2 , k  1 2   H xn  (i , j  1 2 , k  1 2   E yn (i , j  1 2 , k  1  E yn (i , j  1 2 , k   E zn (i , j , k  1 2   E zn (i , j  1, k  1 2 
n  12
(i  1 2 , j , k  1 2   H yn  (i  1 2 , j , k  1 2   E zn (i  1, j , k  1 2   E zn (i , j , k  1 2   E xn (i  1 2 , j , k   E zn (i  1 2 , j , k  1
n  12
(i  1 2 , j  1 2 , k   H zn  (i  1 2 , j  1 2 , k   E xn (i  1 2 , j  1, k   E xn (i  1 2 , j , k   E yn (i , j  1 2 , k   E yn (i  1, j  1 2 , k 
Hx
Hy
Hz
1
2
1
2
~ n 1
E x (i 
~
1
2
1
2
~ n 1
E y (i , j 
~n
, j , k   Ca ( m   E x (i 
1
2
~ n 1
E z (i , j , k 
1
2
~n
, k   Ca ( m   E y (i , j 
2

n  12

n  12
, j , k   Cb ( m  H z
1
2
, k   Cb ( m  H x
~
~
(i  1 2 , j  1 2 , k   H zn  (i  1 2 , j  1 2 , k   H yn  (i  1 2 , j , k  1 2   H yn  (i  1 2 , j , k  1 2 
1
1
2
1
2
2
(i , j  1 2 , k  1 2   H zn  (i , j  1 2 , k  1 2   H zn  (i  1 2 , j  1 2 , k   H zn  (i  1 2 , j  1 2 , k 
1
1
2
1
2
2
  Ca (m   E zn (i , j , k  1 2   Cb (m H yn  (i  1 2 , j , k  1 2   H yn  (i  1 2 , j , k  1 2   H xn  (i , j  1 2 , k  1 2   H xn  (i , j  1 2 , k  1 2 
~
1
~
1
1
2
1
2
1
2
2
ABC’s
•In general EM analysis of scattering structures often requires the solution of
“open region” problems.
•As a result of limited computational resources, it becomes necessary to truncate
the computational domain in such a way as to make it appear infinite.
•This is achieved by enclosing the structure in a suitable output boundary that
absorbs all outward traveling waves
ABC
•In this lecture we will describe some of the more common ABC’s, such as:
•Bayliss-Turkel annihilation operators
•Enqquist-Majda one way operators
•Mur ABC
•Liao’s extrapolation method
•And the PML, perfectly matched layer
•The PML method which was introduced in 1994 by Berenger, represents one of the
most significant advances in FDTD development, since it conception I 1966, by Kane
Yee.
•The PML produces back reflection ~ 10  6  10  8 over a very broad range of incident
PMC Region
Early ABC’s
•When Yee first introduced the FDTD method, he used PEC boundary conditions.
•This technique is not very useful in a general sense.
•It wasn’t until the 70’s when several alternative ABC’s were introduced.
•However, these early ABC’s suffered from large back reflections, which limited
the efficacy of the FDTD method.
Extrapolation from Interior Node (Taylor 1969)
n
•If we consider the electric field E ( i , j ) located on a 2D boundary
y, (j)
n
E (i ,3 )
Wave
n
E (i , 2 )
x, (i)
n
E (i ,1)
n
n
E
(
i
,
1
)

E
( i ,3 )
n
E (i ,2 ) 
2
•Since E n (i , 2 ) and E n (i ,3 ) are determined in the FDTD calculations, and are
therefore known values, we can solve this equation for E n (i ,1) the exterior node.
E ( i ,1)  2 E ( i , 2 )  E ( i ,3 )
n
n
n
•This equation is only effective on normally incident waves and degrades rapidly when
the incident wave is off-normal.
Extending this method to 2D:
 E n  1 ( i  1, 2 )  E n  1 ( i , 2 )  E n  1 ( i  1, 2 ) 
n
x
x

E ( i ,1)   x
x


3


This approach applies to a wide range of incident field angles, but due to
the nature of the averaging process often gives rise to significant nonphysical back reflections.
j=3
j=2
j=1
i-1
i
i+1
Dissapative Medium
•In this technique a lossy medium is used to surround the FDTD
computational region.
•The idea is that as that waves propagate into this medium, they are dissipated
before they can undergo back reflection
•The problem is that there is often an input impedance between the FDTD region
and the long media.

Quadratic
Linear
x0
x
1
•The back reflection results from the ratio of electrical-conductivity and magneticconductivity parameters,  and  x respectively.
•Here the  0 and  0 are assumed to be free space.
•Therefore the input impedance is:
z
  j  0
*
  j  0
which is not necessarily equal to Zo.
•To overcome this the conductivity values can be implemented in a non-uniform
fashion.
•That is the can have a linear or quadratic profile.
•This tends to require relatively thick medium layers - computational requirements!
Download