functionweibullVariableGeneration

Random variable generator from the Weibull distribution

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

Information

This function generates a random variable, from a Weibull distribution with the inputs of lambda and k. The random variable might be the duration of a specific event, for instance the time to keep the HVAC on.

The inputs lambda and k defines the probability density function. lambda is similar to the mean value of exponential distribution, and k defines the shape. A value of k = 1 means the Weibull distribution reduces to an exponential distribution. Genrally speaking, higher lambda and higher k indicate a higher chance to generate a higher output.

Inputs

TypeNameDefaultDescription
ReallambdaParameter defining the Weibull distribution scale factor
RealkParameter defining the Weibull distribution shape factor
Integer[Modelica.Math.Random.Generators.Xorshift1024star.nState]stateInState of the random number generator

Outputs

TypeNameDefaultDescription
RealyRandom variable generated from Weibull Distribution
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.