Parameter Sweeps and Sweep Plans
Generally, sweeps of individual parameters can be performed most efficiently from within many of the simulator dialog boxes themselves. The ability to step through a series of values automatically is incorporated into all the standard simulation controllers. Sweeps can be performed at both the circuit and the system level.
The following parameters are typical candidates for sweeping:
- Signal frequency, amplitude, or power
- Bias voltage or current
- Resistance
- Signal path attenuation
- Impedance
- Ambient temperature
- Most component parameters
However, it is possible to combine sweeps of several parameters into a hierarchical sweep plan. By using parameter sweeps, you can do the following:
- Find the bias voltage that yields the best mixer conversion gain.
- Find the load impedance that yields the lowest harmonic distortion.
- Simulate a load-pull measurement.
- Simulate the effects of process variations and temperature on circuit performance.
By selecting the ParamSweep and SweepPlan controllers from any of the simulator palettes, you can sweep a variety of parameters and construct a series of sweep plans for special purposes. See the sections SweepPlan Controller and Parameter Sweep Controller.
Conducting Sweeps
Sweeps of frequencies can be conducted from within many of the simulation controllers themselves, using options available under the Sweep tab where applicable. To sweep a parameter such as power, for example, select a ParamSweep controller from a simulator palette and edit it. It is necessary to ensure that frequency and power variables to be swept are defined appropriately in a source component, such as a P_1Tone component (available in the Sources-Freq Domain library).
If using the Load Sharing Facility (LSF) utility, you can break up a sweep and run the simulation on multiple machines, in parallel, by selecting Parallel Hosts as the Simulation Mode ( Simulate > Simulation Setup ). Individual sweep points are run on each machine and results combined into a single dataset on the local machine. For details on setting up remote and local machines for remote processing, see "Using Remote Simulation" in the installation documentation for your platform:
Using Options under the Simulator Sweep Tab
A variety of simulation options enable you to conduct a simulation for only a single parameter at a single value, or to sweep a parameter over a defined range, either linear or logarithmic. They also enable you to select a named sweep plan that you can define.
Select the Sweep tab in various simulation controllers to do the following:
- Define a parameter to sweep (can be a variable or component parameter)
- Select a sweep type
- Select start, stop, and step sizes
- Select a sweep plan
A parameter entered into the Parameter to sweep field will appear on the schematic in quotes. To display a parameter to sweep so you can edit it directly on the schematic, do the following:
- Select the Display tab.
- Select SweepVar.
- Select Display parameter on schematic, then click OK.
You can then define that parameter directly on the schematic, taking care to place the definition in double quotes.
Using Sweep Controllers
In addition to the sweeps that are provided within various simulators, ParamSweep and SweepPlan controllers are available in each simulation palette. To use these controllers, place and edit them in a schematic as you would other controllers. You must also define the swept parameter in a VAR item. While both of these sweep controllers expand the sweep capability beyond what a simulator provides, they do have differences.
The ParamSweep can be used by itself to sweep a parameter that has been defined. This controller can sweep only in equal increments using single point, linear, or log sweeps. The ParamSweep must also identify the simulator to be used. If a design happens to use additional simulators, you can enter their names in the ParamSweep in the order they should be invoked.
The SweepPlan controller provides more flexibility. It supports more ranges, and a sweep plan can include a single point along with sweeps across a range of values. To use a SweepPlan controller that you have defined, it must be referenced by a ParamSweep or simulation controller. To reference a SweepPlan controller, select Use sweep plan on the ParamSweep or simulation controller, then enter the SweepPlan controller's name. Some simulation controllers do not include access to a SweepPlan. When a SweepPlan is used, its settings override any sweep setup information in a simulator or ParamSweep. Multiple SweepPlans can be chained together by selecting Next Sweep Plan on the SweepPlan controller.
Note
The placement of sweep controllers within a circuit or system design does not affect the order in which parameters are swept. Similarly, the order in which the sweeps are automatically numbered does not determine the order in which they are executed. The order of execution is determined by the order in which one sweep calls another, as determined by the value of the parameter SweepPlan. The simulation or ParamSweep controller calls the first sweep plan to be conducted, whatever it is named.
Basic Procedures
This section presents the following example sweep scenarios:
Note
The appropriate simulators are required to run the following simulations, i.e. a Harmonic Balance simulation requires the Harmonic Balance simulator (included with all Circuit Design suites except the RF Designer suite.). You may build the examples with the appropriate license, you will simply be unable to run the simulations.
Using ParamSweep to Sweep Two Parameters
The next figure below illustrates an example setup that uses a ParamSweep controller (available in all the simulation palettes) to sweep two parameters. In this case, the result is a curve-tracer display of collector current versus Vce for different values of Ibb.
Note
This design, Curve_Tracer.dsn, is in the Examples directory under MW_Ckts/LNA_prj. The results re in Curve_Tracer.dds.
Although it is not necessary for the current design, such a simulation can be used to characterize a device whose I-V relationships are unknown. SRC1 establishes collector-to-emitter voltage Vce. SRC2 establishes base current Ibb. The current probe, Probe1, measures collector current Icc. Note that Probe1 has been named Icc and that Icc.i, the current at this point, will be plotted later.
The procedure for using the ParamSweep controller, in conjunction with a simulator sweep and an equation, is outlined as follows.
Note
The following steps describe the design under discussion. Modify the details to suit your particular needs.
Example setup for a hierarchical sweep
To use the ParamSweep controller to sweep two parameters:
- Use a VarEqn component (available from Component Palette List > Data Items > Var eqn ) to define two variables-an "inner" and an "outer" variable. The inner variable is swept over its full range each time the outer variable is stepped.
- Use a DC Simulation controller to define the parameter to sweep, the inner variable.
- Use a ParamSweep controller to establish a sweep plan for the outer variable.
The following illustrates this procedure in detail.
Define Inner and Outer Variables
- Edit the VarEqn component on the schematic.
- In the Select Parameter field, ensure that the following variables are defined by an equation:
- VCE = 0 V
- IBB = 0 A
These equations are written in the field on the right of the box, with Variable or Equation Entry Mode set to Name=Value.
Note
The simulator requires that all variables be initialized. The above voltage values would be used if no sweep were in effect.
- Click OK.
Define the Inner Variable in the Simulation Controller
- Edit the DC Simulation controller.
- In the Parameter to sweep field, ensure that VCE is entered. VCE is the inner variable, which has been established in the Var/Eqn component.
Note
Variables entered into this field will appear in quotes on the schematic. If you enter a variable directly on the schematic (in this case, as the right-hand side of the SweepVar statement in the DC controller), you must surround the variable with double quotes.
- Ensure that the following parameters are set:
- Sweep Type = Linear
- Start/Stop is selected.
- Click Apply, then OK.
Establish a Sweep Plan for the Outer Variable
- Edit the ParamSweep controller.
- Ensure that the following parameters are set, and make them visible on the schematic:
- Parameter to sweep = IBB. This establishes Idc at SRC2.
- Sweep Type = Linear
- Start/Stop is selected
- Start = 20 µA
- Stop = 100 µA
- Step-size = 10 µA
- Select the Simulations tab, and ensure that DC1 is entered in the Simulation 1 field.
Launch the Simulation and Display Data
- Launch the simulation. The following is a plot of Icc.i:
Information such as that depicted above is useful in deciding whether a device is suitable for a given application where the limiting factors are available voltage and current.
Nesting Parameter Sweeps with Multiple Items
To nest parameter sweeps with multiple parameter sweep items, assign the instance name of the Parameter sweep item associated wih the inner sweep to the SimInstance name [1] parameter of the Parameter sweep item associated with the outer sweep.
Using SweepPlans to Perform Fine and Coarse Sweeps
The next figure below illustrates an example setup for using two SweepPlan controllers (available in all the simulation palettes) to perform a fine sweep of noise figure versus RF frequency, followed by a coarse sweep.
Note
This design, SweptRF_NF.dsn, is in the Examples directory under RFIC/Mixers_prj. The results re in SweptRF_NF.dds.
This simulation uses a Harmonic Balance Simulation controller ( HB ) to call a sweep plan, and that sweep plan, in turn, calls a second sweep plan. A simulation controller cannot call more than one sweep plan.
Note
The following steps describe the design under discussion. Alter the details to suit your particular needs.
To use two SweepPlan controllers to perform a fine and a coarse sweep:
- Use a VarEqn component (available from Component Palette List > Data Items > Var eqn ) to define all frequencies.
- Using two SweepPlan controllers (available in all the simulation palettes), establish two sweep plans-one for a fine sweep and one for a coarse sweep.
- Use a Harmonic Balance Simulation controller ( HB ) to define the parameter to sweep and reference a sweep plan.
Example setup for using two sweep plans
The following topics illustrate this procedure in detail.
Define Frequencies
- Edit the VarEqn component on the schematic.
- In the Select Parameter field, confirm that the following variables are defined by an equation:
- Fif (intermediate frequency) = 70 MHz. This is the noise frequency defined in the Harmonic Balance Simulation controller ( HB ) (see below).
- Frf (RF input frequency) = 1 GHz. This is the input frequency defined in the Harmonic Balance Simulation controller ( HB ) (see below).
- Flo = Frf - Fif. Flo is the frequency assigned to the P_1Tone component at the LO input of the mixer.
These equations are written in the field on the right of the box, with Variable or Equation Entry Mode set to Name=Value.
Note
The simulator requires that all variables be initialized. Although a value of 0 MHz or 0 GHz is sufficient to establish units for a local variable, leaving realistic units on the schematic allows a meaningful simulation to be conducted even when those variables are not swept.
- Click Apply, then OK.
Establish Two Sweep Plans
- From any simulation palette, select the SweepPlan controller and place two of these in the Schematic window.
- Edit the first SweepPlan (Plan1) as follows:
- Sweep Type = Linear
- Start = 300 MHz
- Stop = 1 GHz
- Step = 350 MHz
- Select Next Sweep Plan, and enter Plan2 (to be established in the next step) in the field below the option.
- Edit the second SweepPlan (Plan2) as follows:
- Sweep Type = Linear
- Start = 1 GHz
- Stop = 7 GHz
- Step = 3 GHz
- Because this is the last SweepPlan in this series, do not select Next Sweep Plan or enter a plan name.
Define Sweep Frequencies and Sweep Plan in the Simulation Controller
- Under the Sweep tab of the Harmonic Balance Simulation controller ( HB ), establish the following:
- Parameter to sweep = Frf
Note
Variables entered into this field will appear in quotes on the schematic. If you enter a variable directly on the schematic (in this case, as the right-hand side of the SweepVar statement in the DC controller), you must surround the variable with double quotes.
- Sweep Type = Linear
- Use sweep plan is selected, and the entry in the field is Plan1. You can use the pulldown menu at the right of the field to select the name of a SweepPlan controller.
Other sweep parameter entries will be overridden by values in the SweepPlan controller. - Finally, because this is a noise analysis, also select Nonlinear noise to enable the analysis.
- Parameter to sweep = Frf
- Click Apply, then OK.
Launch the Simulation and Display Data
- Launch the simulation. The following are Rectangular and List plots of noise figure:
Additional Examples
An additional example of a swept-parameter simulation is found in the examples directory, in RFIC/Mixers_prj/networks. IMDLOSwp.dsn uses a ParamSweep controller to sweep LO power in conjunction with harmonic balance simulation.
Recommendations and Tips
This section presents suggestions for using sweeps and improving the accuracy of results.
Ensuring that Sweep Results are Displayed Correctly
Parameter sweeps in the time domain are remarkable only in the way that they affect the adaptive time-step algorithm, which may have possible negative effects when results are displayed in the Data Display window. If the Transient simulator is allowed to use its adaptive time-step algorithm and Max time step is not specified by the simulation controller, the simulator will probably produce results that have irregular data intervals. This does not matter when you are simulating only versus time and not sweeping – that is, when you are attempting to produce only a single trace for each nodal waveform, not a family of traces.
The potential difficulty arises when the Data Display server attempts to display a family of traces, each having different numbers of trace points and irregular spacings. Simply stated, the data cannot be displayed. The Data Display server must have a rectangular array of data. This means that all subtraces must have the same number of points, and that the spacing between the points must be the same as that between the corresponding points in other subtraces. The spacing can be irregular, as long as the distribution of spacing along the x-axis is the same for all traces. The only way to be sure that the Data Display server receives a neatly formatted, rectangular array of data is to specify a value for Max time step. This is especially true of Monte Carlo simulations, which are essentially statistical parameter sweeps.
Controlling the Amount of Data Sent to the Dataset
Time-domain simulations generally take more time and produce more nodal data than do comparable frequency-domain simulations. Hundreds (or even thousands) of time points may be required to simulate the behavior of the circuit accurately. This makes it especially important to minimize the number of time points and swept parameter values. You can control the amount and kind of data sent to the dataset using the Output tab of each analysis controller.
Using Sweeps in Monte Carlo Analysis
It is possible to use sweeps in Monte Carlo statistical analyses with the transient simulator, to the extent that histograms can be generated. Yield percentage analyses are not possible except through the following indirect method.
Note
Monte Carlo analyses are enabled through the use of the Yield and YieldOptim components in the Optim/Stat/Yield palette (under their Parameters tab, enable Random variables to dataset, and establish seed values as appropriate).
Yield percentages can be estimated if the pass/fail yield criterion can be expressed in terms of node voltages and currents at individual time points.
Instead of plotting a histogram, plot the cumulative distribution function (CDF) using the cdf() operator and equations. The CDF increases monotonically from 0 to 1. Insert two markers onto the CDF trace at the limits of the pass/fail criterion. Then use the delta marker mode to find the difference between them. The yield percentage is the difference between the two markers, multiplied by 100. For example, suppose the response of a circuit to a 1.0-V step with a 100-psec risetime is being plotted. The maximum risetime desired from the circuit is 300 psec.
Ask for 100 Monte Carlo trials. Select the time point where the output voltage must be at least 90% (perhaps t = 350 psec). Then plot the CDF multiplied by 100. Insert a marker on the 90% value and another on the maximum value, then examine the difference. This difference is approximately the yield.
Monte Carlo statistical analyses can be regarded as a special type of parameter sweep in which the parameter values are assigned randomly, rather than as a succession of ascending values.
SweepPlan Controller
The options listed in the following table describe the SweepPlan controller's parameters. This controller sweeps a parameter which may be called by a ParamSweep controller or a simulator. It is unitless, as the parameter it sweeps can be any parameter. In the table, names used in netlists and schematics appear under Parameter Name.
Sweep Plan Options
Setup Dialog Name | Parameter Name | Description | |
---|---|---|---|
SweepPlan Instance Name | Enter the name of the SweepPlan controller. The default is SwpPlan1. | ||
Parameter | Use this area in conjunction with the Add button to add Start, Stop, and Step parameters to the schematic. Use the Cut button to remove a parameter set, and Paste to copy one that has been selected. | ||
Sweep Type | |||
Single point | Pt | Enables simulation at a single frequency point. Specify the desired value in the Parameter field. | |
Linear | Enables sweeping a range of values based on a linear increment. Click the Start/Stop option to select start and stop values for the sweep, or Center/Span to set the center value and a span of the sweep. | ||
Log | Enables sweeping a range of values based on a logarithmic increment. Click Start/Stop to set start and stop values for the sweep, or Center/Span to select a center value and a span of the sweep. | ||
Start/Stop Start, Stop, Step-size, Pts./decade, Num. of pts. |
Start Stop Step Dec Lin |
Select the Start/Stop option to sweep based on start, stop, step-size or pts./decade, and number of points. Linear sweep uses Step-size; Log sweep uses Pts./decade. - Start-the start point of a sweep - Stop-the stop point of a sweep - Step-size-the increments at which the sweep is conducted - Pts./decade-number of points per decade - Num. of pts.-the number of points over which sweep is conducted |
|
Center/Span Center, Span, Step-size, Pts./decade, Num. of pts. |
Center Span Step Dec Lin |
Select the Center/Span option to sweep based on center and span, step-size or pts./decade, and number of points. Linear sweep uses Step-size; Log sweep uses Pts./decade. - Center-the center point of a sweep - Span-the span of a sweep - Step-size-the increments at which the sweep is conducted - Pts./decade-number of points per decade - Num. of pts.-the number of points over which sweep is conducted |
|
Note: Changes to any of the Start, Stop, etc. fields causes the remaining fields to be recalculated automatically. | |||
Increasing Order | Reverse=no | Start and progress through sweep from lower to higher values. | |
Decreasing Order | Reverse=yes | Start and progress through sweep from higher to lower values. | |
Next Sweep Plan | UseSweepPlan=yes
SweepPlan= |
Use this field to enter the name of the sweep plan (SweepPlan) to be performed after the current plan. |
Parameter Sweep Controller
This section describes the fields of the Parameter Sweep controller tabs. In the following tables, names used in netlists and schematics appear under Parameter Name.
Parameter Sweep Options
Setup Dialog Name | Parameter Name | Description | ||
---|---|---|---|---|
ParamSweep Instance Name | Enter the name of the sweep controller. The default is Sweep1. | |||
Parameter to sweep | SweepVar | Use this area to select from a variety of sweep types and other parameters. In any parameter sweep, selecting a sweep start point as close as possible to the convergence point and varying the parameter gradually shortens simulation time. This yields better estimates for the next simulation, and achieves convergence more rapidly than if the parameter were changed abruptly. | ||
Parameter sweep | ||||
Sweep Type | ||||
Single point | Pt | Enables simulation at a single frequency point. Specify the desired value in the Parameter field. | ||
Linear | Enables sweeping a range of values based on a linear increment. Click the Start/Stop option to select start and stop values for the sweep, or Center/Span to set the center value and a span of the sweep. | |||
Log | Enables sweeping a range of values based on a logarithmic increment. Click Start/Stop to set start and stop values for the sweep, or Center/Span to select a center value and a span of the sweep. | |||
Start/Stop Start, Stop, Step-size, Pts./decade, Num. of pts. |
Start Stop Step Dec Lin |
Select the Start/Stop option to sweep based on start, stop, step-size or pts./decade, and number of points. Linear sweep uses Step-size; Log sweep uses Pts./decade. - Start-the start point of a sweep - Stop-the stop point of a sweep - Step-size-the increments at which the sweep is conducted - Pts./decade-number of points per decade - Num. of pts.-the number of points over which sweep is conducted |
||
Center/Span Center, Span, Step-size, Pts./decade, Num. of pts. |
Center Span Step Dec Lin |
Select the Center/Span option to sweep based on center and span, step-size or pts./decade, and number of points. Linear sweep uses Step-size; Log sweep uses Pts./decade. - Center-the center point of a sweep - Span-the span of a sweep - Step-size-the increments at which the sweep is conducted - Pts./decade-number of points per decade - Num. of pts.-the number of points over which sweep is conducted |
||
Note: Changes to any of the Start, Stop, etc. fields causes the remaining fields to be recalculated automatically. | ||||
Use sweep plan | SweepPlan | To use a sweep plan that you have defined and named, select this option and enter the name of the plan in the field. |
Simulations Tab
Setup Dialog Name |
Parameter Name |
Description |
---|---|---|
ParamSweep Instance Name |
|
Enter the name of the sweep controller. The default is Sweep1 |
Simulations to perform |
SimInstanceName[n] |
Use this area to enter the name(s) of the simulation(s) you wish to perform. As an example, entering DC1, AC1, and HB3 in the setup dialog box causes the following to appear in the schematic: Simulation 1="DC1", Simulation 2="AC1", and Simulation 3="HB3". |
Display Tab
For information on the Display tab, which enables you to control the visibility of simulation parameters on the Schematic, see the topic Displaying Simulation Parameters on the Schematic.