资源描述:
《三维电磁场FDTD程序(3D-FDTD-matlab)PEC边界.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、三维电磁场FDTD程序(3D-FDTDmatlab)PEC边界%FDTDMainFunctionJobstoWorkers%%***********************************************************************% 3-DFDTDcodewithPECboundaries%***********************************************************************%% ThisMAT
2、LABM-fileimplementsthefinite-differencetime-domain% solutionofMaxwell'scurlequationsoverathree-dimensional% Cartesianspacelatticecomprisedofuniformcubicgridcells.% % Toillustratethealgorithm,anair-filledrectangularcavity% resonatorismode
3、led.Thelength,width,andheightofthe% cavityareXcm(x-direction),Ycm(y-direction),and% Zcm(z-direction),respectively.%% ThecomputationaldomainistruncatedusingPECboundary% conditions:% ex(i,j,k)=0onthej=1,j=jb,k=1,andk=kbplanes%
4、 ey(i,j,k)=0onthei=1,i=ib,k=1,andk=kbplanes% ez(i,j,k)=0onthei=1,i=ib,j=1,andj=jbplanes% ThesePECboundariesformtheouterlosslesswallsofthecavity.%% Thecavityisexcitedbyanadditivecurrentsourceoriented% alongthez-direction.Thesourcewavefo
5、rmisadifferentiated% Gaussianpulsegivenby% J(t)=-J0*(t-t0)*exp(-(t-t0)^2/tau^2),% wheretau=50ps.TheFWHMspectralbandwidthofthiszero-dc-% contentpulseisapproximately7GHz.Thegridresolution% (dx=2mm)waschosentoprovideatleast10samplesper
6、% wavelengthupthrough15GHz.%% ToexecutethisM-file,type"fdtd3D"attheMATLABprompt.% ThisM-filedisplaystheFDTD-computedEzfieldsateveryother% timestep,andrecordsthoseframesinamoviematrix,M,which% isplayedattheendofthesimulationusingthe"movie
7、"command.%%***********************************************************************function[Ex,Ey,Ez]=FDTD3D_Main(handles)globalSimRunStop%if~isdir('C:MATLAB7workcavityfigures')% mkdir'C:MATLAB7workcavityfigures'%end%*************************
8、**********************************************% GridPartition%***********************************************************************p.ip=get(handles.XdirPar,'Value');p.jp=get(handles.YdirPar,'Value');p.PN=get(handles.PartNo,'Value')