1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Speed up simulation with LTspice?

Discussion in 'Circuit Simulation & PCB Design' started by carbonzit, Jun 2, 2011.

  1. carbonzit

    carbonzit Active Member

    Joined:
    Mar 19, 2011
    Messages:
    1,958
    Likes:
    13
    On some simulations, LTspice runs verrrrrrrrry slowly. Is there any way to speed up the simulation without affecting the results, by changing the intervals or something?

    If a simulation runs slowly, does that indicate problems with the circuit that should be attended to? or does it just happen, depending on the circuit topology, etc.?
     
  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,235
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    Post a problem asc file.
     
  3. aljamri

    aljamri Member

    Joined:
    Jun 12, 2006
    Messages:
    694
    Likes:
    6
    I'm not as expert as Eric, I'm just a beginner to LTSpice.

    Recently, I've read How to use booklet where they talk about the cause of slow simulation, they stated causes like your operating system, memory available and some other factors.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. carbonzit

    carbonzit Active Member

    Joined:
    Mar 19, 2011
    Messages:
    1,958
    Likes:
    13

    It's "JT multivibrator 2" in this thread here. When it hits the snag, it take about 30 seconds of computer time to grind through 1mS of simulation. (If you have anything to add about the circuit itself, I'm all ears!)

    Mind you, I'm not complaining about LTspice per se: I'm sure there's something about my circuit that's causing difficulty in its analysis. I guess there are two questions here: is there something that can be done to speed up LTspice under such conditions? or should one try to reconfigure one's circuit to avoid this problem altogether?

    I have managed to crash LTspice when it's been in the middle of such slow calculations several times. What happens it that the simulation speed goes to zero (caught in infinite loop?), and I can't halt the simulation. When I close the simulation and either try to reload it or load another one, then try to run it, I get a pop-up message saying "Can't load Marching Waves" (?!?!?), and then it crashes.

    Overall, though, it's a great tool, so I'm not complaining (the price is right!).
     
  6. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,623
    Likes:
    479
    Location:
    L.A., USA Zulu -8
    SPICE solves all the node equations incrementally until it arrives at a convergent solution. Sometimes the nature of the circuit makes is difficult to rapidly arrive at this convergence and SPICE will take a long time (or sometimes fail to reach it at all and the simulation will fail).

    You might try changing some of the parameters in the "Tools/Control Panel/SPICE" window. For example a different Default Integration Method may affect the time. Also reducing the accuracy by changing the values of the parameters on the right such as the Abstol, Volttol, etc. to larger values (try a factor of 10 to start) may also speed up the simulation (of course at a likely reduction in simulation accuracy). If none of that helps, then just click the "Reset to Default Values" to go back to the original values.

    Understand that when you are simulating 1ms of a circuit that is oscillating at a high frequency, it requires many millions of calculations, and it can take a long time for even a fast PC to perform them all. You are simulating an analog circuit with many incremental digital calculations using complex circuit mesh matrix math. (If you've ever tried to calculate the voltages and currents for just one point in even a simple circuit with a couple loops of inductors, resistors, and capacitors, then you can get an idea of how many calulations are required.) If you can get the desired results with a shorter simulation interval, that will certainly help.
     

Share This Page