Getting LTspice to simulate as accurately as possible - Page 1
Forum section: electronics / beginners

author: Shocker
author_rank: Contributor
timestamp: December 15, 2015, 02:32:42 pm
content: How can we simulate a circuit as accurately as possible?I have a circuit, where i've managed to obtain all of the simulation circuit components for LTspice. But when i simulate it, i don't get the same distortion and oscillations as i do in the real circuit. I've even gone to the effort of calculating the inductance and capacitance of the traces but i still get a result that shows that it should be working beautifully well.I've also found that depending on how i simulate the traces - lumped RLC or lossy transmission lines, LTspice sometimes doesn't want to simulate the circuit. I've found that it doesn't like multiple transmission lines but is fine with multiple lumped RLC representations. Is there a likely cause to this? I would attached the simulation file for people to have a glance at but i can't in it's entirety.Thanks

author: c4757p
author_rank: Super Contributor
timestamp: December 15, 2015, 02:38:21 pm
content: Oh god,lotsof reasons why it might not be accurate. If you're using any ICs or MOSFETs, there could just be a poor model there - both of those aren't all that great, though the BJT models are pretty good. Could have missed some magnetic coupling somewhere (try throwingthatin if you really want to see it slow down), or some stray capacitance, or whatever. In short, you're probably missing something.As for why it doesn't always simulate at all - uh, math. Maybe someone here's more familiar with the specific math involved, but all I can say is - the "equations" (really linear-algebraic matrix computations) don't always have a solution, and are more likely to for simpler circuits. And my general experience matches yours, that transmission lines don't always simulate nicely, particularly when not perfectly matched and terminated.

author: krivx
author_rank: Frequent Contributor
timestamp: December 15, 2015, 02:43:53 pm
content: Apart from the missing circuit elements and inaccurate models, LTSpice also sidesteps any measurement issues. It effectively has perfectly accurate DMMs and Oscilloscopes, with zero parasitic probing.How far from reality are your simulations? "Good enough" varies by problem but I'm usually fine if things are within 5%

author: dom0
author_rank: Super Contributor
timestamp: December 15, 2015, 02:55:09 pm
content: There are two different kinds of accuracy involved in numerical simulators like SPICE(1) Accuracy of the model(2) Accuracy of the solvers(1) Are the models of your componentsandthe netlist, which, for accurate results, would need to contain all the additional parasitic properties of the real circuit (as lumped elements for lower frequencies). So your netlist might be off, but also the submodels you include in it (e.g. transistors, integrated circuits etc.)(2) Is the numerical accuracy of the solver which determines numerical solutions with finite resolution from your model. SPICE / LTSPICE has a few options here, e.g. floating point precision, time step size, lossy compression, ...

author: macboy
author_rank: Super Contributor
timestamp: December 15, 2015, 04:15:21 pm
content: Your real circuit will have inductive and capacitive coupling, as well as resistive loss along conductors (especially ground traces), all of which contribute to its behaviour, and none of which are usually modelled. Also, passives like R, L, C are all ideal by default in LTSpice, but not in the real world. You need to add the parasitics in to them if you want more realistic modelling. Add ESR and ESL to Caps, add Cp and ESR to inductors. You might add series inductance to resistors (ironically, the easiest way is to use an inductor in place of the resistor). I sometimes find that regulators don't like ideal capacitors on the output, and I need to add realistic ESR to get stability (opposite problem you have).You might do better to examine your real circuit and question why is it oscillating, rather than questioning why the simulation doesn't. Many layout and construction issues can can instabilities. For example, you never need to decouple power supplies in the simulation since power rails and grounds are all perfect. When have you ever gotten away with that in a real circuit? Care to post a photo of your circuit?(p.s., you did not attach the simulation).

author: rjeberhardt
author_rank: Regular Contributor
timestamp: December 17, 2015, 04:45:08 pm
content: Unless you post a few more details people can only guess at the possibilities.Can you post a schematic? What kind of components are you using? Is it a digital circuit, an audio circuit, a microwave circuit? You say your circuit doesn't work but what are the symptoms.Russell.

author: Neilm
author_rank: Super Contributor
timestamp: December 17, 2015, 07:44:27 pm
content: There is also the possibility that your circuit is going unstable due to the layout of your circuit. If your circuit has any high frequency components this could be critical. For instance some circuits will never work on a vero-board (basically any switch mode PSU)I have used LTSpice to model circuits and have got very good corrolation between real world and the simulation. However to get it that good, I needed to measure and model all of parasitic components. With the transformer that included resistance of the windings, the leakage inductance, the capacitance between the primary and the both of the other windings, the capacitance between the two secondary windings. Add into that the inductance and capacitance of the current sense resistor, ESR of the supply caps the characteristics of the snubber network etc that is a lot of things to model. The final result was the flyback off pulse snubbed to within 4% of what LTSpice predicted.