Waveguide Simulation Walkthrough

advertisement
9/13/2016
EE 5303
Electromagnetic Analysis Using Finite‐Difference Time‐Domain
Lecture #22
Waveguide Simulation Walkthrough
 These notes may contain copyrighted material obtained under fair use rules. Distribution of these materials is strictly prohibited 
Lecture 22
Slide 1
Lecture Outline
• Optical Integrated Circuits
• Walkthrough
–
–
–
–
–
–
–
–
–
–
–
–
Step 0 – Problem Definition
Step 1 – Define the problem in MATLAB
Step 2 – Compute grid
Step 3 – Build device on grid
Step 4 – Compute source
Step 5 – Initialize Fourier transforms
Step 6 – Compute the PML
Step 7 – Compute update coefficients
Step 8 – Initialize FDTD data arrays
Step 9 – Main FDTD loop
Step 10 – Compute reflectance and transmittance
Step 11 – Produce professional looking results
• Results
Lecture 22
Slide 2
1
9/13/2016
Optical Integrated Circuits
Lecture 22
Slide 3
Integrated Optical Waveguides
Stripe waveguide
Diffused waveguide
Buried‐strip waveguide
Buried‐rib waveguide
Rib waveguide
Strip‐loaded waveguide
Lecture 22
Slide 4
2
9/13/2016
Integrated Optical Circuits (Examples)
Ginés Lifante, Integrated Photonics Fundamentals, (Wiley, 2003).
Lecture 22
Slide 5
Another Fundamental Circuit Element…
To interconnect multiple photonic elements within a single optical integrated circuit, it is necessary to turn waveguides. A critical design parameter is the minimum bend radius that will prevent scattering out of the waveguides.
Rmin=?
Lecture 22
Slide 6
3
9/13/2016
Fabrication of a Rib Waveguide (1 of 6)
Typically, we start with a cleaned fused silica substrate. A 4” wafer is common in research labs. Fused silica has n = 1.52.
flat
4” wafer
Silica substrate
Lecture 22
Slide 7
Fabrication of a Rib Waveguide (2 of 6)
Second, a layer of high index material is deposited onto the silicon wafer. A common process is plasma enhanced chemical vapor deposition (PECVD). A common high index material is silicon nitride (SiN) which has n = 1.9.
Silica substrate with SiN
Lecture 22
Slide 8
4
9/13/2016
Fabrication of a Rib Waveguide (3 of 6)
Third, a photoresist is spun onto the wafer using a spinner. A common photoresist is PMMA.
Silica substrate with SiN
and photoresist
Lecture 22
Slide 9
Fabrication of a Rib Waveguide (4 of 6)
Fourth, the resist is exposed to ultraviolet radiation through a mask in the pattern of the eventual optical integrated circuit. The exposed resist is then washed away leaving behind the unexposed resist.
Silica substrate with SiN
and developed photoresist
Lecture 22
Slide 10
5
9/13/2016
Fabrication of a Rib Waveguide (5 of 6)
Fifth, the wafer is etched using a plasma etching process. Both the resist and SiN are etched, but the remaining resist prevent etching of the SiN material directly underneath.
Wafer after etching process
Lecture 22
Slide 11
Fabrication of a Rib Waveguide (6 of 6)
Sixth, the wafer is cleaned by removing the remaining resist. The optical integrated circuit (and our rib waveguide) is complete!
Rib Waveguide
Lecture 22
Slide 12
6
9/13/2016
Rib Waveguide Example
0  1550 nm
w  775 nm
h  775 nm
a  310 nm
neff  1.68
nair
w
nair  1.00
h
a
nSiN  1.90
nSiN
nSiO2  1.52
nSiO2
Lecture 22
Slide 13
Effective Index Method
n2
Vertically Polarized
n1
neff,2
Hz mode
Requires rigorous full‐vector model
E
neff,1
neff
neff,2
We hope these are very similar results
E
Requires only a 1D slab model
Ez mode
Lecture 22
E
neff,2
neff,1
neff,2
neff
Slide 14
7
9/13/2016
2D Approximation of Optical Integrated Circuits
It is possible to very accurately simulate an optical integrated circuit in two dimensions using the effective index method.
n1,eff
n2,eff
Effective indices are best computed by modeling the vertical cross section as a slab waveguide.
A simple average index can also produce good results. n1,eff
n2,eff
Lecture 22
Slide 15
Walkthrough
Lecture 22
Slide 16
8
9/13/2016
Step 0: Problem Definition
An optical integrated circuit is to be composed of stripe waveguides as shown below and operate at a wavelength of 1550 nm. Determine the minimum bend radius that ensures 90% through a 90° bend.
y
w
x z
SiN
n  1.90
h
Fused silica (SiO2) substrate
n  1.52
y
What device are you modeling?
What is its geometry?
What materials is it made from?
What do you wish to learn?
z
‐‐ stripe waveguide with 90° bend
‐‐ see above
‐‐ see above
‐‐ minimum bend radius for >90% transmission
Lecture 22
Slide 17
Step 1: Define Problem – setup MATLAB
Initialize MATLAB
% Lecture22_bend.m
% INITIALIZE MATLAB
close all;
clc;
clear all;
% UNITS
meters
centimeters
millimeters
inches
feet
seconds
hertz
kilohertz
megahertz
gigahertz
=
=
=
=
=
=
=
=
=
=
1;
1e-2 * meters;
1e-3 * meters;
2.54 * centimeters;
12 * inches;
1;
1/seconds;
1e3 * hertz;
1e6 * hertz;
1e9 * hertz;
% CONSTANTS
e0 = 8.85418782e-12;
u0 = 1.25663706e-6;
N0 = sqrt(u0/e0);
c0 = 299792458 * meters/seconds;
Lecture 22
Define Problem
% SOURCE
lam0 = 1.55 * micrometers;
f0
= c0/lam0;
k0
= 2*pi/lam0;
% RIB
nair
nsub
ncore
WAVEGUIDE PARAMETERS
= 1.0;
= 1.52;
= 1.9;
w = 0.5 * lam0;
h = 0.5 * lam0;
x
rbend = 20 * micrometers;
% GRID
nmax =
NRES =
BUF =
NPML =
PARAMETERS
max([nair nsub ncore]);
10;
5*lam0 * [1 2 1 1];
[40 40 40 40];
z
Slide 18
9
9/13/2016
Step 1: Define Problem – reduction to 2D
Assumption #1: Effective index method
n2
Performing a fully three dimensional simulation using standard FDTD is prohibitively computationally intensive. An alternative is to approximate the 3D circuit as a 2D circuit using the effective index method.
For the stripe waveguide, there is no slab waveguide outside of the core. So instead of modeling a slab waveguide, we just estimate the effective by assuming 30% of the energy will reside I the air.
nair
n1
neff,2
neff,1
No slab!
neff,2
No slab!
neff,2  0.3nair  0.7 n1
x
neff,1  1.7795
z
neff,2  1.3640
neff,2
neff,1
neff,2
Lecture 22
Slide 19
Step 1: Define Problem – calculate effective n’s
% COMPUTE SLAB GRID
Sz = 7*h;
dz = lam0/NRES/nmax;
Nz = ceil(h/dz);
dz = h/Nz;
Nz = ceil(Sz/dz);
%size of grid
%initial resolution
%snap grid to h
%revised resolution
%total number of cells
n2
nair
n1
% INITIALIZE MATERIALS TO FREE SPACE
ERzz = ones(1,Nz);
URxx = ones(1,Nz);
URyy = ones(1,Nz);
% COMPUTE POSITION INDICES
nz1 = round(3*h/dz);
nz2 = nz1 + round(h/dz) - 1;
neff,2
neff,1
No slab!
% CLADDING
neff2 = 0.3*nair + 0.7*nsub;
neff,2
No slab!
x
 0.3n  0.7 n2
% CORE SLAB
ERzz = nair^2 * ones(1,Nz);
eff,2
air
ERzz(nz1:nz2) = ncore^2;
ERzz(nz2+1:Nz) = nsub^2;
[Ez,Hx,neff1] = ezmode(URxx,URyy,ERzz,k0*dz);
n
neff,2
Lecture 22
z
neff,1
neff,2
Slide 20
10
9/13/2016
Step 2: Compute Grid – grid construction
NPML  3
BUF  3
a
x
BUF  2  NPML  2 
NPML 1 BUF 1
y
BUF  4 
NPML  4 
Lecture 22
Slide 21
Step 2: Compute Grid – grid resolution
Compute Initial Grid Resolution
x 
N   10
nmax  n2  1.90
y 
min  1550 nm
min
nmax N 
min
nmax N 
 81.6 nm
 81.6 nm
% DEFAULT RESOLUTION
dx = lam0/nmax/NRES;
dy = lam0/nmax/NRES;
Snap Grid to Critical Dimensions
w
 9.5 cells
x
w
x 
 77.5 nm
Nx
N x 
w
 9.5 cells
y
w
y 
 77.5 nm
Ny
N y 
Lecture 22
round up

make odd
N x  10
% SNAP GRID TO CRITICAL DIMENSIONS
Nx = ceil(w/dx);
dx = w/Nx;
Ny = ceil(w/dy);
dy = w/Ny;
round up

