In some situations, you might see a negative Q-factor, and this is obviously wrong. This post discuss one possible reason that can cause a false Q value from a simulation.
High Q cavities
If this is a high Q cavity, light can be trapped within the cavity for a long time. As a results, it is not very efficient to wait for the simulation to finish and take the ratio of the resonant frequency and delta_f. Instead, we use another approach to look at a portion of the decaying signal to find Q.
This approach relies a lot on the slope, m. Normally, m should be negative and makes Q a positive number. If the resonance is so strong (fields decay very slowly), the wiggling of the fields can sometimes cause a positive slope and makes a negative Q value. For example,negative_Q_value.fsp (244.8 KB), modified from the Whispering Gallery example.
If the system has no gain, the fields should eventually decay. One way to solve this problem is to increase the simulation time to include more data in the time domain to calculate the slope. For this test file, from 500 fs to 5000 fs.
This can ensure that the slope is negative and thus a positive Q value.