您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > 光强分布MATLAB
一、高斯光束模拟的焦点附近光场分布forn=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,'-');holdonend右半边:forn=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,'-');holdonplot(z,r2,'-');holdonend全图:clearallforn=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,'-');axisequalholdonplot(z,r2,'-');axisequalholdonendxlabel('Z(λ)/m');ylabel('r(λ)/m');title('焦点附近光场分布')带空间坐标:clearallforn=1:10I=0.1*n;w0=200e-9;wl=780e-9;a=pi*w0^2*sqrt(1./I-1)/wl;z=-a:0.0001*a:a;r1=w0*sqrt(0.5.*(1+(wl/(pi*w0^2)).*z.^2).*log(1./(I.*(1+(wl/(pi*w0^2)).*z.^2))));r2=-w0*sqrt(0.5.*(1+(wl/(pi*w0^2)).*z.^2).*log(1./(I.*(1+(wl/(pi*w0^2)).*z.^2))));plot(z,r1,'-');axisequalholdonplot(z,r2,'-');axisequalholdonendxlabel('Z(λ)/m');ylabel('r(λ)/m');title('焦点附近光场分布')-3-2-10123-2-1012YAxisTitleXAxisTitle二、焦点附近的三维光场分布三、高斯光束在传播过程中,焦点处的光强分布1、高斯光束在光腰处的三维光强分布图clearallN=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);colormaphot;%colormapgray线性灰度图colormaphot热色颜色图去掉这句命令为彩图shadinginterp;xlabel('x/m');ylabel('y/m');zlabel('intensity/a.u.');axis([-3*w03*w0-3*w03*w001])title('焦点附近三维光场分布')colorbar;2、高斯光束在光腰处的二维光强分布图clearallN=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=sqrt(X.^2+Y.^2);I=exp(-2*R.^2./w0.^2);imagesc(x,y,I,[01]);axisequalcolormaphot;%colormapgray线性灰度图colormaphot热色颜色图去掉这句命令为彩图colorbar;xlabel('x/m');ylabel('y/m');axis([-3*w03*w0-3*w03*w0])title('焦点附近三维光场分布')3、高斯光束在传播过程中,焦点处的三维光强分布clearallw0=200e-9;%高斯光束的光腰半径wavelength=780e-9;%高斯光束的光波长ZR=pi*w0^2/wavelength;%高斯光束的瑞利长度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/w0^2).^2);I=w0^2./wz.^2.*exp(-2*pr.^2./wz.^2);surf(pz,pr,I);shadinginterp;xlabel('Z(λ)/m');ylabel('r(λ)/m');zlabel('intensity/a.u.');axis([-3*ZR3*ZR-InfInf-InfInf])title('焦点附近三维光场分布')colorbar;colormaphot;%colormapgray线性灰度图colormaphot热色颜色图view(2)%显示二维视图
本文标题:光强分布MATLAB
链接地址:https://www.777doc.com/doc-1456431 .html