On Tue, Apr 10, 2012 at 05:58:20PM +0200, Filip Dominec wrote:
> Thanks for the hint. Although it took me a while again, my python-meep
> script now records the field in two points and after the simulation it
> calculates its amplitude and phase spectra, average refractive index
> etc. If anybody is interested, the current version (2012-04-10) of the
> script is at http://fzu.cz/~dominecf/misc/meep/sphere.py .
> 
> However, I am using the get_field() function, which gives the field
> intensity in one point. See how two different monitor (x, y) positions
> give different values:
> http://fzu.cz/~dominecf/misc/meep/rt_example1.png (x=50%, y=50%)
> http://fzu.cz/~dominecf/misc/meep/rt_example2.png (x=75%, y=50%)
> (Grey underlay "energy by MEEP" in the top graph is the exact,
> integrated value measured by the flux_plane.)
> I may average many points manually, but I would prefer to use some
> built-in field-averaging function. Do you know some elegant answer?

You can use the built in integrate-field-function and divide by the bounds,
or output to a HDF file and take the average that way.  

As for elegance, you seem to be doing something akin to s-parameter
retrieval.  In my experience this whole business is a little iffy:  the
methods in the papers I've read haven't had a lot of repeatability, and
I've spoken to more than one person who has expressed serious doubts as to
the integrity of the method's results.
 
> Aside from this, there were major issues with numerical stability when
> the simulation was ran about 10 times longer than usually. The output
> abruptly started to give unrealistic, oscillating values. This limits
> the spectral resolution of my calculations. Increasing the mesh
> resolution does not help much; shall I modify the Courant constant?
> Does anybody have any experience with this?

You could try, but numerical instabilities are unavoidable in FDTD
simulations.  If you have to solve for some steady state behavior where
energy is building up, frequency domain methods might be a better option.

--
Aaron Webster
 
> Thank you!
> Filip
> 
> 2012/4/9, Aaron Webster <aaron.webs...@mpl.mpg.de>:
> > On Sun, Apr 08, 2012 at 12:42:33AM +0200, Filip Dominec wrote:
> >> Dear Meep users,
> >> I wrote a Python-MEEP simulation of a gaussian pulse passing through a
> >> simple structure. My script can be found at
> >> http://fzu.cz/~dominecf/sphere.py; more information is in this file and I
> >> hope it may even be useful for somebody.
> >>
> >> At the input and output of the simulation volume, there are flux planes
> >> measuring the intensity transmission and reflection spectra, T(f) and
> >> R(f), which are plotted succesfully.
> >>
> >> However, I would like to obtain the complex _amplitude_ spectra of
> >> transmission and reflection, say t(f) and r(f). I believe that Meep knows
> >> these values all the time and only at the end it simply calculates
> >> R(f)=|r(f)|^2 and T(f)=|t(f)|^2.
> >>
> >> But I need to know the complex r(f), t(f) to calculate also the phase of
> >> the passing wave.
> >>
> >> Any hints are appreciated. Thank you in advance!
> >
> > The trick to this is to do the fourier transform yourself.  Instead of your
> > typical reflection/transmission monitors, output the electric field at
> > these points at each timestep, then take the FFT of the resulting data.
> > See here for an example:
> >
> > http://falsecolour.com/aw/meep_ptest.tar.gz
> >
> > In the file getsparams.m.  But be warned!  I was never quite able to work
> > out all the kinks with this method.  There's also post on meep-discuss
> > where Prof. Johnson describes this kind of thing, but again the results are
> > suspicious.
> >
> > --
> > Aaron Webster
> >
> 

_______________________________________________
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