[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Waldhäuser Str. 64, D-72076 Tübingen, Germany
[Uni logo]


RANDOMP Source code in randomp.pro

RANDOMP

Name
       RANDOMP
Purpose
       Generates an array of random numbers distributed as a power law.
Calling Sequence
       RANDOMP, X, Pow, N, [ RANGE_X = [low,high], SEED= ]'
Input Parameters
       Pow:  Exponent of power law.
               The pdf of X is f_X(x) = A*x^pow, low <= x <= high
Astronomers Please Note
               pow is little gamma  = big gamma - 1 for stellar IMFs.
       N:    Number of elements in generated vector.
Optional Input Keywords
       RANGE_X:  2-element vector [low,high] specifying the range of
               output X values; the default is [5, 100].
Optional Keywords
       SEED:    Seed value for RANDOMU function.    As described in the
               documentation for RANDOMU, the value of SEED is updated on
               each call to RANDOMP, and taken from the system clock if not
               supplied.   This keyword can be used to have RANDOMP give
               identical results on different runs.
Output Parameters
       X:    Vector of random numbers, distributed as a power law between
               specified range
Procedure
       "Transformation Method" for random variables is described in Bevington
       & Robinson, "Data Reduction & Error Analysis for Physical Sciences", 2nd
       Edition (McGraw-Hill, 1992). p. 83.
       Output of RANDOMU function is transformed to power-law
       random variable.
Example
       Create a stellar initial mass function (IMF) with 10000 stars
       ranging from 0.5 to 100 solar masses and a Salpeter slope.  Enter:
       RANDOMP,MASS,-2.35,10000,RANGE_X=[0.5,100]
Note
       Versions 5.1.1 and V5.2 of IDL have a bug in RANDOMU such that the SEED
       value is initialized to the same value at the start of each session,
       rather than being initialized by the system clock.    RANDOMP will be
       affected in a similar manner.
Revision History
       Written by R. S. Hill, Hughes STX, July 13, 1995
       July 14, 1995   SEED keyword added at Landsman's suggestion.
                    Documentation converted to standard format.  RSH
       Converted to IDL V5.0   W. Landsman   September 1997

Last modified by pro2html on 2001 April 26 at 03:13 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically