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

  Index of the largest fibonacci number

What is the index of the largest Fibonacci number that can be represented exactly as a MATLAB double-precision quantity without roundoff error

  Matlab – discrete time simulation

MATLAB – Discrete time simulation, solve  Discrete time syetm problem,  DT kalman filter problem,  Steady state DT kalman filter problem

  Use the sandp 500 excess returns and inflation

Use the S&P 500 excess returns and inflation to predict Intel stock excess returns. Provide the regression equation for the Intel stock excess returns when using S&P 500 excess returns and inflation as explanatory variables.

  Matlab function to perform gauss-jordan elimination

Write a matlab function to perform gauss-jordan elimination with pivoting. Modify the pivoting so that it is using the row with the highest absolute value rather than the first non-zero row.

  Realistic animations include more

Realistic animations include more than just translations of shapes. They also have scaling involved. For this question, you're asked to write a function called "problem4" that accepts a single input variable and applies a scaling constant of 3. Th..

  Find the unit vector perpendicular to the plane

Write a MATLAB program to verify your answers. Submit the output displayed.(Use matlab functions such as dot, cross, norm, acos

  Using dimensional analysis nondimensionalize the period t

the period of a pendulum t is assumed correctly or incorrectly to depend on the mass m the length of the pendulum l the

  Calculate the bending moment and shearforce diagrams

Matlab code that will calculate the bending moment and shearforce diagrams for the attached file. It must be possible to input lengths,udl values fro each element and the programme must calculate the reaction forces at A,B,C

  Compute the output response

Write a MATLAB M-file to compute the output response y[n] of the 6-point MA filter to the input x[n]=5sin(pn/10 + p/4), for 0

  Plot way forms for the subsequent modulation schemes

Plot way forms for the subsequent modulation schemes using Matlab

  Make a function of the coding

Generate Plot of the Example 1-10 on MATLAB,Use INPUT for variable external force

  Write a function that takes as input a vector and string

Using MATLAB, write a function that takes as input a vector and string. Switch on the string to select between the arithmetic, harmonic and geometric means of the vector.

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