functionexponentialVariableGeneration

Random variable generator from the exponential distribution

Extends from Modelica.Icons.Function (Icon for functions).

Information

This function generates a random variable, from a exponentuial distribution with the input of mean mu. The random variable might be the duration of a specific event, for instance the time to keep the HVAC on.

The input mu denotes the mean value of the exponential distribution. Higher mu indicates a higher chance to generate a larger output y.

Inputs

TypeNameDefaultDescription
RealmuMean exponential distribution
Integer[Modelica.Math.Random.Generators.Xorshift1024star.nState]stateInState of the random number generator

Outputs

TypeNameDefaultDescription
RealyRandom number
Integer[Modelica.Math.Random.Generators.Xorshift1024star.nState]stateOutNew state of the random number generator

Revisions

  • December 6, 2024, by Michael Wetter:
    Refactored implementation of random number calculations, transfering the local state of the random number generator from one call to the next.
    This is for #4069.
  • October 3, 2023, by Michael Wetter:
    Initialized localSeed.
    This is for #3549.
  • July 20, 2018, by Zhe Wang:
    First implementation.