modelDistributions
Demonstrates noise with different types of distributions
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
This example demonstrates different noise distributions methods that can be selected for a Noise block. Both noise blocks use samplePeriod = 0.02 s, y_min=-1, y_max=3, and have identical fixedLocalSeed. This means that the same random numbers are drawn for the blocks. However, the random numbers are differently transformed according to the selected distributions (uniform and truncated normal distribution), and therefore the blocks have different output values. Simulation results are shown in the next diagram:
As can be seen, uniform noise is distributed evenly between -1 and 3, and truncated normal distribution has more values centered around the mean value 1.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Period | samplePeriod | 0.02 | Sample period of all blocks |
| Real | y_min | -1 | Minimum value of band for random values |
| Real | y_max | 3 | Maximum value of band for random values |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Noise.GlobalSeed | globalSeed | ||
| Real | uniformNoise_y | uniformNoise.y | |
| Real | truncatedNormalNoise_y | truncatedNormalNoise.y | |
| Integer | n | if time < 0.5 then 12 else 2 | |
| Modelica.Blocks.Noise.UniformNoise | uniformNoise | ||
| Modelica.Blocks.Noise.TruncatedNormalNoise | truncatedNormalNoise |
Revisions
| Date | Description | ||
|---|---|---|---|
| June 22, 2015 |
|