Author Topic: LT Spice IV - slow simulations  (Read 16098 times)

0 Members and 1 Guest are viewing this topic.

Offline SrbelTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
  • Country: cs
  • Electronics engineer
LT Spice IV - slow simulations
« on: November 28, 2015, 12:59:55 pm »
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?
 

Offline SrbelTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
  • Country: cs
  • Electronics engineer
Re: LT Spice IV - slow simulations
« Reply #1 on: November 28, 2015, 02:28:08 pm »
That is pathetic. it is almost 2016.

Incompetent software developers...
 

Offline Tomorokoshi

  • Super Contributor
  • ***
  • Posts: 1212
  • Country: us
Re: LT Spice IV - slow simulations
« Reply #2 on: November 28, 2015, 03:18:31 pm »
If there are multiple voltage sources, check to see if they are in series with no series resistance.
 

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2766
  • Country: ca
Re: LT Spice IV - slow simulations
« Reply #3 on: November 28, 2015, 04:17:13 pm »
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?

Can 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
 

Offline Mechanical Menace

  • Super Contributor
  • ***
  • Posts: 1288
  • Country: gb
Re: LT Spice IV - slow simulations
« Reply #4 on: November 28, 2015, 05:27:18 pm »
That is pathetic. it is almost 2016.

Incompetent software developers...

Some 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.
Second sexiest ugly bloke on the forum.
"Don't believe every quote you read on the internet, because I totally didn't say that."
~Albert Einstein
 

Offline SrbelTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
  • Country: cs
  • Electronics engineer
Re: LT Spice IV - slow simulations
« Reply #5 on: November 28, 2015, 07:33:36 pm »
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?

Can 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

it is just this, nothing advanced.

http://www.linear.com/docs/42254
http://www.linear.com/product/LT1512#simulate

Simulation time increased form 5 to 50ms. Looking at output voltage and current.
« Last Edit: November 28, 2015, 07:37:04 pm by Srbel »
 

Offline Tomorokoshi

  • Super Contributor
  • ***
  • Posts: 1212
  • Country: us
Re: LT Spice IV - slow simulations
« Reply #6 on: November 28, 2015, 07:44:52 pm »
it is just this, nothing advanced.

http://www.linear.com/docs/42254
http://www.linear.com/product/LT1512#simulate

Simulation time increased form 5 to 50ms. Looking at output voltage and current.

Those Linear part models can be quite complex internally. That's where the slowdown is coming from.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11821
  • Country: us
    • Personal site
Re: LT Spice IV - slow simulations
« Reply #7 on: November 28, 2015, 08:03:41 pm »
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.
Alex
 

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2766
  • Country: ca
Re: LT Spice IV - slow simulations
« Reply #8 on: November 28, 2015, 08:51:36 pm »
Running the LT512_F01.asc this what the SPICE error log reports:


Code: [Select]
Circuit: * C:\Users\John\AppData\Local\Microsoft\Windows\INetCache\IE\292UGX2E\LT1512_F01.asc

Direct Newton iteration failed to find .op point.  (Use ".option noopiter" to skip.)
Starting Gmin stepping
Gmin = 10
Gmin = 1.07374
Gmin = 0.115292
Gmin = 0.0123794
Gmin = 0.00132923
Gmin = 0.000142725
Gmin = 1.5325e-005
Gmin = 1.6455e-006
Gmin = 1.76685e-007
Gmin = 1.89714e-008
Gmin = 2.03704e-009
Gmin = 2.18725e-010
Gmin = 2.34854e-011
Gmin = 2.52173e-012
Gmin = 2.70769e-013
Gmin = 0
Gmin stepping succeeded in finding the operating point.


Date: Sat Nov 28 15:44:25 2015
Total elapsed time: 7.581 seconds.

tnom = 27
temp = 27
method = modified trap
totiter = 1369886
traniter = 1369536
tranpoints = 414766
accept = 304532
rejected = 110234
matrix size = 28
fillins = 9
solver = Normal
Matrix Compiler1: 1.46 KB object code size  0.6/0.2/[0.2]
Matrix Compiler2: off  [0.2]/0.3/0.4

It takes 7.581 seconds on my laptop which is an i7 4700HQ @2.4GHz Quad core

Regards,

Jay_Diddy_B


 

Offline SrbelTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
  • Country: cs
  • Electronics engineer
Re: LT Spice IV - slow simulations
« Reply #9 on: November 29, 2015, 08:24:44 am »
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!

 

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2766
  • Country: ca
Re: LT Spice IV - slow simulations
« Reply #10 on: November 29, 2015, 11:55:15 am »
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
« Last Edit: November 29, 2015, 11:57:35 am by Jay_Diddy_B »
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: LT Spice IV - slow simulations
« Reply #11 on: November 30, 2015, 02:32:42 am »
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Tim F

  • Regular Contributor
  • *
  • Posts: 107
Re: LT Spice IV - slow simulations
« Reply #12 on: November 30, 2015, 02:51:44 am »
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.
 

Offline timofonic

  • Frequent Contributor
  • **
  • Posts: 904
  • Country: es
  • Eternal Wannabe Geek
Re: LT Spice IV - slow simulations
« Reply #13 on: December 09, 2015, 11:14:07 pm »
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 :(
 

Offline f5r5e5d

  • Frequent Contributor
  • **
  • Posts: 349
Re: LT Spice IV - slow simulations
« Reply #14 on: December 09, 2015, 11:37:54 pm »
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 settings

and sw mode circuits can have markedly different operating modes such as continuous vs discontinuous inductor current modes


the Yahoo LTspice forum is the best place for LTspice specific info including processors/core benchmarks, settings for speeding up sims
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf