1
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
2
, y
2
, z
2
,
t
2
) using the Finite Difference method as
௨,ೕ,ೖ
శభି௨,ೕ,ೖ
షభ
ଶ∆௧
=
௨శభ,ೕ,ೖ
ିଶ௨,ೕ,ೖ
ା௨షభ,ೕ,ೖ
∆௫
మ +
௨,ೕశభ,ೖ
ିଶ௨,ೕ,ೖ
ା௨,ೕషభ,ೖ
∆௬మ +
௨,ೕ,ೖశభ
ିଶ௨,ೕ,ೖ
ା௨,ೕ,ೖషభ
∆௭
మ
where 𝑢,,
= 𝑢(𝑖∆𝑥,𝑗∆𝑦, 𝑘∆𝑧, 𝑛∆𝑡). Determine the stability condition of the above discrete
equation.
2. The propagation of electromagnetic waves in 2D is governed by the wave equation
2
2
2
2
2
2
2
2
y
u
x
u
t
u
c
n
,
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:
Simulation 1:
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:
sin( )
/ 2
( , , ) exp
2
0
t
w
t T
u x y t s s
,
2
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
1
,
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.
Simulation 2:
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)
s
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
2
(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).
3
(iii)From Fraunhofer’s theory of diffraction, the intensity distribution of light transmitted
through a single slit is given by
2
sin( )
( )
o
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.
25
15
0
1 10
a = 5m
20
0.5m
-15
y (m)
x (m)
line
source plate screen
(n = 10)
n = 1 n = 1
L
4
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 En1(jj,ii)
end
end
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;
end
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 moreEach 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 moreThanks 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 moreYour 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 moreBy 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