Package Modelica.​Math.​Random.​Examples
Examples demonstrating the usage of the functions in package Random

Information

This package contains examples demonstrating the usage of the functions in package Random.

Extends from Modelica.​Icons.​ExamplesPackage (Icon for packages containing runnable examples).

Package Contents

NameDescription
GenerateRandomNumbersGenerate random numbers with the various random number generators

Model Modelica.​Math.​Random.​Examples.​GenerateRandomNumbers
Generate random numbers with the various random number generators

Information

This example demonstrates how to utilize the random number generators of package Math.Random.Generators in a Modelica model. The example calculates random numbers in the range 0 .. 1 of the available random number generators periodically with a sample period of 0.05 s. Simulations results are shown in the figure below:

Extends from Modelica.​Icons.​Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
PeriodsamplePeriod0.05Sample period for the generation of random numbers
IntegerglobalSeed30020Global seed to initialize random number generator
IntegerlocalSeed614657Local seed to initialize random number generator
IntegeridUtilities.initializeImpureRandom(globalSeed)A unique number used to sort equations correctly