登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
时域有限差分法 FDTD
>
脉冲源加入空间后的设置问题
发帖
回复
1020
阅读
1
回复
[
求助
]
脉冲源加入空间后的设置问题
离线
shaoxianjun
UID :58939
注册:
2010-05-07
登录:
2012-06-17
发帖:
31
等级:
仿真新人
0楼
发表于: 2010-07-12 14:01:48
大家看一下这个3DPEC边界的例子,把高斯脉冲波加入空间是采用ez(is,js,1:ke)=ez(is,js,1:ke)+...
Yr&Ka:
J0*(n-ndelay)*exp(-((n-ndelay)^2/tau^2)); 加入的,我觉得应该是这样才对呀:ez(is,js,1:ke)=ez(is,js,1:ke)+...
Nw](".
J0*(n-ndelay)*exp(-((n-ndelay)^2/tau^2))/epsion*dt; epsion为介电常数,因为在maxwell方程组计算E是从D化简过来的。 这么是否有道理?请大家指教一下,谢谢
aU<s<2O)
:%-,Fxl4
%***********************************************************************
]HvZ$
% 3-D FDTD code with PEC boundaries
-p#,5}
%***********************************************************************
NW.XA! =E)
%
t<b 3K-
% Program author: Susan C. Hagness
Rf[V)x
% Department of Electrical and Computer Engineering
!0fI"3P@r
% University of Wisconsin-Madison
.gT4_
% 1415 Engineering Drive
{K7YTLWY
% Madison, WI 53706-1691
E`@43Nz
%
hagness@engr.wisc.edu
d\]O'U)s
%
kR6A3?[
% Copyright 2005
jM__{z
%
J4yt N3
% This MATLAB M-file implements the finite-difference time-domain
T{S4|G1R6
% solution of Maxwell's curl equations over a three-dimensional
68x}w Ae
% Cartesian space lattice comprised of uniform cubic grid cells.
H+cNX\,
% Each unit cell within the Yee lattice contains electric field
d5U; $q{o
% components sampled along the edges of the cube and magnetic field
?y-s20Kd
% components normal to the faces of the cube (the dual of Fig. 3.1).
^,7=X8Su
%
2@MN]Low
% To illustrate the algorithm, an air-filled rectangular cavity
30 7fBa
% resonator is modeled. The length, width, and height of the
W(&6
% cavity are 10.0 cm (x-direction), 4.8 cm (y-direction), and
9qH[o?]
% 2.0 cm (z-direction), respectively.
Hq xK\m%,.
%
=,Ttw>
% The computational domain is truncated using PEC boundary
V-vlTgemwc
% conditions:
[b`6v`x
% ex(i,j,k)=0 on the j=1, j=jb, k=1, and k=kb planes
\f"?Tv-C'
% ey(i,j,k)=0 on the i=1, i=ib, k=1, and k=kb planes
,$Tk$
% ez(i,j,k)=0 on the i=1, i=ib, j=1, and j=jb planes
Q\#UWsN(T/
% These PEC boundaries form the outer lossless walls of the cavity.
]*ov&{'
%
Tb#
% The cavity is excited by a line of current sources oriented
9e5gy
% along the z-direction and located in the center of the x-y plane.
v["3
% The source waveform is a differentiated Gaussian pulse given by
&`@M8-m#F
% J(t)=J0*(t-t0)*exp(-(t-t0)^2/tau^2),
ac6*v49
% where tau=50 ps. The FWHM spectral bandwidth of this zero-dc-
k!E"wJkpz
% content pulse is approximately 7 GHz. The grid resolution
dERc}oAh(
% (dx = 2 mm) was chosen to provide at least 10 samples per
6GKT yN
% wavelength up through 15 GHz.
="B n=>
%
#pu}y,QN$
% To execute this M-file, type "fdtd3D_pec" at the MATLAB prompt.
6An{3"
%
`-D$Fsl
% This code has been tested in the following Matlab environments:
QHQj/)J8
% Matlab version 6.1.0.450 Release 12.1 (May 18, 2001)
"T*I|
% Matlab version 6.5.1.199709 Release 13 Service Pack 1 (August 4, 2003)
]P*!'iYN(
% Matlab version 7.0.0.19920 R14 (May 6, 2004)
K+mU_+KRp
% Matlab version 7.0.1.24704 R14 Service Pack 1 (September 13, 2004)
"=A|K~b
% Matlab version 7.0.4.365 R14 Service Pack 2 (January 29, 2005)
V} bM!5 H
%
R{<Y4C2~
% Note: if you are using Matlab version 6.x, you may wish to make
%CT!$Y'n
% one or more of the following modifications to this code:
]_2yiKv&
% --uncomment line numbers 125 and 126
.Z5[_'T
% --comment out line numbers 180 and 188
\GHOg.P
%***********************************************************************
FaWl,} ]
J~dTVBx
clear
@+dHF0aXd
v*L '{3f
%***********************************************************************
; J2-rh
% Fundamental constants
#Wx=v$"
%***********************************************************************
pbdF]>\
'rx?hL3VW
cc=2.99792458e8; %speed of light in free space
d;g-3Pf
muz=4.0*pi*1.0e-7; %permeability of free space
WF)s*$'uz;
epsz=1.0/(cc*cc*muz); %permittivity of free space
W uf/LKj
{8ECNQ[]
%***********************************************************************
r{V.jZ%p'Z
% Grid parameters
g8Aj `O
%***********************************************************************
9cOx@c+/
CZfE |T~
ie=50; %number of grid cells and Ex samples along x-direction
6z]`7`G
je=24; %number of grid cells and Ey samples along y-direction
DR{]sG
ke=10; %number of grid cells and Ez samples along z-direction
#HDesen
I Tn;m
ib=ie+1; %grid boundary coordinates
AP ;*iyQ[
jb=je+1;
Dqr9Vv
kb=ke+1;
)KE_t^$
q u:To7
is=26; %location of z-directed current source
6J;i,/ky
js=13; %location of z-directed current source
I{<;;;a
Bbs5f@E
kobs=5;
]Wy.R6
,cS0
dx=0.002; %space increment of cubic lattice
qvTJ>FILT
dt=dx/(2.0*cc); %time step
08io<c,L
=kO@ Gk?
nmax=500; %total number of time steps
xPvRQ
_3U|2(E
%***********************************************************************
m >hovikY*
% Differentiated Gaussian pulse excitation
IQoH@l&Xk
%***********************************************************************
Y^5"qd|`
\^m.dIPdO
rtau=50.0e-12;
;/aB)JZ5=
tau=rtau/dt;
O=`o'%K<
ndelay=3*tau;
8GW ut=D
J0=-1.0;
SW=aHM
e/P4mc)
%***********************************************************************
.xnQd^qoac
% Material parameters
'^B3pR:
%***********************************************************************
z'e1"Y.
.$^wy3:F"
eps=1.0;
{9'hOi50
sig=0.0;
y&3TQ]f\
M1gP R
%***********************************************************************
um}N%5GAa
% Updating coefficients
.m!s". ?[
%***********************************************************************
kDg{>mf
X?kPi&ru
ca=(1.0-(dt*sig)/(2.0*epsz*eps))/(1.0+(dt*sig)/(2.0*epsz*eps));
^#7viZ*
cb=(dt/epsz/eps/dx)/(1.0+(dt*sig)/(2.0*epsz*eps));
&@"w-M
da=1.0;
b.,$# D{p
db=dt/muz/dx;
dh?S[|='
'ucGt
%***********************************************************************
,W8au"
% Field arrays
%Il ;B~t
%***********************************************************************
dv[\.T`LY
&*ZC0V3
ex=zeros(ie,jb,kb);
1{7_ `[
ey=zeros(ib,je,kb);
$~TfL{$
ez=zeros(ib,jb,ke);
RSFJu\0}N
hx=zeros(ib,je,ke);
mf~Lzp
hy=zeros(ie,jb,ke);
X,&xhSzg?
hz=zeros(ie,je,kb);
v0u\xX[H;
gb9[Meg'
%figure
Kv1vx*>
%set(gcf,'DoubleBuffer','on')
4UazD_`'
s8yCC#H"
%***********************************************************************
gTuX *7w
% BEGIN TIME-STEPPING LOOP
w. vY(s
%***********************************************************************
Lv^a+'
W'd/dKUx
for n=1:nmax
9kUV1?
UXQb={
%***********************************************************************
9yDFHz w
% Update electric fields
6_Fpca3L
%***********************************************************************
jvWI_Fto
&EGY+p|2Y
ex(1:ie,2:je,2:ke)=ca*ex(1:ie,2:je,2:ke)+...
l&$*}yCK
cb*(hz(1:ie,2:je,2:ke)-hz(1:ie,1:je-1,2:ke)+...
1=ip,D
hy(1:ie,2:je,1:ke-1)-hy(1:ie,2:je,2:ke));
jPj2
pB[%:w/@l:
ey(2:ie,1:je,2:ke)=ca*ey(2:ie,1:je,2:ke)+...
^xmZ|f-
cb*(hx(2:ie,1:je,2:ke)-hx(2:ie,1:je,1:ke-1)+...
=;g= GcVK
hz(1:ie-1,1:je,2:ke)-hz(2:ie,1:je,2:ke));
B'!PJj
CR.bMF}
ez(2:ie,2:je,1:ke)=ca*ez(2:ie,2:je,1:ke)+...
<gR`)YF7
cb*(hx(2:ie,1:je-1,1:ke)-hx(2:ie,2:je,1:ke)+...
oAC^4-Ld
hy(2:ie,2:je,1:ke)-hy(1:ie-1,2:je,1:ke));
#,)PN @P
z6Fun
ez(is,js,1:ke)=ez(is,js,1:ke)+...
s7vPI
J0*(n-ndelay)*exp(-((n-ndelay)^2/tau^2));
|O%:P}6c
*|sxa#
%***********************************************************************
>|5XaaDa
% Update magnetic fields
Ys)+9yPPn
%***********************************************************************
n~9 i^
.r(^h/IF
hx(2:ie,1:je,1:ke)=hx(2:ie,1:je,1:ke)+...
(UXv,_"nU
db*(ey(2:ie,1:je,2:kb)-ey(2:ie,1:je,1:ke)+...
17|@f
ez(2:ie,1:je,1:ke)-ez(2:ie,2:jb,1:ke));
\!m!ibr
M,ppCHy/$
hy(1:ie,2:je,1:ke)=hy(1:ie,2:je,1:ke)+...
/XjN%|
db*(ex(1:ie,2:je,1:ke)-ex(1:ie,2:je,2:kb)+...
P~o@9RV-
ez(2:ib,2:je,1:ke)-ez(1:ie,2:je,1:ke));
CN-4-
{$3j/b
hz(1:ie,1:je,2:ke)=hz(1:ie,1:je,2:ke)+...
|z ]aa
db*(ex(1:ie,2:jb,2:ke)-ex(1:ie,1:je,2:ke)+...
#fO*ROe
e ..
{ _-wG3f|
>QA/Mi~R
未注册仅能浏览
部分内容
,查看
全部内容及附件
请先
登录
或
注册
共
条评分
离线
kevin123581
UID :94438
注册:
2012-05-22
登录:
2013-04-10
发帖:
75
等级:
禁止发言
1楼
发表于: 2012-06-20 20:39:00
用户被禁言,该主题自动屏蔽!
共
条评分
发帖
回复