On Thu, 17 Aug 2006, hb wrote:
I have some qusetions:
1) How to write a loop?
2) The phases of the sources is random, but I have not find a function
to generate random number. How to solve the problem?
The answer to both your questions can be found at:
http://ab-initio.mit.edu/wiki/index.php/Guile_and_Scheme_links
Loops are described on that page. Random number generation is described
in the Guile Reference Manual linked to from that page. In particular,
you'll want to use
(random:uniform)
to get a uniform pseudo-random number in [0,1). In order to generate
different random numbers each time you run meep, you need to set the seed
to a value based on e.g. the time. Put this at the top of your .ctl file:
(set! *random-state* (seed->random-state (current-time)))
Steven
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss