We introduce a new finite-difference time-domain algorithm to directly
solve Maxwell's equations based on nonstandard finite differences. Th
is algorithm is some 10,000 times more accurate than the standard one
on a coarse grid. Although computational load per grid point is greate
r, it is more than offset by a large reduction in the total number of
grid points needed to solve a given problem. In addition, algorithm st
ability is greater, so that the number of iterations needed is also re
duced. While optimum performance is achieved at a fixed frequency, the
accuracy is still higher than that of the standard-algorithm over mod
erate bandwidths. The algorithm is implemented in Fortran 90 and can e
asily model spatially variant media and irregular boundaries. By displ
aying one. or more fields per wave period we obtain on-line movielike
visualizations of the electromagnetic fields while the computation is
running. (C) 1997 American Institute of Physics.