This function returns a random number according to a normal distribution. This means that 99.7 % of the returned random numbers are in the range:
mu-3*sigma ≤ y ≤ mu+3*sigma
This function is only for test purposes. It computes the quantile (= inverse cumulative distribution function) of a normal distribution with a reduced precision of about 1e-7.
For more details of this distribution see Wikipedia.
function quantileNormalSimple extends Modelica.Icons.Function; input Real u(min = 0, max = 1) "Random number in the range 0 <= u <= 1"; input Real mu = 0 "Expectation (mean) value of the normal distribution" annotation( Dialog); input Real sigma = 1 "Standard deviation of the normal distribution" annotation( Dialog); output Real y "Random number u transformed according to the given distribution"; end quantileNormalSimple;
Date | Description | ||
---|---|---|---|
June 22, 2015 |
|