Chapter 26

Monte Carlo

Abstract

The Monte Carlo analysis was introduced in Chapter 10. In summary, the Monte Carlo analysis is used to estimate the statistical performance of a circuit by randomly varying component tolerances and model parameter tolerances between their specified tolerance limits. The generated component values are based upon statistical distributions. The circuit analysis (DC, AC, or transient) is repeated a number of specified times using newly generated component and model tolerance values. Increasing the number of simulation runs will increase the spread of component tolerance values used for each simulation. The statistical results will give an indication on the robustness or yield of circuit performance to a range of different component values within their tolerance limits. However, using regular PSpice A/D, you can only run one Monte Carlo analysis for each defined measurement whereas Advanced Analysis lets you define multiple measurements for a single Monte Carlo analysis. You can also add tolerances to any SPICE model and subcircuit parameter. This will enable you to run Monte Carlo analysis on third party models or models downloaded from manufacturer's website.

Keywords

Circuit analysis; Tolerance values; Simulation; PSpice; Transient; Density function; Probability density function; Cumulative density function

26.1 Introduction

The Monte Carlo analysis was introduced in Chapter 10. In summary, the Monte Carlo analysis is used to estimate the statistical performance of a circuit by randomly varying component tolerances and model parameter tolerances between their specified tolerance limits. The generated component values are based upon statistical distributions. The circuit analysis (DC, AC, or transient) is repeated a number of specified times using newly generated component and model tolerance values. Increasing the number of simulation runs will increase the spread of component tolerance values used for each simulation. The statistical results will give an indication on the robustness or yield of circuit performance to a range of different component values within their tolerance limits. However, using regular PSpice A/D, you can only run one Monte Carlo analysis for each defined measurement whereas Advanced Analysis lets you define multiple measurements for a single Monte Carlo analysis. You can also add tolerances to any SPICE model and subcircuit parameter. This will enable you to run Monte Carlo analysis on third party models or models downloaded from manufacturer's website.

The Monte Carlo results can be shown as either a probability density function (PDF) or as a cumulative distribution function (CDF), together with a summary of the statistical data. Monte Carlo yield results can also be updated for alternate specifications by adjusting and defining the appropriate limits using maximum and minimum cursors on the PDF display. Fig. 26.1 shows the results of a Monte Carlo simulation being displayed in PDF format. The number of graphical bins can be increased for finer statistical resolution and different data can be generated by changing the default random seed value. This is useful if you want to compare different data sets using the same number of Monte Carlo runs. The raw data from the simulations can also be accessed from the Raw Measurements tab seen in Fig. 26.1.

Fig. 26.1
Fig. 26.1 Probability distribution function.

Only components or model parameters that have a tolerance value defined will be included in a Monte Carlo simulation. Monte Carlo starts with a nominal run (number one) by setting component tolerances to zero. Successive runs are numbered such that you can selectively rerun Monte Carlo for component values of interest without having to rerun the simulation again. Monte Carlo uses a default random seed number of 1 when running a simulation. If you change the seed number, then this will enable you to collect a different set of data with the same number of runs previously specified. The maximum number of runs depends on the how much system memory you have available.

The component and model parameter deviations from the nominal values up to the tolerance limits are determined by a probability distribution curve. By default, the distribution curve is flat or uniform, that is, each value has an equal chance of being used. The other option is the Gaussian distribution which is the more familiar bell-shaped curve commonly used in manufacturing. Component values are more likely to take on values found near the center of the Gaussian distribution compared to the outer edges of the tolerance limits. The distribution is characterized by the mean value (μ) and the standard deviation that is called sigma (σ). The standard deviation is a measure of the spread in measured values about the mean value. For a spread of one sigma (1σ) deviation, there is a probability that 68.26% of all the measured values are within that range. Advanced Analysis Monte Carlo calculates 3σ (99.73% probability) and 6σ (99.999998%) as well as the Mean and Median. The mean is the sample mean that is calculated from all the measured values divided by the total number of runs, whereas the Median is the measured value that represents the middle value of all the measured values.

The PDF gives an indication as to the number of measured values that fall into small specific ranges displayed as histograms or bins. The outline of the histograms then gives an indication to the distribution of measured values. The CDF is obtained from the integration of the PDF. The CDF in effect accumulates the probabilities from the PDF so that the probability of a measured value being less than or equal to a specified range can be determined by the cumulative number of runs on the y-axis of the CDF (Fig. 26.2).

Fig. 26.2
Fig. 26.2 Cumulative distribution function.

Monte Carlo uses five standard tolerance value distributions; Flat, Gauss, Gauss0.4, BIMD4.2, and Skew4.8. These distributions are defined in text files and can be found in:

< install path > oolspspicelibrarydistribution

You can create your own distributions in the form of a text file that you place in the distribution folder. These distributions are readily available with the Advanced Analysis parameterized components. Fig. 26.3 shows the PSpice model for the 2N3904 from the advanlsjn library. Once the tolerances have been set, the distribution is selected from the pull down menu.

Fig. 26.3
Fig. 26.3 2N3904 parameterized PSpice model.

If you are not using parameterized models, you can enter the distribution and tolerance to the model text parameter in the PSpice model editor text. For example,

     BF = 200 dev/gauss0.4 = 40%

     BF = 200 dev/BIMD4.2 = 20%

     BF = 200 Skew4.8Q = 20%

Note

You can use the TOL_ON_OFF property to exclude a component from a Monte Carlo simulation even if a tolerance value has been defined for that component. Use the Property Editor to add the TOL_ON_OFF property and assign a value of either OFF or ON accordingly.

26.2 Exercise

Exercise 1

Fig. 26.4 shows the optimized power supply circuit from Chapter 25. You will need to have set up a transient analysis and created measurement expressions as in steps 1 to 6 of Exercise 1 of Chapter 25.

Fig. 26.4
Fig. 26.4 Optimized voltage regulator circuit.

1. From the Optimizer results, resistor R1, R2, and R3 values were optimized with 1% resistor values. Assign a tolerance of 1% to resistors R1, R2, and R3 if not already assigned. Assign a 5% tolerance to the load resistor R4.

2. From Capture, select PSpice > Advanced Analysis > Monte Carlo.

3. From the top tool bar, select Edit > Profile Settings…. Set the Number of Runs to 100, the Number of Bins to 20 (Fig. 26.5), and click on OK.

Fig. 26.5
Fig. 26.5 Setting number of runs to 100 and Number of Bins to 20.

4. In the Statistical Information window, click on, Click here to import a measurement created within PSpice …. Select V(out) and I(R4) and click on OK.

5. Run the simulation by clicking on the play button.

6. You should see similar results to that in Fig. 26.6. The distribution for V(out) shows that there are possible output voltages down toward 8.870 V and the median is 8.9678 V. Ideally the median should have a value of 9 V with an equal distribution either side. The distribution is not symmetrical about the mean but the values are within the specified 9 V ± 5%.

Fig. 26.6
Fig. 26.6 Probability distribution function.

7. To take a measurement over a range of values, click once on the Min or Max cursor that will change from black to orange and then move and click to new position. If you mess up, rmb > Zoom Fit to rescale the PDF display.

8. Right mouse click in the PDF display and select MC Graph (PDF/CDF) to display the CDF distribution as shown in Fig. 26.7.

Fig. 26.7
Fig. 26.7 Cumulative distribution function.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.149.168