You are on page 1of 4

Homework #7

Due October 13, 2015

EE 5320

Problem #1: Implement the FDFD-2D Method


The grating shown below was designed to operate at 8.0 GHz. Write a MATLAB
program to simulate this device using a two-dimensional finite-difference frequencydomain (FDFD) method. The program should be able to simulate both the E mode and
the mode at any frequency and at any angle of incidence. Assume the device is
infinitely periodic in the x-direction, is of infinite extent in the z-direction, and is finite
in the y-direction. The device resides in air and all the device parameters are provided
below.

Your program must:


1. Use the calcpml2d() and yeeder() functions from the previous homework.
Do not break your code into any other functions!
2. Follow the outline presented in Lecture 14 exactly.
3. In a single figure window, visualize the relative permeability UR2, relative
permittivity ER2 and the resulting field using the subplot() and imagesc()
commands. In the title of the field plot, report which mode is simulated and at
what frequency.
4. In the command window, output the dashboard parameters, tables of the
diffraction efficiencies for both the reflected and transmitted diffraction orders,
and the overall reflectance, transmittance, and conservation of power.
Hints:
1. The frequency of the source and the frequency that the device is designed for are
two different things! In this homework, the device is always to be designed for
8.0 GHz, but you will be simulating it at different frequencies.

Page 1 of 4

Homework #7
Due October 13, 2015

EE 5320

Use the following header for your program. You can make changes as necessary.
%
%
%
%
%

Homework #7, Problem 1


EE 5320 - COMPUTATIONAL ELECTROMAGNETICS
This MATLAB script file implements the FDFD method
to model transmission and reflection from a grating.

% INITIALIZE MATLAB
close all;
clc;
clear all;
% OPEN FIGURE WINDOW
figure('Color','w');
% UNITS
centimeters
millimeters
meters
degrees
seconds
hertz
gigahertz

=
=
=
=
=
=
=

1;
0.1 * centimeters;
100 * centimeters;
pi/180;
1;
1/seconds;
1e9 * hertz;

% CONSTANTS
c0 = 299792458 * meters/seconds;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DEFINE SIMULATION PARAMETERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SOURCE PARAMETERS
f0
= 24.0 * gigahertz;
lam0 = c0/f0;
theta = 15 * degrees;
MODE = 'H';

%operating frequency
%operating wavelength in free space
%angle of incidence
%electromagnetic mode, 'E' or 'H'

% GRATING PARAMETERS
fd
= 8.0 * gigahertz;
lamd = c0/fd;
x1
= 0.1040*lamd;
x2
= 0.0175*lamd;
x3
= 0.1080*lamd;
L
= 0.6755*lamd;
d
= 0.2405*lamd;
t
= 0.0510*lamd;
ur
= 1.0;
er
= 10.0;

%design frequency
%design wavelength
%width of tooth 1
%width of slot
%width of tooth 2
%period of grating
%grating depth
%substrate thickness
%relative permeability of grating
%dielectric constant of grating

% EXTERNAL MATERIALS
ur1 = 1.0;
er1 = 1.0;
ur2 = 1.0;
er2 = 1.0;

%permeability
%permittivity
%permeability
%permittivity

% GRID
NRES =
BUFZ =
NPML =

%grid resolution
%spacer region above and below grating
%size of PML at top and bottom of grid

PARAMETERS
40;
2*lam0 * [1 1];
[20 20];

in
in
in
in

the
the
the
the

reflection region
reflection region
transmission region
transmission region

Page 2 of 4

Homework #7
Due October 13, 2015

EE 5320

The output of your program should look something like below for the H mode. Provide
these same results for both the E and H modes in your homework. Be careful to display
the parameters with proper units!

DASHBOARD PARAMETERS:
Source Frequency
Angle of Incidence
Electromagnetic Mode
Device Design Frequency
x1
x2
x3
L
d
t
ur
er
ur1
er1
ur2
er2
NRES
BUFZ
NPML

=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=

24 GHz
15 degrees
H
8 GHz
3.8973 mm
0.6558 mm
4.0472 mm
25.3137 mm
9.0125 mm
1.9112 mm
1
10
1
1
1
1
40
[2 2]*lam0
[20 20]

REFLECTION DIFFRACTION ORDERS:


RDE(-1) = 0.78747%
RDE(0) = 0.22295%
RDE(1) = 0.20161%
RDE(2) = 1.4108%
TRANSMISSION DIFFRACTION ORDERS:
TDE(-1) = 61.4221%
TDE(0) = 19.7914%
TDE(1) = 14.9838%
TDE(2) = 1.1522%
OVERALL:
REF = 2.6229%
TRN = 97.3495%
CON = 99.9724%

Page 3 of 4

Homework #7
Due October 13, 2015

EE 5320

Problem #2: Convergence


Using the same device, set the source frequency to 11 GHz and the angle of incidence to
45. Plot reflectance as a function of the grid resolution from /4 to /80 for both the E
and H modes. That is, perform parameter sweeps for NRES = [4:1:80]. Do NOT
write a generic fdfd2d() function for this assignment.
Provide the following:
1. Discuss the meaning of these plots.
2. Identify on the plots where the model converges. Justify your answers.
You plot should look something like the following for the E mode.

Page 4 of 4

You might also like