N y  10
Slide 22
11
9/13/2016
Step 2: Compute Grid – grid size
Determine Physical Size
a  rbend  w 2  5.3875  m
S x  BUF 1  a  BUF  2   11.5875  m
S y  BUF  3  a  BUF  4   11.5875  m
Calculate Number of Cells
Sx
 NPML  2   230
x
S x  N x  x  17.825  m
N x  NPML 1 
N y  NPML  3  3 
Sy
 2  NPML  4   230
y
S y  N y  y  17.825  m
% COMPUTE GRID SIZE
a = rbend + w/2;
Sx = BUF(1) + a + BUF(2);
Nx = ceil(Sx/dx) + NPML(1) + NPML(2);
Sx = Nx*dx;
Sy = BUF(3) + a + BUF(4);
Ny = ceil(Sy/dy) + NPML(3) + NPML(4);
Sy = Ny*dy;
Lecture 22
Slide 23
Step 3: Build Device – initialize grid
Initialize Materials to Free Space
 xx  x, y   1.0
 yy  x, y   1.0
 zz  x, y   1.0
% INITIALIZE MATERIALS TO FREE SPACE
URxx = ones(Nx,Ny);
URyy = ones(Nx,Ny);
ERzz = ones(Nx,Ny);
Compute Position Indices
% COMPUTE START AND STOP INDICES OF BEND WINDOW
nx = round(a/dx);
nx1 = NPML(1) + round(BUF(1)/dx);
nx2 = nx1 + nx - 1;
ny = round(a/dy);
ny1 = NPML(3) + round(BUF(3)/dx);
ny2 = ny1 + ny - 1;
x
y
Lecture 22
Slide 24
12
9/13/2016
Step 3: Build Device – construct bend
Compute the Center of Curvature of the Waveguide Bend
% COMPUTE CENTER OF CURVATURE
x0 = nx2*dx;
y0 = ny1*dy;
 x0 , y0 
Construct the Bend
% CONSTRUCT BEND
[Y,X] = meshgrid(ya,xa);
R1
= ((X - x0).^2 + (Y - y0).^2) <= (rbend + w/2)^2;
R2
= ((X - x0).^2 + (Y - y0).^2) >= (rbend - w/2)^2;
R
= R1 .* R2;
x
y
R
R1
Lecture 22
R2
Slide 25
Step 3: Build Device – add I/O waveguides
Clip the Center Window for a Single 90° Bend
% CLIP BEND WINDOW
R(1:nx1-1,:) = 0;
R(nx2+1:Nx,:) = 0;
R(:,1:ny1-1) = 0;
R(:,ny2+1:Ny) = 0;
Add Input Waveguide
% ADD INPUT WAVEGUIDE
nx = round(w/dx);
nxa = nx1;
nxb = nxa + nx - 1;
R(nxa:nxb,1:ny1-1) = 1;
x
y
Add Output Waveguide
% ADD OUTPUT WAVEGUIDE
ny = round(w/dy);
nya = ny2 - ny + 1;
nyb = ny2;
R(nx2+1:Nx,nya:nyb) = 1;
Lecture 22
Slide 26
13
9/13/2016
Step 3: Build Device – convert to materials
Convert “Binary” Waveguide Structure to Materials in ERzz
% BUILD MATERIALS
ERzz = neff2^2 + (neff1^2 - neff2^2)*R;
Lecture 22
x
y
Slide 27
Step 4: Compute Source – time step
Compute Stable Time Step
 min  min  x, y 
t   min
 2c0 
% COMPUTE STABLE TIME STEP
dmin = min([dx dy]);
dt
= dmin/(2*c0);
“Snap” Time Step so One Wave Cycle is an Integer Number of Time Steps
% SNAP
period
Nt
dt
Lecture 22
TIME STEP SO WAVE PERIOD IS AN INTEGER NUMBER OF STEPS
= 1/f0;
= ceil(period/dt);
= period/Nt;
Slide 28
14
9/13/2016
Step 4: Compute Source – extract slab waveguide
Determine Position of Source
% COMPUTE
nx1_src =
nx2_src =
ny_src =
SOURCE POSITION
NPML(1) + 1;
Nx - NPML(2);
NPML(3) + 2;
x
y
Extract the Cross Section of the Waveguide
% EXTRACT MATERIALS ACROSS INPUT SLAB WAVEGUIDE
urxx = URxx(nx1_src:nx2_src,ny_src);
uryy = URyy(nx1_src:nx2_src,ny_src);
erzz = ERzz(nx1_src:nx2_src,ny_src);
Lecture 22
Slide 29
Step 4: Compute Source – compute fundamental mode
Analyze the Waveguide
% ANALYZE WAVEGUIDE
[Ez_src,Hx_src,neff,EZR,mref] = ezmode(urxx,uryy,erzz,k0*dx);
emax = max(abs(Ez_src));
EZR
Lecture 22
x
y
Ez_src & Hx_src
Slide 30
15
9/13/2016
Step 4: Compute Source – other source data
Compute Delay Between E and H
t 
neff y t

2c0
2
% COMPUTE DELAY
delt = 0.5*neff*dy/c0 + dt/2;
Compute the Number of FDTD Iterations
d  S x2  S y2
 prop  nmax d c0
 sim  2 prop
% COMPUTE NUMBER OF TIME STEPS
d
= sqrt(Sx^2 + Sy^2);
tprop = nmax*d/c0;
tsim = 2*tprop;
STEPS = ceil(tsim/dt);
STEPS  ceil  sim t 
Compute Ramp Function
  3 f0
t0  3

  t  t0  2 
exp   
  t  t0
r t   
    

1
t  t0

