PS Random Number
R2026bGenerate normally distributed random numbers for physical modeling
Libraries:
Simscape /
Foundation Library /
Physical Signals /
Sources
Description
The PS Random Number block generates normally (Gaussian) distributed random numbers. To generate uniformly distributed random numbers, use the PS Uniform Random Number block.
The block behavior is the same as the Simulink® Random Number block (except that it generates a physical signal rather than a Simulink signal) and is based on the polar rejection method ([1], [2]).
You have an option to specify an initial time offset as part of the Sample
time parameter. In this case, the block outputs 0 until the simulation time
reaches the offset value, at which point the random sequence
starts.
PS Random Number blocks that use the same seed and parameters generate a repeatable sequence. The seed resets to the specified value each time a simulation starts. By default, the block produces a sequence that has a mean of 0 and a variance of 1.
Ports
Output
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"fl_lib/Physical Signals/Sources/PS Random Number"
Example: add_block("fl_lib/Physical Signals/Sources/PS Random Number","myModel/myBlock",MakeNameUnique="on")
For information about programmatic access to individual block parameters, see the Programmatic Use section of parameter descriptions on this page.
References
[1] Bell, J. R. “Algorithm 334: Normal random deviates.” Communications of the ACM. Vol. 11, Number 7, 1968, p. 498.
[2] Knop, R. “Remark on Algorithm 334 [G5]: normal random deviates.” Communications of the ACM. Vol. 12, Number 5, 1969, p. 281.
