资源描述:
《拉盖尔高斯光束_厄米高斯光束MATLAB仿真.pdf》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、激光原理by贾而穑130212114厄米高斯光束MATLAB仿真其中主程序文件:plotHermiteGaussianBeams.m子程序文件:HermitePoly.m程序如下:plotHermiteGaussianBeams.m%-------------------------------------------------------------------------%%auther:ErseJia%StudentID130212114%--------------------------------------------------
2、-----------------------%%%HermiteGaussianBeams%%SETPARAMETERS%Physicalparameterslambda=500;%nmk=2*pi/lambda;%Thetwoparametersforthegaussianbeam(andderivedquantities)z0=1;A0=1;W0=sqrt(lambda*z0/pi);W=@(z)W0*sqrt(1+(z/z0)^2);R=@(z)z*(1+(z/z0)^2);Zeta=@(z)atan(z/z0);%Thecoeffici
3、entsfortheHermite-Gaussian(HG)beamoforder(l,m)A=[1000;1100;0000;00.20];%DisplayParametersres=800;z=1e-9;x=linspace(-2*W(z),2*W(z),res);y=linspace(-2*W(z),2*W(z),res);[XY]=meshgrid(x,y);X=X(:);Y=Y(:);%%RUNTHESIMULATION%PreallocateMemoryU=zeros(length(X),1);Utemp=zeros(length(X
4、),1);Utemp2=zeros(length(X),1);%CalculateValuesthatareindependentofHGPolynomialorderlpf=exp(-1i*k*z-1i*k*(X.^2+Y.^2)/(2*R(z)));%lateralphasefactoru=sqrt(2)*X/W(z);v=sqrt(2)*Y/W(z);forl=1:size(A,1)%ifthereareanytermsofthisorder,calculatethex-HG(soyoudon't%needtorepeatforeachva
5、lueofmifsum(A(l,:)~=0)~=0Utemp2=(W0/W(z))*polyval(HermitePoly(l-1),u).*exp(-u.^2/2);elsecontinue;endform=1:size(A,2)ifA(l,m)~=0Utemp=Utemp2.*(polyval(HermitePoly(m-1),v)).*exp(-v.^2/2);Utemp=A(l,m)*Utemp.*lpf*exp(1i*(l+m+1)*Zeta(z));U=U+Utemp;endendend%%DRAWPLOTSfigure;U=resh
6、ape(U,res,res);imagesc(x,y,abs(U).^2);axissquare;set(1,'color','w');title('Hermite-GaussianBeamofOrder');xlabel('x(nm)');ylabel('y(nm)');HermitePoly.m%-------------------------------------------------------------------------%%HermitePoly.mbyErseJia%StudentID130212114%Givennon
7、negativeintegern,computethe%HermitepolynomialH_n.Returntheresultasavectorwhosemth%elementisthecoefficientofx^(n+1-m).%polyval(HermitePoly(n),x)evaluatesH_n(x).%-------------------------------------------------------------------------%functionhk=HermitePoly(n)ifn==0hk=1;elseif
8、n==1hk=[20];elsehkm2=zeros(1,n+1);hkm2(n+1)=1;hkm1=zeros(1,n+1);hkm1