Your thoughts on simulation compared to reality

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Reading a few opinions on the usefullness of simulation results in another thread, I wondered what everyone else thinks and if there are any tips for getting the most out of sims.

Personally I simulate a lot. It's very rare for me to build a circuit without having simulated it first, unless it's very simple. I usually find the measured performance of real circuits matches the simulations with uncanny accuracy. There are a few caveats though:

  • Simulator must be good. I'm sure most people use some form of Spice, so that's not a problem.
  • Models must be good. This can be a big problem. Some manufacturers don't provide models and even where they are available they aren't always accurate (op-amps with infinite bandwidth are a classic example!). Creating a good model from datasheets/measurements isn't exactly easy either.
  • Perfect component matching. Real components vary, whereas in simulations they are all identical. This can result in much higher DC offset and distortion in reality than sims and even circuits that don't work in reality at all (like complementary differential input stages with current mirrors). It's a good idea to swap out e.g. one of a pair of transistors in a sim with one of a different but similar model temporarily to simulate the effect of component mismatches. If performance changes a lot then the circuit is probably too sensitive to component variation.
  • High frequency stability. I sometimes find that circuits sims predict will be stable are unstable in reality and vice versa. Thus things like Miller capacitor values can only be accurately selected from real circuits. It also means you shouldn't necessarily be put off just because you can't get a circuit stable in sims.
  • Thermal effects. Although it is possile to simulate the effects of heat in Spice, it's not perfect.
  • Simulated devices never break. You can exceeed their ratings in sims and it won't tell you. If you don't take care to check carefully then you could end up liberating some magic smoke.

That's everything I can think of right now.
 
When people get to talking about simulation, there's always some excuse as to why it doesn't match reality. Be it the code, the models, the user who doesn't know what he's doing...
Reminds me of religion. When something goes awry, you're supposed to pray. Prayer didn't work? Well, you didn't pray hard enough, or god had other things on her mind right then, or you'll get your wish in some other unexpected way, or...

Grey
 
Mr Evil said:

[*]Simulated devices never break. You can exceeed their ratings in sims and it won't tell you. If you don't take care to check carefully then you could end up liberating some magic smoke.[/list]

That's everything I can think of right now.

I hear that the programmers at cadence (Orcad P-spice) are working on smoke parameters, where you can specify max parameters for your components, and let out virtual magic smoke if you exceed these parameters.

\Jens
 
GRollins said:
When people get to talking about simulation, there's always some excuse as to why it doesn't match reality...
You may scoff, but simulations are a valuable tool. Like any tool they are imperfect and not suitable for all jobs, but it's a hell of a lot quicker than doing all the calculations by hand.

Most of the time the difference between sims and reality is negligible. Even when there is a difference, this can in itself be informative: By adding stray impedances until the sims resemble real results (like the caps across op-amp inputs that janneman mentioned), it's often possible to determine why a circuit is not functioning as expected. Many times this has shown me that a particular track is too inductive, allowing me to fix it much more quickly than using measurements alone.
 
Simulations are good, and useful, so long as you bear in mind that they are just simulations and inherently imperfect. Which statement I shall backup by pointing out that any transient sim is a discretized version of a continuous system. Hence you can get instability in the sim thats not there in the real thing, and vice versa.

I use sims a lot, to get me in the ballpark, then I build the thing on the bench.
 
Yes, but the question is...how many potentially useful designs get abandoned because the simulation claims it won't work? You don't know that it won't work (or, conversely, that it will) until you build it. Case in point--the Aleph-X. Had I been "designing" it in a simulator, I would have abandoned the concept entirely because the simulator would have told me that it wouldn't work. Only, it does work, in spite of a gaggle of people with simulators telling me it doesn't.
Save time? Hardly. I can pull a resistor and solder it in as fast or faster than you can simulate it and have 100% confidence in the result--after all, it's reality. You may think you have 100% confidence in your result, but...
To me, this is all part of a disturbing trend wherein people insulate themselves from reality. They tell themselves that they're gaining a better understanding of things, but bit by bit they are actually disengaging from the real world. There's a lot of it going on in politics, religion, and the everyday things that we do. It's gotten to the point where at least some of the people, some of the time, are unable to judge reality accurately when they are forcibly confronted with it. They retreat to their sanitized, simplified versions in order to cope.
I think I need to write a story about this...

Grey
 
GRollins said:
Yes, but the question is...how many potentially useful designs get abandoned because the simulation claims it won't work? You don't know that it won't work (or, conversely, that it will) until you build it. Case in point--the Aleph-X. Had I been "designing" it in a simulator, I would have abandoned the concept entirely because the simulator would have told me that it wouldn't work.
Grey

