||
NO1.单缝衍射
%单缝衍射仿真
%光学,P244,(4,34)
clear all;clc,
close all;
lambda=659e-9;%波长
z=0.08;%距离z=0.080m
a=1e-4;% 狭缝
x=linspace(-0.002,0.002,1000);
for i=1:1000
u=(pi*a/lambda)*(x(i)/sqrt(x(i)^2+z^2));
I(i)=(sin(u)/u)^2;
end
NClevels=255;
Ir=NClevels*I;
colormap(gray);
subplot(2,1,1),image(x,I,Ir);
title('单缝衍射');
subplot(2,1,2),plot(x,I(:)/max(I));
title('单缝衍射');
NO2.多缝衍射
%多缝衍射
%P262,(4.5.5)
clear all,clc
%close all
lambda=650e-9;%波长;光栅缝数N=8;光栅常量d=2e-5;透光缝宽a=6e-6
z=0.1;%距离
a=6e-6;d=2e-5;N=8;%最大坐标x=12mm
x=linspace(-0.012,0.012,1000);
for i=1:1000
u=(pi*a/lambda)*(x(i)/sqrt(x(i)^2+z^2));
I(i)=(sin(u)/u)^2*(sin(d*u*N/a)/sin(d*u/a))^2;
end
NClevels=255;
Ir=NClevels*I;
figure
colormap(gray(256));
subplot(2,1,1),image(x,I,Ir);
title('多缝衍射N=8');
subplot(2,1,2),plot(x,I(:)/max(I));
title('多缝衍射强度');
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-23 15:52
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社