[SciPy-user] convergence detection in optimize/nonlin.py

Pauli Virtanen pav@iki...
Wed Nov 12 18:20:43 CST 2008

Wed, 12 Nov 2008 16:29:24 -0700, Andrew Hawryluk wrote:

> I am experimenting with optimize.broyden3() for solving a multivariable,
> nonlinear problem. The signature is
>   def broyden3(F, xin, iter=10, alpha=0.4, verbose = False)
> and it is written to iterate exactly 'iter' times.
> However, after it converges (to within machine tolerances) it runs into
> division by zero errors and fails while trying to take the square root
> of a NaN.

Yes, I think these methods should terminate after reaching user-specified 
tolerances. IIRC, divisions by zero etc. are not uncommon in Broyden 
methods if they are run to very short step lengths.

It's a bug, ticket here: http://scipy.org/scipy/scipy/ticket/791

Pauli Virtanen

More information about the SciPy-user mailing list