ECE 452 – Assignment 2
Due at 4 pm, Monday, October 17, 2022
Please submit your assignment as a PDF file on eClass.
1. The 3D diffusion equation ut u
2 is discretized to second order accuracy O(x
) using the Finite Difference method as
= 𝑢(𝑖∆𝑥,𝑗∆𝑦, 𝑘∆𝑧, 𝑛∆𝑡). Determine the stability condition of the above discrete
2. The propagation of electromagnetic waves in 2D is governed by the wave equation
where n(x, y) is the refractive index of the medium and c = 3 × 108
m/s is the speed of light in
vacuum. We would like to solve the above equation using the Finite Difference Time Domain
(FDTD) method. The computation domain is restricted to a rectangular region of size a × b
and first-order Radiating Boundary Conditions based on the one-way wave equation are
applied to all four boundaries.
(a) Give a FD discretization of the wave equation for an interior node (i, j).
(b) Derive the FD equations for nodes on the left, right, top and bottom boundaries.
(c) Implement the FDTD method in a MATLAB program to solve the above wave equation.
An outline of the program is given at the end of the assignment for your reference.
(d) Use your program to run the following simulations:
This is a test run to verify that your program works correctly. Define the computational
domain to be the region 0 ≤ x ≤ 10m, 5m ≤ y ≤ 5m, and set the index of the medium
to be free space everywhere, n(x, y) = 1. Apply a point source located at (2.5m, 0). The
source emits a Gaussian pulse modulating a carrier signal given by:
( , , ) exp
u x y t s s
where = 2c/ is the frequency, = 1.0m is the wavelength, w = 8.0fs is the pulse
width, and T0 = 4.0fs is the time offset of the pulse centre. Use grid sizes x = y = 0.05m
and set the time step to the maximum allowable by the CFL stability condition. Initialize
the fields at the first two time steps to 0 (i.e., set 0
0 ui, j ui j ). Run the simulation for
175 time steps and provide the following results:
(i) A 3D plot or a contour plot of the field distribution u(x, y) at time step n = 175. (Use
mesh or surf commands for 3D plot and contour for contour plot)
(ii) A plot of the field u versus x along the line y = 0 at time step n = 175.
Print out and hand in a copy of your MATLAB program.
In this simulation we would like to study the diffraction of a plane wave by a single slit.
We consider a plate with a slit of width a = 5m illuminated by a plane wave with
wavelength = 1.0m, as shown in the figure below. The plate is 0.5m thick and is
assumed to be made of a material of very high refractive index (n = 10) so that it is strongly
reflective. In the simulation, set the computational domain to be ≤ x ≤ 25m, 15m ≤
y ≤ 15m, with grid sizes x = y = 0.05m. Use a line source located at xs = 1.0m to
generate a plane wave with unit amplitude and wavelength = 1.0m. The field at a node
on the line source is given by
u(x , y,t) sin( t)
where 14.5m ≤ y ≤ 14.5m (so that the line source does not touch the top and bottom
boundaries). Set the time step to the maximum allowable by the CFL stability condition,
run the simulation and provide the following results:
(i) A 3D plot or a contour plot of the field distribution u(x, y) at t = 90fs.
(ii) Suppose a “screen” is placed at location xo = 20m to image the diffraction pattern of
the field intensity. The field distribution on the screen can be expressed as
u(x , y,t) E(x , y) cos( t) o o ,
where E(xo, y) is the envelope of the field. Give a plot of the intensity diffraction
pattern, I(y) = E
(xo, y). (The field envelope can be obtained by capturing the maximum
field at each point on the screen over a few periods of oscillation of the wave).
(iii)From Fraunhofer’s theory of diffraction, the intensity distribution of light transmitted
through a single slit is given by
I y I ,
where (a /)sin . The angle is given by tan y / L, where L = 10m is the
distance from the plate to the screen. Choosing an appropriate value for Io, plot the
above expression on the same plot obtained in (ii) and compare the numerical
simulation to the theoretical intensity distribution.
a = 5m
source plate screen
(n = 10)
n = 1 n = 1
Outline of the 2D Finite Difference Time Domain Program
% Create and initialize Ny x Nx matrices to store fields at time levels
% n – 1, n, and n + 1:
En_1 = zeros(Ny,Nx); % time level n – 1
En0 = zeros(Ny,Nx); % time level n
En1 = zeros(Ny,Nx); % time level n + 1
% March solution from time step n = 0 to n = nstop:
for n = 1 : nstop,
% Compute interior nodes:
for jj = 2 : Ny-1,
for ii = 2 : Nx-1,
Compute value of E at source point (xs, ys) at time step n + 1
Compute boundary nodes at time step n + 1
% Store fields at the two most recent time levels:
Un_1 = Un0;
Un0 = Un1;
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more