“LTspice® can be used for statistical tolerance analysis of complex circuits. This article describes methods for tolerance analysis and worstcase analysis using Monte Carlo and Gaussian distributions in LTspice. To demonstrate the effectiveness of this approach, we model a voltage regulation example circuit in LTspice, demonstrating Monte Carlo and Gaussian distribution techniques with an internal reference voltage and feedback resistors.
“
By: Steve Knudtsen, Field Applications Engineer, Analog Devices
Summary
LTspice^{®}Can be used for statistical tolerance analysis of complex circuits. This article describes methods for tolerance analysis and worstcase analysis using Monte Carlo and Gaussian distributions in LTspice. To demonstrate the effectiveness of this approach, we model a voltage regulation example circuit in LTspice, demonstrating Monte Carlo and Gaussian distribution techniques with an internal reference voltage and feedback resistors. The resulting simulation results are then compared to the worstcase analysis simulation results. It includes 4 appendices. Appendix A provides insights on finetuning the reference distribution. Appendix B provides the Gaussian distribution analysis in LTspice. Appendix C provides a graphical view of the Monte Carlo distribution defined by LTspice. Appendix D provides instructions for editing LTspice schematics and extracting simulation data.
This article describes the statistical analysis that can be performed using LTspice. This is not a review of 6sigma design principles, the central limit theorem, or Monte Carlo sampling.
Tolerance Analysis
In system design, parameter tolerance constraints must be considered in order to ensure a successful design. A common approach is to use a worst case analysis (WCA), in which all parameters are adjusted to the maximum tolerance limits. In a worstcase analysis, the performance of the system is analyzed to determine whether the worstcase results are within the system design specifications. The power of worstcase analysis has some limitations, such as:
• Worstcase analysis requires determining which parameters need to be maximized and which need to be minimized in order to arrive at a true worstcase result.
• Worstcase analysis results often violate design specifications, resulting in expensive component selections to obtain acceptable results.
• Statistically, the results of a worstcase analysis are not representative of what is routinely observed; studying a system that exhibits worstcase analysis performance may require the use of a large number of systems under test.
Another alternative to performing system tolerance analysis is to use statistical tools to perform component tolerance analysis. The advantage of statistical analysis is that the resulting distribution of data reflects which parameters are typically measured in a physical system. In this article, we use LTspice to simulate circuit performance using Monte Carlo and Gaussian distributions to account for parameter tolerance variations, and compare them to worstcase analysis simulations.
In addition to some of the issues mentioned about worstcase analysis, both worstcase analysis and statistical analysis can provide valuable insights related to system design. For a tutorial on how to use worstcase analysis when using LTspice, see the article “LTspice: WorstCase Circuit Analysis with Minimal Simulation Runs” by Gabino Alonso and Joseph Spencer.
Monte Carlo distribution
Figure 1 shows the reference voltage modeled in LTspice, using a Monte Carlo distribution. The nominal voltage source is 1.25 V with a 1.5% tolerance. The Monte Carlo distribution was within a 1.5% tolerance, defining 251 voltage states. Figure 2 shows a histogram of 251 values with 50 bins. Table 1 presents the statistical results associated with this distribution.
Figure 1. LTspice schematic for a voltage source (using Monte Carlo distribution)
Figure 2. Monte Carlo simulation results for a 1.25 V reference voltage, presented as a histogram of 50 bars and 251 points
Table 1. Statistical analysis of Monte Carlo simulation results
result 

average value 
1.249933 
minimum 
1.2313 
maximum value 
1.26874 
standard deviation 
0.010615 
positive error 
1.014992 
negative error 
0.98504 
Gaussian distribution
Figure 3 shows the reference voltage modeled in LTspice, using a Gaussian distribution. The nominal voltage source is 1.25 V with a 1.5% tolerance. The Monte Carlo distribution was within a 1.5% tolerance, defining 251 voltage states. Figure 4 shows a histogram of 251 values with 50 bins. Table 2 presents the statistical results associated with this distribution.
Figure 3. LTspice schematic for a voltage source (using a 3sigma Gaussian distribution)
Table 2. Statistical analysis of Gaussian reference simulation results
result 

minimum 
1.22957 
maximum value 
1.26607 
average value 
1.25021 
standard deviation 
0.006215 
positive error 
1.012856 
negative error 
0.983656 
Figure 4. 3sigma Gaussian simulation results for a 1.25 V reference voltage, presented as a histogram of 50 bars and 251 points
The Gaussian distribution is a normal distribution represented by a bellshaped curve, and its probability density is shown in Figure 5.
Figure 5.3 – sigma Gaussian normal distribution
The correlation between the ideal distribution and the Gaussian distribution simulated by LTspice is shown in Table 3.
Table 3. Statistical distribution of the 251point Gaussian distribution simulated by LTspice
simulation 
ideal value 

