Often, you want to see the effect of changing multiple parameters on the performance of your design. For example, you might want to know how the gain or bandwidth of a design is affected when you vary multiple components across a range of values. Sometimes, the variation of the component values can also be nested - varying a component for each changed value of another component. In simple words, you want to sweep a design to determine the relationship of parameter variations to performance. You can use Parametric Plotter to sweep any number of design and model parameters in any combinations and view results in Plot/Probe in a tabular or plot form.

You need to determine the answers to the following three questions before you start with parametric plots: What performance you want to measure, which components you will vary and in what order, and how you will vary the value of the components?

Most often the choice of components to be swept and the performance being measured are closely tied to each other. For example, on running transient analysis on a circuit, overshoots or spikes are seen and it is observed that the spikes can be reduced by increasing the values of a resistor and a capacitor in the circuit. However, increasing the value leads to power dissipation across the resistor. The measurements will then be overshoot and power dissipation against the resistor and the capacitor values.

Once you have identified the components, you can vary the values using any of the following four sweep types:

**Discrete Sweep**: Specify the parameter values in the order they are to be used. For example, you can specify 10, 85, 63 as the three values to be assigned to a resistor. The first simulation will be run using 10 Ohms, followed by the second using 85 Ohms, and the third using 63 Ohms.**Linear Sweep**: Specify the start value, the end value, and a step value. The simulation will start with the start value, followed by values incremented by the specified step value till the final value is reached. For example, assume a start value of 10, an end value of 50, and a step value of 15. The simulation will run for the following values: 10, 25, and 40.**Logarithmic Octave sweep**: Specify the start value, the end value, and the number of points per octave. An octave is twice the start value. Assume that the start value is 10, the end value is 50, and the number of points per octave is 2. Two points will be picked between 10 and 20, including 20. But the end is 50, so another two points will be picked between 20 and 40, including 40. But because 50 is more than two octaves from the start value, an extra point will be picked. Each point will be calculated using the following formula to calculate a factorial:

exp(ln(2)/N), where N is the number of points.

The factorial in the example is 1.4142. Multiplying the start number with the factorial gives 14.142. Therefore, the two points in the first octave are 14.142 and 20. Calculating similarly, the simulation will be run for the following values: 10, 14.142, 20, 28.284, 40, and 56.569.

**Logarithmic Decade Sweep**: Specify the start value, the end value, and the number of points per decade. A decade is ten times the start value. Assume that the start value is 10, the end value is 100, and the number of points per decade is 5. Five points will be picked between 10 and 100, including 100. Each point will be calculated using the following formula to calculate a factorial:

exp(ln(10)/N), where N is the number of points.

The factorial in the example is 1.8489. Multiplying the start number with the factorial gives 15.8489, the second point. Multiplying the second point by the factorial gives 25.1189. Calculating similarly, the simulation will be run for the following values: 10, 15.8489, 25.1189, 39.8107, 63.0957, and 100.

The total number of simulation runs will depend upon the number of components and what values are specified for each component. For example, if in a nested sweep, the first component is swept for 10 values and the second component is swept for 15 values, the total number of simulations will be 150.

You will use the *RF Amplifier* demo design (*File* – *Open* – *Demo Designs*) in OrCAD® Capture to follow along with the steps. If you are using another design, you might want to run a transient simulation or AC analysis and create the measurements of interest in PSpice A/D. You can also create measurements in PSpice Advanced Analysis.

### Selecting Parameters and Specifying Sweep Types

To specify sweep types, do the following:

- In OrCAD Capture, choose
*PSpice*–*Advanced Analysis*–*Parametric Plot*. - In the Sweep Parameters table, click the text
*Click here to import a parameter from the design property map*.

The Select Sweep Parameters Component Filter dialog appears.

First, you will select component R6 and specify a linear sweep setting with default values.

- Click in the
*Sweep Type*column for R6 and choose*Linear*. - Click in the
*Sweep Values*column for R6.

The Sweep Settings dialog appears.

Notice that the default start value is 47 and the end value is 4700. The step value is 470 and the number of steps is 10.

- Click
*OK*to retain the default settings. - Similarly, specify linear sweep for R4 and retain the default values.
- Click
*OK*to close the Select Sweep Parameters Component Filter dialog.

There will be a total of 100 simulations as each parameter will be swept for 10 values.

### Specifying Measurements and Running Simulation

You will observe the effect of value change on the bandwidth and gain of the circuit. You can either import measurements created in PSpice A/D by clicking the text *Click here to import a Measurement created within PSpic*e or right-click and choose *Create New Measurement*.

- Create or import the following two measurements: max(db(v(load))) and bandwidth(v(load),3).

- Click
*Start/Resume*( ) to run Parametric Plot.

The number of sweeps is 100.

The Results tab shows the outcome of the sweep.

You can select and copy any part of the table or the entire table to the clipboard for use in other applications.

- Observe the nesting order of the table.

For each value of R6, the different values of R4 and the equivalent measurements are given.

You can double-click a column header to sort the data by that column in ascending or descending order.

You can click the lock icon of a given column while sorting another column. This allows you to change the nesting order of the sweep without simulating.

#### Adding a Plot

You can also add a plot to show the relationship between parameters and measurements graphically.

To add a plot, do the following steps:

- Click
*Plot Information*. - Click the text
*Click here to add a plot*to start the Plot Wizard. - Select the
*ac*.*sim*profile and click*Next*. - Select
*R4*as the parameter to be plotted on the X-axis. - Click
*Next*. - Select the bandwidth measurement expression for the Y-axis.
- Click
*Next*. - Select
*R6*as the parameter to be varied. - Click
*Finish*.

The plot is listed under Plot Information.

- Right-click and choose
*Display Plot*.

The plot of bandwidth versus R4 and R6 is displayed.

- To see information specific to a trace, right-click the trace and choose
*Trace Information*.

### Conclusion

This concludes our series on Advanced Analysis. You can refer to the following earlier posts:

- Smoke Analysis: Managing the Stress Levels of Design Components
- Sensitivity Analysis: Creating Predictable Designs Using Sensitivity Analysis
- Optimization:
- Using Measurements: How to Use Measurements to Optimize Your Design
- Using Curve-fitting: Using Curve-Fitting to Optimize a Design

- Monte Carlo: Using Monte Carlo to Make Sense of Randomness and Calculate Yield

**Contact Us**

For any feedback, including any topic you want to be covered, write to us at pcbbloggers@cadence.com.

Do SUBSCRIBE to be updated about upcoming blogs.

**About (P)SPiceItUp**

The (P)SpiceItUp series provides solutions to analog and mixed-signal simulation and analysis-related tasks performed using PSpice A/D or PSpice Advanced Analysis. Our vision, as reflected by the logo and the title of this series, is to make the critical simulation and analysis activities easy and enjoyable. Our regular new blog posts cover every aspect of analysis and simulation, including modeling and schematic design preparation.