swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Query: Spatially uncorrelated reproducible random values


From: Jan Burse
Subject: Re: Query: Spatially uncorrelated reproducible random values
Date: Wed, 02 Aug 2000 19:32:26 +0200

Dear Nigel

A stream can be generated for example by 
a formula such as:

  x(0)=1
  x(n+1)=x(n)*a mod b.

The simplest parameters that come to my
mind are a=257 and b=8191. Thus for a line 
I would then use
  
  x(n)=a^n mod b.

where x(n) is the magnitude at n. Typically 
a^n will exceed a fixed integer representation. 
But if you look for example at the Java class 
java.math.BigInteger you find the method:

   public BigInteger modPow(BigInteger exponent, BitInteger m)

Which would do the job. A generalisation to many
dimensions seems also possible. But I must admit, I 
didnt test all this.

Best Regards
--
Jan Burse                         SIAM, EAWAG
Scheuchzerstr. 67                 Überlandstr. 133
8006 Zürich                       8600 Dübendorf
tel: +41-1-364 17 66              tel: +41-1-823 55 34


                  ==================================
   Swarm-Modelling is for discussion of Simulation and Modelling techniques
   esp. using Swarm.  For list administration needs (esp. [un]subscribing),
   please send a message to <address@hidden> with "help" in the
   body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]