Implement the fdtd method in a matlab program

Assignment Help MATLAB Programming
Reference no: EM131245921

Question 1. The 2D diffusion equation ut = D∇2u is discretized using the Finite Difference method as

ui,jn+1 - uni,j/DΔt = γ [(un+1i+1,j - 2ui+jn+1 + ui-1,jn+1)/Δx2 +  (un+1i,j+1 - 2ui,jn+1 + ui,j-1n+1)/Δy2] +(1-γ)[(uni+1,j - 2ui+jn + ui-1,jn)/Δx2 +  (uni,j+1 - 2ui,jn + ui,j-1n)/Δy2],

where γ is a parameter between 0 and 1 which determines the method of time discretization. Specifically, we have

γ = 0 : explicit method

γ = 1 : implicit method

γ = 1/2 : Crank-Nicholson method

Derive the stability condition for each of the above time discretization methods.

Question 2. The propagation of electromagnetic waves in 2D is governed by the wave equation

n2/c2.∂2u/∂t2 = ∂2u/∂x2 + ∂2u/∂y2,

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 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 ≤ 10μm, -5μm ≤ y ≤ 5μm, and set the index of the medium to be free space everywhere, n(x, y) = 1. Apply a point source located at (2.5μm, 0). The source emits a Gaussian pulse modulating a carrier signal given by:

u(xs, ys, t) = exp[- ((t - To)/(w/2))2]sin(ωt) ,

where ω = 2Πc/λ is the frequency, λ = 1.0μm 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.05μm 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 u0i,j = u1i,j = 0). 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 = 5μm illuminated by a plane wave with wavelength λ = 1.0μm, as shown in the figure below. The plate is 0.5μm 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 0 ≤ x ≤ 25μm, -15μm ≤ y ≤ 15μm, with grid sizes Δx = Δy = 0.05μm. Use a line source located at xs = 1.0μm to generate a plane wave with unit amplitude and wavelength λ = 1.0μm. The field at a node on the line source is given by u(xs , y, t) = sin(ωt) where -14.5μm ≤ y ≤ 14.5μm (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 = 20μm to image the diffraction pattern of the field intensity. The field distribution on the screen can be expressed as

u(xo, y, t) = E(xo, y) cos(ωt),

where E(xo, y) is the envelope of the field. Give a plot of the intensity diffraction pattern, I(y) = E2(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) = I0 [sin(β)/β]2

where β = (Πa / λ) sin θ. The angle θ is given by tan θ = y/L , where L = 10μm 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.

632_Figure.jpg

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

Verified Expert

Work is about finite domain difference equation. The solution has theoretical analysis of the finite difference equation The equation is extended for various boundary conditions. This is followed by MATLAB analysis for two cases.

Reference no: EM131245921

Questions Cloud

What is the effective monthly payment of the second : Comparison of the ‘effective' monthly payment of the two. The first one has a monthly payment of 400. What is the effective monthly payment of the second?
Explore which position you support and defend your position : Evaluate both the advocates' position and the critics' position. Determine which position you support and defend your position. Cite a minimum of 3 peer-reviewed sources not including your textbook.
How you would use it to facilitate your collaborations : What communication models (A common language for team communication see page 22 i.e. SBAR or other models from week 8 content) do you presently use when communicating with other healthcare providers in your area of practice. a. with other nurses a..
What inventory level should lott place another order : Calculate the EOQ. -  What is the difference in inventory costs between the EOQ and the current order quantity of 10,000 units?
Implement the fdtd method in a matlab program : ECE 452 - Derive the stability condition for each of the above time discretization methods and Derive the FD equations for nodes on the left, right, top and bottom boundaries.
What role if any government should play : In explaining your position, be sure to include cited research that supports your consideration, recommendations for safeguards going forward, and what role, if any, government should play.
What is the fair price of given invesment : An investment pays $500 per year for the first 4 years, $400 per year for the next 3 years, and $700 per year the following 8 years. - If the discount rate if 10% compounding quarterly, what is the fair price of this invesment?
Describe methods of estimating costs : Consider a project in which you have been involved that used an estimating technique to provide numbers for the conceptual plan.
What would be the expected risk on mr jones portfolio : If standard deviation of Stock A is 12.65%, Stock B is 21.55%, and correlation between Stock A and Stock B is 0.5, what would be the expected risk on Mr. Jones' portfolio?

Reviews

wjd1245921

10/18/2016 10:40:47 PM

I need help with this questions too.. Hi do you know when the expert would have done this order? Because I really need it asap. please send the solutions by tonight

Write a Review

MATLAB Programming Questions & Answers

  Matlab code to detect number of vehicles in a video clip

Machine Vision & Imaging Techniques in Mechanical Engineering - Write a MATLAB code to detect the number of vehicles in a video clip.

  Calculate the distance between cities

Calculate the distance between cities

  Approximate the solution to the above initial value problem

1. dydt te3t - 2y 0 le t le 1 y0 0approximate the solution to the above initial value problem usinga modified-euler

  Create a transformation matrix

Find the transformation matrix T02, i.e. T defining {0} with respect to {2}. Learn how to compute the inverse of T20 to get this. Verify that this works by using tranimate to view the movement of frame

  Solve the differential equation

Find a general solution of the following differential equation and solve the differential equation

  Investigate a monte carlo type simulation for an ensemble

The purpose of this assignment is to investigate a Monte Carlo type Simulation for an ensemble average. We can perform a Mende Carlo simulation to calculate the ensemble average of a random process. Consider the Random Process as in Example

  Function that takes as input parameters

Define a function that takes as input parameters a function handle f, start and end values a and b, and a number of steps n. The function should compute and return the x and y values of the maximum of the function over the range a to b.

  Design the circuit and select the appropriate components

ENG318 Project - Design the circuit and select the appropriate components for that circuit to fulfill the requirements of the device and Verify your design by MATLAB simulations.

  Write a program to display all unit-step responses

Write a program that will read in a text string mixed with numbers and letters from the keyboard and count how many numbers there are in the string

  It''s a mechanical engineering project proposal

It's a mechanical engineering project proposal. the program that we using is called "Mat lab". Here are the rules for the project proposal.

  Write a matlab function newtonraphson

Write a MATLAB function newtonRaphson(fx, x0, sigfig, maxIT) that will return a root of the function f(x) near x=x0 using the Newton-Raphson method, where sigfig is the accuracy of the solution in terms of significant figures

  Write a function that takes a list of integers

Using ML write a function that takes a list of integers as argument and returns a pair consisting of the sum of the even position and the sum of the odd positions of the list.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd