|
FhSim
3.1.0
Marine systems simulation
|
Uniformly distributed random numbers.
Collaboration diagram for Random:Generates random numbers, uniformly distributed between RandomMin and RandomMax. The user must specify the type of random (constant or variable).
A VariableRandom draws a new number on every accepted step and holds it until the next one, so the output is the same for every integrator and for every evaluation inside a step (Runge-Kutta stages and finite-difference Jacobian columns). OutDot is 0. A ConstRandom draws once. The numbers come from std::mt19937 seeded with Seed: the same Seed gives the same numbers on every run and platform. Give each Src/Random its own Seed when the signals must differ (owner ruling D23).
This function has no inputs.
| Name | Width | Description |
|---|---|---|
| Out | <PortWidth> | The output signal |
| OutDot | <PortWidth> | The derivative of the output signal |
| Name | Width | Description |
|---|---|---|
| PortWidth | The number of elements in the signal. | |
| RandomType | 1 |
A bool variable define the type of random function. Choose a constant random number or a variable random number. The variable must be defined as <ConstRandom> or <VariableRandom>. |
| RandomMin | <PortWidth> |
The lower limit for the random numbers. |
| RandomMax | <PortWidth> |
The upper limit for the random numbers. |
| Seed | 1 | Seed of the random number generator. Default 1, so a run is repeatable. |
There are no initial conditions for this function.
This SimObject is referred to as Src/Random