登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
程序
>
Susan C. Hagness的1D/2D/3D FDTD(matlab)源码
发帖
回复
1
2
3
4
5
6
...28
下一页
到第
页
确认
88847
阅读
277
回复
[
资料共享
]
Susan C. Hagness的1D/2D/3D FDTD(matlab)源码
离线
gwzhao
方恨少
UID :17098
注册:
2008-08-24
登录:
2019-01-09
发帖:
1374
等级:
荣誉管理员
0楼
发表于: 2008-10-23 14:40:30
— 本帖被 tensor 从 资料库 移动到本区(2009-10-28) —
[post]%***********************************************************************
X2}\i5{
% 1-D FDTD code with simple radiation boundary conditions
q?nXhUD
%***********************************************************************
o )G'._
%
SsIy ;l
% Program author: Susan C. Hagness
\ExM.T
% Department of Electrical and Computer Engineering
+\fr3@Yc
% University of Wisconsin-Madison
_[<R<&jG
% 1415 Engineering Drive
\3-XXq
% Madison, WI 53706-1691
JN .\{ Y
% 608-265-5739
ra0:Lg'
%
hagness@engr.wisc.edu
2%m H
%
&BY%<h0c
% Date of this version: February 2000
#5wOgOv
%
(CJiCtAsl`
% This MATLAB M-file implements the finite-difference time-domain
o8-BTq8
% solution of Maxwell's curl equations over a one-dimensional space
`TYQ^Zm
% lattice comprised of uniform grid cells.
X|TEeE c[L
%
c*-8h{}
% To illustrate the algorithm, a sinusoidal wave (1GHz) propagating
j&6,%s-M`a
% in a nonpermeable lossy medium (epsr=1.0, sigma=5.0e-3 S/m) is
-icOg6%
% modeled. The simplified finite difference system for nonpermeable
%[u6<
% media (discussed in Section 3.6.6 of the text) is implemented.
Hzcy'
%
{0nZ;1,m
% The grid resolution (dx = 1.5 cm) is chosen to provide 20
puF'w:I(
% samples per wavelength. The Courant factor S=c*dt/dx is set to
&Gp@,t
% the stability limit: S=1. In 1-D, this is the "magic time step."
GbFLu`I u
%
#v0"hFOH,
% The computational domain is truncated using the simplest radiation
z\Rs?v"
% boundary condition for wave propagation in free space:
GpMKOjVm|
%
AON";&dLq-
% Ez(imax,n+1) = Ez(imax-1,n)
X/gIH/
%
gbsRf&4h
% To execute this M-file, type "fdtd1D" at the MATLAB prompt.
@zL)R b%P$
% This M-file displays the FDTD-computed Ez and Hy fields at every
:!Wijdq
% time step, and records those frames in a movie matrix, M, which is
I= G%r/3
% played at the end of the simulation using the "movie" command.
lM86 *g 'l
%
^VK-[Sz&
%***********************************************************************
Sf);j0G,D
w,bILv)
clear
m2E$[g
{>H#/I8si
%***********************************************************************
}fpK{db
% Fundamental constants
p(QB 5at
%***********************************************************************
,24NMv7
3FT%.dV^
cc=2.99792458e8; %speed of light in free space
b'Pq[ )
muz=4.0*pi*1.0e-7; %permeability of free space
<W~5;m
epsz=1.0/(cc*cc*muz); %permittivity of free space
]( V+ qj
'b:e`2fl
freq=1.0e+9; %frequency of source excitation
1L]7*NJe
lambda=cc/freq; %wavelength of source excitation
}S<2({GI
omega=2.0*pi*freq;
!rZO~a0
A{iI,IFe
%***********************************************************************
M$DJ$G|Z
% Grid parameters
7-6Z\.-
%***********************************************************************
guz{DBlK
C)~YWx@v
ie=200; %number of grid cells in x-direction
h!5^d!2,
6&M