2009/5/15 Ondrej Certik <ond...@certik.cz>

>
> On Fri, May 15, 2009 at 3:16 AM, Priit Laes <plaes...@gmail.com> wrote:
> >
> > Ühel kenal päeval, N, 2009-05-14 kell 23:32, kirjutas Ondrej Certik:
> >> Hi,
> >>
> >> please review my spherical bessel patches:
> >>
> > I didn't check the math part, but in the jn_zeros() docstring there's
> > method = "sympy" instead of "scipy" in one place.
>
> Ah, thanks for noticing:
>
> +    method = "sympy": uses the scipy's sph_jn and newton to find all
> roots,
> +            which if faster than method="sympy", but it requires scipy and
> only
>
> this should be scipy.
>
> Apart from that, are there any other objections?
>

> # The findroot() is fragile, it sometimes returns complex numbers,
> # so we chop all complex parts (that are small anyway). Also we
> # need to set the tolerance, as it sometimes fail without it.
> def f_real(x):
>     return f(complex(x).real)
> root = findroot(f_real, x, solver="muller", tol=1e-9)
> root = complex(root).real

As mentioned in my other post, I don't get the point of using
method='muller', especially if you are not interested in complex roots.

I recommend to just use the default (secant), it won't give complex results
for real starting points. Or you might want to use an intersection method,
it would be more reliable and faster.

Do you think some of the functions should be rather implemented in mpmath?

Vinzent

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to