On Wed, 28 Mar 2007, Nils Jensen wrote:
In your suggestion, you mention about the function that let us compute
the instantaneous flux at a single time step. How can I define it in my
MEEP program?
" No. You can't use the integrated flux spectrum for a CW source
because the source does not cover a finite time interval. (Remember,
the flux spectrum is computed by integrating the Fourier transform of
the fields, but this is problematic if the fields never go to zero.). It
would be better just to use the functions that let you compute the
instantaneous flux at a single time step."
You want the flux-in-box function, as described in the Meep reference. To
use it, I would do something like:
(define ((display-flux-in-box dir box))
(print "flux:, " (meep-time) ", " (flux-in-box dir box) "\n"))
(run-until 100 (at-every 1.0 (display-flux-in-box X
(volume (center 5 0 0) (size 0 1 2)))))
This outputs the flux in the X direction, through a 1x2 plane at x=5,
every 1.0 time unit (modify as needed).
Note the double parentheses in the definition of display-flux-in-box.
These mean that the result of calling (display-flux-in-box dir box) is not
to immediately print out the flux...rather it is to return a *function*,
of no arguments, that prints out the flux when called. That is because
the arguments you pass to run-until (etc.) should be *functions* that are
called at every time step. See also the section "Run and step functions"
in the Meep reference manual.
See the documentation for flux-in-box, in the Meep reference manual, for
more information.
Steven
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss