On Jul 29, 2008, at 3:50 AM, Jefferson Thomas wrote:
> Thank you for your reply.
> What suggestion do you mean ? I dont see any suggestion in Steven's  
> mail.
> Sure I can calculate Q using longer intervals and it is exactly what I
> am doing now.

Computing the energy in the entire cell and plotting it as a function  
of time is not a very good way to compute Q, in my experience.  You  
really only need the field at a single point in the cavity as a  
function of time.  And rather than fitting it yourself, it is usually  
better to use harminv (i.e. in my experience harminv will give you a  
more accurate Q with fewer data points than fitting the energy or  
field amplitude to a decaying exponential, especially if you use a  
relatively narrow-bandwidth source around your cavity frequency).

(There are also other ways besides harminv, e.g. there is a nice  
method involving Pade approximants that is sometimes even better.  But  
again, that only involves the fields at a single point in the cavity  
as a function of time.)

> Of course I understand when you say that the generality has higher
> priority. I perfectly agree. But I also think that finding
> the total energy is a pretty common and important task and it deserves
> its own optimized function

Finding the total energy in the computation at *every time step* is  
not a common task in my experience.  I personally have never needed to  
do so except in artificial testing situations.  Doing it usually  
indicates that you are making a mistake, as seems to be the case  
here.  Optimizing mistakes is definitely not a priority.

Steven

_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to