FDTD模拟一维波传播小程序(初学者使用)不太懂
我这有个程序是一本书上FDTD模拟一维吸收条件波传播的,红色部分是吸收条件我看不太懂,哪为大哥帮帮忙详细解释一下啊我只是初学者,谢谢了%One-Dimension Simulation of EM Field(Absorbing Boudary Condition added)
clear
format long;
KE = 200;
kc= 0.5*KE;
t0 = 40;
spread = 12;
T = 0;
ex_low_m1=0;ex_low_m2 = 0;ex_high_m1=0;ex_high_m2=0;
NSTEPS = 285;%Controllable Step Number
ex = zeros(20);
hy = zeros(20);
for i = 1:NSTEPS
T = T+1;
for k=2:(KE-1)
ex(k) = ex(k) + 0.5*( hy(k-1) - hy(k) );
end;
pulse =exp( -0.5 * ((t0 - T)/spread).^2);
ex(kc) = ex(kc) + pulse ;
ex(1) = ex_low_m2;
ex_low_m2 = ex_low_m1;
ex_low_m1 = ex(2);
ex(KE-1) = ex_high_m2;
ex_high_m2 = ex_high_m1;
ex_high_m1 = ex(KE-2);
for k=1:KE-2
hy(k) = hy(k) + 0.5*( ex(k) - ex(k+1) );
end;
i = 1: KE;
subplot(2,1,1),plot(i,ex(i)),ylabel('Ex'),axis()
subplot(2,1,2),plot(i,hy(i),'r'),xlabel('x'),ylabel('Hy'),axis();
pause(0.05);
end; 应非编程问题, 待高人路过 要看一下原始数学模型是什么样的
再就是看使用的什么样的算法了
页:
[1]