Re: [ng-spice-devel] convergence
On Fri, 27 Apr 2001, Steve Hamm wrote:
> Actually, KCL is cheap if you're solving the right equation. If
> F(x) is the KCL equations for each node with MNA constraints
> appended, then if in solving F(x) = 0 you calculate delta x, rather
> than x like Spice does, then Newton is:
>
> J^(-1) F(x_k) = -delta_x
> x_{k+1} = x_k + delta_x
>
> So the right-hand side vector is F(), which can be used directly as
> a KCL check as well as in the calculation of delta_x.
Ok ... so you solve for delta_v instead of v, then compute v by
adding the newly solved delta_v to it.
Then, since the right side is now F(x) (where x is delta_v) (instead
of J*x - F(x), where x is v), you can do J*x - F(x) to see if you get
zero. Of course you do, except for round-off error, unless the
matrix solution has a problem. This has nothing to do with
convergence. It also has nothing to do with round-off errors that
occur in building the matrix.
Spice/ACS formulation: solves for v, checks v against v_old.
Steve's formulation: solves for x, which is (v-v_old), checks x
against 0. I don't see the difference.
I still must be missing something.
Consider:
V 1 0 2
Y1 1 0 poly(0 0 1)
The second line is a nonlinear admittance, i = v^2
The correct solution is v(1) = 2 (obviously)
The current in Y1 should be 4 amps.
Consider an initial guess, v(1) = 0.
So ... i=v^2 ..means i=0.
J = f'(x) = 2v = 0. (an open circuit!)
So, solving that equivalent circuit for v=2 means that current still
is 0. KCL is satisfied, yet it is still the wrong answer.
> 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?
In ACS, convergence checks are not scattered. It is all at
e_element.h, line 258. (in version 0.28).
Besides, for a number of reasons, it is necessary that each device
knows its status. Just checking a voltage vector or current vector
does not provide this information. It is not just a global
convergence check.
Partial thread listing:
- Re: [ng-spice-devel] convergence, (continued)