block NormalNoise "Noise generator with normal distribution"
import distribution = Modelica.Math.Distributions.Normal.quantile;
extends Modelica.Blocks.Interfaces.PartialNoise;
parameter Real mu = 0 "Expectation (mean) value of the normal distribution"
annotation (Dialog(enable = enableNoise));
parameter Real sigma(start = 1) "Standard deviation of the normal distribution"
annotation (Dialog(enable = enableNoise));
initial equation
r = distribution(r_raw, mu, sigma);
equation
when generateNoise and sample(startTime, samplePeriod) then
r = distribution(r_raw, mu, sigma);
end when;
annotation (
Icon(
coordinateSystem(
preserveAspectRatio = false,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Text(
visible = enableNoise,
extent = {
{-66, 92},
{94, 66}},
lineColor = {175, 175, 175},
textString = "mu=%mu"),
Text(
visible = enableNoise,
extent = {
{-70, -68},
{94, -96}},
lineColor = {175, 175, 175},
textString = "sigma=%sigma")}),
Documentation(
info = "<html>\n<p>\nA summary of the common properties of the noise blocks is provided in the documentation of package\n<a href=\"modelica://Modelica.Blocks.Noise\">Blocks.Noise</a>.\nThis NormalNoise block generates reproducible, random noise at its output according to a normal distribution.\nThis means that random values are normally distributed with expectation value mu and standard deviation sigma.\n(see example <a href=\"modelica://Modelica.Blocks.Examples.NoiseExamples.NormalNoiseProperties\">NoiseExamples.NormalNoiseProperties</a>).\nBy default, two or more instances produce different, uncorrelated noise at the same time instant.\nThe block can only be used if on the same or a higher hierarchical level,\nmodel <a href=\"modelica://Modelica.Blocks.Noise.GlobalSeed\">Blocks.Noise.GlobalSeed</a>\nis dragged to provide global settings for all instances.\n</p>\n</html>",
revisions = "<html>\n<table border=1 cellspacing=0 cellpadding=2>\n<tr><th>Date</th> <th align=\"left\">Description</th></tr>\n\n<tr><td> June 22, 2015 </td>\n <td>\n\n<table border=0>\n<tr><td>\n <img src=\"modelica://Modelica/Resources/Images/Blocks/Noise/dlr_logo.png\">\n</td><td valign=\"bottom\">\n Initial version implemented by\n A. Klöckner, F. v.d. Linden, D. Zimmer, M. Otter.<br>\n <a href=\"http://www.dlr.de/rmc/sr/en\">DLR Institute of System Dynamics and Control</a>\n</td></tr></table>\n</td></tr>\n\n</table>\n</html>"));
end NormalNoise;