Hi Steven,

I have been trying to put together a source that emits only to one side by 
combining electric and magnetic sources.  If the electric and magnetic 
sources are identical, then the fields on one side of the sources 
interfere to cancel out, while on the other side they reinforce each other 
(as is of course well known and easy to understand from symmetry 
considerations). 
However, in meep, it seems that the destructive interference is not quite 
complete.

Attached is a simple example in one dimension, a gaussian pulse in empty 
space emitted from the center to the right.  It shows the total energy 
emitted to each side, as well as the flux (it is redundant, I know). 
As an extra, the .ctl file defines a parameter n, the delay of the 
magnetic source with respect to the electric source, in units of 
simulation time steps.  Here is an example run:

$ meep n=0 1d_electric_and_magnetic_source.ctl
command-line param: n=0
-----------
Initializing structure...
Working in 2D dimensions.
time for set_epsilon = 3.24799e-08 s
-----------
energy: 0.00591944535609377
energy: 0.892598771248037
energy (ideal): 0.886226925452758
run 0 finished at t = 20.0 (800 timesteps)
flux1:, 1.0, -0.00154548650201008
flux1:, 1.0, 0.247960040697758
flux (ideal): 0.25

Elapsed run time = 0.75 s
$


For n=0, the ratio flux-to-the-left:flux-to-the-right is 0.015:0.25, as 
you can see above.  For n=1, the ratio turns out to be 9.6e-6:0.25. 
Clearly the cancellation is much better for n=1, suggesting that meep 
evaluates the magnetic source one time step ahead of the electric one.

Of course the update steps for the magnetic and electric fields are half a 
time step apart in the Yee algorithm, and the sources need to be sampled 
half a time step apart.  Could it be that there is a sign problem with 
this half time step in meep?  So the sources are a full step apart instead 
of coinciding?

Best regards,
Mischa


PS:
As a further indication that the electric and magnetic sources are not 
synchronized for n=0:  try increasing the Courant number from 0.5 to 0.99 
(so the numerical dispersion is reduced).  For n=0, the flux to the left 
*increases* (about 4x).  For n=1, the emitted flux decreases (slightly), 
as expected for synchronous sources.

Attachment: 1d_electric_and_magnetic_source.ctl
Description: Binary data

_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to