Re: [ng-spice-devel] convergence
Regarding the two different loop forms:
Form 1: (Spice method, inconsistent according to Steve):
evaluate F(x_n) and J(x_n)
solve for x_(n+1)
if (x_(n+1) - x_n)) is small, quit
Form 2: (consistent according to Steve):
evaluate F(x_n) and J(x_n)
solve for delta x
if (F(x_n) is small and delta x is small) quit
x_(n+1) = x_n + delta x
loop to top
Actually, both are inconsistent.
With form 1, x is solved using the latest state variables, which may
not match what you get using the latest x.
With form 2, the state variables are solved using the latest x, which
may not match what you get when you apply the state variables you
have.
But, at convergence it doesn't matter. The error is bounded.
They would be equivalent if in Form 1, you display x_n, even though
you know x_(n+1).
The ACS method is closer to form 2.
evaluate F(x_n) and J(x_n)
if (delta F(x), delta x, and delta J(x) are all small) quit
solve for x_(n+1)
> This loop is consistent. Assuming the number of branches and state
> variables to be checked is larger than the number of equations --
> and it should be -- the checking is much quicker, independent of
> the devices involved, and I still think directly checking F is a
> benefit, since that's what we're solving. The number of function
> evaluations should be the same, except for purely linear networks
You are still assuming global iteration -- all or nothing. Checking
many parameters, as soon as one fails there is no need to check any
more. It is beneficial to check the one most likely to fail first.
ACS checks J(x) first (the derivative). The reason it checks all
elements is that it uses the local information to optimize.
Steve:
> (but spice doesn't do anything special for those).
ACS does. It also optimizes portions of the circuit that settle down
quickly, and linear portions of partially nonlinear networks.
Information from the state variable checks is used to do this.
Steve:
> To actually do the check of F, there have been a number of
> proposals in the literature. One could keep track of the maximum
> branch current incident at a node and use it for a relative
> tolerance per equation; an absolute tolerance could be compared to
> some norm of F; a relative reduction in F from F(x_0) could be
> used.
More complexity, and I still don't see how checking the composite is
better than checking the individual pieces.
This gives me some ideas for more optimization.
Partial thread listing:
- Re: [ng-spice-devel] convergence, (continued)