版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选优质文档-倾情为你奉上%* 5= T$h;O % 3-D FDTD code with PEC boundaries Iw?*y.z| %* H!'4A& % r dCs % Program author: Susan C. Hagness B_?7+ % Department of Electrical and Compute
2、r Engineering &hrMpD6z6i % University of Wisconsin-Madison T/|nOu 5 % 1415 Engineering Drive 41P0)o %
3、0; Madison, WI 53706-1691 9MH;=88q % 608-265-5739 :s zkh? % |UA=? Xl % )_;l%& % Date of this
4、version: February 2000 !$Ivro % yYSmmgrX0 % This MATLAB M-file implements the finite-difference time-domain ("F$r$9S % solution of Maxwell's curl equations over a three-dimensional $gN%X/n"1 % Cartesian space lattice
5、comprised of uniform cubic grid cells. %hN(79:g % vq.o ;q / % To illustrate the algorithm, an air-filled rectangular cavity < Np Mv!g % resonator is modeled. The length, width, and height of the pojhfn % cavity are 10.0 cm (x-di
6、rection), 4.8 cm (y-direction), and VcXr!4 M % 2.0 cm (z-direction), respectively. DU81( % #pgD-0_ % The computational domain is truncated using PEC boundary >Gy+- % conditions: yUDoOVC0 % ex(i,
7、j,k)=0 on the j=1, j=jb, k=1, and k=kb planes kyN) % ey(i,j,k)=0 on the i=1, i=ib, k=1, and k=kb planes 7Hv 6>z#m % ez(i,j,k)=0 on the i=1, i=ib, j=1, and j=jb planes <9"<, % These PEC bo
8、undaries form the outer lossless walls of the cavity. A6z.MdYZ % a&qdp % The cavity is excited by an additive current source oriented x 9 a % along the z-direction. The source waveform is a differentiated Qj1%'wWG % Gaussia
9、n pulse given by #K!jh)y % J(t)=-J0*(t-t0)*exp(-(t-t0)2/tau2), dMjeF % where tau=50 ps. The FWHM spectral bandwidth of this zero-dc- eYoc(bG(+ % content pulse is approximately 7 GHz. The grid resolution Gs|a$ V|o
10、60;% (dx = 2 mm) was chosen to provide at least 10 samples per j1;0kb? % wavelength up through 15 GHz. jqjj2 9 % _X<V , p % To execute this M-file, type "fdtd3D" at the MATLAB prompt. g(sR ? % This M-file displa
11、ys the FDTD-computed Ez fields at every other Wt!;Y,1 s % time step, and records those frames in a movie matrix, M, which i WGGnGS % is played at the end of the simulation using the "movie" command. WTt /y'6 % j+/EG*/ %* cMy?&
12、;_3f/lG?&- clear EOqV5$+ czWUD %* ov!L8 9u % Fundamental constants Tgq,tR %* <_bGV d +eb!fi cc=2.e8; %speed of light in free space Di_K muz=4.0*pi*1.0e-7; %p
13、ermeability of free space <lPHeO< epsz=1.0/(cc*cc*muz); %permittivity of free space c/3M>+M ?nR$>a %* $:DhK % Grid parameters .7#04_aP %* jRjQDK_"ka (<G) +* ie=50; %number of grid cells
14、 in x-direction pQ+4+7ID je=24; %number of grid cells in y-direction L30>?l ke=10; %number of grid cells in z-direction Aa%ks+1 s0'Xihsw6 ib=ie+1; gB#$"mq, jb=je+1; D#&N?< kb=ke+1; iW <B1'dp Y
15、JrZ is=26; %location of z-directed current source +xtRY" js=13; %location of z-directed current source LaiUf_W#X X<"W kobs=5; <El6?ml 47XQZ-4 dx=0.002; %space increment of cu
16、bic lattice jZ3 dt=dx/(2.0*cc); %time step N XzgI SuW_6 nmax=500; %total number of time steps # 1,(I ghiFI<)VY cF aYI %* /Et:',D % Differentiated Gaussian pulse excitation >ACMO %* d
17、YJWQ;j.| F/PN1#T rtau=50.0e-12; |k> _ jO tau=rtau/dt; y_8 8I:O ndelay=3*tau; /W/ =OPe srcconst=-dt*3.0e+11; mg*,_3q33 6546"sU %* %Sfew/"R0 % Material parameters qI" PI!s %* C jsy1gA FU Ip eps=1.0; 3xhxE
18、 sig=0.0; 5R/!e(m r+;op_ %* :v&TQ % Updating coefficients iu2%S)w %* SS1-UbL q<yp6Q3 ca=(1.0-(dt*sig)/(2.0*epsz*eps)/(1.0+(dt*sig)/(2.0*epsz*eps); AF>J8V cb=(dt/epsz/eps/dx)/(1.0+(dt*sig)/(2.0*epsz*eps); ?k?7GN da=1.0; +dcB
19、h Dq db=dt/muz/dx; #TM+Vd$ >f JY %* -uXf?sTV % Field arrays ra/5D %* $014/IB fb.jXSR ex=zeros(ie,jb,kb); eW, E)x: ey=zeros(ib,je,kb); bfcQ( m5 ez=zeros(ib,jb,ke); ul$k xc=N hx=zeros(ib,je,ke); W%5o87 hy=zeros(ie,jb,ke)
20、; q#B=PZ'NA hz=zeros(ie,je,kb); Z;Q2tT /F OSreS5bg %* +Ch2Lod % Movie initialization C.qN Bl* %* .n$c+ O0m_ tview(:,:)=ez(:,:,kobs); elF#$ sview(:,:)=ez(:,js,:); B xAyjA6 |5il5UP subplot('position',0.15 0.45 0.7 0.4
21、5),pcolor(tview'); +_EE shading flat; mH:8_=(. *is(-1.0 1.0); 6roq 1= colorbar; ,GeW_!Q axis image; Ms<v81z5T title('Ez(i,j,k=5), time step = 0'); Jb/VITqN4 xlabel('i coordinate'); pTB1I3=.u ylabel('j coordinate'); c1tM(& &
22、#160;5J-slNNCQ subplot('position',0.15 0.10 0.7 0.25),pcolor(sview'); Mz&h> shading flat; :3N6Ej *is(-1.0 1.0); ajCe&+ colorbar; %E8HLTEvl axis image; E '| title('Ez(i,j=13,k), time step = 0'); qWU59:d xlabel('i coordin
23、ate'); 3qQU-;| ylabel('k coordinate'); zr 4JTS 9=J 3T66U rect=get(gcf,'Position'); qEH rect(1:2)=0 0; # uyAC$ )j QrD M=moviein(nmax/2,gcf,rect); DUmp6 X2zIFm %* _gfec4o % BEGIN TIME-STEPPING LOOP Z= LLL %* u
24、F ;8B" P_Pco for n=1:nmax rM4RibS 5Z(q|nn7P %* uG+eF % Update electric fields pf#R %* + jN)$Y3Ya x f)P ex(1:ie,2:je,2:ke)=ca*ex(1:ie,2:je,2:ke)+. >J,IxRGi cb*(hz(
25、1:ie,2:je,2:ke)-hz(1:ie,1:je-1,2:ke)+. Pk8(2fAYk hy(1:ie,2:je,1:ke-1)-hy(1:ie,2:je,2:ke); ()fYhk|W >?> !#1 ey(2:ie,1:je,2:ke)=ca*ey(2:ie,1:je,2:ke)+. C?rb(m &
26、#160; cb*(hx(2:ie,1:je,2:ke)-hx(2:ie,1:je,1:ke-1)+. 1 y7$"N8Xo hz(1:ie-1,1:je,2:ke)-hz(2:ie,1:je,2:ke); d 8z9_C- IQB%v5 ez(2:ie,2:je,1:ke)=ca*ez(2:ie,2:je,1:ke)+. fM<g+X
27、 cb*(hx(2:ie,1:je-1,1:ke)-hx(2:ie,2:je,1:ke)+. r+n hm"9 hy(2:ie,2:je,1:ke)-hy(1:ie-1,2:je,1:ke); <h_7Dn rgu7g ez(is,js,1:ke)=ez(is,js,1
28、:ke)+. pJETM srcconst*(n-ndelay)*exp(-(n-ndelay)2/tau2); -PH qD j"<F?kQ %* V7>, % Update magnetic fields o(5 ( bJ %* o n?8l?iQ ?;Ge/QU5 hx(2:ie,1:je,1:ke)=hx(2:ie,1:je,1:ke)+. ,:/3'
29、L db*(ey(2:ie,1:je,2:kb)-ey(2:ie,1:je,1:ke)+. .Ue1'v*, ez(2:ie,1:je,1:ke)-ez(2:ie,2:jb,1:ke); 2o-Ie/"d m_1BB$lyP2 hy(1:ie,2:je,
30、1:ke)=hy(1:ie,2:je,1:ke)+. AqPQeNgz db*(ex(1:ie,2:je,1:ke)-ex(1:ie,2:je,2:kb)+. u:D,;) ez(2:ib,2:je,1:ke)-ez(1:ie,2:je,1:ke); Sf*b6lcC WT>2
31、eMK hz(1:ie,1:je,2:ke)=hz(1:ie,1:je,2:ke)+. QWV12t$v db*(ex(1:ie,2:jb,2:ke)-ex(1:ie,1:je,2:ke)+. z/Yrf ey(1:ie,1:je,2:ke)-ey(2:ib,1:je,2:ke);
32、=%V(n7= F"Y.'my8 %* 6vQCghI % Visualize fields gK8=A0c %* A7qKY-4B HYf if mod(n,2)=0; $Dm2>:Dmt plRBfw>N timestep=int2str(n); BB694 tview(:,:)=ez(:,:,kobs); :d ts> sview(:,:)=ez(:,js,:); *+qlam4N >vPDF+u
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年玉林货运从业资格仿真考题
- 2024商标转让及品牌升级合同:携手共进品牌升级之旅3篇
- 2024商混合同范本:商混混凝土生产与质量控制合作协议3篇
- 2025厨房设备销售合同版
- 商业综合体电力施工合同范本
- 城市公园旁咖啡馆租赁合同
- 城市绿化带扩建植树合同
- 出入境文件公证办理规范
- 智能家居维修员招聘合同模板
- 汽车研发中心施工协议
- 【道法广角】成语故事会:立木为信
- 《我们去看海》阅读答案
- 智慧酒店无人酒店综合服务解决方案
- 考研英语一新题型历年真题(2005-2012)
- 健身房会籍顾问基础培训资料
- 9脊柱与四肢、神经系统检查总结
- 秀场内外-走进服装表演艺术智慧树知到答案章节测试2023年武汉纺织大学
- 【高分复习笔记】王建《现代自然地理学》(第2版)笔记和课后习题详解
- TSGD0012023年压力管道安全技术监察规程-工业管道(高清晰版)
- SMM英国建筑工程标准计量规则中文 全套
- 2023-2024学年浙江省富阳市小学数学四年级上册期末通关题
评论
0/150
提交评论