[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: OPTIONS in ngspice?
On Saturday 30 July 2005 07:38 pm, Harold D. Skank wrote:
> I need to run a SPICE simulation that currently is getting
> about 10% of the way through the simulation then aborting on
> minimum step size. I thought I would reduce that size (and
> switch to the GEAR integration method), but apparently
> ngspice doesn't know about the OPTIONS command. Is there a
> way to get to these parameters?
I don't think there is anything wrong with the options command.
Your problem is a convergence failure. You might get around it
by increasing ITL5. It is probably something wrong with your
circuit or model parameters. Sometimes increasing the value of
option GMIN helps. GMIN specifies a conductance that is added
from every node to ground. It could be a nonlinear capacitor
that is causing the problem. The Meyer capacitance model used
in the level-2 MOSFET if a common culprit.
Here's what is happening .....
Your simulation starts out fine. The initial DC works. If
spice resorts to gmin stepping to get the initial DC
convergence, that is a sign that you are likely to have trouble
later.
The simulation moves along fine for a while, but hits a trouble
spot. Maybe your circuit goes through some kind of unstable or
high gain region. I can't tell unless I see it. Convergence
fails. Note that a convergence failure is defined as the
failure to achieve convergence in ITL5 iterations. Maybe just
allowing more iterations will solve the problem.
Spice rejects the solution for that time, then backs up to the
most recent good step, and takes a smaller step and tries
again. If it fails, it tries another smaller step in the same
way. Hopefully, eventually it finds one that works. It is
possible that it never does find a step that works, that even
the smallest allowable step results in a failure. That is when
it aborts in the minimum step size. As I recall, the message
is something like "internal time step too small".
It might help to specify smaller steps in your transient
command. As I recall, the minimum is some fraction of the time
step you specify.
Gnucap uses almost the same algorithm, so it is prone to the
same problem. Due to nuances, there are cases where gnucap
converges and spice doesn't and vice versa. That's one reason
it is nice to have both.
Gnucap has some features that may (or may not) help in this
case. By default, it doesn't abort on this type of convergence
failure. It might give a few bad points, but it will move on.
You can request that it print every iteration, or every
internal time step. Spice shows all accepted actual times
always in the "rawfile", but interpolates to fake the points
you request in the interactive display. Gnucap also has some
"damping" and limiting parameters you can tweek. If still have
trouble you can send me the file. I will look at it. I need
some good convergence test cases.
If the nonlinear capacitor is the cause of your problem, it
might be worse in gnucap. Gnucap checks capacitor charges for
convergence. Spice does not.
Convergence failures are usually not bugs in the software. Most
simulators use Newton's method, which does not guarantee
convergence. Simple methods like bisection can guarantee
convergence for simple systems, but still cannot be guaranteed
for complex systems.