Random voltage source

The TRRANDOM option yields statistically distributed voltage values, derived from the ngspice random number generator. These values may be used in the transient simulation directly within a circuit, e.g. for generating a specific noise voltage, but especially they may be used in the control of behavioral sources (B, E, G sources 5, voltage controllable A sources 12, capacitors 3.2.8, inductors 3.2.12, or resistors 3.2.4) to simulate the circuit dependence on statistically varying device parameters. A Monte-Carlo simulation may thus be handled in a single simulation run.

General Form:

TRRANDOM(TYPE TS <TD <PARAM1 <PARAM2>>>)

Examples:

VR1 r1  0 dc 0 trrandom (2 10m 0 1) $ Gaussian

TYPE determines the random variates generated: 1 is uniformly distributed, 2 Gaussian, 3 exponential, 4 Poisson. TS is the duration of an individual voltage value. TD is a time delay with 0 V output before the random voltage values start up. PARAM1 and PARAM2 depend on the type selected.

TYPE
description
PARAM1
default
PARAM2
default
1
Uniform
Range
1
Offset
0
2
Gaussian
Standard Dev.
1
Mean
0
3
Exponential
Mean
1
Offset
0
4
Poisson
Lambda
1
Offset
0