登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
时域有限差分法 FDTD
>
脉冲源加入空间后的设置问题
发帖
回复
1022
阅读
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)+...
;@I4[4ph}
J0*(n-ndelay)*exp(-((n-ndelay)^2/tau^2)); 加入的,我觉得应该是这样才对呀:ez(is,js,1:ke)=ez(is,js,1:ke)+...
@vy{Q7aM
J0*(n-ndelay)*exp(-((n-ndelay)^2/tau^2))/epsion*dt; epsion为介电常数,因为在maxwell方程组计算E是从D化简过来的。 这么是否有道理?请大家指教一下,谢谢
9DAk|K
WfnBWSA2T
%***********************************************************************
]z^*1^u^ig
% 3-D FDTD code with PEC boundaries
!R{C
%***********************************************************************
H<hFA(M
%
/hNZ7\|P
% Program author: Susan C. Hagness
]<9KX} B
% Department of Electrical and Computer Engineering
U64WTS@
% University of Wisconsin-Madison
GIo7- 6kvm
% 1415 Engineering Drive
X>0$zE@0
% Madison, WI 53706-1691
;r**`O
%
hagness@engr.wisc.edu
Q db~I#}m'
%
x<mHTh:-V
% Copyright 2005
H<gC{:S
%
n"p|tEK
% This MATLAB M-file implements the finite-difference time-domain
Rds_Cd C
% solution of Maxwell's curl equations over a three-dimensional
#n9:8BKf
% Cartesian space lattice comprised of uniform cubic grid cells.
!!jitFHzb
% Each unit cell within the Yee lattice contains electric field
x EX"pd
% components sampled along the edges of the cube and magnetic field
,};UD W
% components normal to the faces of the cube (the dual of Fig. 3.1).
"4 Lt:o4x
%
DU@ZLk3
% To illustrate the algorithm, an air-filled rectangular cavity
`i'72\(
% resonator is modeled. The length, width, and height of the
Q Pel n)
% cavity are 10.0 cm (x-direction), 4.8 cm (y-direction), and
D^R=
% 2.0 cm (z-direction), respectively.
G;^}, %<
%
^xBF$ua37)
% The computational domain is truncated using PEC boundary
-F7GUB6B
% conditions:
G4VdJ(_
% ex(i,j,k)=0 on the j=1, j=jb, k=1, and k=kb planes
YPq4VX,
% ey(i,j,k)=0 on the i=1, i=ib, k=1, and k=kb planes
]\ fXy?2
% ez(i,j,k)=0 on the i=1, i=ib, j=1, and j=jb planes
`^mPq?f
% These PEC boundaries form the outer lossless walls of the cavity.
C(RZ09,.S
%
BtPUUy.
% The cavity is excited by a line of current sources oriented
m1](f[$
% along the z-direction and located in the center of the x-y plane.
n0/H2>I[
% The source waveform is a differentiated Gaussian pulse given by
>EMsBX
% J(t)=J0*(t-t0)*exp(-(t-t0)^2/tau^2),
R]s\s[B
% where tau=50 ps. The FWHM spectral bandwidth of this zero-dc-
J\WUBt-M
% content pulse is approximately 7 GHz. The grid resolution
o~ v
% (dx = 2 mm) was chosen to provide at least 10 samples per
f&z@J,_=
% wavelength up through 15 GHz.
dZMOgZ.!yr
%
\]@XY_21
% To execute this M-file, type "fdtd3D_pec" at the MATLAB prompt.
I UMt^z
%
o$S/EZ
% This code has been tested in the following Matlab environments:
&p."` C
% Matlab version 6.1.0.450 Release 12.1 (May 18, 2001)
,wyfMOGLt
% Matlab version 6.5.1.199709 Release 13 Service Pack 1 (August 4, 2003)
?1DA
% Matlab version 7.0.0.19920 R14 (May 6, 2004)
+{qX,
% Matlab version 7.0.1.24704 R14 Service Pack 1 (September 13, 2004)
]8Eci^i
% Matlab version 7.0.4.365 R14 Service Pack 2 (January 29, 2005)
CG`s@5y>5
%
IvW%n(a8^
% Note: if you are using Matlab version 6.x, you may wish to make
`{1&*4!
% one or more of the following modifications to this code:
1$Jria5n
% --uncomment line numbers 125 and 126
9;fyC=
% --comment out line numbers 180 and 188
uQ} 0hs
%***********************************************************************
E3p3DM0F$
AK7IPftlH
clear
/b$0).fj@,
\R m2c8Z2
%***********************************************************************
ucVWvXCr
% Fundamental constants
?Re6oLm<B
%***********************************************************************
,-4SVj8$P
'aq9]D_k
cc=2.99792458e8; %speed of light in free space
] bPj%sb*@
muz=4.0*pi*1.0e-7; %permeability of free space
l'~~hQ{h/
epsz=1.0/(cc*cc*muz); %permittivity of free space
dn"&j1@KY
& o2F4
%***********************************************************************
6m=FWw3y
% Grid parameters
mnZS](>
%***********************************************************************
F"#8`Ps>
_tl,-}~
ie=50; %number of grid cells and Ex samples along x-direction
NXJyRAJ*%
je=24; %number of grid cells and Ey samples along y-direction
3!+N}[$iy
ke=10; %number of grid cells and Ez samples along z-direction
\`nRgYSE
@[:JQ'R=
ib=ie+1; %grid boundary coordinates
-zzM!1@F
jb=je+1;
YY&3M
kb=ke+1;
m|7lDfpb
zF%'~S0{
is=26; %location of z-directed current source
,b&-o?.{
js=13; %location of z-directed current source
,wI$O8"!j
)_MIUQ%
kobs=5;
pPC_ub
%lr<;
dx=0.002; %space increment of cubic lattice
e:h(,
dt=dx/(2.0*cc); %time step
W7j-siWJ
(|{b ZW}
nmax=500; %total number of time steps
lbRm(W(
(c'=jJX
%***********************************************************************
-<R"
% Differentiated Gaussian pulse excitation
JTK0#+?
%***********************************************************************
86]})H
B@:11,.7
rtau=50.0e-12;
fs43\m4=m
tau=rtau/dt;
?8j#gYx2
ndelay=3*tau;
%XpYiW#AK
J0=-1.0;
o(2tRDT\_b
#6jdv|fu
%***********************************************************************
kLr6j-X
% Material parameters
SP&Y|I$:
%***********************************************************************
8Wa&&YTB
X_j=u1*5
eps=1.0;
gypE~@
sig=0.0;
X5(S+;v"^
yf KJpy
%***********************************************************************
#Cwzk{p(
% Updating coefficients
d )}@0Q
%***********************************************************************
!7m ) QNV
BQs~>}(V
ca=(1.0-(dt*sig)/(2.0*epsz*eps))/(1.0+(dt*sig)/(2.0*epsz*eps));
.7BB*!CP
cb=(dt/epsz/eps/dx)/(1.0+(dt*sig)/(2.0*epsz*eps));
h-^7cHI}
da=1.0;
fP6]zy^*
db=dt/muz/dx;
eH*u,/
4\#!Gv-
%***********************************************************************
CL~21aslI
% Field arrays
8-A *Jc
%***********************************************************************
!Q`vOVSUD
CdTyUl
ex=zeros(ie,jb,kb);
|5ifgSZ
ey=zeros(ib,je,kb);
qkM<t?uS
ez=zeros(ib,jb,ke);
k:+Bex$g
hx=zeros(ib,je,ke);
FUq>+U!Qu
hy=zeros(ie,jb,ke);
#^\qFj
hz=zeros(ie,je,kb);
#rE#lHo
JOR ?xCc
%figure
K*ZH<@o4
%set(gcf,'DoubleBuffer','on')
R^fk :3
f/FK>oUh
%***********************************************************************
) <lpI';T
% BEGIN TIME-STEPPING LOOP
%(EUZu2
%***********************************************************************
'G.^g}N1
liYR8 D |
for n=1:nmax
xnyp'O8yk
4. &t
%***********************************************************************
@IB+@RmL
% Update electric fields
-:5]*zVp+-
%***********************************************************************
vYYLn9}5
K3c(c%$<R
ex(1:ie,2:je,2:ke)=ca*ex(1:ie,2:je,2:ke)+...
!PaDq+fB
cb*(hz(1:ie,2:je,2:ke)-hz(1:ie,1:je-1,2:ke)+...
208 dr*6U
hy(1:ie,2:je,1:ke-1)-hy(1:ie,2:je,2:ke));
Fu K(SP3
~7N>tjB
ey(2:ie,1:je,2:ke)=ca*ey(2:ie,1:je,2:ke)+...
qep<7 QO
cb*(hx(2:ie,1:je,2:ke)-hx(2:ie,1:je,1:ke-1)+...
D92#&,KD
hz(1:ie-1,1:je,2:ke)-hz(2:ie,1:je,2:ke));
~-"<)XPe
*ybwlLg
ez(2:ie,2:je,1:ke)=ca*ez(2:ie,2:je,1:ke)+...
LPg1 G+e
cb*(hx(2:ie,1:je-1,1:ke)-hx(2:ie,2:je,1:ke)+...
X j'7nj
hy(2:ie,2:je,1:ke)-hy(1:ie-1,2:je,1:ke));
}]qx "
-n C 5
ez(is,js,1:ke)=ez(is,js,1:ke)+...
Ji>
J0*(n-ndelay)*exp(-((n-ndelay)^2/tau^2));
wU\3"!^h
n*4N%yI^m5
%***********************************************************************
vd4}b>
% Update magnetic fields
if S) < t
%***********************************************************************
K?y!zy
" <GDOL
hx(2:ie,1:je,1:ke)=hx(2:ie,1:je,1:ke)+...
Yj^| j
db*(ey(2:ie,1:je,2:kb)-ey(2:ie,1:je,1:ke)+...
q{rc[ s?
ez(2:ie,1:je,1:ke)-ez(2:ie,2:jb,1:ke));
0@ -3U{Q
|_Y[931<
hy(1:ie,2:je,1:ke)=hy(1:ie,2:je,1:ke)+...
STC'j1U
db*(ex(1:ie,2:je,1:ke)-ex(1:ie,2:je,2:kb)+...
aYjFRH`
ez(2:ib,2:je,1:ke)-ez(1:ie,2:je,1:ke));
?\HXYCi0r
hb6UyN
hz(1:ie,1:je,2:ke)=hz(1:ie,1:je,2:ke)+...
jY]hMQ/H
db*(ex(1:ie,2:jb,2:ke)-ex(1:ie,1:je,2:ke)+...
WsA(8Ck<
e ..
F-=W7 D:[c
C$Y pk\p
未注册仅能浏览
部分内容
,查看
全部内容及附件
请先
登录
或
注册
共
条评分
离线
kevin123581
UID :94438
注册:
2012-05-22
登录:
2013-04-10
发帖:
75
等级:
禁止发言
1楼
发表于: 2012-06-20 20:39:00
用户被禁言,该主题自动屏蔽!
共
条评分
发帖
回复