Ask MATLAB Expert

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

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M92001782
  • Price:- $90

Priced at Now at $90, Verified Solution

Have any Question?


Related Questions in MATLAB

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Assignment details -need to write a code for connecting

Assignment Details - Need to write a code for connecting segments (Lines) a special case of TSP. The problem is to connect lines in 2d/ 3d space with path obstructions. Can you help me write the code for this? Hope you m ...

Assignment -we have daily gridded rainfall data of 40 years

Assignment - We have daily gridded rainfall data of 40 years and structure of the dataset is like below; Lat = [6.5:0.25:38.5]; Lon = [66.5:0.25:100]; Rainfall (135x129x365x40) (Lon, Lat, days, years). Now, we looking fo ...

Question a safe prime is a prime number that can be written

Question : A safe prime is a prime number that can be written in the form 2p + 1 where p is also a prime number. Write a MATLAB script file that finds and displays all safe primes between 1 and 1000.

Question - verify the attached paper with matlab and get

Question - Verify the attached paper with matlab and get all the results in the paper and explain step by step the matlab code. Paper - Improving Massive MIMO Belief Propagation Detector with Deep Neural Network. Attachm ...

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

Question 1 manipulate spectral imagehyperspectral images

Question 1. Manipulate spectral image Hyperspectral images can be seen as a generalisation of normal colour images such as RGB images. In a normal RGB colour image, there are 3 channels, i.e. channels for red colour, gre ...

Assignment -matlab codes and simulated model in

Assignment - Matlab codes and simulated model in simulink/matlab and truetime. 1. Matlab codes and simulink model for pid controller optimization using particle swarm optimization (PSO) my plant is integer order 1000/(s^ ...

Assignment matlab programmingusing appropriate matlab

Assignment: MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As