登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
时域有限差分法 FDTD
>
为什么高斯波(软源)在某个步数后在加载 ..
发帖
回复
1129
阅读
0
回复
[
求助
]
为什么高斯波(软源)在某个步数后在加载点变为恒值(不为0)
离线
shaoxianjun
UID :58939
注册:
2010-05-07
登录:
2012-06-17
发帖:
31
等级:
仿真新人
0楼
发表于: 2010-07-14 21:29:06
麻烦问下,我在改Susan C. Hagness的3-D FDTD code with PEC boundaries,将所加的激励源改了一下后,怎么在60多步后加载点变为恒值,电场不在变化,不为0.
an|x$e7|?
印象中一定步数后高斯波就应该没了呀,怎么一直在呀?
%;e/7`>Ma
程序如下:
Bm"KOr$}-
clear
ROk5]b.
L1ieaKw
%***********************************************************************
lmfi
% Fundamental constants
{.QEc0-
%***********************************************************************
Z0 o~+Ct$
&m|wH4\
cc=2.99792458e8; %speed of light in free space
Z2TL #@
muz=4.0*pi*1.0e-7; %permeability of free space
Q.]}]QE
epsz=1.0/(cc*cc*muz); %permittivity of free space
et,f_fd7v
"Jt.lL ]5
%***********************************************************************
Hz.(qW">5*
% Grid parameters
{) Q@c)'
%***********************************************************************
3H|_mX
3~}uqaGt
ie=50; %number of grid cells and Ex samples along x-direction
W6"v)Jc>_
je=24; %number of grid cells and Ey samples along y-direction
t*>R`,j
ke=10; %number of grid cells and Ez samples along z-direction
!eEHmRgg4
`0P$#5?
ib=ie+1; %grid boundary coordinates
TQx.KM>y
jb=je+1;
IG|X!l
kb=ke+1;
F'B8v3
2_zp:v
is=26; %location of z-directed current source
G`\f
js=13; %location of z-directed current source
I9:Cb)hbU]
MxGu>r
%kobs=5;
^1Zeb$Nw'
ks=6;
|P -8HlOr
QAvir%Y9Q
dx=0.002; %space increment of cubic lattice
RA G3o-
dt=dx/(2.0*cc); %time step
.a._NW
ZCB_
nmax=200; %total number of time steps
^go7_y
bzX\IrJpOZ
%***********************************************************************
%!du,2
% Differentiated Gaussian pulse excitation
po$ /7
%***********************************************************************
MxY/`9>E|+
dl~%MWAVb
rtau=50.0e-12;
SzUpWy&
tau=rtau/dt;
AgFVv5
ndelay=3*tau;
*d"DA[(
J0=-1.0;
A8pIs
g>dA$h%
%***********************************************************************
\8<BLmf4U
% Material parameters
PI`jExL
%***********************************************************************
Bx/L<J@
=dII- L=`
eps=1.0;
-C<zF`jO
sig=0.0;
'Y56+P\u
d/bEt&
%***********************************************************************
iMs5zf<M
% Updating coefficients
~$p2#AqX
%***********************************************************************
=Qgt${|
.G+Pe'4a
ca=(1.0-(dt*sig)/(2.0*epsz*eps))/(1.0+(dt*sig)/(2.0*epsz*eps));
f. FYR|%tq
cb=(dt/epsz/eps/dx)/(1.0+(dt*sig)/(2.0*epsz*eps));
9(6I<]#
da=1.0;
_T2=J+"-Kp
db=dt/muz/dx;
|1b_3?e
&|!7Z4N
%***********************************************************************
d4nH_?
% Field arrays
E I:w aIr
%***********************************************************************
1RK=,Wx
#B:hPZM1
ex=zeros(ie,jb,kb);
q|8{@EMT
ey=zeros(ib,je,kb);
" )V130<
ez=zeros(ib,jb,ke);
Zf'TJ`S
hx=zeros(ib,je,ke);
Sqo :-
hy=zeros(ie,jb,ke);
i K12pw
hz=zeros(ie,je,kb);
iVG-_RsKK
rk7QZVE
%figure
Q8DQlqHm
%set(gcf,'DoubleBuffer','on')
L+CyQq
rFC" Jx
%***********************************************************************
"g'jPwFG
% BEGIN TIME-STEPPING LOOP
4dhvFGlW
%***********************************************************************
z.Y$7bf)
/\H>y
for n=1:nmax
Nkp)Ax&
P&b19 K'
%***********************************************************************
,:??P1
% Update electric fields
L+'Fs
%***********************************************************************
tkXEHsRT
xA9:*>+>
ex(1:ie,2:je,2:ke)=ca*ex(1:ie,2:je,2:ke)+...
u%/goxA
cb*(hz(1:ie,2:je,2:ke)-hz(1:ie,1:je-1,2:ke)+...
DqX{'jj
hy(1:ie,2:je,1:ke-1)-hy(1:ie,2:je,2:ke));
fH)YFn/
RTv qls
ey(2:ie,1:je,2:ke)=ca*ey(2:ie,1:je,2:ke)+...
5g9; +}X;
cb*(hx(2:ie,1:je,2:ke)-hx(2:ie,1:je,1:ke-1)+...
Fd#m<"
hz(1:ie-1,1:je,2:ke)-hz(2:ie,1:je,2:ke));
I =1+h
7{I h_.#
ez(2:ie,2:je,1:ke)=ca*ez(2:ie,2:je,1:ke)+...
tUgEeh6
cb*(hx(2:ie,1:je-1,1:ke)-hx(2:ie,2:je,1:ke)+...
lKlU-4
hy(2:ie,2:je,1:ke)-hy(1:ie-1,2:je,1:ke));
ap{2$k ,
BM(]QUxRd
%ez(is,js,ks)=ez(is,js,ks)+...
h}]fnA
% J0*exp(-((n-ndelay)^2/tau^2));
`&-Mi[1
D5:{fWVsV/
ez(is,js,ks)=ez(is,js,ks)+J0*exp(-0.5*((n-25)^2/20^2));
I('Un@hS
%***********************************************************************
jLpc Zb,
% Update magnetic fields
v76D3'8
%***********************************************************************
CT1ja.\;
(s{RnD
hx(2:ie,1:je,1:ke)=hx(2:ie,1:je,1:ke)+...
LrATSq@
db*(ey(2:ie,1:je,2:kb)-ey(2:ie,1:je,1:ke)+...
V^\8BVw
ez(2:ie,1:je,1:ke)-ez(2:ie,2:jb,1:ke));
C&6IU8l\
4E+hRKuo,
hy(1:ie,2:je,1:ke)=hy(1:ie,2:je,1:ke)+...
+QE^\a
db*(ex(1:ie,2:je,1:ke)-ex(1:ie,2:je,2:kb)+...
Z7RiPSdxp
ez(2:ib,2:je,1:ke)-ez(1:ie,2:je,1:ke));
<x&%~6j
5vw{b?
hz(1:ie,1:je,2:ke)=hz(1:ie,1:je,2:ke)+...
*X4PM\ck
db*(ex(1:ie,2:jb,2:ke)-ex(1:ie,1:je,2:ke)+...
glDh([
ey(1:ie,1:je,2:ke)-ey(2:ib,1:je,2:ke));
r\blyWi
({NAMc*
%***********************************************************************
lhtZaU~V
% Visualize fields
Fr%d}g
%***********************************************************************
kdn'6>\
JqMDqPIQ
timestep=int2str(n);
_>v<(7
tview(:,:)=ez(:,:,ks);
Vo7dAHHL
sview(:,:)=ez(:,js,:);
Qu7T[<
;\[(- )f!=
subplot('position',[0.15 0.45 0.7 0.45]),imagesc(tview');
y|Ir._bt
shading flat;
1*dRK6
caxis([-1.0 1.0]);
mWyqG*-Hb
colorbar;
2KQoy;
axis image; axis xy;
&[At`Nw71
title(['Ez(i,j,k=5), ti ..
1?| flK
8P"_#M?!
未注册仅能浏览
部分内容
,查看
全部内容及附件
请先
登录
或
注册
共
条评分
发帖
回复