peter-gr said:A simple 1-D FDTD code in matlab with ABC is given below.
% 1-D FDTD code
KE=200 ;%KE is he number of cells to be used
%Main FDTD Loop
ex(k)=ex(k) + 0.5*(hy(k-1)-hy(k));
%Gaussian pulse in the middle
%Absorbing Boundary Conditions
%End of FDTD Loop
Absorbing Boundary ... So in one time step of the FDTD algorithm,it travels:
The above equation explains that it takes two time steps for a wave to cross one cell.So a common sense approach tells as that a common boundary condition would be Ex(0)=Ex(n-2)(1)
It is relativeley easy to implement this.Store a value of Ex(1) for two time steps and then put it in Ex(0).