# What tools can I use for parametric circuit analysis?

I have analog circuit designs that I want to analyze for accuracy, etc. according to the component variations based on tolerance, temperature, etc. To elaborate further, imagine there is a circuit designed with couple of resistors and an opamp, and based on their nominal values we have an expected output. How does this output change based on the possible changes in the circuit element parameters? (tolerance and temperature dependency of the resistors, offset voltage and bias current of the opamp, etc.)

• How does this output change based on the possible changes in the circuit element parameters? That depends entirely on the circuit so you will need to analyze the circuit by hand and/or do a sensitivity analysis using a circuit simulator. Jan 30, 2019 at 15:11
• Analyzing the circuit by hand is ok, however the tricky part is to vary the parameters of each and every component and rerun the analysis, get the results and find the worst or base ones. Which tool can I use for sensitivity analysis? Jan 30, 2019 at 15:23
• As mentioned in Elliot's answer: Monte Carlo analysis is an option. Most circuit simulators have such a function. However, you will need statistical data (information about tolerances) of your components. There is no separate tool, this is part a circuit simulator like LTspice, Qucs. If those names ring no bell then you first have to learn about circuit analysis using a circuit simulator. Only when you are familiar with simulating circuits can you consider doing Monte Carlo analysis. Jan 30, 2019 at 15:34
• Monte carlo seems to be not the kind of analysis that I want. What is require is worst-case analysis and I added another comment to Elliot's answer. Jan 30, 2019 at 15:55
• @felvan The problem with a simplistic worst-case analysis is that for it to provide any meaningful information your circuit must be monotonic with respect to your parameter variations. Any moderately complex circuit will not be monotonic, the actual worst case will generally be at least one peak in a very complex parameter hyper-surface. The only way to explore such space in a reasonable amount of time is by using Monte Carlo techniques in a simulator. For small circuits, a formal sensitivity analysis (done by hand or with a, somewhat rare, algebraic circuit solver) would provide more insight. Jan 30, 2019 at 20:55

You want to do a Monte Carlo simulation. In this kind of simulation you specify the tolerance for all of the parameters of interest. You may also be able specify whether the expected variation of each parameter is a normal distribution or a gaussian distribution. The simulator then selects random values for each parameter, based on the parameter's tolerance, and runs a simulation.

So, set up the Monte Carlo simulation and run 50 simulations. Look at the results from these simulations to see how the output characteristics of the circuit have changed. That gives you a reasonable approximation of how actual manufactured circuits will vary, if you have set up the component tolerances correctly.

• Can I also change the temperature setting in such a simulation? For example, running the simulation at -40C, 25C and 85C? Also selecting the random values and running a fixed number of simulations wouldn't give me the worst case scenario? (I know the probability of the worst case scenario happening is very low.) Is there a way to define the transfer function of the circuit and run the simulation based on all the possibilities of the component variations, and analyze the output voltage for the worst and best case scenarios? Jan 30, 2019 at 15:22
• If you know that the parameters shift a certain way as a function of temperature then that should be built into the model for the component. The Monte Carlo simulation shows you how manufacturing variations affect your circuit. It's true that the MC simulation doesn't necessarily reveal the worst-case scenario, but it does reveal the statistics of the variation in product performance which allows you to extrapolate to the probability of any given behavior. If you truly want worst-case analysis you must determine a priori how every parameter affects the output. Jan 30, 2019 at 15:34
• What I actually want is the worst-case analysis and I know that I have to know how every parameter affects the output. However, I would assume this is not a trivial task if you have several resistors connected in all kinds of ways. So what I would like to do is after determining the variation of each component, run the simulation to cover all possible combinations with a predefined resolution and analyze the results to pick the worst case. For example, I know LTspice can do parameter sweep, but AFAIK it sweeps the parameter for one component. Jan 30, 2019 at 15:53
• You could make all of the actual component parameters be a function of some other dummy parameter, and then just change that parameter to get the worst case, nominal, and best case simulations. Jan 30, 2019 at 16:12
• @felvan I want to caution you also that if you find the sensitivity of your circuit behavior to each component value individually you may get false results. For example, the matching of pairs of resistors might be critically important, and you will miss that if you only look at how their individual values affect the circuit. Jan 30, 2019 at 16:39

I use LT spice to find worst case DC operating points of circuits. I can't remember where I learned this technique.

In LTSpice one can specify the value of a component as a function of other parameters. You need two functions for this. The first is a utility function to determine if a certain bit of a number (when represented in binary) is set. The second is a function that gives the value of a component for a particular "run".

In LTSpice these functions look like this

.function bit_get(bits, index) floor(bits/(2**index))-2*floor(bits/(2**(index+1)))
.function wc(nom, tol, id) if(run==-1, nom, if(bit_get(run, id)==1,nom*(1+tol),nom*(1-tol)))


bit_get takes a number and the index of the bit to check and returns 1 if that bit is set and 0 otherwise.

wc takes the component's nominal value, its tolerance, and a unique (among all components that have a tolerance) "id". Depending on the value of the global variable run, wc returns either the nominal value, the maximum value, or the minimum value.

In order to determine operating points of the circuit for all combinations of nominal, minimum, and maximum value for each component you create a step directive of the form

.step run -1 max 1


where max is 2^(num wc components)-1. For example, if I want to analyze a circuit with 4 components then max is 15. Then you create a directive to find the operating point for each step of run with

.op


A trivial example of this all tied together:

Here the voltage source is nominally 5 VDC +- 5% and the resistor is 10K +- 1%. The graph shows the current through R1 for each run. Nominal values are when run is -1.

This method assumes only one symmetrical tolerance per part, but hopefully it is a helpful starting point for you.

• Thanks for your answer. I believe this is the same method described here and here. However, what I require is a little bit more detailed that this, because this only works for resistors and capacitors which have fixed values. How can I include the effects like bias current and offset voltage of an opamp? And the said opamp is not necessarily from LT. Jan 31, 2019 at 13:24
• You can add custom devices to LTSpice, and you may be able to find a model for your op-amp that someone else has already created. I have a model for LM324 that I found somewhere online. That part is not included in LTspice by default. I'm not positive, but I imagine that you could apply this method to things like bias current and offset voltage using a custom model. Jan 31, 2019 at 14:11

Normally in production, the bottom line is yield to test specifications. There is a statistical measure of margin to upper/lower specifications and a multiplier of standard deviation . This is called Cpk.

Depending on the cost of scrap that cannot be repaired cheaply, and your cost margins , an analog statistical deviation may be 2 sigma to 6 sigma reaching the spec limits. Like Diode forward voltage , it may be asymmetrical tolerance on the high side from the mean.

I suggest you use Cpk to evaluate your design margin to specs using sigma and limits and use worst case tolerance analysis to compare.

• then validate your component tolerance with datasheets and supplier qualification.
• Specs may be guaranteed by source testing by supplier or stated as implied by design.

When there are too many variables, that are interactive with each other, we do a sensitivity analysis Allen the Taguchi Method. For simple designs however, one can analyze sensitivity by summing the tolerances with 2 sigma and differentiating the sensitivity curve to find the min, max points to improve the design.