《光强分布MATLAB.doc》由会员分享,可在线阅读,更多相关《光强分布MATLAB.doc(10页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、.-一、高斯光束模拟的焦点附近光场分布for n=1:10I=0.1*n;a=sqrt(1./I-1);z=0:0.0001:a;r=sqrt(0.5.*(1+z.2).*log(1./(I.*(1+z.2);plot(z,r, -);hold on end右半边:for n=1:10I=0.1*n;a=sqrt(1./I-1);z=0:0.0001:a;r1=sqrt(0.5.*(1+z.2).*log(1./(I.*(1+z.2);r2=-sqrt(0.5.*(1+z.2).*log(1./(I.*(1+z.2);plot(z,r1, -);hold on plot(z,r2, -);ho
2、ld on end全图:clear allfor n=1:10I=0.1*n;a=sqrt(1./I-1);z=-a:0.00001*a:a;r1=sqrt(0.5.*(1+z.2).*log(1./(I.*(1+z.2);r2=-sqrt(0.5.*(1+z.2).*log(1./(I.*(1+z.2);plot(z,r1, -); axis equalhold on plot(z,r2, -); axis equalhold on endxlabel(Z()/m);ylabel(r()/m);title(焦点附近光场分布)带空间坐标:clear allfor n=1:10I=0.1*n;w
3、0=200e-9;wl=780e-9;a=pi*w02*sqrt(1./I-1)/wl;z=-a:0.0001*a:a;r1=w0*sqrt(0.5.*(1+(wl/(pi*w02).*z.2).*log(1./(I.*(1+(wl/(pi*w02).*z.2);r2=-w0*sqrt(0.5.*(1+(wl/(pi*w02).*z.2).*log(1./(I.*(1+(wl/(pi*w02).*z.2);plot(z,r1, -); axis equalhold on plot(z,r2, -); axis equalhold on endxlabel(Z()/m);ylabel(r()/m
4、);title(焦点附近光场分布)二、焦点附近的三维光场分布三、高斯光束在传播过程中,焦点处的光强分布1、高斯光束在光腰处的三维光强分布图clear allN=200;w0=200e-9; %高斯光束的光腰半径r=linspace(0,3*w0,N);eta=linspace(0,2*pi,N);rho,theta=meshgrid(r,eta); %生成极坐标网格x,y=pol2cart(theta,rho); %将极坐标网格转化为直角坐标网格I=exp(-2*rho.2./w0.2); %高斯光束在归一化的光强值surf(x,y,I);colormap hot; %colormap gra
5、y线性灰度图 colormap hot热色颜色图 去掉这句命令为彩图shading interp;xlabel(x /m);ylabel(y /m);zlabel(intensity /a.u.);axis(-3*w0 3*w0 -3*w0 3*w0 0 1)title(焦点附近三维光场分布)colorbar;2、高斯光束在光腰处的二维光强分布图clear allN=200;w0=200e-9; %高斯光束的光腰半径x=linspace(-3*w0,3*w0,N);y=linspace(-3*w0,3*w0,N);X=meshgrid(x,y);Y=meshgrid(y,x);Y=Y;R=sq
6、rt(X.2+Y.2);I=exp(-2*R.2./w0.2);imagesc(x,y,I,0 1); axis equalcolormap hot; %colormap gray线性灰度图 colormap hot热色颜色图 去掉这句命令为彩图colorbar;xlabel(x /m);ylabel(y /m);axis(-3*w0 3*w0 -3*w0 3*w0)title(焦点附近三维光场分布)3、高斯光束在传播过程中,焦点处的三维光强分布clear allw0=200e-9; %高斯光束的光腰半径wavelength=780e-9; %高斯光束的光波长ZR=pi*w02/wavelen
7、gth; %高斯光束的瑞利长度L=3*ZR; %高斯光束的传输范围N=200;z=linspace(-L,L,N);r=linspace(-4*w0,4*w0,N);pr,pz=meshgrid(r,z);wz=w0*sqrt(1+(wavelength*pz/pi/w02).2);I=w02./wz.2.*exp(-2*pr.2./wz.2);surf(pz,pr,I);shading interp;xlabel(Z() /m);ylabel(r() /m);zlabel(intensity /a.u.);axis(-3*ZR 3*ZR -Inf Inf -Inf Inf)title(焦点附近三维光场分布)colorbar;colormap hot; %colormap gray线性灰度图 colormap hot热色颜色图view(2) %显示二维视图