




已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
function output_args = Untitled2( input_args )%UNTITLED2 Summary of this function goes here% Detailed explanation goes here%*% 3-D FDTD code with PEC boundaries%* % Program author: Susan C. Hagness% Department of Electrical and Computer Engineering % University of Wisconsin-Madison% 1415 Engineering Drive% Madison, WI 53706-1691% 608-265-5739% % Date of this version: February 2000% This MATLAB M-file implements the finite-difference time-domain % solution of Maxwells curl equations over a three-dimensional% Cartesian space lattice comprised of uniform cubic grid cells.% To illustrate the algorithm, an air-filled rectangular cavity% resonator is modeled. The length, width, and height of the % cavity are 10.0 cm (x-direction), 4.8 cm (y-direction), and % 2.0 cm (z-direction), respectively.% The computational domain is truncated using PEC boundary % conditions:% ex(i,j,k)=0 on the j=1, j=jb, k=1, and k=kb planes% ey(i,j,k)=0 on the i=1, i=ib, k=1, and k=kb planes% ez(i,j,k)=0 on the i=1, i=ib, j=1, and j=jb planes% These PEC boundaries form the outer lossless walls of the cavity. % The cavity is excited by an additive current source oriented % along the z-direction. The source waveform is a differentiated % Gaussian pulse given by% J(t)=-J0*(t-t0)*exp(-(t-t0)2/tau2),% where tau=50 ps. The FWHM spectral bandwidth of this zero-dc- % content pulse is approximately 7 GHz. The grid resolution % (dx = 2 mm) was chosen to provide at least 10 samples per% wavelength up through 15 GHz.% To execute this M-file, type fdtd3D at the MATLAB prompt.% This M-file displays the FDTD-computed Ez fields at every other % time step, and records those frames in a movie matrix, M, which % is played at the end of the simulation using the movie command.%这个MATLAB的m文件实现了麦克斯韦旋度方程的有限差分方法在三维笛卡尔空间点阵组成的统一的立方网格细胞。为了说明算法,建模一个充气矩形空腔谐振器。腔的长度、宽度和高度是10.0厘米(x方向)(y方向)4.8厘米,2.0厘米(z三个方向),分别为。计算域边界截断使用压电陶瓷这些压电陶瓷外无损耗腔壁边界形式。腔是由面向添加剂电流源的兴奋沿着z三个方向。源波形是一个差异化的高斯脉冲的半最大值光谱带宽zero-dc -内容脉冲大约是7 GHz。网格分辨率(dx = 2毫米)被选为至少10样品每波长通过15 GHz。执行这个m文件,输入“fdtd3D”MATLAB提示。这个m文件显示在每个其他FDTD-computed Ez字段时间步长,并记录这些框架在电影矩阵,M播放结束时模拟使用“电影”命令。clear%*% Fundamental constants%*cc=2.99792458e8; %speed of light in free space muz=4.0*pi*1.0e-7; %permeability of free space epsz=1.0/(cc*cc*muz); %permittivity of free space%*% Grid parameters%*ie=50; %number of grid cells in x-directionje=24; %number of grid cells in y-directionke=10; %number of grid cells in z-directionib=ie+1;jb=je+1;kb=ke+1; is=26; %location of z-directed current sourcejs=13; %location of z-directed current source kobs=5; dx=0.002; %space increment of cubic latticedt=dx/(2.0*cc); %time step nmax=500; %total number of time steps%* % Differentiated Gaussian pulse excitation%*rtau=50.0e-12;tau=rtau/dt;ndelay=3*tau;srcconst=-dt*3.0e+11;% Material parameters%*eps=1.0;sig=0.0;%* % Updating coefficients%*ca=(1.0-(dt*sig)/(2.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;%* % Field arrays%*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);%* % Movie initialization%*tview(:,:)=ez(:,:,kobs);sview(:,:)=ez(:,js,:);subplot(position,0.15 0.45 0.7 0.45),pcolor(tview);shading flat;caxis(-1.0 1.0);colorbar;axis image;title(Ez(i,j,k=5), time step = 0);xlabel(i coordinate);ylabel(j coordinate);subplot(position,0.15 0.10 0.7 0.25),pcolor(sview);shading flat;caxis(-1.0 1.0);colorbar;axis image;title(Ez(i,j=13,k), time step = 0);xlabel(i coordinate);ylabel(k coordinate);rect=get(gcf,Position);rect(1:2)=0 0;M=moviein(nmax/2,gcf,rect);%* % BEGIN TIME-STEPPING LOOP%*for n=1:nmax%*% Update electric fields%*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,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(-(n-ndelay)2/tau2);%*% Update magnetic fields%*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: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);%*% Visualize fields%*if mod(n,2)=0; timestep=int2str(n);tview(:,:)=ez(:,:,kobs);sview(:,:)=ez(:,js,:); subplot(position,0.15 0.45 0.7 0.45),pcolor(tview);shading flat;caxis(-1.0 1.0);colorbar;axis image;title(Ez(i,j,k=5), time step = ,timestep);xlabel(i coordinate);ylabel(j coordinate);subplot(position,0.15 0.10
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 考点解析人教版八年级上册物理物态变化《温度》专题攻克练习题(含答案解析)
- 难点解析-人教版八年级上册物理光现象《光的直线传播》同步练习试卷(含答案详解版)
- 基于修正CLV模型的平台企业客户资产价值评估研究-以美团为例
- B公司研发人员绩效管理优化研究
- 环泊酚与丙泊酚对老年骨科手术患者术后谵妄的影响差异性研究
- 排水系统抗渗漏技术应用方案
- 绿化植物种植技术实施方案
- 考点解析-人教版九年级物理《内能的利用》章节训练试题(含答案解析)
- 人防设施验收与质量评估方案
- 冲击地压巷道桩基液压支架围岩控制研究
- 小学一年级音乐教案《其多列》及反思
- FZ/T 73070-2022针织面料型胸贴
- GB/T 25853-20108级非焊接吊链
- GB/T 12467.5-2009金属材料熔焊质量要求第5部分:满足质量要求应依据的标准文件
- 水力学与桥涵水文课件
- DIP插件外观检验标准
- 天津科万物业设备台帐
- 数字电子技术说课
- 易文化与中医学课件
- 提高粘滞流体阻尼器埋件的一次验收合格率
- JIS G4304-2021 热轧不锈钢板材、薄板材和带材
评论
0/150
提交评论