-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lorentzian check reports instability even when stable #12
Comments
@FilipDominec, wouldn't the normal way to proceed be to perform a Von Neumann stability analysis for a homogeneous material? Trial-and-error does not inspire confidence, although it can be a useful first step. I haven't thought about this for a while, but the Because the check is performed outside the |
|
I'm just reluctant to implement a stability criterion in Meep which is purely empirical, because I don't know how trustworthy it is. I'd prefer to be overly conservative than to be overly permissive. |
@stevengj I can understand your point. It is indeed beyond my capabilities (and allocated time) to mathematically prove the two rules posted above, and it may be they have no mathematical background at all or later turn out to be just an approximation. But the currently implemented criterion is known to systematically give wrong results, and it does so in a restrictive way (which eventually made me to wipe it out of the sources and recompile meep to proceed). I believe it can not be of any harm if this stability check for the 1st rule, whatever its implemenation be, just displays a warning and lets one run the simulation at their own risk. |
In fact, both rules I realized by blind experimentation are more or less contained in the MEEP documentation. The first rule, limiting the frequency of an oscillator, is mentioned in 2nd paragraph here: The second rule is hidden e.g. in the definition of the Courant factor http://ab-initio.mit.edu/wiki/index.php/Meep_Reference, if one rewrites minimum refractive index to arguably more exact formulation minimum real part of refractive index, measured at the frequency 1/(π Δ_t_). I think this is all in all a beautiful result; everything suggests the necessary conditions to avoid numerical instabilities in FDTD are already contained in the docs. |
@stevengj Two years later, my experience only confirms what I suggested above. The built-in stability check in MEEP should be replaced for the benefit of MEEP users - no matter that it might have been mathematically derived in any way. It is often falsely positive (simulation is aborted when it would be perfectly stable otherwise), and falsely negative (one can design materials that pass the test, but make the simulation unstable. |
For now, the stability check has been disabled. If people notice a simulation blowing up, it is up to them to reduce the Courant factor. |
I would like to open the broad question of FDTD numerical stability. By trial-and-error I isolated two independent criteria of how a definition of a material can make the simulation unstable (the third mechanism of unstable PML for grazing incidence wave has been resolved in MEEP 1.2). In the treatise that follows, I tried to describe these two criteria.
In last 3 years I tested different materials thoroughly and these rules seem to hold so far (though I have no theory why).
What does not always hold, however, is the corresponding function `lorentzian_unstable' (in src/susceptibility.cpp). MEEP checks for the position of the oscillator pole in the frequency complex plane, based on some mathematics that I admit not to understand yet, and sometimes reports false positives. In the cases near the edge of stability it reports instability and aborts.
I experimentally verified that by disabling the function, recompiling and running the same simulation again, no instability developed even in very long time.
Of course, there are also false negatives, due to the second criterion: The simulation goes unstable whenever the permittivity at high frequencies is too low.
I suggest that first of all, the `lorentzian_unstable' should be changed to a warning only, it should be called only once after the initialisation (not in n-times every step), and no matter what the outcome, the simulation should continue. In the future, we should thoroughly test out the hypothesis attached below. This starts to be a bit experimental research instead of programming, but with so many people computing some plasmonics etc, it is important to make it clear.
Looking forward to your comments!
Filip
The text was updated successfully, but these errors were encountered: