Time step too small in LTSpice

Thread Starter

Nanaiah

Joined Mar 16, 2017
25
Hello,
I need to be able to run my circuit for about 50 ms but it shows that the "time step is too small" in LTspice. I tried changing the "Solver" in tools to "alternate" but it works only for 1 ms. I have attached my circuit below. Any help is much appreciated.

Thank you.
 

Attachments

WBahn

Joined Mar 31, 2012
29,978
Usually this is the result of nominally instantaneous transients, often at start up, that require the sim engine to keep reducing the time step smaller and smaller in order to get convergence. Using ideal parts is usually the most common culprit, particularly sources that change output from one value to another instantly (or over a time span that is too short) coupled with either inductive or capacitive elements that go singular under those conditions.
 

eetech00

Joined Jun 8, 2013
3,859
Hello,
I need to be able to run my circuit for about 50 ms but it shows that the "time step is too small" in LTspice. I tried changing the "Solver" in tools to "alternate" but it works only for 1 ms. I have attached my circuit below. Any help is much appreciated.

Thank you.
Use one voltage source for each of your + and - supply.
Then connect each supply, using labels, where necessary to the devices.
Then add 100m series resistance to each supply including the sinewave generator.

I'v also uploaded a symbol and spice model file.

See if that helps.

eT
 

Attachments

MrAl

Joined Jun 17, 2014
11,389
Hello,
I need to be able to run my circuit for about 50 ms but it shows that the "time step is too small" in LTspice. I tried changing the "Solver" in tools to "alternate" but it works only for 1 ms. I have attached my circuit below. Any help is much appreciated.

Thank you.
Hi,

To add a little to the already good replies here...

The circuit simulators use numerical approximations for derivatives and that presents a problem in itself when the circuit time constant is very fast because it means the time step has to be short and that not only causes very high value derivatives (which eventually peak out the numerical range being used) it also causes greater and greater inaccuracy because of the truncation that occurs during the calculation of the slope. That means there will be some limit based on the numerical range available on a given machine and most home PC's only have the double float type floating point to work with.

Given that you cant change some things and you can only change other things, the way to deal with this is to slow down the time constant that is giving the problem. This means either increasing the resistance or increasing the capacitance or something like that, that makes the time constant longer. This of course means the circuit has to be altered from what you really want it to be, but you may be able to find a way to deal with that by changing something else like perhaps slowing down all the time constants and then scaling up the results, or just putting up with a slower time constant for some things that dont matter that much anyway.

Sometimes adding a capacitor in a place where the voltage changes very fast helps because it slows down the ability for that point in the circuit to change quickly and therefore lowers the derivative and therefore the required time step. An inductor may help in places where the current changes too fast.
There are a lot of possibilities though so you have to play around with it a little unless you want to get deep into the math behind the scenes which is usually time consuming. It is a little interesting that there is usually some scaling going on internally that you would think could handle these problems, but the problem then is the ratio of the slowest time constant to the fastest time constant and when that ratio is large the defining equations are referred to as "stiff", and you can look up stiff differential equations to find out more about that if you like. That can also occur for a very slow changing response.
 
Last edited:
Top