登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
时域有限差分法 FDTD
>
新手请教问题,谢谢高手指教呀
发帖
回复
1051
阅读
3
回复
[
求助
]
新手请教问题,谢谢高手指教呀
离线
thiker_2009
UID :58085
注册:
2010-04-26
登录:
2010-06-02
发帖:
2
等级:
旁观者
0楼
发表于: 2010-05-18 17:06:53
下面是一个一维的FDTD算法,其中的scfact=dt/muz/dx是什么意思和用途呀
tB-0wD=PR
谢谢高手指点。
CHxu%-g
clear
BWRM gN'.
%***********************************************************************
X.^S@3[
% Fundamental constants(基本常量)
AG?cI@',
%***********************************************************************
M@\A_x(Mas
cc=2.99792458e8; %speed of light in free space
3sUTdCnNf
muz=4.0*pi*1.0e-7; %permeability of free space(真空中磁导率)
1yHlBeEC
epsz=1.0/(cc*cc*muz); %permittivity of free space(真空中介电常数)
<7-Qn(m,
freq=1.0e+9; %frequency of source excitation(激励源的周期,频率)
3^NHVg
lambda=cc/freq; %wavelength of source excitation(激励源的波长)
c8'a<<sj
omega=2.0*pi*freq;%(角频率 =欧米噶)
90ZMO7_
%***********************************************************************
$J]VY;C!
% Grid parameters (网格参量)
XNODDH
%***********************************************************************
yb{ud
ie=200; %number of grid cells in x-direction(X轴向的格点数)
X;[$yW9hE
ib=ie+1;
X)P;UVR0
dx=lambda/20.0; %space increment of 1-D lattice(空间步长条件:dx=<lambda/12)
'vbrzI5m
dt=dx/cc; %time step(时间步长条件:dt=<sqir(2)*dx/2*cc)
X6hm,0[
omegadt=omega*dt;
`r?xo7
nmax=round(12.0e-9/dt); %total number of time steps(12.0e-9计算可得,时间步数)
PL*Mz(&bf
%***********************************************************************
Y|%s =0M
% Material parameters(材料背景参量)
-2Bkun4Pt
%***********************************************************************
-.XICKz
eps=1.0;%(介质电导率)
tkQ#mipAj
sig=5.0e-3;%(电导率)
[1Cs
%***********************************************************************
/Z':wu\
% Updating coefficients for space region with nonpermeable media(非渗透性材料)
<0R$yB
%***********************************************************************
\v|nRn,`-
scfact=dt/muz/dx;%(??????)
OUo N
ca=(1.0-(dt*sig)/(2.0*epsz*eps))/(1.0+(dt*sig)/(2.0*epsz*eps));
4}C^s\?z
cb=scfact*(dt/epsz/eps/dx)/(1.0+(dt*sig)/(2.0*epsz*eps));
hsYS<]
%***********************************************************************
IY$v%%2WZ
% Field arrays (场列阵)
UEkn@^&bg
%***********************************************************************
K ?R* )_
ez(1:ib)=0.0;
`[.b>ztqgJ
hy(1:ie)=0.0;
t]dtBt].:
%***********************************************************************
&~9'7 n!
% Movie initialization (初值化)
k&TZ
%***********************************************************************
\OR=+\].9
x=linspace(dx,ie*dx,ie);
w +pK=R
subplot(2,1,1),plot(x,ez(1:ie)/scfact,'r'),axis([0 3 -1 1]);
,0j7qn@tm
ylabel('EZ');
'E_M,Y
subplot(2,1,2),plot(x,hy,'b'),axis([0 3 -3.0e-3 3.0e-3]);
[w>T.b
xlabel('x (meters)');ylabel('HY');
!'yCB9]O
rect=get(gcf,'Position');
H[H+s!)"
rect(1:2)=[0 0];
SQ$|s%)oB
M=moviein(nmax/2,gcf,rect);
zVeQKN9^Z
%***********************************************************************
t(d$v_*y51
% BEGIN TIME-STEPPING LOOP(时间步循环)
&`]Lg?J
%***********************************************************************
Kyn[4Bu!?
for n=1:nmax
x}\_o< d
%***********************************************************************
|AgdD
% Update electric fields
FBDRb J su
%***********************************************************************
(T&rvE
ez(1)=scfact*sin(omegadt*n);
\W%Aeg*c
rbc=ez(ie);
pK_n}QW
ez(2:ie)=ca*ez(2:ie)+cb*(hy(2:ie)-hy(1:ie-1));
h`{agWB
ez(ib)=rbc;
k&oq6!ix
%***********************************************************************
_f^JXd,7v
% Update magnetic fields
ZeB"k)FI>
%***********************************************************************
kfb*|
hy(1:ie)=hy(1:ie)+ez(2:ib)-ez(1:ie);
cD&Q