Dear Steven,
 
I write a part of code to generate a source which has random phase and 
orientation in time,
  
(set! *random-state* (seed->random-state (current-time))); you mentioned put 
this at the top of the .ctl file in a former mail, I am not sure if is needed 
now.
...
 
(define ss (make contiunous-src (frequency f) (fwidth df)))
(set! sources (list  (make source (src ss) (center 0) (component Ex) (amplitude 
(exp (* 0+2i pi (random:uniform))))
                     (make source (src ss) (center 0) (component Ey) (amplitude 
(exp (* 0+2i pi (random:uniform))))
                     (make source (src ss) (center 0) (component Ez) (amplitude 
(exp (* 0+2i pi (random:uniform))))
)                             
..
 
Am I right?
 
I know If I want a bunch of sources, I need to write a loop. I think I need to 
write the loop inside (set! sources (list...)), because (set! sources...) will 
replace the former source when a outside loop call (set! sources...) every 
time. Am I right? How to write a loop inside (set! sources (list...))?
 
Thanks.
 
sincerely,
Li 
 
 
>Just add a bunch of sources, one for every point where you want a  
>dipole, with random phases.

>e.g. (exp (* 0+2i pi (random:uniform))) returns a random complex phase  
>factor.

>If you need the phases to be varying randomly in time as well, then  
>you would need to use the custom-src object to specify the time- 
>dependence (see the reference manual).

>Steven

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

Reply via email to