RE: [ng-spice-devel] convergence
---"Alan" == Gillespie, Alan <Alan.Gillespie@analog.com> writes:
Alan> What exactly do you mean by a KCL check ? I can only think of
Alan> two possibilities :-
Alan> A) Check that all the currents in each devices add up to zero
Alan> B) Check that all the currents into each node add up to zero.
We're writing KCL equations, so "checking KCL" would be B.
Alan> But surely B must be satisfied if the nodes haven't changed
Alan> since the last iteration.
Define "haven't changed" -- that's part of the problem.
Alan> If the matrix stuff is correct, surely an imbalance of current
Alan> would move the node voltage in the solution. Or are we worrying
Alan> about currents going into very low impedance nodes.
I think it's more straightforward to actually check KCL directly,
and with a change in formulation it is almost free.
And one can't always count on the accuracy of the matrix solution, but
that's a different set of headaches.
Alan> That's a point. Are we saying that device currents aren't
Alan> checked, only inductor and voltage source currents kept in the
Alan> matrix ?
Inductor and voltage source currents are part of the solution vector,
in MNA. So these get checked for iteration-to-iteration changes in
spice. Device currents are not checked in spice3. In spice2, they were
checked, sorta, in the linearization check. But since we're solving
KCL as F(x)=0, why have checks scattered all over the code when a loop
over the F vector would more directly check exactly the right thing?
--Steve
Partial thread listing: