modelAutomaticSeed
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
This example demonstrates manual and automatic seed selection of UniformNoise blocks, as well as starting the noise at startTime = 0.5 s with an output value of y = -1 before this time. All noise blocks in this example generate uniform noise in the band y_min=-1 .. y_max=3 with samplePeriod = 0.01 s.
The blocks automaticSeed1, automaticSeed2, automaticSeed3 use the default option to automatically initialize the pseudo random number generators of the respective block. As a result, different noise is generated, see next diagram:
The blocks manualSeed1, manualSeed2, manualSeed3 use manual selection of the local seed (useAutomaticLocalSeed = false). They use a fixedLocalSeed of 1, 2, and 3 respectively. Again, different noise is generated, see next diagram:
Try to set fixedLocalSeed = 1 in block manualSeed2. As a result, the blocks manualSeed1 and manualSeed2 will produce exactly the same noise.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Time | startTime | 0.5 | Start time of noise |
| Real | y_off | -1.0 | Output of block before startTime |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Real | manualSeed1_y | manualSeed1.y | |
| Real | manualSeed2_y | manualSeed2.y | |
| Real | manualSeed3_y | manualSeed3.y | |
| Modelica.Blocks.Noise.GlobalSeed | globalSeed | ||
| Modelica.Blocks.Noise.UniformNoise | automaticSeed1 | ||
| Modelica.Blocks.Noise.UniformNoise | automaticSeed2 | ||
| Modelica.Blocks.Noise.UniformNoise | automaticSeed3 | ||
| Modelica.Blocks.Noise.UniformNoise | manualSeed1 | ||
| Modelica.Blocks.Noise.UniformNoise | manualSeed2 | ||
| Modelica.Blocks.Noise.UniformNoise | manualSeed3 |
Revisions
| Date | Description | ||
|---|---|---|---|
| June 22, 2015 |
|