% COMPUTE RAMP FUNCTION
tau = 3/f0;
t0 = 3*tau;
ta = [0:STEPS-1]*dt;
ramp = exp(-((ta - t0)./tau).^2);
ind = find(ta>=t0);
ramp(ind) = 1;
Lecture 22
Slide 31
Step 5: Initialize Output – Fourier transforms
Compute Kernel
K 0  exp   j 2  t  f 0 
% KERNEL FOR f0
K = exp(-1i*2*pi*dt*f0);
reflection plane
Initialize Steady‐State Field Arrays
transmission plane
% INITIALIZE STEADY-STATE FIELDS
Eref = zeros(Nx,1);
Etrn = zeros(1,Ny);
Compute Position of Record Planes
% POSITION OF RECORD PLANES
nyref = NPML(3) + 1;
nxtrn = Nx - NPML(2);
x
y
Lecture 22
Slide 32
16
9/13/2016
Step 5: Initialize Output – output waveguide
Extract Materials at Transmission Record Plane
% EXTRACT MATERIALS
ny1 = NPML(3) + 1;
ny2 = Ny - NPML(4);
nx = Nx - NPML(2);
urxx = URxx(nx,ny1:ny2);
uryy = URyy(nx,ny1:ny2);
erzz = ERzz(nx,ny1:ny2);
x
y
Analyze Output Waveguide
% ANALYZE OUTPUT WAVEGUIDE
[Ez,Hx,n,EZT,mtrn] = ezmode(urxx,uryy,erzz,k0*dy);
Lecture 22
Slide 33
Step 6: Compute the PML
Compute Size of 2× Grid
% NUMBER OF POINTS ON 2X GRID
Nx2 = 2*Nx;
Ny2 = 2*Ny;
Compute PML Parameters
% COMPUTE sigx
sigx = zeros(Nx2,Ny2);
for nx = 1 : 2*NPML(1)
nx1 = 2*NPML(1) - nx + 1;
sigx(nx1,:) = (0.5*e0/dt)*(nx/2/NPML(1))^3;
end
for nx = 1 : 2*NPML(2)
nx1 = Nx2 - 2*NPML(2) + nx;
sigx(nx1,:) = (0.5*e0/dt)*(nx/2/NPML(2))^3;
end
% COMPUTE sigy
sigy = zeros(Nx2,Ny2);
for ny = 1 : 2*NPML(3)
ny1 = 2*NPML(3) - ny + 1;
sigy(:,ny1) = (0.5*e0/dt)*(ny/2/NPML(3))^3;
end
for ny = 1 : 2*NPML(4)
ny1 = Ny2 - 2*NPML(4) + ny;
sigy(:,ny1) = (0.5*e0/dt)*(ny/2/NPML(4))^3;
end
Lecture 22
 x  x  
0  x 
3
 
2t  Lx 
  y
 y  y   0  
2t  Ly



x
3
y
 x  x 
 x  x 
Ly
Lx
Lx
 y  y 
 y  y 
Ly
Slide 34
17
9/13/2016
Step 7: Compute Update Coefficients ‐‐ Hx
Compute Update Coefficients for Hx
Extract the PML parameters from the 2× grid.
% COMPTUE HX UPDATE COEFFICIENTS
sigHx = sigx(1:2:Nx2,2:2:Ny2);
sigHy = sigy(1:2:Nx2,2:2:Ny2);
mHx0 = (1/dt) + sigHy/(2*e0);
mHx1 = ((1/dt) - sigHy/(2*e0))./mHx0;
mHx2 = - c0./URxx./mHx0;
mHx3 = - (c0*dt/e0) * sigHx./URxx ./ mHx0;
Compute the update coefficients
mHx 0
i, j
mHx 2
i, j

 H i, j
1 y

t  2 0


mHx1
c0
1
mHx 0




i, j
i, j
 xx
mHx 3
i, j
i, j


1
 t

1
i, j
mHx 0

  H i, j
y

 2 0




 
H i, j
c0 t  x
1
mHx 0
i, j
 0  xx i , j
Lecture 22
Slide 35
Step 7: Compute Update Coefficients ‐‐ Hy
Compute Update Coefficients for Hy
Extract the PML parameters from the 2× grid.
% COMPUTE HY UPDATE COEFFICIENTS
sigHx = sigx(2:2:Nx2,1:2:Ny2);
sigHy = sigy(2:2:Nx2,1:2:Ny2);
mHy0 = (1/dt) + sigHx/(2*e0);
mHy1 = ((1/dt) - sigHx/(2*e0))./mHy0;
mHy2 = - c0./URyy./mHy0;
mHy3 = - (c0*dt/e0) * sigHy./URyy ./ mHy0;
Compute the update coefficients
mHy 0
i, j
mHy 2
Lecture 22
i, j

 H i, j
