单模光纤的三维模场分布(共17页).doc
精选优质文档-倾情为你奉上目 录1单模光纤1 2单模光纤模场分布近似13 MATLAB语言6 3.1主程序63.2调用函数93.3 程序运行说明114 总结16 专心-专注-专业1单模光纤 在工作波长中,只能传输一个传播模式的光纤,通常简称为单模光纤(SMF:Single ModeFiber)。由于光纤的纤芯很细(约10pm)而且折射率呈阶跃状分布,当归一化频率V参数2.4时,理论上只能形成单模传输。2单模光纤模场分布光纤中的电磁波可以看成时谐场,满足亥姆霍兹方程, 与电磁波理论中的做法一样,先求解z方向分量,然后再由麦克斯韦方程组求得其他分量。采用柱坐标,z方向的分量满足亥姆霍兹方程: 如果求得z方向的分量,其他各横向分量可以用z分量表示出来。阶跃光纤中的电磁场解及导波模的截止参数 式中,A 、B 待定常数, Jm :m 阶第一类贝塞尔函数,Km:m 阶第二类变形贝塞尔函数。U=kca W=aca u表示导波模场在纤芯内部的横向分布规律,w表示它在包层中的横向分布规律,两者结合起来,就可以完整地描述导波模的横向分布规律; 是轴向的相位传播常数,表明导波模的纵向传输特性。与电磁学公式比较 几个低阶第一类贝塞尔函数曲线 几个低阶第二类变形贝塞尔函数曲线用纵向分量表示的其他分量利用边界条件得到特征方程:对于实际使用的光钎可以引入弱导条件而得到的简化方程。简化的特征方程,上面这些公式与电磁场与电磁波中公式完全相同,求解很困难,一般用数值法,如果只求各种模式的截止条件,只需令W20,求解满足边界条件的U,则相对简单一些.本征方程是反映导波模涉及到的参数u、w和之间相互关系的方程,对于弱导光纤(n1n2)则可得到本征方程当W2=0,对应包层中导波模和辐射模的转折点或临界点,可以在此条件下求解纤芯内的归一化相位常数U。导波模一共可以分成4种模式即,TE0n、TM0n、EHmn、Hemn。在电磁波课程中我们已经得到了这些模的截止波长,下面直接写出结果。上面这些式子中,uxy表示x阶贝塞尔函数的第y个零点,下面表5.1 是几个低阶贝塞尔函数的零点位置。 HE11模对应 0 阶贝塞尔函数的第零个零点Jm(U)的第n个根umnnm012312.404833.831715.135626.3801625.520087.015598.417249.7610238.6537310.1734711.6198413.01520411.7915312.3236914.7959616.22347514.16.6317.9598214.40942 定义另一个重要的特征参量,V,称为光纤的归一化频率,是一个无量纲的参数。 当W20时,相应的 U 记为 Uc,V 记为Vc, Vc称之为归一化截止频率。显然,此时Uc Vc 且: 这样,光纤中任意一个模式的传播条件是: 光纤中单模传播的条件是:3 MATLAB语言3.1 主程序1、运行框位置 大小 抬头 默认文本框 绘图相框位置 背景颜色运行框位置 大小gcc=figure('Position',10,50,1100,660);设置程序抬头set(gcc,'Menubar','none','Name','单模光钎的三维模场分布','NumberTitle','off');uicontrol(gcc,'Style','text','Units','normalized','Position',0.01,0.35,0.05,0.6,'String','单模光钎的三维模场分布','Fontsize',24,'Horizontal','center','Back',0.5 0.8 0.9); 设置交互区域框uicontrol(gcc,'Style','Frame','Units','normalized','Position',0.15,0.015,0.8,0.24,'Back',1,1,1); 设置绘图框b=axes('Position',0.15,0.3,0.8,0.68); 设置程序背景颜色set(gcc,'color',0.5 0.8 0.9); 2、视图缩放功能 通过改变坐标轴的值改变视图大小uicontrol(gcc,'Style','text','Units','normalized','Fontsize',15,'Position',0.04,0.21,0.075,0.04,. 'String','同比例缩放','Fontsize',12,'Horizontal','left','Back',1 1 0.4); COM='j=get(hdxyz,''Value'');','f=5*j;','g=1*j;','set(b,''xlim'',-f,f,''ylim'',-f,f,''zlim'',0,g);'hdxyz=uicontrol(gcc,'Style','slider','Units','normalized','Position',0.015,0.18,0.12,0.04,. 'Min',0,'Max',2,'Value',1,'Call',COM);uicontrol(gcc,'Style','text','Units','normalized','Fontsize',15,'Position',0.043,0.13,0.07,0.04,. 'String','z方向缩放','Fontsize',12,'Horizontal','left','Back',1 1 0.4); COM0='l=get(hdz,''Value'');','set(b,''zlim'',0,l);'hdz=uicontrol(gcc,'Style','slider','Units','normalized','Position',0.015,0.1,0.12,0.04,. 'Min',0,'Max',2,'Value',1,'Call',COM0);uicontrol(gcc,'Style','text','Units','normalized','Fontsize',15,'Position',0.04,0.05,0.075,0.04,. 'String','xy方向缩放','Fontsize',12,'Horizontal','left','Back',1 1 0.4); COM1='k=get(hdxy,''Value'');','set(b,''xlim'',-k,k,''ylim'',-k,k);'hdxy=uicontrol(gcc,'Style','slider','Units','normalized','Position',0.015,0.02,0.12,0.04,. 'Min',2,'Max',10,'Value',5,'Call',COM1); 3、加设菜单 更改图像背景颜色 截图运行程序 建立程序使用说明hsz=uimenu(gcc,'Label','设置');hview=uimenu(hsz,'Label','转换视角','Separator','on'); uimenu(hview,'Label','侧视图','Accelerator','z','Call','view(90,0)'); uimenu(hview,'Label','俯视图','Accelerator','x','Call','view(0,90)'); uimenu(hview,'Label','原视图','Accelerator','c','Call','view(-37.5,30)');建立旋转动画COM='for el=-10:1:150','view(-37.5,el);','grid off;','drawnow;','grid on;','end'hxz=uimenu(hview,'Label','旋转动画','Accelerator','v','Call',COM);建立更改绘图图像的背景颜色菜单htbjs=uimenu(hsz,'Label','图像背景颜色','Separator','on'); uimenu(htbjs,'Label','草绿色','Call','set(gca,''Color'',0.7 0.9 0.4)'); uimenu(hzbc,'Label','天青色','Call','set(gca,''Color'',0.5 0.8 0.9)'); uimenu(hzbc,'Label','橙红色','Call','set(gca,''Color'',0.9 0.4 0.3)'); uimenu(hzbc,'Label','取消颜色','Call','set(gca,''Color'',1 1 1)');建立截图菜单COM1='saveas(gcc,''Mypictures'',''jpg'');'hSPC=uimenu(gcc,'Label','文件'); uimenu(hSPC,'Label','运行程序截图','Call',COM1); uimenu(hSPC,'Label','打开程序路径','Call','winopen(pwd);');uimenu(hSPC,'Label','打开程序截图','Call','b=strcat(pwd,''Mypic.jpg'');','winopen(b)');建立程序使用说明菜单COM2='a=strcat(pwd,''单模光纤的三维模场分布.doc'');','winopen(a);'hhelp=uimenu(gcc,'Label','帮助');uimenu(hhelp,'Label','程序使用说明','Call',COM2); 4、滑动条滑动条主程序hsli1=uicontrol(gcc,'Style','slider','Units','normalized','Position',0.2,0.14,0.4,0.04,'Min',0.1,'Max',2.1845,'Value',1.6453,'CallBack','set(azmcur,''String'','num2str(get(hsli1,''Value'');'set(gcc,''Position'',10,50,1100,660);');标记滑动条最小值azmmin=uicontrol(gcc,'Style','text','Units','normalized','Fontsize',12,'Position',0.155,0.14,0.045,0.04,'String',num2str(get(hsli1,'Min'),'Back',1,1,1); 标记滑动条最大值azmmax=uicontrol(gcc,'Style','text','Units','normalized','Fontsize',12,'Position',0.61,0.14,0.045,0.04,'String',num2str(get(hsli1,'Max'),'Back',1,1,1); 设置输出值位置uicontrol(gcc,'Style','text','Units','normalized','Position',0.25,0.2,0.04,0.04,'String','U =','Fontsize',15,'Horizontal','left','Back',1,1,1); 滑动条返回值azmcur=uicontrol(gcc,'Style','text','Units','normalized','Fontsize',15,'Position',0.29,0.2,0.06,0.04,'String',num2str(get(hsli1,'Value'),'Back',0.9,0.8,0.9); 触发函数COM3='n=str2num(get(azmcur,''String'');','set(UW,''String'',num2str(dataUW(n);'设置文本区域UW=uicontrol(gcc,'Style','Text','Units','normalized','String',1.7473,'Fontsize',15,'Position',0.48,0.2,0.07,0.04,'Back',0.9 0.8 0.9); 函数触发按钮uicontrol(gcc,'Style','Push','Units','normalized','Position',0.38,0.2,0.07,0.04,'String','对应W值','fontSize',10,'Call',COM3); 第二个滑动条程序雷同 此处不作赘述 5、计算归一化函数值 触发函数COM5='aa=str2num(get(azmcur,''String'');','bb=str2num(get(elvcur,''String'');','set(scz,''String'',num2str(cc(aa,bb);' 设置输出文本区域scz=uicontrol(gcc,'Style','Text','Units','normalized','String',2.405,'Position',0.81,0.17,0.12,0.05,'Horizontal','center','Fontsize',15,'Back',0.9 0.8 0.9); 函数触发按钮uicontrol(gcc,'Style','Push','Units','normalized','Posi',0.67,0.17,0.12,0.05,'String','计算归一化频率 V','fontSize',10,'Call',COM5); 6、绘图按钮 关闭按钮uicontrol(gcc,'Style','push','Units','normalized','Fontsize',18,'Position',0.67,0.04,0.12,0.1,'String','绘 图','Call','COMM(hsli1,hsli2)'); uicontrol(gcc,'Style','push','Units','normalized','Fontsize',18,'Position',. 0.765,0.045,0.08,0.08,'String','动 画','Call',COM); uicontrol(gcc,'Style','push','Units','normalized','Fontsize',18,'Position',0.81,0.04,0.12,0.1,'String','关 闭','Call','close all'); 3.2调用函数(1) COMM 绘图函数function COMM(hsli1,hsli2)如果归一化频率大于2.4048 程序将会报错 并不会执行绘图指令U=get(hsli1,'Value');W=get(hsli2,'Value');M=sqrt(U.2+W.2);if M>2.4048msgbox('归一化频率大于2.4048,请更换计算公式!','提示!')如果归一化频率小于等于2.408 程序将会运行绘图指令else N=201; R1=linspace(0,1,N); R2=linspace(1,5,N); Theta1=linspace(0,2*pi,N); Theta2=linspace(0,2*pi,N); E1=zeros(N,N); E2=zeros(N,N); I1=E1;I2=E2; for i = 1:N E1(:,i)=besselj(0,U*R1); I1(:,i)=E1(:,i).2; end for i = 1:N E2(:,i)=besselj(0,U).*besselk(0,W.*R2)./besselk(0,W); I2(:,i)=E2(:,i).2; end Theta1, R1=meshgrid(Theta1,R1); Theta2, R2=meshgrid(Theta2,R2); X1, Y1=pol2cart(Theta1,R1); X2, Y2=pol2cart(Theta2,R2); mesh(X1,Y1,I1); hold on mesh(X2,Y2,I2); colorbar xlabel('x') ylabel('y') zlabel('z') pause(1) hold offend(2)cc计算归一化频率,若大于2.4048程序将会报错 程序计算完后将会返回V值function V=cc(aa,bb) V1=sqrt(aa.2+bb.2); if V1>2.4048 msgbox('请确认归一化频率 0<V<2.408','提示!'); end V=sqrt(aa.2+bb.2);(3)function W=data_UW(n)用于对输入的U查询对应的W值 并将其返回到原函数function W=data_UW(n)U2=因数据过于庞大 故略;W2=因数据过于庞大 故略;%U W以100行1列存储j=0;for i=1:980 if U2(i)-n<0.001 %将U2中的数据依次和传入的V即x做差 j=j+1; %若差大于等于0.001,则输出对应在矩阵中的序号j end %然后用j在U2中找到对应的W值,并作为函数的end %返回参数W=W2(j);(4)function U=data_WU(n)用于对输入的W查询对应的U值 并将其返回到原函数function U=data_WU(n)W3=因数据过于庞大 故略;U3=因数据过于庞大 故略;%W U以100行1列存储j=0;for i=1:980 if W3(i)-n<0.0048 %将W3中的数据依次和传入的W即x做差 j=j+1; %若差大于等于0.0048,则输出对应在矩阵中的序号j end %然后用j在U3中找到对应的U值,并作为函数的end %返回参数U=U3(j);3.3 函数运行及说明初始化报错绘图更改背景颜色更改视角同比例缩放Z方向上缩放Xy方向缩放4、 总结光纤中传导光波的电磁场用Maxwell方程组描述。其特征方程有如下特点,即可以用一个统一的特征方程来表示不同类的模式(TE、TE、HE和EH模)。各种模式的具体电磁场结构并不重要,而传播常数相同的那些模则不论其电磁场结构如何则统统归并为一类模。这个设计比较简单,初版时没有太多的功能性东西,后来经过改进以后增加了截屏,改变背景颜色,改变视图视角,旋转动画以及视图缩放等功能,虽然在本设计中没有太大的能力上的体现,但是对于对Matlab中的语句及设计能力方面有了深入的理解,可以在以后的学习中用到。