Monte Carlo Solution Setups
To run a Monte Carlo Analysis with a simple DC analysis, use the following syntax:
.DC SWEEP MONTE=mval [FIRSTRUN=firstval]
To run a Monte Carlo analysis with a DC sweep, use the following syntax:
.DC variable sweep_specSWEEP MONTE=mval [FIRSTRUN=firstval]
To run a Monte Carlo analysis with Transient analysis, use the following syntax:
.TRANstepstoptimeMONTE=mval [FIRSTRUN=firstval]
In the Monte Carlo setup, the value (mval) specified for the MONTE keyword sets the number of Monte Carlo trials to be run. The random value generator can be set to start at a definite seed value by setting the SEED option (See Monte Carlo Analysis Options).
Here are some examples. Suppose the Monte Carlo parameters have been set up with the following statements (from a previous example):
.PARAM indiv=AUNIF(0, 0.05)
...
Rtest1 Vin 0 R='0.1 + indiv'
Rtest2 Vin 0 R='0.5 + 10*indiv'
Now, to run a DC analysis using ten random resistance values for each resistor:
.DC SWEEP MONTE=10
To run a set of Monte Carlo analyses during each iteration of a DC sweep:
.DC Vin V LIN 0.1 0.5 5 SWEEP MONTE=10
The previous example would execute five iterations of the voltage sweep, with ten Monte Carlo variations in each iteration, for a total of 50 analyses.
To run a transient analysis with the same Monte Carlo parameters:
.TRAN 1e-3 10e-2 SWEEP MONTE=10
The FIRSTRUN parameter runs the Monte Carlo simulation
starting with random value number firstval, and continuing through
random value number (mval minus 1). Random values 1 through
(firstrun-1) are discarded. The FIRSTRUN parameter can
be used with the SEED option to partition a Monte Carlo analysis
over separate runs. Any Monte Carlo analysis that starts with a given
SEED setting runs through the same sequence of random values.
So, for example, you could run ten trials with the following netlist:
.OPTION SEED=5
...
.TRAN 0.1 10 SWEEP MONTE=10
And later, modify the netlist as follows to do the next ten trials:
.OPTION SEED=5
...
.TRAN 0.1 10 SWEEP MONTE=21 FIRSTVAL=11
The FIRSTVAL entry causes Nexxim to run the Monte Carlo analysis, discarding the first ten random values, then execute transient simulations using Monte Carlo values 11 through 20.
If a solution setup does not specify a Monte Carlo distribution, the nominal or mean value will be used as the value of any Monte Carlo netlist parameter that is referenced by an instance or model parameter, when that solution is run.
You can specify a Monte Carlo distribution for one or more analyses, but use the nominal values of Monte Carlo netlist parameters for other analyses set up in the netlist. For example, using the netlist from the previous examples:
.PARAM indiv=AUNIF(0, 0.05)
...
Rtest1 Vin 0 R='0.1 + indiv'
Rtest2 Vin 0 R='0.5 + 10*indiv'
.DC
.TRAN 1e-3 10e-2 SWEEP MONTE=10
The DC analysis uses the nominal value (zero) for the Monte Carlo parameter indiv. The transient analysis sweeps the Monte Carlo parameter over the specified distribution.