How to create grating diffraction pattern.

조회 수: 62 (최근 30일)
Rose Mermate
Rose Mermate 2020년 3월 2일
댓글: OzjaszGoldberg 2022년 2월 4일
How to create a code to plot the intensity of the light I see from the grating diffraction in theory.
The graph shows only the diffraction ranking at zero. I want the graph to show the first number diffraction.
Who can see if it might go wrong? Please help me.
x = linspace(-50, 50, 500);
A = 4*W;
lambda = 632.8e-9; % m
D = 1; % Distance to the observation plane m
W = 38e-6; % slit width(m)
fx = x/(lambda*D); % frequency coordinat
I = (A^2/(lambda^2*D^2)) .* sinc(2*W*fx).^2;
figure
plot(x, I)
grid
xlabel('fx')
ylabel('Intensity')
  댓글 수: 1
Star Strider
Star Strider 2020년 3월 2일
@Rose Mermate —
You quoted the code I posted in your other Question: How to create a code to plot the intensity of the light
That should do everything you want.
What part of my Answer do you need help to understand?

댓글을 달려면 로그인하십시오.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 3월 2일
편집: KALYAN ACHARJYA 2020년 3월 2일
x = linspace(-50, 50, 500);
lambda = 632.8e-9; % m
D = 1; % Distance to the observation plane m
W = 38e-6;
A = 4*W;% slit width(m)
fx = x/(lambda*D); % frequency coordinat
I = (A^2/(lambda^2*D^2)) .* sinc(2*W*fx).^2;
figure, plot(x,I)
grid
xlabel('fx')
ylabel('Intensity');
% Just repeat the same row multiple times
% For Better visualisation
grad_pattern=repelem(I,[50],[1]);
figure,imshow(grad_pattern,[]);
title('Diffraction Pattern');
  댓글 수: 8
Prathamesh Chavan
Prathamesh Chavan 2021년 5월 12일
M is a order of principal maxima..
OzjaszGoldberg
OzjaszGoldberg 2022년 2월 4일
hi did you make it ?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Bar Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by