欢迎来到天天文库
浏览记录
ID:33638217
大小:101.50 KB
页数:15页
时间:2019-02-27
《环形光波导耦合器件程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、10度:%Thisprogramcalculatethewaveguidebyaphotoniccrystal.%Fortwodimensioncase.%OnlyforTMcase(Ez,Hx,Hy),inthisversion试验版本.clear;%tic%Initialparametersandotherthings.W=0.36;%Normalizedfrequency就是能带图中的纵坐标,单位为(a/lamda)%Thefollowingparametersarecontrolparamet
2、ers.WaveGuide=1;%IfthisprogramisforWaveGuide?Ifso,pleasespecify1.IsMovie=0;%Ifyouwanttoplaymovie,pleaseuse1.IsFigure=1;%Ifitwillplotthefigures?Ifso,pleasespecify1.WantToSeeEp=1;%DoyouwanttoseethedistrubutionofEp(TE极化,S极化)?Ifso,pleasespecify1.%Endofdefin
3、ingcontrolparametersMLatx=11;%HowmanyLatticecellinxdirection.栅格MLaty=11;%HowmanyLatticecellinydirection.NMlat=21;%ThegirdnumberineachLatticeCell.每个栅格中包含的fdtd网格个数%SHOULDBEODDINTEGER!!!!奇数整数个ifmod(NMlat,2)==0NMlat=NMlat+1;end%Forceittobeaoddinteger!NTx=ML
4、atx*NMlat+1;%ItisthenumberoftheGridalongxaxis.总的fdtd网格坐标点(所以要加1)NTy=MLaty*NMlat+1;%ItisthenumberoftheGridalongyaxis.ifWaveGuide==1Nrow=5;%TherownumberofcoloumnsbetweenthePMLboundaryandthewaveguide.(此处定义,现在还不知所措)endNPML=12;%HowmanyPMLlayerswillbeusedinou
5、rcomputation.PML的层数NTimeSteps=5000;%TotalnumberofTimeStepsMeach=20;%DefinetheintervalforplotfiguresifIsFigure==1.%Thisalsoworksforsavingintervals.每隔20个时间步显示一次。R=0.2;%Theradiusofdielectriccolumns,ea=11.4;%Thedielectricconstantofthesecolumns.Zmax=0.8;%The
6、maximumvalueforzaxiswhenplottingfigures.Colormax=2.8;%Themaximumvalueforcolormapwhenplottingfigures.%Someconstantsmu0=4*pi*1.0e-7;%EpsilonZero,ifusingGaussUnit,itequalsto1.e0=8.85*1e-12;%MuZero,ifusingGaussUnit,itequalsto1.c=1/sqrt(mu0*e0);%Thelightspee
7、d.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;%T
8、imeinterval%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
此文档下载收益归作者所有