for negative dielectric constant, how to set grid size?
Grid resolution should be no larger than lambda/10 where lambda is the smallest wavelength of interest inside the materials with the highest refractive index. You can choose your grid resolution this way:
1. Compute refractive index:
n = sqrt(er*ur);
2. Compute the absolute value of the real part of the refractive index:
n = abs(real(n));
3. Compute grid resolution
dx = lam_min/n/10;
Since you are interested in a negative dielectric constant, are you modeling metals? Are you using FDTD with a dispersion model? If so, there is another pitfall that will make your simulations go unstable. In metals, the refractive index can be less than one and you need to consider this when computing the time step in FDTD. If you are using a frequency-domain simulation, then no worries.
-Tip
Thanks a lot, rrumpf. I got it. Yes, I'm planning to modeling metal.
You may be interested in looking at Chapter 4 of my dissertation. I describe in pretty good detail FDTD for modeling metals. Section 4.3.1 (pp. 102-103) describes the modification for computing the time step for models including metals. In addition, Table 4-1 (pp. 95) lists Lorentz-Drude parameters for several metals.
Find my dissertation here:
https://www.edaboard.com/download.php?id=124081
Good luck!
-Tip