1 x

t  2 0


c0
1
mHy 0




i, j
 yy
i, j
mHy1
mHy 3
i, j
i, j

1
mHy 0

i, j
  H i, j
x

 2 0




 
H i, j
c0 t  y
1
mHy 0

1
 t

i, j
 0  yy i , j
Slide 36
18
9/13/2016
Step 7: Compute Update Coefficients ‐‐ Dz
Compute Update Coefficients for Dz
Extract the PML parameters from the 2× grid.
% COMPUTE DZ UPDATE COEFFICIENTS
sigDx = sigx(1:2:Nx2,1:2:Ny2);
sigDy = sigy(1:2:Nx2,1:2:Ny2);
mDz0 = (1/dt) + (sigDx + sigDy)/(2*e0) ...
+ sigDx.*sigDy*(dt/4/e0^2);
mDz1 = (1/dt) - (sigDx + sigDy)/(2*e0) ...
- sigDx.*sigDy*(dt/4/e0^2);
mDz1 = mDz1 ./ mDz0;
mDz2 = c0./mDz0;
mDz4 = - (dt/e0^2)*sigDx.*sigDy./mDz0;
Compute the update coefficients
D i, j
mDz 0
i, j
mDz 2
i, j


1 x

t
  yD
2 0
i, j

   t
D i, j
x
D i, j
y
4 02
c0
mDz 0
mDx1
mDz 4
i, j
i, j
i, j



i, j
i, j

D i, j
D i, j
 xD
 yD t 
 1  x  y



i, j 

2 0
4 02
mDx 0  t



1 t D i , j
D i, j

x
y
i, j
2
mDz 0  0

1



Lecture 22
Slide 37
Step 7: Compute Update Coefficients ‐‐ Ez
Compute Update Coefficients for Ez
mEz1
i, j

1
 zz
i, j
% COMPUTE EZ UPDATE COEFFICIENT
mEz1 = 1./ERzz;
Lecture 22
Slide 38
19
9/13/2016
Step 8: Initialize FDTD Data Arrays
Initialize FDTD Data Arrays
% INITIALIZE FIELDS
Hx = zeros(Nx,Ny);
Hy = zeros(Nx,Ny);
Dz = zeros(Nx,Ny);
Ez = zeros(Nx,Ny);
% INITIALIZE CURL
CEx = zeros(Nx,Ny);
CEy = zeros(Nx,Ny);
CHz = zeros(Nx,Ny);
% INITIALIZE INTEGRATION TERMS
ICEx = zeros(Nx,Ny);
ICEy = zeros(Nx,Ny);
IDz = zeros(Nx,Ny);
Lecture 22
Slide 39
Step 9: Run FDTD (Main Loop)
Compute Curl of E‐Field
Correct Curl of E‐Field for TF/SF
Update H
Update H‐Field Integration Terms
Update H‐Field
Compute Curl of H‐Field
Done?
Finished!
Correct Curl of H‐Field for TF/SF
Update D‐Field Integration Terms
Update D
Update D‐Field
Update E‐Field
Update Fourier Transforms
Visualize Simulation
Lecture 22
Slide 40
20
9/13/2016
Step 9: Main Loop – Curl of E
Compute the x‐Component of the Curl of E
C
 E i , j 1  E i , j
z t
 zt
y

  i ,1
i,N y
 E z  E z
t
t

y

E i, j
x t
% Compute CEx
for ny = 1 : Ny-1
for nx = 1 : Nx
CEx(nx,ny) = (Ez(nx,ny+1) - Ez(nx,ny))/dy;
end
end
for nx = 1 : Nx
CEx(nx,Ny) = (Ez(nx,1) - Ez(nx,Ny))/dy;
end
for j  N y
for j  N y
Compute the y‐Component of the Curl of E
C yE
i, j
t
 E i 1, j  E i , j