1Sigma amplitude 
67.73% 
68.27% 
2Sigma amplitude 
95.62% 
95.45% 
3sigma amplitude 
99.60% 
99.73% 
In summary, LTspice can be used to simulate Gaussian or Monte Carlo tolerance distributions of voltage sources. This voltage source can be used to model the reference voltage in a DCDC converter. The LTspice Gaussian distribution simulation results are in good agreement with the predicted probability density distribution.
Tolerance Analysis of DCDC Converter Simulation
Figure 6 shows a schematic diagram of an LTspice simulation of a DCDC converter using a voltagecontrolled voltage source to simulate closedloop voltage feedback. Feedback resistors R2 and R3 are nominally 16.4 kΩ and 10 kΩ. The internal reference voltage is nominally 1.25 V. In this circuit, the nominal regulation voltage V_{OUT}Or the setpoint voltage is 3.3 V.
Figure 6. LTspice DCDC Converter Simulation Schematic
To simulate the tolerance analysis of the voltage regulation, the tolerance of the feedback resistors R2 and R3 is defined as 1%, and the tolerance of the internal reference voltage is defined as 1.5%. This section describes three methods of tolerance analysis: statistical analysis using the Monte Carlo distribution, statistical analysis using the Gaussian distribution, and worst case analysis (WCA).
Figures 7 and 8 show the schematic and voltage regulation histograms simulated using the Monte Carlo distribution.
Figure 7. Schematic of tolerance analysis using Monte Carlo distribution
Figure 8. Voltage regulation histogram simulated using Monte Carlo distribution
Figures 9 and 10 show the schematic and voltage regulation histograms simulated using a Gaussian distribution.
Figure 9. Schematic of tolerance analysis using Gaussian distribution
Figure 10. Histogram of Tolerance Analysis Using Gaussian Distribution Simulation
Figure 11 and Figure 12 show schematics and voltage regulation histograms simulated using worstcase analysis
Figure 11. Schematic of tolerance analysis using worstcase analysis simulation
Figure 12. Histogram of tolerance analysis using WCA
Table 4 and Figure 13 compare the tolerance analysis results. In this example, WCA predicts the largest deviation, and a simulation based on a Gaussian distribution predicts the smallest deviation. Specifically, as shown in the box plot in Figure 13, the box represents the 1sigma limit, and the box whiskers represent the minimum and maximum values.
Table 4. Summary of Voltage Regulation Statistics for Three Tolerance Analysis Methods
WCA 
Gaussian 
Monte Carlo 

average value 
3.30013 
3.29944 
3.29844 
minimum 
3.21051 
3.24899 
3.21955 
maximum value 
3.39153 
3.35720 
3.36922 
standard deviation 
0.04684 
0.01931 
0.03293 
positive error 
1.02774 
1.01733 
1.02098 
negative error 
0.97288 
0.98454 
0.97562 
Figure 13. Boxplot Comparison of Regulation Voltage Distribution
Summarize
This article uses a simplified DCDC converter model to analyze three variables, using two feedback resistors and an internal reference voltage to simulate voltage set point regulation. Use statistical analysis to present the resulting distribution of voltage setpoints. Display the results with graphs. And compare with the worstcase calculation results. The resulting data suggest that the worstcase limit is statistically impossible.
Thanks
Simulations were conducted in LTspice.
Simulations are all done in LTspice.
Appendix A
Appendix A presents the statistical distribution of regulated reference voltages in integrated circuits.
Before adjustment, the internal reference voltage adopts Gaussian distribution, and after adjustment, adopts Monte Carlo distribution. The tuning process usually looks like this:
• Measure the value before adjustment. At this time, a Gaussian distribution is usually used.
• Can the chip be finetuned? If not, discard the chip. This step basically clips the end part of the Gaussian distribution.
• Adjust the value. This keeps the reference voltage as close to the ideal as possible; the farther the value is from the ideal, the greater the adjustment. However, the finetuning resolution is very precise, so that the reference voltage value close to the ideal value does not shift.
• Measure the adjusted value and lock the value if the value is acceptable.
Comparing the resulting distribution with the original Gaussian distribution shows that some values are unchanged, while others are as close to ideal as possible. The resulting histogram resembles a column with a curved top, as shown in Figure 14.
Figure 14. Distribution of reference voltage values after adjustment
While this looks a lot like a random distribution, it is not. If the product is trimmed after encapsulation, its profile at room temperature is shown in Figure 14. If the product is finetuned during wafer sorting, the distribution will spread out again when assembled into a plastic package. The result is usually a skewed Gaussian distribution.
Appendix B
Appendix B briefly reviews the Gaussian distribution commands available in LTspice. The distributions at sigma = 0.00333 and sigma = 0.002 will be reviewed, along with some numerical comparisons between the ideal distribution and the simulated Gaussian distribution. The purpose of this appendix is to provide a graphical and numerical analysis of the simulation results.
Figure 15 shows a schematic diagram of the 1001 point Gaussian distribution of resistor R1.
Figure 15.5 – Schematic diagram of sigma Gaussian distribution
It is worth noting the modification to the .function statement to define the tolerance of the Gaussian function as tol/5.This results in a standard deviation of 0.002, or at 1% tolerance the deviation is^{1}⁄5. The histogram is shown in Figure 16.
Figure 16. Histogram of 1001point, 5sigma Gaussian distribution with 50 bar intervals
Table 5 shows the statistical analysis of the 1001 point simulation. Notably, the standard deviation is 0.001948, while the prediction deviation is 0.002.
Table 5.5 – Statistical analysis of sigma distribution simulation
result 

