资源描述:
《MATLAB_光学仿真设计实验报告》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、MATLAB光学仿真设计实验报告实验一代码:clear;clc;i=sqrt(-1);lm=1064e-9;L=888*lm;a=18*lm;k=2*pi/lm;x1=linspace(-a,a,1000);Un_n=zeros(1,1000);Un_1=ones(1,1000);form=1:1000x=x1(m);y=exp((-i*k*(x-x1).^2)/(2*L)).*Un_1;Un_n(m)=sqrt(i/(lm*L)*exp(-i*k*L))*sum(y);endaaa=abs(Un_
2、n);yabsmax=max(aaa);Un_n=Un_n/yabsmax;Un_2=aaa/yabsmax;Yn_2=angle(Un_n);formmm=1:299forn=1:1000x=x1(n);y=exp((-i*k*(x-x1).^2)/(2*L)).*Un_n;Un_n_1(n)=sqrt(i/(lm*L)*exp(-i*k*L))*sum(y);endUn_n=Un_n_1;aaa1=abs(Un_n);yabsmax=max(aaa1);Un_n=Un_n/yabsmax;end
3、Un_300=aaa1/yabsmax;Yn_300=angle(Un_n);forn=1:1000x=x1(n);y=exp((-i*k*(x-x1).^2)/(2*L)).*Un_n;Un_n_1(n)=sqrt(i/(lm*L)*exp(-i*k*L))*sum(y);endUn_n=Un_n_1;bbb=abs(Un_n);yabsmax=max(bbb);Un_n=Un_n/yabsmax;Un_301=bbb/yabsmax;Yn_301=angle(Un_n);figure(1);pl
4、ot(Un_2);holdon;plot(Un_300,'r');holdon;plot(Un_301,'g');xlabel('X');ylabel('振幅');gridon;axison;axis([0,1000,0,1])figure(2);plot(Yn_2);holdon;plot(Yn_300,'r');holdon;plot(Yn_301,'g');xlabel('X');ylabel('相位');gridon;axison;axis([0,1000,-0.5,2.5])所得图像:更改
5、数据为:L=666*lm;a=22*lm;实验二:代码:clearallclctao_p=1.6e-12;tao_e=2.2e-9;N0=1.1e8;n_g=4;c=3e8;v_g=c/n_g;Tao=0.3;a=2.5e-20;Nth=2.14e8;n0=1e12;w=2e-6;L=250e-6;d=0.2e-6;V=w*L*d;Gr=Tao*v_g*a;beta_sp=1e-4;B=1e-16;ee=1.6e-19;gama=1/tao_p;gama_e=1/tao_e;I=2e-2;h=2e-
6、12;Th=h*(2^15);tt=[0:h:Th];M=length(tt);tt=zeros(1,M+1);P_0=zeros(1,M+1);N=zeros(1,M+1);P_0(1)=3e2;N(1)=n0*V;forii=1:MPK1=((Gr*(N(ii)/V-n0)-gama)*P_0(ii)+beta_sp*B*N(ii).^2/V);NK1=(I/(ee)-gama_e*N(ii)-Gr*(N(ii)/V-n0)*P_0(ii));PK2=((Gr*((N(ii)+h*NK1/2)/
7、V-n0)-gama)*(P_0(ii)+h*PK1/2)+beta_sp*B*(N(ii)+h*NK1/2).^2/V);NK2=(I/(ee)-gama_e*(N(ii)+h*NK1/2)-Gr*((N(ii)+h*NK1/2)/V-n0)*(P_0(ii)+h*PK1/2));PK3=((Gr*((N(ii)+h*NK2/2)/V-n0)-gama)*(P_0(ii)+h*PK2/2)+beta_sp*B*(N(ii)+h*NK2/2).^2/V);NK3=(I/(ee)-gama_e*(N(
8、ii)+h*NK2/2)-Gr*((N(ii)+h*NK2/2)/V-n0)*(P_0(ii)+h*PK2/2));PK4=((Gr*((N(ii)+h*NK3)/V-n0)-gama)*(P_0(ii)+h*PK3)+beta_sp*B*(N(ii)+h*NK3).^2/V);NK4=(I/(ee)-gama_e*(N(ii)+h*NK3)-Gr*((N(ii)+h*NK3)/V-n0)*(P_0(ii)+h*PK3));tt(ii+1)=tt(ii)+h;P_0(