欢迎来到天天文库
浏览记录
ID:20829481
大小:101.50 KB
页数:15页
时间:2018-10-16
《环形光波导耦合器件程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、10度:%Thisprogramcalculatethewaveguidebyaphotoniccrystal.%Fortwodimensioncase.%OnlyforTMcase(Ez,Hx,Hy),inthisversion试验版本.clear;%tic%Initialparametersandotherthings.W=0.36;%Normalizedfrequency就是能带图中的纵坐标,单位为(a/lamda)%Thefollowingparametersarecontrolparameters.WaveGuide=1;%IfthisprogramisforWaveGuide
2、?Ifso,pleasespecify1.IsMovie=0;%Ifyouwanttoplaymovie,pleaseuse1.IsFigure=1;%Ifitwillplotthefigures?Ifso,pleasespecify1.WantToSeeEp=1;%DoyouwanttoseethedistrubutionofEp(TE极化,S极化)?Ifso,pleasespecify1.%EndofdefiningcontrolparametersMLatx=11;%HowmanyLatticecellinxdirection.栅格MLaty=11;%HowmanyLatticec
3、ellinydirection.NMlat=21;%ThegirdnumberineachLatticeCell.每个栅格中包含的fdtd网格个数%SHOULDBEODDINTEGER!!!!奇数整数个ifmod(NMlat,2)==0NMlat=NMlat+1;end%Forceittobeaoddinteger!NTx=MLatx*NMlat+1;%ItisthenumberoftheGridalongxaxis.总的fdtd网格坐标点(所以要加1)NTy=MLaty*NMlat+1;%ItisthenumberoftheGridalongyaxis.ifWaveGuide==1Nr
4、ow=5;%TherownumberofcoloumnsbetweenthePMLboundaryandthewaveguide.(此处定义,现在还不知所措)endNPML=12;%HowmanyPMLlayerswillbeusedinourcomputation.PML的层数NTimeSteps=5000;%TotalnumberofTimeStepsMeach=20;%DefinetheintervalforplotfiguresifIsFigure==1.%Thisalsoworksforsavingintervals.每隔20个时间步显示一次。R=0.2;%Theradiuso
5、fdielectriccolumns,ea=11.4;%Thedielectricconstantofthesecolumns.Zmax=0.8;%Themaximumvalueforzaxiswhenplottingfigures.Colormax=2.8;%Themaximumvalueforcolormapwhenplottingfigures.%Someconstantsmu0=4*pi*1.0e-7;%EpsilonZero,ifusingGaussUnit,itequalsto1.e0=8.85*1e-12;%MuZero,ifusingGaussUnit,itequalst
6、o1.c=1/sqrt(mu0*e0);%Thelightspeed.factor=mu0/e0;%Thefactorbetweenconductivityandpermeability.%Permeability=Conductivity*factor,inPML.PML中的匹配条件a=1;%e-6;%Thelatticeconstant.栅格常数。W=W*(2*pi*c/a);%frequencyDx=a/NMlat;%Deltax.dx=1/(一个栅格中的网格数)Dy=Dx;%Deltay.Dt=1/sqrt(1/(Dx*Dx)+1/(Dy*Dy))/c;%Timeinterval
7、%tic%Inthefollowingpartmwedefinethedielectric%constants:,定义FDTD中平面波导与空气的介电常数Ep=ones(NTx-1,NTy-1)*e0;%FDTD总的网格中的介质常数,真空。Ep_cell=ones(NMlat,NMlat)*e0;%每个栅格中的fdtd介电常数,真空。x=-(NMlat-1)/2*Dx:Dx:(NMlat-1)/2*Dx;%先对栅格操作,然后进行rep
此文档下载收益归作者所有