This function generates a random binary variable with a
continuous inputs x from a Weibull distribution
relation.
The probability of being 1 is calculated from the input
x from a Weibull distribution relation with three
predefined parameters u (threshold, the output would
be 0 if x is bigger than u),
L (normalization faction) and k (shape
factor). Then a random generator generates the output, which should
be a binary variable.
function weibull1DOFF extends Modelica.Icons.Function; input Real x "Continous variable"; input Real u = 1.0 "Parameter defining the Weibull distribution threshold"; input Real L = 1.0 "Parameter defining the Weibull distribution normalization factor"; input Real k = 1.0 "Parameter defining the Weibull distribution shape factor"; input Real dt = 60 "Time step length"; input Integer stateIn[Modelica.Math.Random.Generators.Xorshift1024star.nState] "State of the random number generator"; output Boolean y "Binary variable 0/1"; output Integer stateOut[Modelica.Math.Random.Generators.Xorshift1024star.nState] "New state of the random number generator"; end weibull1DOFF;