In this topic:
The sweep specification described in General Sweep Specification can also be applied to define multiple analyses including Monte Carlo analysis. This can be applied to the swept modes .DC, .AC, .NOISE and .TF along with .TRAN. The analyses .SENS and .OP cannot be run in multi-step mode. A multi-step .OP is in fact the same as .DC so this is not required. Monte Carlo analysis is the subject of its own chapter (see Monte Carlo Analysis) but it is invoked in the same way as other multi-step modes. As well as the standard 6 sweep modes, small-signal multi-step analyses can be run in snapshot mode which uses snapshots created by a previous transient analysis.
Multi-step analyses may be nested. That is a multi-step specification can be applied to another multi-step specification. Nesting may be defined to any level.
The general form is:
.analysis_name analysis_parameters SWEEP + [sweep_spec] | [SNAPSHOT STP snapstart snapstop snapstep] | [SCRIPTCOUNT=numscriptruns SCRIPT=script] [ NUMCORES=num_cores] .analysis_name analysis_parameters SWEEP + [reduced_sweep_spec] | [SCRIPTCOUNT=numscriptruns SCRIPT=script] [SWEEP reduced_sweep_spec]... + [ NUMCORES=num_cores]
Where:
.analysis_name | Dot statement for analysis |
analysis_parameters | Specific parameters for that analysis |
sweep_spec | See General Sweep Specification. |
SNAPSHOT | Use snapshots created by a previous transient analysis. For full details, see Snapshots. |
reduced_sweep_spec | Same as sweep_spec but omitting SENS and WC. These modes may not be nested |
snapstart | Index of first snapshot. Snapshots are counted in the order in which they are created. The first is 0. Use STP 0 0 0 to specify all available snapshots. |
snapstop | Index of last snapshot |
snapstep | Snapshot interval (usually 1) |
numscriptruns | Number of repeat steps using script. If present, the script script is called for each step. The script may use the function GetCurrentStepValue() to determine the step number (base 1, i.e. the first step is 1, the second 2 etc.). The functions SetInstanceParamValue() and SetModelParamValue() may be used to change model or instance parameters |
script | Script called for each step |
num_cores | If specified and greater than 1, the work for the run will be shared amongst num_cores processor cores using multiple processes. More information about using multiple cores can be found in User's Manual/Analysis Modes/Using Multiple Cores for Multi-step Analyses. |
.TRAN 1m SWEEP MONTE 10
.TRAN 1m SWEEP MONTE 1000 NUMCORES=4
.TRAN 200u SWEEP DEVICE V1 STP 0 5 0.1
.AC DEVICE=V5 LIN 100 -300m 300m F=100000 + SWEEP PARAM=restail LIN 6 450 550
.AC DEC 100k 10G SWEEP SNAPSHOT STP 0 0 0
.TRAN 200u SWEEP SENS .TRAN 200u SWEEP WC
A special form of multi-step runs an optimisation analysis. This is an alternative to the form that uses the .OPTIMISER statement. The multi-step optimiser mode can only specify a single analysis but runs more quickly especially for small circuits.
.analysis_name analysis_parameters SWEEP OPT + optparams=[parameter_names] + optinitvals=initial_values + [optminvals=minimum_values] + [optmaxvals=maximum_values] + alg=algorithm + [abstol=absolute_tolerance] + [reltol=relative_tolerance] + [iterlim=iteration_limit] + [schematic=schematic_file] + [results_file=results_file] + [show_progress]
.analysis_name | Dot statement for analysis |
analysis_parameters | Specific parameters for that analysis |
parameter_names | Names of parameters whose optimal value will be sought in the optimisation process. This is a list of names separated by commas. Parameters may be used in expressions to define model and instance parameters in exactly the same way as the .PARAM statement |
initial_values | Initial values for the parameters. List of values separated by commas corresponding directly with the parameter names. Values that will be used initially. The optimiser will subsequently adjust these values |
minimum_values | Minimum values for the parameters. List of values separated by commas corresponding directly with the parameter names. The optimiser will not use values less than those specified here |
maximum_values | Maximum values for the parameters. List of values separated by commas corresponding directly with the parameter names. The optimiser will not use values greater than those specified here |
absolute_tolerance | Optimiser will stop when the objective function (defined using .OPTSPEC statement) stabilises to an absolute value controlled by this parameter |
relative_tolerance | Optimiser will stop when the objective function (defined using .OPTSPEC statement) stabilises to a relative value controlled by this parameter |
iteration_limit | Optimiser will stop when this number of iterations reaches this value |
schematic_file | Report purposes only. Path entered here will appear in the final report |
results_file | XML file where full details of the optimiser session will be written. The GUI can read this file and create an HTML report from it |
show_progress | If present, progress messages will be displayed while the optimiser is running |
◄ General Sweep Specification | .AC ▶ |