Sweep/Step Analysis
Sweep, or Step, analysis allows the user to modify any parameter within the circuit file. These swept parameters are then applied to the types of analyses as specified within the circuit file.
Sweep/Step Command Editor
There are six different types of variables that can be swept, they are:
The total number of simulations which will be run is determined by the maximum number of swept values specified and the number of simulation commands found in the circuit file.
The Sweep/Step Command Editor dialog box is analogous to the .step command within circuit description files.
NOTE: You are not allowed to step more than one variable at a time when using .STEP analysis.
General statement format:
.step [analysis type (frequency)] [lin] + <sweep_variable> <start_value> <end_value> + <increment_value>
or
.step [analysis type (frequency)][oct][dec] + <sweep_variable> <start_value> <end_value> + <points_value>
.step [analysis type (frequency)] + <sweep_variable> list <value>*
Examples:
.step npn qnl(bf) list 60 90 120 .step dec npn qnl(is) 1e-17 1e-10 6 .step lin temp -30 120 20 .step param vsupply list 10 12 14 16 18 20 .step oct param tf 2ns 200ns 4 .step vin 2v 12v 2v .step op vin 2v 12v 2v .step tran param vsupply list 10 12 14 16 18 20 .step ac(1MEG) npn qnl(tf) list 60 90 120
Important: In general, .DC, .TEMP and .STEP/.SWEEP are not allowed to vary the same variable (model parameter, parameter, or TEMP) in the same circuit file. Therefore, the following commands are illegal (to prevent any two from appearing in the same circuit file): .TEMP 30 40 50 .DC TEMP LIN 30 90 10 .STEP TEMP LIST 60 90 120
Analysis type can be one of the following:
Only AC analysis can take a parameter. This parameter is the frequency at which the AC analysis is performed.
Sweep variable can be one of the following:
1. An independent source name, either current or voltage.
2. A model parameter name:
3. model_type model_name(model_parameter)
Example: npn qnl(bf)
4. A global parameter name:
param param_name
Example: param vsupply
5. Temperature (in °C ):
temp
The sweep can be linear, logarithmic, or a list of values. The default is linear.
Step Analysis Example
Input File, step1.cir:
* Project STEP No 1 R1 VIN VCENT 1K R2 FOUT 0 2K C1 VCENT 0 239PF C2 FOUT 0 80PF L1 VCENT FOUT 212U VIN VIN N154 PULSE ( 0V 100MV 0NS 0 0 100US 200US ) V0 N154 0 AC 1 0 Q1 AMP1 FOUT N163 Q2N3903 R3 N186 AMP1 2K R4 N163 0 1K V180 N186 0 DC 15V R5 N186 FOUT 2K .DC TEMP LIN 10 90 10 *.STEP TEMP list 0 60 100 .STEP NPN Q2N3903(bf) list 60 100 120 *.AC DEC 10 1KHZ 10MEGHZ .PROBE/CSDF V([AMP1]) .PROBE/CSDF V([VCENT]) .PROBE/CSDF V([FOUT]) .OPTIONS ACCT NODE LIST * *.TEMP 20 40 60 * .model q2n3903 NPN( is = 2.96568e-15 dev=10% va = 40 dev=10% tf = 6.36943e-10 + ne = 1.2851 ise = 2.14091e-14 bf = 100 ikf = 0.05 + mje = 0.345335 cje = 4.38552e-12 mjc = 0.286574 cjc = 3.62782e-12) .END
Waveforms in DR. SPICE:
Step Analysis Output File