Discussion:
[Meep-discuss] Complex field in meep
adrian
2009-03-05 05:12:48 UTC
Permalink
  Hi Meep users and Steven:
    I know this question has been discussed but I can't find the answer to previous poster.
    My question is:

    1. what is the definition of complex field in FDTD. Is it just E0*exp(j(wt - kr)) and the real field and imaginary field correspond to real part and imaginary part, respectively?
      If so, if we set force-complex-fields? false, then the real field we normally got is E0 times cos(wt - kr)?
      I try to reach "Complex field in meep"  but it requires password. so I can't find the definition of complex fields in meep.

     The purpose for getting complex field is to get the far field patterns from the near field patterns calculated by meep

Thanks in advanced

Adrian
  



______________________________________________________________________________________________________
付費才容量無䞊限Yahoo!奇摩電子信箱2.0免費絊䜠信件氞遠䞍必刪 http://tw.mg0.mail.yahoo.com/dc/landing
adrian
2009-03-06 21:31:32 UTC
Permalink
  Hi Zheng:
        I finally figure out your approach after reading one website as below:

     http://www.martinos.org/~adunn/papers/dissertation/node36.html
 
   I think that's what you mean.
   However, I am thinking if anyway in meep to accumulate the field in one period without storing fields in each time step for postprocess. Since if we have to do so, then it takes a huge disk space.

   so my question is: can we write a function in meep to sum up the field respect to time (or integrate field respect to time ) in one period and only output the accumulated field?

Thanks a lot

Cheers
Adrian



--- 09/3/6 (五)Zheng Li <***@mails.tsinghua.edu.cn> 寫道

寄件者: Zheng Li <***@mails.tsinghua.edu.cn>
䞻旚: Re: [Meep-discuss] Complex field in meep
收件者: "adrian" <***@yahoo.com.tw>
日期: 2009 3 6 五 䞋午 4:17






Hi, adrian,



You need to get fields' complex parts by yourself. 

1, accumulate fields at every point of the surface you like for a
period of time

2, retrieve what you want via applying FFT to the data in the
time-domain.

3, apply spatial FFT to those complex number arrays.



Yours

Zheng

2009-3-6



adrian 写道:





Hi Zheng:

    Thanks for your reply.

    However, if I'd like to use FFT then I need real part and imaginary
part of the field and that's why I have to compute the complex field.

   What I try to figure out is if the definition of complex field is
the same as what I said:

     E0*exp(j(wt-kr))

   and real field I obtain is the real part of that formula and
imaginary field is the imaginary part of the formula.

   If it is true, I may put the real field and imaginary field at one
time step from meep into FFt formula to get Far field patterns.



   Thanks a lot



Cheers

Adrian





 



--- 09/3/5 (四)Zheng Li <***@mails.tsinghua.edu.cn>
寫道



寄件者: Zheng Li <***@mails.tsinghua.edu.cn>

䞻旚: Re: [Meep-discuss] Complex field in meep

收件者: "adrian" <***@yahoo.com.tw>

日期: 2009 3 5 四 䞋午 3:40



Hi, adrian,



If you only simulate the dielectric structures, you  needn't utilize
complex fields because it may consume two-fold memory and CPU.   Yet,
if metals or other materials are involved, complex fields is the only
choice to you.



To complete the far-to-near field calculation, you might manipulate the
obtained fields with FFT method in both of the time and spacial
domains.



Yours,

Zheng

2009-3-5





adrian 写道:




  Hi Meep users and Steven:

    I know this question has been discussed but I can't find the answer
to previous poster.

    My question is:



    1. what is the definition of complex field in FDTD. Is it just
E0*exp(j(wt - kr)) and the real field and imaginary field correspond to
real part and imaginary part, respectively?

      If so, if we set force-complex-fields? false, then the real field
we normally got is E0 times cos(wt - kr)?

      I try to reach "Complex field in meep"  but it requires password.
so I can't find the definition of complex fields in meep.



     The purpose for getting complex field is to get the far field
patterns from the near field patterns calculated by meep



Thanks in advanced



Adrian

  















付費才容量無䞊限Yahoo!奇摩電子信箱2.0免費絊䜠信件氞遠䞍必刪 - 銬
䞊體驗




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



















付費才容量無䞊限Yahoo!奇摩電子信箱2.0免費絊䜠信件氞遠䞍必刪 - 銬
䞊體驗










______________________________________________________________________________________________________
付費才容量無䞊限Yahoo!奇摩電子信箱2.0免費絊䜠信件氞遠䞍必刪 http://tw.mg0.mail.yahoo.com/dc/landing
Steven G. Johnson
2009-03-07 00:04:14 UTC
Permalink
Post by adrian
I finally figure out your approach after reading one website
http://www.martinos.org/~adunn/papers/dissertation/node36.html
I think that's what you mean.
However, I am thinking if anyway in meep to accumulate the field
in one period without storing fields in each time step for
postprocess. Since if we have to do so, then it takes a huge disk
space.
so my question is: can we write a function in meep to sum up the
field respect to time (or integrate field respect to time ) in one
period and only output the accumulated field?
If you want to accumulate the field at all points in space, the
simplest way is to save it to a temporary file. You can delete each
file after it is accumulated, so disk space is independent of run
time. This has been discussed previously on the mailing list; see e.g.

http://thread.gmane.org/gmane.comp.science.electromagnetism.meep.general/1455/focus=1456

Steven
adrian
2009-03-06 21:37:05 UTC
Permalink
   Hi Zheng:
    I should make my question clearer.
    If I'd like to calculate the equation:
   
       sum Ex(r,t)*cos(w*t) over one period,
 
  can it be done in meep or I have to do postprocess, say to save field in each time step?

  Thanks

