登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
时域有限差分法 FDTD
>
脉冲源加入空间后的设置问题
发帖
回复
1021
阅读
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)+...
ZYRZ$87jZ
J0*(n-ndelay)*exp(-((n-ndelay)^2/tau^2)); 加入的,我觉得应该是这样才对呀:ez(is,js,1:ke)=ez(is,js,1:ke)+...
\%&BK.t
J0*(n-ndelay)*exp(-((n-ndelay)^2/tau^2))/epsion*dt; epsion为介电常数,因为在maxwell方程组计算E是从D化简过来的。 这么是否有道理?请大家指教一下,谢谢
{jdtNtw
pY@$N&+W
%***********************************************************************
Y$JGpeq8w
% 3-D FDTD code with PEC boundaries
]mIcK
%***********************************************************************
L_4c~4
%
EHI%QT
% Program author: Susan C. Hagness
/ bm2v;
% Department of Electrical and Computer Engineering
b,C2(?hg
% University of Wisconsin-Madison
E%Tpby}^'
% 1415 Engineering Drive
u}_,4J
% Madison, WI 53706-1691
C7PVJnY0
%
hagness@engr.wisc.edu
HK}br!?
%
8(d Hn
% Copyright 2005
uBpnfIe
%
s'$5]9$S
% This MATLAB M-file implements the finite-difference time-domain
h&5bMW
% solution of Maxwell's curl equations over a three-dimensional
$~)BO_;o
% Cartesian space lattice comprised of uniform cubic grid cells.
:\hcl&W:
% Each unit cell within the Yee lattice contains electric field
E3..$x-/
% components sampled along the edges of the cube and magnetic field
'NaNh0y
% components normal to the faces of the cube (the dual of Fig. 3.1).
FTu6%~M/
%
YA+jLy6ZL
% To illustrate the algorithm, an air-filled rectangular cavity
`Xs3^FJt
% resonator is modeled. The length, width, and height of the
v=m!$~
% cavity are 10.0 cm (x-direction), 4.8 cm (y-direction), and
\e)>]C}h
% 2.0 cm (z-direction), respectively.
b$@vJ7V!
%
LAs#g||M
% The computational domain is truncated using PEC boundary
P ?^h
% conditions:
i28WgDG)5
% ex(i,j,k)=0 on the j=1, j=jb, k=1, and k=kb planes
HKB?G~
% ey(i,j,k)=0 on the i=1, i=ib, k=1, and k=kb planes
P}"=67$
% ez(i,j,k)=0 on the i=1, i=ib, j=1, and j=jb planes
v@,n]"
% These PEC boundaries form the outer lossless walls of the cavity.
R:N4_4& C~
%
Q]h.{nN#PK
% The cavity is excited by a line of current sources oriented
RBOb/.$
% along the z-direction and located in the center of the x-y plane.
rF@njw@
% The source waveform is a differentiated Gaussian pulse given by
(U_`Q1Jo
% J(t)=J0*(t-t0)*exp(-(t-t0)^2/tau^2),
b"4'*<=au
% where tau=50 ps. The FWHM spectral bandwidth of this zero-dc-
B'NtG84
% content pulse is approximately 7 GHz. The grid resolution
ws/e~ T<c
% (dx = 2 mm) was chosen to provide at least 10 samples per
stxei 6
% wavelength up through 15 GHz.
|)TI&T;k
%
nR%ey"
% To execute this M-file, type "fdtd3D_pec" at the MATLAB prompt.
f%,Vplb
%
qStZW^lFeY
% This code has been tested in the following Matlab environments:
)NF5,eD
% Matlab version 6.1.0.450 Release 12.1 (May 18, 2001)
Zc!rL0T
% Matlab version 6.5.1.199709 Release 13 Service Pack 1 (August 4, 2003)
L i g7Ac,
% Matlab version 7.0.0.19920 R14 (May 6, 2004)
}xx"
% Matlab version 7.0.1.24704 R14 Service Pack 1 (September 13, 2004)
g2RrBK,
% Matlab version 7.0.4.365 R14 Service Pack 2 (January 29, 2005)
bF2RP8?en
%
DtEvt+h
% Note: if you are using Matlab version 6.x, you may wish to make
a7Mn/ i.
% one or more of the following modifications to this code:
s+m3&(X
% --uncomment line numbers 125 and 126
D;1?IeS
% --comment out line numbers 180 and 188
q\DN8IJ
%***********************************************************************
0Y>5&
srbES6
clear
d9=i{i3
sA(d_Yu_
%***********************************************************************
,r5'nDV=d
% Fundamental constants
7];AB;0"
%***********************************************************************
^Uq%-a
Aj{c s
cc=2.99792458e8; %speed of light in free space
MiK -W
muz=4.0*pi*1.0e-7; %permeability of free space
Yamu"#
epsz=1.0/(cc*cc*muz); %permittivity of free space
$Wy(Wtrx|
#}xw *)3
%***********************************************************************
*;ehSg9
% Grid parameters
8(3nv[
%***********************************************************************
6 4,('+
k3PFCl~e
ie=50; %number of grid cells and Ex samples along x-direction
gPE`mE
je=24; %number of grid cells and Ey samples along y-direction
?8U#,qq#`
ke=10; %number of grid cells and Ez samples along z-direction
Wg5<@=x!G
hr@kU x
ib=ie+1; %grid boundary coordinates
H^3f!\MC;o
jb=je+1;
"1P[D'HV4|
kb=ke+1;
!+Fr U'^
I%|,KWM
is=26; %location of z-directed current source
B}(r>8?dm
js=13; %location of z-directed current source
M&[bb $00j
Vb @lK~
kobs=5;
n2V $dF4m
olv0w;s
dx=0.002; %space increment of cubic lattice
!-veL1r
dt=dx/(2.0*cc); %time step
K0aT(Rc e
.IU\wN
nmax=500; %total number of time steps
C^IPddw>
L*6R5i>
%***********************************************************************
$,.XPK5Qu
% Differentiated Gaussian pulse excitation
1agNwFd~
%***********************************************************************
P.y06^ X}A
m{gw:69h
rtau=50.0e-12;
H*H~~yQ
tau=rtau/dt;
wPE\?en
ndelay=3*tau;
oBS m>V
J0=-1.0;
\; voBU
9 _oAs"w
%***********************************************************************
)Fsc0_
% Material parameters
H:#sf][&,L
%***********************************************************************
?S<`*O +
B7QRG0
eps=1.0;
f&L3M)T
sig=0.0;
$ucDzf=o
@=ro/.
%***********************************************************************
RVN;j4uMg
% Updating coefficients
U-*`I?~=4
%***********************************************************************
BHu%x|d
;7>k[?'e
ca=(1.0-(dt*sig)/(2.0*epsz*eps))/(1.0+(dt*sig)/(2.0*epsz*eps));
41v#|%\w
cb=(dt/epsz/eps/dx)/(1.0+(dt*sig)/(2.0*epsz*eps));
!AXt6z cZ
da=1.0;
a.z)m}+
db=dt/muz/dx;
n\i~H
5La' I7q
%***********************************************************************
Ro@=oyLE
% Field arrays
rRvZG&k
%***********************************************************************
#b eLo J
4{QD: D(D
ex=zeros(ie,jb,kb);
L`"j>),
ey=zeros(ib,je,kb);
OZR{+YrB^
ez=zeros(ib,jb,ke);
'NNfzh
hx=zeros(ib,je,ke);
gy`WBg(7x
hy=zeros(ie,jb,ke);
$L4h'(s
hz=zeros(ie,je,kb);
["_+~*
`N}aV Ns
%figure
<nk9IAH
%set(gcf,'DoubleBuffer','on')
*B)J(^M!q
4%$#
%***********************************************************************
|SfCuV#g/<
% BEGIN TIME-STEPPING LOOP
F{G.dXZZ<
%***********************************************************************
%<O0Yenu
0z$::p$%u
for n=1:nmax
#|"M
ym8pB7E7%
%***********************************************************************
Xqy9D ZIn
% Update electric fields
%M*2 j%6
%***********************************************************************
:w<Ga8\tZ
NmA6L+
ex(1:ie,2:je,2:ke)=ca*ex(1:ie,2:je,2:ke)+...
9vckQCLM
cb*(hz(1:ie,2:je,2:ke)-hz(1:ie,1:je-1,2:ke)+...
ES)@iM?5
hy(1:ie,2:je,1:ke-1)-hy(1:ie,2:je,2:ke));
Z8ds`KZM
N(l
ey(2:ie,1:je,2:ke)=ca*ey(2:ie,1:je,2:ke)+...
#9glGPR(
cb*(hx(2:ie,1:je,2:ke)-hx(2:ie,1:je,1:ke-1)+...
der\"?_.
hz(1:ie-1,1:je,2:ke)-hz(2:ie,1:je,2:ke));
`aDVN_h{6
`F$lO2 #k
ez(2:ie,2:je,1:ke)=ca*ez(2:ie,2:je,1:ke)+...
D0}r4eA
cb*(hx(2:ie,1:je-1,1:ke)-hx(2:ie,2:je,1:ke)+...
onU\[VvM
hy(2:ie,2:je,1:ke)-hy(1:ie-1,2:je,1:ke));
nN2huNTf:
"-Yj~
ez(is,js,1:ke)=ez(is,js,1:ke)+...
P~*'/!@
J0*(n-ndelay)*exp(-((n-ndelay)^2/tau^2));
G3o `\4p
b~*CJ8Ad
%***********************************************************************
jdIAN
% Update magnetic fields
| Rj"}SC
%***********************************************************************
&Nw[J5-"k
[Y4Wm?
hx(2:ie,1:je,1:ke)=hx(2:ie,1:je,1:ke)+...
x }@P
db*(ey(2:ie,1:je,2:kb)-ey(2:ie,1:je,1:ke)+...
(DkfLadB
ez(2:ie,1:je,1:ke)-ez(2:ie,2:jb,1:ke));
ZY|$[>X!
U1W8f|u
hy(1:ie,2:je,1:ke)=hy(1:ie,2:je,1:ke)+...
7NRm\%^q
db*(ex(1:ie,2:je,1:ke)-ex(1:ie,2:je,2:kb)+...
(h|E@gRa
ez(2:ib,2:je,1:ke)-ez(1:ie,2:je,1:ke));
4-?zW
&;naaV_2T
hz(1:ie,1:je,2:ke)=hz(1:ie,1:je,2:ke)+...
u]OYu
db*(ex(1:ie,2:jb,2:ke)-ex(1:ie,1:je,2:ke)+...
5]*!N
e ..
8shx7"
#}lWM%9Dy
未注册仅能浏览
部分内容
,查看
全部内容及附件
请先
登录
或
注册
共
条评分
离线
kevin123581
UID :94438
注册:
2012-05-22
登录:
2013-04-10
发帖:
75
等级:
禁止发言
1楼
发表于: 2012-06-20 20:39:00
用户被禁言,该主题自动屏蔽!
共
条评分
发帖
回复