Lecture #5 Transfer Matrix Method Using …emlab.utep.edu/ee5390cem/Lecture 5b -- TMM...
Transcript of Lecture #5 Transfer Matrix Method Using …emlab.utep.edu/ee5390cem/Lecture 5b -- TMM...
1/8/2018
1
Lecture 5b Slide 1
EE 5337
Computational Electromagnetics
Lecture #5
Transfer Matrix Method Using Scattering Matrices These notes may contain copyrighted material obtained under fair use rules. Distribution of these materials is strictly prohibited
InstructorDr. Raymond Rumpf(915) 747‐[email protected]
Outline
• Review
• Calculating reflected and transmitted power
• Simplifications for 1D transfer matrix method
• Notes on implementation
• Parameter Sweeps
Lecture 5b Slide 2
1/8/2018
2
Lecture 5b Slide 3
Review
Lecture 5b Slide 4
Two Paths to Combined Solution
0
0
r
r
E k H
H k E
Maxwell’s Equations Field Solution
2
2
ˆyz yz zy x y yz zx yz zyzx x
y x x yx yyzz zz zz zz zz zz zz zz
zy yxz zx xzxy x y
zz zz zz zz zzy
x
y
k k kj k k jk k
kE jk j k kE
Hz
H
2
2
x y xz zyxz zxxx xy
zz zz zz
x y yz zx yz zy yz yz zyx zxyx yy y x x
zz zz zz zz zz zz zz zz
y x yxz zxxx
zz zz z
k k
k k kj k k jk
k k k
x
y
x
y
xz zy zyxz zx xzxy y x y
z zz zz zz zz zz
E
E
H
H
jk j k k
2
2
2
2
1
1
x y r r x
r y r r x y
x y r r x
r y r r x y
k k k
k k k
k k k
k k k
P
Q
2×2 Matrices
Sort Eigen‐Modes
PQ Method
No sorting!
Isotropic or diagonally anisotropic
Anisotropic
E E
H H
zz
z
ee
e
λλ
λ
W WW
W W
0
0
x
y
x
y
E
E
H
H
zE E
zH H
z
z
ez
e
ez
e
λ
λ
λ
λ
0W W cψ
V V c0
W W 0 cψ
V V 0 c
4×4 Matrix
1/8/2018
3
Lecture 5b Slide 5
Definition of A Scattering Matrix
11 121 1
21 222 2
S Sc c
S Sc c11
21
reflection
transmission
S
S
This is consistent with network theory and experimental convention.
Lecture 5b Slide 6
Scattering Matrix for a Single Layer
The scattering matrix Si of the ith
layer is still defined as:
But the equations to calculate the elements reduce to
1 1
2 2
i
c cS
c c
11 12
21 22
i ii
i i
S SS
S S
1 1g g
1 1g g
i i i
i i i
A W W V V
B W W V V
0i ik Li e λX
11 111
11 112
21 12
22 11
ii i i i i i i i i i i i
ii i i i i i i i i i i
i i
i i
S A X B A X B X B A X A B
S A X B A X B X A B A B
S S
S S
• Layers are symmetric so the scattering matrix elements have redundancy.• Scattering matrix equations are simplified.• Fewer calculations.• Less memory storage.
iS
1/8/2018
4
Lecture 5b Slide 7
Reflection/Transmission Side Scattering Matrices
The reflection‐side scattering matrix is
ref 111 ref ref
ref 112 ref
ref 121 ref ref ref ref
ref 122 ref ref
2
0.5
S A B
S A
S A B A B
S B A
1 1ref g ref g ref
1 1ref g ref g ref
A W W V V
B W W V V
trn 111 trn trn
trn 112 trn trn trn trn
trn 121 trn
trn 122 trn trn
0.5
2
S B A
S A B A B
S A
S A B
1 1trn g trn g trn
1 1trn g trn g trn
A W W V V
B W W V V
The transmission‐side scattering matrix is
,I
,I
r
r
r,g
r,g
0limL
,II
,II
r
r
r,g
r,g
refs
trns
0limL
Lecture 5b Slide 8
Summary of Using Scattering Matrices
1S 2S 3S NS
1L 2L 3L NL
0 0
refS
0
0
trnS
0
0
ref tgl l rnoba 1 2
device
N
S
S S SS SS
Device in gap medium
deviceS
1/8/2018
5
Lecture 5b Slide 9
Redheffer Star Product
Two scattering matrices may be combined into a single scattering matrix using Redheffer’s star product.
A A11 12
A A21 22
A
S SS
S S
B B11 12
B B21 22
B
S SS
S S AB A B S S S
The combined scattering matrix is then
AB AB11 12
AB AB21 22
AB
S SS
S S
1AB A A B A B A
11 11 12 11 22 11 21
1AB A B A B
12 12 11 22 12
1AB B A B A
21 21 22 11 21
1AB B B A B A B
22 22 21 22 11 22 12
S S S I S S S S
S S I S S S
S S I S S S
S S S I S S S S
R. Redheffer, “Difference equations and functional equations in transmission-line theory,” Modern Mathematics for the Engineer, Vol. 12, pp. 282-337, McGraw-Hill, New York, 1961.
Lecture 5b Slide 10
Calculating Transmitted and Reflected Power
1/8/2018
6
Lecture 5b Slide 11
Recall How to Calculate Source Parameters
inc 0 inc
sin cos
sin sin
cos
k k n
0
ˆ ˆ 0
1zn a
incTE
inc
ˆ 0
ˆˆ 0
ˆ
ya
n ka
n k
TE incTM
TE inc
ˆˆ
ˆ
a ka
a k
Incident Wave Vector Surface Normal Unit Vectors in Direction of TE & TM
Composite Polarization Vector
TE TMTE TMˆ ˆP p p aa
Right‐handedcoordinate system
1P
In CEM, we usually make
ˆxa
ˆyaˆza
Unit vectors along x, y, and z axes.
Can be any direction in the x‐y plane
Lecture 5b Slide 12
Solution Using Scattering Matrices
The external fields (i.e. incident wave, reflected wave, transmitted wave) are related through the global transfer matrix.
globalref inc
trn
c cS
c 0
This matrix equation can be solved to calculate the mode coefficients of the reflected and transmitted fields.
global globalref 11 12 inc
global globaltrn 21 22
c S S c
c 0S S
globalref 11 inc
globaltrn 21 inc
c S c
c S c
,inc1inc ref
,inc
x
y
E
E
c W
rightinc not typically usedc
,inc
,inc
,inc
x x
y y
z z
E P
E P
E P
We get Ex,inc and Ey,inc from the polarization vector P.
Note that Ez,inc is not needed.
1/8/2018
7
Lecture 5b Slide 13
Calculation of Transmitted and Reflected Fields
The procedure described thus far calculated cref and ctrn.
The transmitted and reflected fields are then
ref incglobal global 1
ref ref ref 11 inc ref 11 refref inc
trn incglobal global 1
trn trn trn 21 inc trn 21 reftrn inc
x x
y y
x x
y y
E E
E E
E E
E E
W c W S c W S W
W c W S c W S W
Lecture 5b Slide 14
Calculation of the Longitudinal Components
We are still missing the longitudinal field component Ez on the reflection and transmission sides.
These are calculated using Maxwell’s divergence equation.
0, 0, 0,
0, 0, 0,
0, 0, 0,
0, 0, 0,
0, 0,0,
0
0
0
0
jk r jk r jk rx y z
jk r jk r jk rx x y y z z
x x y y z z
z z x x y y
x x y yz
z
E
E e E e E ex y z
jk E e jk E e jk E e
k E k E k E
k E k E k E
k E k EE
k
ref refref
ref
trn trntrn
trn
x x y yz
z
x x y yz
z
k E k EE
k
k E k EE
k
Note:
0 reduces to
0 when is homogeneous.
E
E
1/8/2018
8
Lecture 5b Slide 15
Calculation of Power Flow
2trn
trn r,trn
2 incr,incinc
Re
Re
z
z
E kT
kE
1 materials have loss
1 materials have no loss and no gain
1 materials have gain
R T
Reflectance is defined as the fraction of power reflected from a device.2
ref
2
inc
ER
E
2 22 2
x y zE E E E
Transmittance is defined as the fraction of power transmitted through a device.
It is always good practice to check for conservation of power.
Note: We will derive these formulas in Lecture 7.
Note: Recall
1A R T
Lecture 5b Slide 16
Reflectance and Transmittance on a Decibel Scale
Decibel Scale
dB 1020 logP A
dB 1010 logP P
How to calculate decibels from an amplitude quantity A.
How to calculate decibels from a power quantity P.
2 2dB 10 10 10 log 20logP A P A A
Reflectance and Transmittance
Reflectance and transmittance are power quantities, so
dB 10
dB 10
10 log
10log
R R
T T
1/8/2018
9
Lecture 5b Slide 17
Simplifications for 1D Transfer Matrix Method
Lecture 5b Slide 18
Analytical Expressions for W and
Using this relation, we can simplify the matrix equation for 2.
2 2 22 2
2 2 2
01
0
x y r r x x y r r x zz
r r y r r x y y r r x y z
k k k k k k kk
k k k k k k k
Ω PQ I
Since 2 is a diagonal matrix, we can conclude that
2 2
1 0
0 1
W I
λ Ω
The dispersion relation with a normalized wave vector is
2 2 2r r x y zk k k
0
0
zz
z
jkjk
jk
λ I
0
0
z
z
jk zz
jk z
ee
e
λ
1 0 identity matrix
0 1
I
For isotropic materials and diagonally anisotropic materials, we don’t actually have to solve the eigen‐value problem to obtain the eigen‐modes!
A lot of algebra
1/8/2018
10
Lecture 5b Slide 19
Simplifications for TMM in LHI Media
In LHI media,
1 0
0 1i
W I ,i z ijkΩ I
1 0 identity matrix
0 1
Iand
Now we do not actually have to calculate because
i iλ Ω
Given all of this, the eigen‐vectors for the magnetic fields can be calculated as
1 1i i i i i i
V Q W λ Q Ω
When calculating scattering matrices, the intermediate matrices Ai and Bi reduce to1 1 1
g g g
1 1 1g g g
i i i i
i i i i
A W W V V I V V
B W W V V I V V
The fields and mode coefficients are now related throughref trn
1inc ref ref 11 inc 11 inc trn 21 inc 21 incref trn
x x x x
y y y y
P P E E
P P E E
c W W S c S c W S c S c
Lecture 5b Slide 20
Simplified External S‐Matrices in LHI Media
The reflection‐side scattering matrix is
ref 111 ref ref
ref 112 ref
ref 121 ref ref ref ref
ref 122 ref ref
2
0.5
S A B
S A
S A B A B
S B A
1ref g ref
1ref g ref
A I V V
B I V V
trn 111 trn trn
trn 112 trn trn trn trn
trn 121 trn
trn 122 trn trn
0.5
2
S B A
S A B A B
S A
S A B
1trn g trn
1trn g trn
A I V V
B I V V
The transmission‐side scattering matrix is
,I
,I
r
r
r,g
r,g
0limL
,II
,II
r
r
r,g
r,g
refs
trns
0limL
1/8/2018
11
Lecture 5b Slide 21
Notes onImplementation
Outline
• Step 0 – Define problem
• Step 1 – Dashboard
• Step 2 – Describe device layers
• Step 3 – Compute wave vector components
• Step 4 – Compute gap medium parameters
• Step 5 – Initialize global scattering matrix
• Step 6 – Main loop through layers
• Step 7 – Compute reflection side scattering matrix
• Step 8 – Compute transmission side scattering matrix
• Step 9 – Update global scattering matrix
• Step 10 – Compute source
• Step 11 – Compute reflected and transmitted fields
• Step 12 – Compute reflectance and transmittance
• Step 13 – Verify conservation of powerLecture 5b Slide 22
• Compute P and Q• Compute eigen‐modes• Compute layer scattering matrix
• Update global scattering matrix
Step 6: Iterate through layers
human does this
computer does the rest
1/8/2018
12
Lecture 5b Slide 23
Storing the Problem
How is a device described and stored for TMM?
We don’t use a grid for this method!
Store the permittivity for each layer in a 1D array.Store the permeability for each layer in a 1D array.Store the thickness of each layer in a 1D array.
ER = [ 2.50 , 3.50 , 2.00 ];UR = [ 1.00 , 1.00 , 1.00 ];L = [ 0.25 , 0.75 , 0.89 ];
We will also need the external materials, and source parameters.
er1, er2, ur1, ur2, theta, phi, pte, ptm, and lam0
Input arrays for three layers
Lecture 5b Slide 24
Storing Scattering Matrices
We often talk about the scattering matrix S as a single matrix.
11 12
21 22
S SS
S S
However, we very rarely ally use the scattering matrix S this way. We usually use the individual terms S11, S12, S21, and S22 separately.
So, scattering matrices are actually best stored as the four separate components of the scattering matrix.
11 12
21 22
S SS
S S 11 12 21 22 , , , and S S S S
1/8/2018
13
Lecture 5b Slide 25
Initializing the Global Scattering Matrix
Before we iterate through all the layers, we must initialize the global scattering matrix as the scattering matrix of “nothing.”
What are the ideal properties of nothing?
1. Transmits 100% of power with no phase change.
2. Does not reflect.
global global12 21 S S I
global global11 22 S S 0
We therefore initialize our global scattering matrix as
global
0 IS
I 0This is NOT an identity matrix!Look at the position of the 0’s and I’s.
Lecture 5b Slide 26
Calculating the Parameters of the Gap Media
2 2 2,g r,g r,g
g
g ,g
1g g g g
z x y
z
k k k
jk
W I
λ I
V Q W λ
Our analytical solution for a homogeneous gap medium is
2r,g r,g
g 2r,g r,g r,g
1 x y x
y x y
k k k
k k k
Q
We are free to choose any r,g andr,g that we wish. We also wish to avoid the case of kz,g = 0. For convenience, we choose
2 2r,g r,g1.0 and 1 x yk k
We then have
2
g 2
1
1
x y y
x x y
k k k
k k k
Q
g
g gj
W I
V Q
W not even used in TMM.
1/8/2018
14
WRONG
Lecture 5b Slide 27
Calculating Xi = exp(ik0Li)
0
0
0
0
0
z i
i i
z i
jk k Lk L
i jk k L
ee
e
ΩX
Recall the correct answer:
It is incorrect to use the function exp() because this calculates a point‐by‐point exponential, not a matrix exponential.
X = exp(OMEGA*k0*L);X =
0.0135 + 0.9999i 1.00001.0000 0.0135 + 0.9999i
Approach #1: expm() Approach #2: diag()
X = expm(OMEGA*k0*L);
X =0.0135 + 0.9999i 0
0 0.0135 + 0.9999i
X = diag(exp(diag(OMEGA)*k0*L));
X =0.0135 + 0.9999i 0
0 0.0135 + 0.9999i
Lecture 5b Slide 28
Efficient Calculation of Layer S‐Matrices
There are redundant calculations in the equations for the scattering matrix elements.
111 22
112 21
11
11
i ii i i i i i
i ii i i i
i i i i i i
i i i i i ii
A X B A X B
A
S
X B A
S X B A X A B
S S X A B AB BX
These are more efficiently calculated as
0
1g
1g
1
1 111 22
1 112 21
i i
i i
i i
k Li
i i i i i i
i ii i i i i i
i ii i i i i
e
λ
A I V V
B I V V
X
D A X B A X B
S S D X B A X A B
S S D X A B A B
1/8/2018
15
Lecture 5b Slide 29
Efficient Star Product
After observing the equations to implement the Redheffer star product, we see there are some common terms. Calculating these multiple times is inefficient so we calculate them only once using intermediate parameters.
AB A A B A11 11 12 11 21
AB A B12 12 12
AB B A21 21 21
AB B
1B A
11 22
1
B A B22 22 21 22 1
B A11
1A B
22 11
1A B
22
2
211
2
S S S S S
S S S
S IS S S
I S S
I S S
I S S
S
S S S S S
1A B A
12 11 2
1B A B
21 22 1
2
1
F
D
S I S S
S I S S AB A B S S S
A B A11 11 11 21
B12 12
A21 21
B A B22 22 22 12
AB
AB
AB
AB
S S S S
S S
S S
S S SF S
F
D
D
Lecture 5b Slide 30
Using the Star Product as an Update
Very often we update our global scattering matrix using a star product.
When we use this equation as an update, we MUST pay close attention to the order that we implement the equations so that we don’t accidentally overwrite a value that we need.
1global
12 11 22
1global global
21 22 11
global global22 22 22
global21 21
global global12 12
global global11 11
global1
1
2
1 21
i i
i
i
i
i i
D S I S S
F S I S S
S S FS
S FS
S DS
S S DS S
S
1global global
12 11 22
1global
21 22 11
global global global11 11 11 21
global12 12
global global21 21
global global22 22 22 12
i
i i
i
i
i i
D S I S S
F S I S S
S S DS S
S DS
S FS
S S FS S
global globali S S S global global i S S S
reverse order
stan
dard order
1/8/2018
16
Lecture 5b Slide 31
Block Diagram of TMM Using S‐Matrices
Calculate Parameters for Layer i
2 2,
2
2
1,
1
z i i i x y
x y i i x
ii y i i x y
i z i i i i
k k k
k k k
k k k
jk
Q
Ω I V Q Ω
Calculate Scattering Matrixfor Layer i
01g
1g
1
1 111 22
1 112 21
i ik Li i i
i i
i i i i i i
i ii i i i i i
i ii i i i i
e
λA I V V X
B I V V
D A X B A X B
S S D X B A X A B
S S D X A B A B
Update Global Scattering Matrix
global global
1global global12 11 22
1global21 22 11
global global global11 11 11 21
global12 12
global global21 21
global global22 22 22 12
i
i
i i
i
i
i i
S S S
D S I S S
F S I S S
S S DS S
S DS
S FS
S S FS S
Done?
no
yes
Calculate Transmitted and Reflected Fields
ref
ref 11 srcref
trn
trn 21 srctrn
x
y
x
y
E
E
E
E
e S e
e S e
Calculate Longitudinal Field Components
ref refref
ref
trn trntrn
trn
x x y yz
z
x x y yz
z
k E k EE
k
k E k EE
k
Calculate Transmittance and Reflectance
2
ref
trn2 r,trn
trn incr,inc
Re
Re
z
z
R E
kT E
k
Calculate Transverse Wave Vectors
inc
inc
sin cos
sin sin
x
y
k n
k n
Initialize Global Scattering Matrix
global
0 IS
I 0
Start
Finish
Calculate Gap Medium Parameters
2
g g g2
1
1
x y y
x x y
k k kj
k k k
Q V Q
Calculate Source
TE TE TM TM
src
ˆ ˆ
1
x
y
P p a p a
P
P
P
e
Connect to External Regions
global ref global
global global trn
S S S
S S S
Loop through all layers
Lecture 5b Slide 32
How to Handle Zero Number of Layers
Follow the block diagram!!
Setup your loop this way…
NLAY = length(L);for nlay = 1 : NLAY
...end
If NLAY = 0, then the loop will not execute and the global scattering matrix will remain as it was initialized.
global
0 IS
I 0
For zero layers:
ER = [];UR = [];L = [];
1/8/2018
17
Lecture 5b Slide 33
Can TMM Fail?
Yes!
The TMM can fail to give an answer and behave numerically strange any time kz = 0. This happens at a critical angle when the transmitted wave is at or very near its cutoff.
We fixed this problem in the gap medium, but this can also happen in any of the layers or in the transmission region.
2 2r r x yk k
This happens in any layer where
Lecture 5b Slide 34
Parameter Sweeps
1/8/2018
18
Lecture 5b Slide 35
What is a Parameter Sweep?
So far, we have learned to simulate a single device at a single frequency, or wavelength.
Suppose we calculate this data as we continuously change one or more parameters? This is called a parameter sweep.
Sim
Parameter
Device Beh
avior
Sim R = 81%T = 19%
Lecture 5b Slide 36
Block Diagrams of Common Parameter Sweeps
Dashboard
Compute Params.
Build Device
Perform Sim
Show Results
Conventional Sim(No Sweep)
Dashboard
Compute Params.
Build Device
Perform Sim
Record Results
0
Show Results
Set or frequency
Wavelength or Frequency Sweep
Dashboard
Compute Params.
Set Parameter
Perform Sim
Record Results
d
Show Results
Build Device
Device Parameter Sweep
Dashboard
Compute Params
Build Device
Perform Sim
Record Results
NRES
Show Results
Set NRES
Convergence Sweep for NRES
Good idea to visualize your results during simulation. You can abort early if something is wrong.
1/8/2018
19
Lecture 5b Slide 37
Make a Generic TMM Function
A great way to simplify programming your parameter sweeps is to first make a generic function out of your TMM code.
The basic TMM simulation will take as input arguments:
Source: 0, , , polarization, etc.Device: UR, ER, L, etc.
Given these input arguments, your TMM function will simulate the device and calculate reflectance, transmittance, fields, etc.
It may return REF, TRN, or whatever else you wish.
Lecture 5b Slide 38
Example Header for a Generic TMM Function
function DAT = tmm1d(DEV,SRC)% TMM1D One-Dimensional Transfer Matrix Method%% DAT = tmm1d(DEV,SRC);%% INPUT ARGUMENTS% ================% DEV Device Parameters% .er1 relative permittivity in reflection region% .ur1 relative permeability in reflection region% .er2 relative permittivity in transmission region% .ur2 relative permeability in transmission region% .ER array containing permittivity of each layer% .UR array containing permeability of each layer% .L array containing thickness of each layer%% SRC Source Parameters% .lam0 free space wavelength% .theta elevation angle of incidence (radians)% .phi azimuthal angle of incidence (radians)% .ate amplitude of TE polarization% .atm amplitude of TM polarization%% OUTPUT ARGUMENTS% ================% DAT Output Data% .REF Reflectance% .TRN Transmittance
These comments are displayed at the command prompt by typing
>>help tmm1d
It is always a good idea to include a help section at the start of your codes.
1/8/2018
20
What Steps are Performed by TMM1D()
• Step 0 – Define problem
• Step 1 – Dashboard
• Step 2 – Describe device layers
• Step 3 – Compute wave vector components
• Step 4 – Compute gap medium parameters
• Step 5 – Initialize global scattering matrix
• Step 6 – Main loop through layers
• Step 7 – Compute reflection side scattering matrix
• Step 8 – Compute transmission side scattering matrix
• Step 9 – Update global scattering matrix
• Step 10 – Compute source
• Step 11 – Compute reflected and transmitted fields
• Step 12 – Compute reflectance and transmittance
• Step 13 – Verify conservation of powerLecture 5b Slide 39
• Compute P and Q• Compute eigen‐modes• Compute layer scattering matrix
• Update global scattering matrix
Step 6: Iterate through layers
human does this
computer does the rest
Lecture 5b Slide 40
Wavelength or Frequency Parameter Sweep
By far, the most common parameter sweep is calculating the device behavior as a function of frequency or wavelength.
UR = [ 1 1 1 ];ER = [ 2.5 6.0 2.0 ];L = [ 0.5 0.78 0.25 ];
Dashboard
Build Device
Perform Sim
Record Results
0
Show Results
Set Wavelength
for nlam = 1 : NLAMSRC.lam0 = LAMBDA(nlam);DAT = tmm1d(DEV,SRC);REF(nlam) = DAT.REF;
end
1/8/2018
21
Lecture 5b Slide 41
Incorporating Material Dispersion in a Parameter Sweep
Sometimes the material properties change significantly as a function of frequency, or wavelength.
This is called dispersion.
Dispersion can be incorporated into your parameter sweep by:
(1) Calculate the material properties at the given wavelength or frequency.
(2) Rebuild the device each iteration with the material properties that were just calculated.
Dashboard
Build Device from and
Perform Sim
Record Results
0
Show Results
Set Wavelength
Determine and
Lecture 5b Slide 42
Bad Vs. Good Parameter Sweeps
WHITESPACE
WHITESPACE
WHITE SPACE
LABEL
LABEL
SCALE
LINE THICKNESS
TRIANGLES
CONSERVATION?
# DIGITS FONT SIZE