Cheers
Adrian





--- 09/3/6 (五)Zheng Li <***@mails.tsinghua.edu.cn> 寫道

寄件者: Zheng Li <***@mails.tsinghua.edu.cn>
䞻旚: Re: [Meep-discuss] Complex field in meep
收件者: "adrian" <***@yahoo.com.tw>
日期: 2009 3 6 五 䞋午 4:17






Hi, adrian,



You need to get fields' complex parts by yourself. 

1, accumulate fields at every point of the surface you like for a
period of time

2, retrieve what you want via applying FFT to the data in the
time-domain.

3, apply spatial FFT to those complex number arrays.



Yours

Zheng

2009-3-6



adrian 写道:





Hi Zheng:

    Thanks for your reply.

    However, if I'd like to use FFT then I need real part and imaginary
part of the field and that's why I have to compute the complex field.

   What I try to figure out is if the definition of complex field is
the same as what I said:

     E0*exp(j(wt-kr))

   and real field I obtain is the real part of that formula and
imaginary field is the imaginary part of the formula.

   If it is true, I may put the real field and imaginary field at one
time step from meep into FFt formula to get Far field patterns.



   Thanks a lot



Cheers

Adrian





 



--- 09/3/5 (四)Zheng Li <***@mails.tsinghua.edu.cn>
寫道



寄件者: Zheng Li <***@mails.tsinghua.edu.cn>

䞻旚: Re: [Meep-discuss] Complex field in meep

收件者: "adrian" <***@yahoo.com.tw>

日期: 2009 3 5 四 䞋午 3:40



Hi, adrian,



If you only simulate the dielectric structures, you  needn't utilize
complex fields because it may consume two-fold memory and CPU.   Yet,
if metals or other materials are involved, complex fields is the only
choice to you.



To complete the far-to-near field calculation, you might manipulate the
obtained fields with FFT method in both of the time and spacial
domains.



Yours,

Zheng

2009-3-5





adrian 写道:




  Hi Meep users and Steven:

    I know this question has been discussed but I can't find the answer
to previous poster.

    My question is:



    1. what is the definition of complex field in FDTD. Is it just
E0*exp(j(wt - kr)) and the real field and imaginary field correspond to
real part and imaginary part, respectively?

      If so, if we set force-complex-fields? false, then the real field
we normally got is E0 times cos(wt - kr)?

      I try to reach "Complex field in meep"  but it requires password.
so I can't find the definition of complex fields in meep.



     The purpose for getting complex field is to get the far field
patterns from the near field patterns calculated by meep



Thanks in advanced



Adrian

  















付費才容量無䞊限Yahoo!奇摩電子信箱2.0免費絊䜠信件氞遠䞍必刪 - 銬
䞊體驗




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



















付費才容量無䞊限Yahoo!奇摩電子信箱2.0免費絊䜠信件氞遠䞍必刪 - 銬
䞊體驗










______________________________________________________________________________________________________
付費才容量無䞊限Yahoo!奇摩電子信箱2.0免費絊䜠信件氞遠䞍必刪 http://tw.mg0.mail.yahoo.com/dc/landing
Steven G. Johnson
2009-03-07 18:35:36 UTC
Permalink
Thanks Steven.
How about the definition for complex field in meep?
I tried to find it in meep reference but I need log in to that
page.
This doesn't make any sense to me --- I just checked, and I can view
the Meep Reference page without "logging in" to the page. See:

http://ab-initio.mit.edu/wiki/index.php/Meep_Reference#source
Er+j*Ei=E0*exp(j*w*t) ?
I suspect that your question needs to be rephrased.

The "definition" of a complex field is just the field in response to a
complex current (or complex initial conditions).

For example, if you turn on force-complex-fields? and you put in a
complex current pulse, you get a complex-valued pulse in E, not a CW
field as in your formula above.

Perhaps what you meant to ask is how the complex current is defined
for a continuous-wave source. This is described at the link I defined
above: a CW current source is proportional to
exp(-i w t)
for an angular frequency w ( = 2 * pi * frequency). The resulting
electric field (after initial transients die away) will also be
proportional to exp(-i w t) in this case.

Similarly for Gaussian pulses, etcetera. The point is that Meep
follows the "physics" sign convention that an angular frequency w
corresponds to exp(-i w t) time dependence, not the "engineering" sign
convention of exp(+ i w t).
And when forced-complex-fields? is false, the normal value we
get is E0*cos(w*t), which should be equal to Er.
When force-complex-fields? is false, the complex current is replaced
by its real part. The corresponding electric field is also replaced
by its real part (in linear media).

Whether this is E0*cos(w*t) will depend on your current source. Even
if you have a CW current at a frequency w, the time dependence of the
*electric* field (after transients have died away) won't necessarily
be cos(w*t), because in general there is a phase difference between
the current and the resulting fields. So, in general for a CW source
you will eventually get fields proportional to cos(w*t - phi) for some
phases phi (depending on the field component, the position, and the
geometry).

The only thing Meep-specific in all of the above is the sign
convention for the frequency; everything else is simply a consequence
of Maxwell's equations.

Steven
Steven G. Johnson
2009-03-08 05:02:46 UTC
Permalink
If we go to meep reference page and see category: input variables
we can find the explanation for force-complex-fields?
"See also: Complex fields in Meep. " the last sentence of the
paragraph ,
the page popping up will show a message that you have to log in
to edit.
That's what I mean I have to log in.
That means that the page doesn't exist yet; I was thinking of writing
a more detailed discussion at some point, but haven't done so yet.

Steven

Continue reading on narkive:
Loading...