average value 
1.000049 
standard deviation 
0.001948 
minimum 
0.99315 
maximum value 
1.00774 
Median 
1.00012 
model 
1.00024 
1 point in Sigma 
690 (68.9%) 
Figure 17. Histogram of 1001point, 3sigma Gaussian distribution with 50 bar intervals
Figure 17 and Table 6 give similar results with sigma = 0.00333, or when the tolerance is defined as 1%^{1}⁄3.
Table 6.3 – Statistical analysis of Sigma Gaussian distribution simulation
result 

average value 
1.000080747 
standard deviation 
0.003247278 
minimum 
0.988583 
maximum value 
1.0129 
Median 
1.0002 
model 
1.00197 
1 point in Sigma 
690 (68.93%) 
Appendix C
Figures 18 to 21 and Table 7 show the schematics of the 1001point Monte Carlo simulation.
Figure 18. LTspice schematic for 1001point Monte Carlo distribution simulation
Table 7. Statistical analysis of Monte Carlo distribution simulations shown in Figures 18 to 21
result 

average value 
1.000014 
minimum 
0.990017 
maximum value 
1.00999 
standard deviation 
0.005763 
Median 
1.00044 
model 
1.00605 
Figure 19. 1000 Bar Interval Histogram of 1001 Point Monte Carlo Distribution
Figure 20. 500 Bar Interval Histogram of 1001 Point Monte Carlo Distribution
Figure 21. 50Bar Interval Histogram of 1001 Point Monte Carlo Distribution
Appendix D
Appendix D Review:
• how to edit LTspice schematics for tolerance analysis, and
• How to use the .measure command and SPICE error logs.
Figure 22 shows a schematic of a Monte Carlo tolerance analysis. The red arrows indicate tolerances for components defined in the .param statement. The .param statement is a SPICE directive.
Figure 22. Monte Carlo tolerance analysis in LTspice
The resistor value of R1 can be edited by rightclicking on the component. As shown in Figure 23.
Figure 23. Editing Resistor Values in LTspice
Enter {mc(1, tol)} to define the nominal value of the resistance as 1, and the Monte Carlo distribution is defined by the parameter tol. The parameter tol is defined as a SPICE instruction.
The SPICE directives shown in Figure 22 can be entered using the SPICE Directive icon in the control bar. As shown in Figure 24.
Figure 24. Entering SPICE instructions in LTspice
The .meas command provides a very useful GUI for entering relevant parameters. As shown in Figure 25. To access this GUI, enter SPICE directives as .meas commands. Right click on the .meas command and the GUI will pop up.
Figure 25. GUI for entering relevant parameters
Measurement data is recorded in the SPICE error log. Figure 26 and Figure 27 show how to access the SPICE error log.
Figure 26. Accessing the LTspice error log
The error log can also be accessed directly from the schematic by rightclicking on the schematic, as shown in Figure 27.
Figure 27. Accessing the LTspice error log
Opening the SPICE error log displays the measured values, as shown in Figure 28. These measurements can be copied and pasted into Excel for numerical and graphical analysis.
Figure 28. Graphical representation of SPICE error log with data from .meas command
About the Author
Steve Knudtsen is a Senior Field Applications Engineer at Analog Devices in Colorado, USA. He is a graduate of Colorado State University with a BS in Electrical Engineering and has been with Linear Technology and Analog Devices since 2000. Contact information:[email protected]