⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diffr.m

📁 此程序用于模拟
💻 M
字号:
%this file compares diffraction for the Fresnel and
%Fraunhoffer approximations

l=1e-6;     %wavelength
Wx=100e-6;  %slit width

%NF1=10;
%z=Wx^2/(l*NF1);
z=0.05;       %for Fresnel z=0.0022      
            %for Fraunhoffer z=0.1

xtmp=max([1.5*Wx,l*z/Wx]);
x=linspace(-xtmp,xtmp,101); %position


NF=Wx^2/(l*z); %Fresnel number

a1=-sqrt(2)*(sqrt(NF)+x/sqrt(l*z));
a2=sqrt(2)*(sqrt(NF)-x/sqrt(l*z));

C1=mfun('FresnelC',a1);
C2=mfun('FresnelC',a2);
S1=mfun('FresnelS',a1);
S2=mfun('FresnelS',a2);

I1=.5*((C2-C1).^2+(S2-S1).^2);  %Fresnel intensity

I2=(sinc(2*Wx*x/(l*z))).^2;     %Fraunhoffer intensity

plot(x,I1/max(I1),'b')
hold
plot(x,I2/max(I2),'r')
plot([-Wx,-Wx],[0,1],'k')
plot([Wx,Wx],[0,1],'k')
hold
xlabel('position')
ylabel('I(x)')


a=max(x)+Wx;
%fraunhoffer approximation
approx_fraun=Wx^2/(2*l*z);

%fresnel approximation
approx_fresnel=(a^4/(4*l*z^3));

[a z]

[approx_fresnel,approx_fraun]


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -