[SciPy-Dev] optimize.fsolve too accurate

Yosef Meller mellerf at netvision.net.il
Thu Feb 24 09:44:02 EST 2011


בתאריך 24/02/11 08:38, ציטוט Joris Vankerschaver:
> I'm relatively new to SciPy, so I hope you will excuse the occasional
> inaccuracies, but I noticed something slightly strange with
> scipy.optimize.fsolve: the following snippet
>
>     import scipy.optimize
>     fun = lambda x: x**2
>     scipy.optimize.fsolve(fun, 0.5)
>
> returns  "Warning: The number of calls to function has reached maxfev =
> 400", while the answer is presented as  2.8405269166788003e-84 (you
> might have to change the initial conditions somewhat to obtain this
> error).  As the default tolerance for fsolve is roughly 1.4e-8, the
> computation should have terminated long before reaching this level of
> precision.
>
> My question: is this a bug or am I invoking fsolve in the wrong way?

I can confirm that this happens on the first time the code is run. 
Second call to fsolve with the same arguments runs as expected. There 
might be something wrong with module initialization or something of the 
sort.



More information about the SciPy-Dev mailing list