LT Spice IV - slow simulations - Page 1
Forum section: electronics / general

author: Srbel
author_rank: Frequent Contributor
timestamp: November 28, 2015, 12:59:55 pm
content: OK, they were slow on my laptop and on my old computer. But now I have a 4 core APU (3,7 - 4,2 GHz), and simulations are still slow. I have to wait for like 30 seconds for it to finish. When I want to do it over and over again (trying out various component values) it takes to much time and it's annoying. And CPU does not even get loaded, it goes between like 15%-30% load during simulation. WTF?

author: Srbel
author_rank: Frequent Contributor
timestamp: November 28, 2015, 02:28:08 pm
content: That is pathetic. it is almost 2016.Incompetent software developers...

author: Tomorokoshi
author_rank: Super Contributor
timestamp: November 28, 2015, 03:18:31 pm
content: If there are multiple voltage sources, check to see if they are in series with no series resistance.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: November 28, 2015, 04:17:13 pm
content: Quote from: Srbel on November 28, 2015, 12:59:55 pmCan you attach an example of the circuit that you are simulating?You may have to zip it. I am not sure if the forum allows .asc extensions.Regards,Jay_Diddy_B

author: Mechanical Menace
author_rank: Super Contributor
timestamp: November 28, 2015, 05:27:18 pm
content: Quote from: Srbel on November 28, 2015, 02:28:08 pmSome problems are inherently unparallelisable, sometimes those problems are a small part of a bigger problem that can be threaded but the rest of the thread (or threads) can't continue until they get the result. Now that may not be the case here but there's an easy test, try your simulation in one of the other SPICEs. If you get similar results that probably means the bottleneck is one of those problems that can't be parallelised. If you still think the software devs are just incompetent after that jump into the NGSPICE code and show them how it's done.

author: Srbel
author_rank: Frequent Contributor
timestamp: November 28, 2015, 07:33:36 pm
content: Quote from: Jay_Diddy_B on November 28, 2015, 04:17:13 pmit is just this, nothing advanced.http://www.linear.com/docs/42254http://www.linear.com/product/LT1512#simulateSimulation time increased form 5 to 50ms. Looking at output voltage and current.

author: Tomorokoshi
author_rank: Super Contributor
timestamp: November 28, 2015, 07:44:52 pm
content: Quote from: Srbel on November 28, 2015, 07:33:36 pmThose Linear part models can be quite complex internally. That's where the slowdown is coming from.

author: ataradov
author_rank: Super Contributor
timestamp: November 28, 2015, 08:03:41 pm
content: This file with default simulation parameters takes ~10 seconds on my machine (actually running under Wine on Linux). I would say it is not a bad time, given how detailed LT models are.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: November 28, 2015, 08:51:36 pm
content: Running the LT512_F01.asc this what the SPICE error log reports:Code:Circuit: * C:\Users\John\AppData\Local\Microsoft\Windows\INetCache\IE\292UGX2E\LT1512_F01.ascDirect Newton iteration failed to find .op point. (Use ".option noopiter" to skip.)Starting Gmin steppingGmin = 10Gmin = 1.07374Gmin = 0.115292Gmin = 0.0123794Gmin = 0.00132923Gmin = 0.000142725Gmin = 1.5325e-005Gmin = 1.6455e-006Gmin = 1.76685e-007Gmin = 1.89714e-008Gmin = 2.03704e-009Gmin = 2.18725e-010Gmin = 2.34854e-011Gmin = 2.52173e-012Gmin = 2.70769e-013Gmin = 0Gmin stepping succeeded in finding the operating point.Date: Sat Nov 28 15:44:25 2015Total elapsed time: 7.581 seconds.tnom = 27temp = 27method = modified traptotiter = 1369886traniter = 1369536tranpoints = 414766accept = 304532rejected = 110234matrix size = 28fillins = 9solver = NormalMatrix Compiler1: 1.46 KB object code size 0.6/0.2/[0.2]Matrix Compiler2: off [0.2]/0.3/0.4It takes 7.581 seconds on my laptop which is an i7 4700HQ @2.4GHz Quad coreRegards,Jay_Diddy_B

author: Srbel
author_rank: Frequent Contributor
timestamp: November 29, 2015, 08:24:44 am
content: Well, at "stock" setup (same as downloaded model), it takes my AMD A10-7850K 13,4 seconds to finish.But I was changing the values to get output voltage at 13,8V then changed output capacitor (battery) to 0,1mF, changed input voltage to 19V and simulation time to 50ms. Now it takes 1 minute and 25 seconds to finish!

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: November 29, 2015, 11:55:15 am
content: Hi,Here are a few more measurements from my PC i7 4700HQ:First a picture from the performance monitor while running the standard LT1512 simulation with the simulation time extended to 15ms:This model used about 10% of the CPU resources.I then tested with this model, the standard LT8609 model, with the simulation time extended to 5ms:This the performance monitor during that simulation:You can see that LTspice is running 4 threads and consuming 37% of the CPU resources.I am not sure about the performance of your AMD CPU. We need a few more people to try this.Regards,Jay_Diddy_B

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 30, 2015, 02:32:42 am
content: Mind that simulations are just that: virtual simulations, models built -- hopefully -- to represent real systems, but inevitably falling hopelessly short of a complete description. That shortfall is what allows us to do anything at all, really. Otherwise the solution would take more computing power than we have right now!So, two things:1. It is up to you, the operator, to ensure that the model is representative of reality. Okay, you don't have much direct control over what's in an IC model, but if you have a choice, you need to select the most appropriate models to use. If you've omitted important elements, like equivalent inductors and capacitors (arising from the circuit physically taking up space -- signals do not travel instantaneously!), you may have problems!2. Simulation is hard. Just, in general. The solver has to crunch a lot of numbers. Mostly, it crunches away, finds an absurd result, completely throws it away, and tries again (with higher precision). When it finds a suitable step, the process repeats. It is very easy to accidentally construct a circuit which is unstable to this approach. Really, it's astonishing that SPICE is able to solve anything at all, and that hang-ups look more accidental than anything!If you find your transient simulation is seemingly stuck on a point in time, it's probably because it's lost, trying to find a smaller timestep (thus, a smaller change from the previous instant; hopefully, an easier problem to solve than a larger step, which already failed). But once the timestep is a small fraction of any time constant (and therefore, any presumable change) in the circuit, it's stuck and unlikely to find a way out.Probably the most common way for stepping to fail is a singular matrix. This occurs when any node or pair branches share a quantity independent of the circuit around them. The simplest mistakes are schematic errors: series capacitors (the DC voltage on the node between them is floating == undefined!) and parallel inductors (the loop between them has an undefined current). LTSpice normally manages these by adding series resistors to inductors (unless otherwise specified), and parallel resistors (everywhere) to your model. But similar situations can arise dynamically, as circuit V/I vary with time and condition (because transistors, diodes, etc. are very nonlinear). It's much more complicated, but effectively looks like division by zero. You need to ensure your model doesn't exhibit these zeros. Usually by making it more realistic (series inductances to transistors, parallel capacitors, etc.).Even if you have a pretty representative model, there's no guarantee; you can do a transient analysis with a sweep value, just varying a resistor somewhere perhaps. Several of the sweeps may simply freeze up in the middle. Sensitivity to initial conditions is a classic hallmark of chaotic systems. There doesn't need to be a reason at all for it to freeze, really; like I said, it's really quite remarkable it ever works at all...Tim

author: Tim F
author_rank: Regular Contributor
timestamp: November 30, 2015, 02:51:44 am
content: Also, turn off data compression in LTSpice (Tools -> Control Panel -> Compression, untick everything). That can speed things up quite a bit at the expense of hard disk space to store simulation data. You can also add the op line ".OPTIONS plotwinsize=0" to your schematic to do this, otherwise you need to go into the control panel and disable compression every time you restart LTSpice.

author: timofonic
author_rank: Frequent Contributor
timestamp: December 09, 2015, 11:14:07 pm
content: Can anyone do the same simulations in QUCS? I'm quite curious about the results, but unfortunately I lack the time and skills required for it

author: f5r5e5d
author_rank: Frequent Contributor
timestamp: December 09, 2015, 11:37:54 pm
content: there's also unrealistic expectations - a switched mode circuit needs to step finely enough to calc the high frequency switching waveform's harmonic components to the accuracy, tolerance settingsand sw mode circuits can have markedly different operating modes such as continuous vs discontinuous inductor current modesthe Yahoo LTspice forum is the best place for LTspice specific info including processors/core benchmarks, settings for speeding up sims