|
FhSim
3.1.0
Marine systems simulation
|
Sample and hold.
Collaboration diagram for Samplifier:Samplifier is a SimObject that samples the input signals in a sample-and-hold fashion. It can simulate a variety of real-world properties in the sampled signal. The following things can be configured to happen with the output signals:
The random draws use std::normal_distribution and std::uniform_real_distribution on a std::mt19937 seeded with NoiseSeed. The engine is portable, but the standard leaves the distributions' transforms to the library, so a given NoiseSeed reproduces the same sequence with one standard library only. Other libraries give a different sequence with the same statistics.
| Name | Width | Description |
|---|---|---|
| In1 .. In<PortWidth> | n_i | Vector inputs. The dimension of each input is inferred from the configuration parameter's dimension. |
| Name | Width | Description |
|---|---|---|
| Out1 .. Out<PortWidth> | n_i | Vector outputs samplified. |
| <Tags> | <PortWidth> | Named outputs (Optional). |
| Name | Width | Description |
|---|---|---|
| NoiseSeed | 0 or 1 | Seed number for random generator (Optional). |
| PortWidth | 1 | Number of std::vector input signals. |
| Tags | <PortWidth> or 0 | Named output ports (Optional). |
| SamplingPeriod<1..PortWidth> | n_i | List of positive sampling periods. |
| FirstSampleTime<1..PortWidth> | n_i or 0 | List of first available sample times. Note that the sample will be available on the first time step after the sampling instant. Default is \(-\infty\). |
| TimeDelay<1..PortWidth> | n_i or 0 | List of non-negative time delays. Default is zeros. |
| OutlierProbability<1..PortWidth> | n_i or 0 | List of probabilities for outliers. Default is zeros. |
| LossProbability<1..PortWidth> | n_i or 0 | List of probabilities for loss of signal. Default is zeros. |
| AvgLostSamples<1..PortWidth> | n_i or 0 | List of average number of lost signals (when loss). Default is zeros. |
| NoiseBias<1..PortWidth> | n_i or 0 | List of bias (mean) for each noisy output. Default is zeros. |
| NoiseStdDev<1..PortWidth> | n_i or 0 | List of standard deviations. Default is zeros. |
| Name | Width | Description |
|---|---|---|
| SamplifierDummy | 1 | Internal placeholder state with zero derivative. It carries no meaning, is set to 0 by InitialConditionSetup, and need not be given in the model. |
This SimObject is referred to as Signal/Samplifier