




下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、%*%3-DFDTDcodewithPECboundaries%*%Programauthor:SusanC.Hagness%DepartmentofElectricalandComputerEngineering%UniversityofWisconsin-Madison%1415EngineeringDrive%Madison,WI53706-1691%608-265-5739*.edu*.edu%Dateofthisversion:February2000%ThisMATLABM-fileimplementsthefinite-differencetime-domain%solution
2、ofMaxwellscurlequationsoverathree-dimensional%Cartesianspacelatticecomprisedofuniformcubicgridcells.%Toillustratethealgorithm,anair-filledrectangularcavity%resonatorismodeled.Thelength,width,andheightofthe%cavityare10.0cm(x-direction),4.8cm(y-direction),and%2.0cm(z-direction),respectively.%Thecomput
3、ationaldomainistruncatedusingPECboundary%conditions:%ex(i,j,k)=0onthej=1,j=jb,k=1,andk=kbplanes%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-
4、direction.Thesourcewaveformisadifferentiated%Gaussianpulsegivenby%J(t)=-J0*(t-t0)*exp(-(t-t0)A2/tauA2),%wheretau=50ps.TheFWHMspectralbandwidthofthiszero-dc-%contentpulseisapproximately7GHz.Thegridresolution%(dx=2mm)waschosentoprovideatleast10samplesper%wavelengthupthrough15GHz.%ToexecutethisM-file,t
5、ypefdtd3DattheMATLABprompt.%ThisM-filedisplaystheFDTD-computedEzfieldsateveryother%timestep,andrecordsthoseframesinamoviematrix,M,which%isplayedattheendofthesimulationusingthemoviecommand.%*clear%*%Fundamentalconstantscc=2.99792458e8;muz=4.0*pi*1.0e-7;cc=2.99792458e8;muz=4.0*pi*1.0e-7;epsz=1.0/(cc*c
6、c*muz);%speedoflightinfreespace%permeabilityoffreespace%permittivityoffreespace%*%Gridparameters%*ie=50;%numberofgridcellsinx-directionje=24;%numberofgridcellsiny-directionke=10;%numberofgridcellsinz-directionib=ie+1;jb=je+1;kb=ke+1;is=26;%locationofz-directedcurrentsourcejs=13;%locationofz-directed
7、currentsourcekobs=5;dx=0.002;%spaceincrementofcubiclatticedt=dx/(2.0*cc);%timestepnmax=500;%totalnumberoftimesteps%*%DifferentiatedGaussianpulseexcitation%*rtau=50.0e-12;tau=rtau/dt;ndelay=3*tau;srcconst=-dt*3.0e+11;%*%Materialparameters%*eps=1.0;sig=0.0;%*%Updatingcoefficients%*ca=(1.0-(dt*sig)/(2.
8、0*epsz*eps)/(1.0+(dt*sig)/(2.0*epsz*eps);cb=(dt/epsz/eps/dx)/(1.0+(dt*sig)/(2.0*epsz*eps);da=1.0;db=dt/muz/dx;%*%Fieldarrays%*ex=zeros(ie,jb,kb);ey=zeros(ib,je,kb);ez=zeros(ib,jb,ke);hx=zeros(ib,je,ke);hy=zeros(ie,jb,ke);hz=zeros(ie,je,kb);%*%Movieinitialization%*tview(:,:)=ez(:,:,kobs);sview(:,:)=e
9、z(:,js,:);subplot(position,0.150.450.70.45),pcolor(tview);shadingflat;caxis(-1.01.0);colorbar;axisimage;title(Ez(i,j,k=5),timestep=0);xlabel(icoordinate);ylabel(jcoordinate);subplot(position,0.25),pcolor(sview);shadingflat;caxis(-1.01.0);colorbar;axisimage;title(Ez(i,j=13,k),timestep=0);x
10、label(icoordinate);ylabel(kcoordinate);rect=get(gcf,Position);rect(1:2)=00;M=moviein(nmax/2,gcf,rect);%*%BEGINTIME-STEPPINGLOOP%*forn=1:nmax%*%Updateelectricfields%*ex(1:ie,2:je,2:ke)=ca*ex(1:ie,2:je,2:ke)+.cb*(hz(1:ie,2:je,2:ke)-hz(1:ie,1:je-1,2:ke)+.hy(1:ie,2:je,1:ke-1)-hy(1:ie,2:je,2:ke);ey(2:ie,
11、1:je,2:ke)=ca*ey(2:ie,1:je,2:ke)+.cb*(hx(2:ie,1:je,2:ke)-hx(2:ie,1:je,1:ke-1)+.hz(1:ie-1,1:je,2:ke)-hz(2:ie,1:je,2:ke);ez(2:ie,2:je,1:ke)=ca*ez(2:ie,2:je,1:ke)+.cb*(hx(2:ie,1:je-1,1:ke)-hx(2:ie,2:je,1:ke)+.hy(2:ie,2:je,1:ke)-hy(1:ie-1,2:je,1:ke);ez(is,js,1:ke)=ez(is,js,1:ke)+.srcconst*(n-ndelay)*exp
12、(-(n-ndelayF2/tauA2);%*%Updatemagneticfields%*hx(2:ie,1:je,1:ke)=hx(2:ie,1:je,1:ke)+.db*(ey(2:ie,1:je,2:kb)-ey(2:ie,1:je,1:ke)+.ez(2:ie,1:je,1:ke)-ez(2:ie,2:jb,1:ke);hy(1:ie,2:je,1:ke)=hy(1:ie,2:je,1:ke)+.db*(ex(1:ie,2:je,1:ke)-ex(1:ie,2:je,2:kb)+.ez(2:ib,2:je,1:ke)-ez(1:ie,2:je,1:ke);hz(1:ie,1:je,2
13、:ke)=hz(1:ie,1:je,2:ke)+.db*(ex(1:ie,2:jb,2:ke)-ex(1:ie,1:je,2:ke)+.ey(1:ie,1:je,2:ke)-ey(2:ib,1:je,2:ke);%*%Visualizefields%*ifmod(n,2)=0;timestep=int2str(n);tview(:,:)=ez(:,:,kobs);sview(:,:)=ez(:,js,:);subplot(position,0.150.450.70.45),pcolor(tview);shadingflat;caxis(-1.01.0);colorbar;axisimage;title(Ez(i,j,k=5),timestep=,timestep);xlabel(icoordinate);ylabel(jcoordinate);subplot(position,0.25),pcolor(sview);sha
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 【正版授权】 ISO/TS 23164:2025 EN Automation systems and integration - Core vocabulary for industrial data
- 【正版授权】 ISO 7434:2024 EN Fasteners - Slotted set screws with cone point
- 2025年度展览场地租赁合同保证金与押金缴纳细则
- 2025年凉果蜜饯合作协议书
- 2025年度智慧交通枢纽包工施工合同(智能交通系统)
- 2025房地产股权并购项目尽职调查及服务合同
- 2025年度智能家居标准私房买卖合同范文
- 增强知识管理的主管工作计划
- 多元化班级文化的建设方法计划
- 客户投诉处理流程的总结与反思计划
- 社区健康促进工作计划
- 2025年度移动端SEO服务及用户体验优化合同
- 中小学《清明节活动方案》班会课件
- 中央2025年交通运输部所属事业单位招聘261人笔试历年参考题库附带答案详解
- 2025年上半年上半年重庆三峡融资担保集团股份限公司招聘6人易考易错模拟试题(共500题)试卷后附参考答案
- 特殊教育学校2024-2025学年度第二学期教学工作计划
- 2025年技术员个人工作计划例文(四篇)
- 【公开课】同一直线上二力的合成+课件+2024-2025学年+人教版(2024)初中物理八年级下册+
- 人教鄂教版六年级下册科学全册知识点
- 急救药品课件教学课件
- 郑州市地图含区县可编辑可填充动画演示矢量分层地图课件模板
评论
0/150
提交评论