z t
 z t

x

1, j
Nx , j
 E z  E z
t
t

x

% Compute CEy
for nx = 1 : Nx-1
for ny = 1 : Ny
CEy(nx,ny) = - (Ez(nx+1,ny) - Ez(nx,ny))/dx;
end
end
for ny = 1 : Ny
CEy(Nx,ny) = - (Ez(1,ny) - Ez(Nx,ny))/dx;
end
for i  N x
for i  N x
Lecture 22
Slide 41
Step 9: Main Loop – Correct Curl‐E for TF/SF
x
Correct CEx for TF/SF Framework
C
E i , jsrc 1
x t

E z
i , jsrc
t
 E z
i , jsrc 1
t
y

1
E
y
y
src i , jsrc
z t
n y ,src  1
n y ,src
We already calculated this.
We just need to incorporate this correction term for all values of i.
% TF/SF Correction
ezsrc = ramp(T) * real(Ez_src*exp(-1i*2*pi*f0*T*dt));
CEx(nx1_src:nx2_src,ny_src-1) = CEx(nx1_src:nx2_src,ny_src-1) - ezsrc/dy;
Lecture 22
Slide 42
21
9/13/2016
Step 9: Main Loop – Update H
Update Integration Terms
% Update Integration Terms
ICEx = ICEx + CEx;
ICEy = ICEy + CEy;
Update Hx and Hy
% Update Hx and Hy
Hx = mHx1.*Hx + mHx2.*CEx + mHx3.*ICEx;
Hy = mHy1.*Hy + mHy2.*CEy + mHy3.*ICEy;
Lecture 22
Slide 43
Step 9: Main Loop – Curl of H
Compute the z‐Component of the Curl of H
CzH
i, j
t  2t
 H i , j  H i 1, j H i , j  H i , j 1
y t  t
x t  t
x t  t
 y t  2t
2
2
2


x
y

 H 1, j  H N x , j H 1, j  H 1, j 1
y t  t
x t  t
x t  t
 y t  2t
2
2
2


x
y

i ,1
i 1,1
 H y t  H y t H x i ,1 t  H x i , Nyt
t 2
t 2
t 2
t 2



x
y

1,1
N x ,1
1,1
1, N
 H y t  H y t H x t  H x yt
t 2
t 2
t 2
t 2


x
y

for i  1 and j  1
for i  1 and j  1
for i  1 and j  1
for i  1 and j  1
% Compute CHz
CHz(1,1) = (Hy(1,1) - Hy(Nx,1))/dx ...
- (Hx(1,1) - Hx(1,Ny))/dy;
for nx = 2 : Nx
CHz(nx,1) = (Hy(nx,1) - Hy(nx-1,1))/dx ...
- (Hx(nx,1) - Hx(nx,Ny))/dy;
end
for ny = 2 : Ny
CHz(1,ny) = (Hy(1,ny) - Hy(Nx,ny))/dx ...
- (Hx(1,ny) - Hx(1,ny-1))/dy;
for nx = 2 : Nx
CHz(nx,ny) = (Hy(nx,ny) - Hy(nx-1,ny))/dx ...
- (Hx(nx,ny) - Hx(nx,ny-1))/dy;
end
end
Lecture 22
Slide 44
22
9/13/2016
Step 9: Main Loop – Correct Curl‐H for TF/SF
Correct CHz for TF/SF Framework
C
H i , jsrc
z t  t
2

Hy
i , jsrc
t  2t
 Hy
i 1, jsrc
t  2t
x
i , j 1
i, j

H x t  srct  H x t  srct
2
2
y

