.Modelica_Noise.Math.Random.Generators

Information

This package contains various pseudo random number generators. A random number generator is a package that consists of the following elements:

In order to have consistent interfaces, the function explained above should be extended from the Interfaces provided in package Interfaces.

The Generators package contains the xorshift suite of random number generators from Sebastiano Vigna (from 2014; based on work of George Marsaglia). The properties of these random number generators are summarized below and compared with the often used Mersenne Twister (MT19937-64) generator. The table is based on http://xorshift.di.unimi.it/ and on the articles:

Sebastiano Vigna: An experimental exploration of Marsaglia's xorshift generators, scrambled, 2014.
Sebastiano Vigna: Further scramblings of Marsaglia's xorshift generators, 2014.

Summary of the properties of the random number generators:

Property xorshift64* xorshift128+ xorshift1024* MT19937-64
Period 2^64 2^128 2^1024 2^19937
Length of state (# 32 bit integer) 2 4 33 624
Statistic failures (Big Crush) 363 64 51 516
Systematic failures (Big Crush) yes no no yes
Worst case startup > 1 call > 20 calls > 100 calls > 100000 calls
Run time (MT=1.0) 0.39 0.27 0.33 1.0

Further explanations of the properties above:

The xorshift random number generators are used in the following way in the Blocks.Noise package:

  1. Xorshift64star (xorshift64*) is used to generate the initial internal state vectors of the other generators from two Integer values, due to the very good startup properties.
  2. Xorshift128plus (xorshift128+) is the default random number generator used by the blocks in Blocks.Noise. Since these blocks hold the internal state vector for every block instance, and the internal state vector is copied whenever a new random number is drawn, it is important that the internal state vector is short (and still has good statistical properties as shown in the table above).
  3. Xorshift1024star (xorshift1024*) is the basis of the impure function Math.Random.Utilities.impureRandom which in turn is used with Blocks.Noise.GlobalSeed.random. The internal state vector is not exposed. It is updated internally, whenever a new random number is drawn.

Note, the generators produce 64 bit random numbers. These numbers are mapped to the 52 bit mantissa of double numbers in the range 0.0 .. 1.0.

Contents

NameDescription
 Xorshift64starRandom number generator xorshift64*
 Xorshift128plusRandom number generator xorshift128+
 Xorshift1024starRandom number generator xorshift1024*

Revisions

Date Description
June 22, 2015
Initial version implemented by A. Klöckner, F. v.d. Linden, D. Zimmer, M. Otter.
DLR Institute of System Dynamics and Control


Generated at 2024-11-21T19:25:40Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos