杨氏干涉的模拟的MATLAB仿真
Posted fpga&matlab
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了杨氏干涉的模拟的MATLAB仿真相关的知识,希望对你有一定的参考价值。
% 杨氏干涉的模拟
close all
figure('position',[217 266 694 244]);
set(gcf,'DoubleBuffer','on');
axes('position',[0.12,0.08,0.6,0.8]);hold on;
rectangle('position',[-1,1.1,0.1,3],'FaceColor',[0.1,0.3,0.4]);
rectangle('position',[-1,-4,0.1,3],'FaceColor',[0.1,0.3,0.4]);
rectangle('position',[-1,-0.8,0.1,1.6],'FaceColor',[0.1,0.3,0.4]);
axis([-4,12,-5,5]);
ha=plot([-3.8,-3.8],[0.9,0.9],'r','linewidth',3);
hb=plot([-3.8,-3.8],[-0.9,-0.9],'r','linewidth',3);
title('Double slit interference \\copyright zjliu')
L=-3.8;
rectangle('position',[11,-4,0.1,8],'FaceColor',[0,0,0]);
plot([-1,4.1],[-3.5,-3.5],'k');
plot([5.9,11],[-3.5,-3.5],'k');
plot([-0.7,-1,-0.7],[-3.3,-3.5,-3.7],'k');
plot([10.7,11,10.7],[-3.3,-3.5,-3.7],'k');
text(4.8,-3.5,'3m');
plot([-1.5,-1.5],[0.9,0.35],'k');
plot([-1.5,-1.5],[-0.9,-0.35],'k');
plot([-1.65,-1.5,-1.3],[0.6,0.9,0.6],'k');
plot([-1.6,-1.5,-1.3],-[0.6,0.9,0.6],'k');
text(-2.1,0,'2mm');
while L<=-0.95;
L=L+0.05;
set(ha,'xdata',[-3.8,L]);
set(hb,'xdata',[-3.8,L]);
pause(0.05);
end
xas=-0.95;yas=0.9;
xbs=-0.95;ybs=-0.9;
po=[-3.5:3.5];
ka=(po-yas)*i+(11+0.95);ka=ka./abs(ka);
kb=(po-ybs)*i+(11+0.95);kb=kb./abs(kb);
for n=1:8;
ah(n)=plot(xas,yas,'r');
bh(n)=plot(xbs,ybs,'r');
end
r=0;
za=xas+yas*i;zb=xbs+ybs*i;
Le=sqrt(11.95^2+3.5^2);
while r<=Le;
for n=1:8;
Ta=za+r*ka(n);
Ya=imag(Ta);
if abs(imag(Ta))>=abs(po(n));
Ya=po(n);
end
set(ah(n),'xdata',[xas,min(11,real(Ta))],'ydata',[yas,Ya]);
Tb=zb+r*kb(n);
Yb=imag(Tb);
if abs(imag(Tb))>=abs(po(n));
Yb=po(n);
end
set(bh(n),'xdata',[xbs,min(11,real(Tb))],'ydata',[ybs,Yb]);
end
r=r+0.05;
pause(0.05);
end
s=meshgrid(linspace(4,-4,300))';
De=abs((s-1)*i+3000)-abs((s+1)*i+3000);
lambda=0.6328e-3;
de_A=De/lambda*pi*2;
It=1-cos(de_A);
axes('position',[0.72,0.16,0.26,0.64]);
cc=cat(3,It/2,zeros(size(It)),zeros(size(It)));
imshow(cc,[]);
xlabel('\\copyright zjliu')
B29
以上是关于杨氏干涉的模拟的MATLAB仿真的主要内容,如果未能解决你的问题,请参考以下文章
光学基于matlab迈克尔逊干涉仪动态仿真含Matlab源码 2054期
光学基于matlab迈克尔逊干涉仪动态仿真含Matlab源码 2054期
光学基于matlab多光束干涉光场分布仿真含Matlab源码 2072期
光学基于matlab多光束干涉光场分布仿真含Matlab源码 2072期