1  src i , jsrc 1
H x t
t 2
y
We just need to incorporate this correction term for all values of i.
We already calculated this.
n y ,src  1
n y ,src
x
y
% TF/SF Correction
hxsrc = ramp(T) * real(Hx_src*exp(-1i*2*pi*f0*(T*dt + delt)));
CHz(nx1_src:nx2_src,ny_src) = CHz(nx1_src:nx2_src,ny_src) - hxsrc/dy;
Lecture 22
Slide 45
Step 9: Main Loop – Update D and E
Update Integration Term for D‐Field Update
% Update Integration Term
IDz = IDz + Dz;
Update Dz
% Update Dz
Dz = mDz1.*Dz + mDz2.*CHz + mDz4.*IDz;
Update Ez
% Update Ez
Ez = mEz1.*Dz;
Lecture 22
Slide 46
23
9/13/2016
Step 9: Main Loop – Update Fourier Transforms
Update the Fourier Transforms During Last Wave Cycle
Eref  f 
i , n y ,ref
e
 2t  f    e
 2t  f 0 

 j 2 f 0 t m
 Ez
i , n y ,ref
 Ez
nx ,trn , j
m
1 f0
Etrn  f 
nx ,trn , j
0

 j 2 f 0 t m
These are calculated at each frequency and at each point across the entire grid.
m
1 f0
reflection plane
transmission plane
% Update f0 Fourier Transform
if T>(STEPS-Nt)
Eref = Eref + (K^(T-STEPS+Nt))*Ez(:,nyref);
Etrn = Etrn + (K^(T-STEPS+Nt))*Ez(nxtrn,:);
end
Note: the constants are incorporated after the main loop is complete.
% FINISH TRANSFORMS
Eref = Eref * (2*dt/period);
Etrn = Etrn * (2*dt/period);
x
y
Lecture 22
Slide 47
Step 9: Main Loop – Visualize Simulation
Draw the Field Superimposed on the Materials
% Update Graphical Status
if ~mod(T,10)
% draw field
draw2d(xa,ya,ERzz,Ez,NPML,0.5);
axis equal tight;
title([num2str(T) ' of ' num2str(STEPS) ]);
x
y
% force MATLAB to draw graphics
drawnow;
end
Graphics are very slow!
This if statement only updates the visualization every 10 iterations.
Lecture 22
Slide 48
24
9/13/2016
Step 10: Reflectance and Transmittance
Compute Mode Amplitude Coefficients
e z  Va

a  V 1e z
% CALCULATE MODE AMPLITUDES
aref = EZR\Eref(NPML(1)+1:Nx-NPML(2));
atrn = EZT\Etrn(NPML(3)+1:Ny-NPML(4))';
e z
reflected field
transmitted field
x
y
Compute Transmission and Reflection
pref 
aref
ainc
2
ptrn 
atrn
ainc
2
% CALCULATE TRANSMITTANCE AND REFLECTANCE
REF = abs(aref(mref))^2;
TRN = abs(atrn(mtrn))^2;
Lecture 22
Slide 49
Step 11: Report the Results
% REPORT TRANSMISSION AND REFLECTION
disp([' Reflectance: ' num2str(100*REF,'%4.1f') '%']);
disp(['Transmittance: ' num2str(100*TRN,'%4.1f') '%']);
Lecture 22
Slide 50
25
9/13/2016
Results
Lecture 22
Slide 51
Convergence
We first test for convergence with a small grid to determine an appropriate grid resolution for the remaining simulations.
 4
T  74.4%
 7
T  72.6%
   10
T  74.4%
NRES = 15: Good choice for doing multiple preliminary simulations.
Lecture 22
   15
T  69.0%
   20
T  70.8%
   30
T  74.0%
NRES = 30: Good choice as a final simulation.
Slide 52
26
9/13/2016
Minimum Bend Radius for 90% Transmission
Given /15 grid resolution, we iterate bend radius to find the value that produces greater than 90% transmission.
r  10  m
T  93.0%
Lecture 22
r  8.5  m
T  89.9%
r  8 m
T  86.4%
r  5 m
T  69.0%
r  9 m
T  92.8%
Slide 53
27
Download