




下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 北京市混凝土外加剂采购合同(征求意见稿)新5篇
- 2025劳动合同应当具备哪些内容
- 《2025年个人土地转让合同书》
- 保龄球馆装修合同终止
- 汽车挂靠补充合同范本
- 厨具买卖回收合同范本
- 二零二五版经典煤炭运输合同
- 短期厂房租赁合同书范例二零二五年
- 授权签合同的委托书范例
- 水塘承包合同范例水塘承包合同二零二五年
- 2025陕西核工业工程勘察院有限公司招聘21人笔试参考题库附带答案详解
- 2024中国核工业集团公司招聘(300人)笔试参考题库附带答案详解
- 第15课《青春之光》课件-2024-2025学年统编版语文七年级下册
- 初中网络安全教育
- 浙江省杭州市金丽衢十二校2024-2025学年高三下学期(3月)第二次联考数学试题 含解析
- 直流斩波电路-升压斩波电路(电力电子技术课件)
- 2024年上海杨浦区社区工作者笔试真题
- 2025年1月浙江省高考物理试卷(含答案)
- DL∕T 5161.8-2018 电气装置安装工程质量检验及评定规程 第8部分:盘、柜及二次回路接线施工质量检验
- 15D501 建筑物防雷设施安装
- 济青高速涵洞定期检查报告模版
评论
0/150
提交评论