Unfortunately, the reverse is too often the case in reality. A modern suite of simulation tools coupled with a properly equiped characterization group can achieve simulated results of IC's that are so close to reality it's scary. The problem is when you actually go to use the thing in a real board with different brands of external components you get stuck.
 
GRollins said:
Yes, but the question is...how many potentially useful designs get abandoned because the simulation claims it won't work?...
That's why in my initial post I said not to despair just because a circuit doesn't seem to work when simulated. It may be 90% certain that a circuit will behave exactly as simulated, but only real testing can be 100%. Having said that, it is quite possible to construct a real prototype that doesn't work because of some minor layout problem or subtly damaged component, which could lead you to the conclusion that it doesn't work at all even though a proper version of it would work fine. So even actual measurements are only, perhaps 95% certain (unless you have huge resources available to you).



GRollins said:
...I can pull a resistor and solder it in as fast or faster than you can simulate it...
Maybe, but tweaking resistor values is hardly very difficult. A better example would be if I wanted to determine what output devices to use for a power amp. Perhaps there are 5 different pairs I like the look of and I need 4 devices in total at £5 each. There is no way I'm going to buy 20 devices just to see what might be best; I'll simulate it and let that information help me decide. There is also zero risk of breaking valuable components in a sim. I would need to at least do some initial calculations to ensure that nothing obvious goes poof, so I may as well do those in a simulator and save paper. It's all very well relying purely on measurements if you have vast stocks of components or lots of money, but for me at least neither of those is true.



GRollins said:
...To me, this is all part of a disturbing trend wherein people insulate themselves from reality. They tell themselves that they're gaining a better understanding of things, but bit by bit they are actually disengaging from the real world....
Two points here:
1) I am most certainly not suggesting that simulations should take the place of real measurements. A simulator is a tool, just as much as a breadboard is a tool. Both are useful, neither is suitable for all tasks. I simulate a lot. I also always have something stuck in a breadboard, and a ton of one-off PCBs I've etched just to test some crazy idea. I wouldn't like to go without either real prototypes or sims.

2) Simulators can help in understanding a circuit. They make it possible to perform measurements that would be very hard to do on a real circuit without a lot of effort and/or expensive equipement. Being able to watch half a dozen waveforms simultaneously and perform mathematical analysis of them without needding a DSO is invaluable, and I wouldn't want to have to measure the emitter currents of a dozen transistors too many times when I could simulate it and end up only having to perform a fraction as many real measurements, just to check.

Anyway, what are you doing saying a thing like that on an internet forum! You should go and talk to some real people... I'm just a simulation:D
 
Re: Which simulators are ...............

ashok said:
So which simulators are the easiest to use , accurate and can accept most models available on the web ?
Cheers.

Go to Linear Technology and download a free copy of SwitcherCAD III

It is a free spice-based simulator with a ton of example files (and of course, LT switchmode power supply IC demo circuits). Easy to use, too. You can import models from other manufacturers easily. There's a menu item to select to update the software- it will go the the LT ftp server and download and install any new files. New files seem to show up almost weekly.

One of the most interesting features for audio is .wav file input and output. Use a .wav file for input and/or send a simulation output to a .wav file (almost any sample rate and number of channels, including 44.1 KHz, stereo) and then listen to it. Uses? make test CDs using accurate digitally generated signals. Test filter networks and listen to the results (burn a RW CD and put it into your stereo system for quality playback), etc.

It let's you view waveforms as the simulation runs so if you're not seeing what you expect, you can kill it and find the problem- no need to wait until a 4 hour simulation is complete to discover you put a diode in backwards.

Accuracy in spice simulations is a function of the models and the user's knowledge of spice's weaknesses. If you know where the results are likely to be poor, you can do things in setting up the simulation or in choosing the types of simulations to get the best results. I suggest a look at Tuinenga's book for practical info. There are many others for details about how spice simulations are actually performed.

One area where spice has problems is with circuits where parts heat up in operation. The user needs to be aware that 5A through a transistor will heat it up, and the temperature at which the simulation is run must account for the die temperature (not the case or room temperature). Spice will not tell you a part has gone into thermal runaway. It also won't tell you that you can't put 10A through a 1N914 diode.

There are some types of simulations that spice is not good for. Any circuit where you have a very wide range of frequencies will lead to very long simulation times. Harmonic balance simulators are faster for simulating such circuits.

I_F
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.