Dear all,

I wanted to compute some good old Bessel functions, and came upon the
following behavior.  I did not want to open trac tickets for all of
this, since I didn't know (apart from 1) whether this behavior is
intentional or not.

1) Sage uses a function "Bessel" which does some input checking and
then calls bessel_{I, J, K, Y} to compute the relevant function.  The
Bessel method takes an optional "algorithm" argument which defaults to
"pari".  However, bessel_Y only uses maxima or scipy and raises an
error when another algorithm is specified.

I've opened a trac ticket (#10239) about this.

It would be good to have bessel_Y use pari to do the computations, but
judging from the fact that bessel_{I, J, K} use pari by default while
bessel_Y doesn't, I suspect that there are some difficulties in doing
so.

2) The current bessel_Y implementation has a funny way of dealing with
complex-valued Bessel functions.  When the algorithm is scipy, the
computation works fine, but when the algorithm is maxima (the
default), the computation fails, since the result of the maxima
computation is coerced into the reals.  In bessel_Y, the relevant line
is

    RR(maxima.eval("bessel_y(%s,%s)"%(float(nu),float(z))))

Maxima does handle complex-valued Bessel functions, so extending this
function to deal with complex arguments should work.

3) I find it confusing to have the spherical Hankel functions defined
in Sage, but not the ordinary Hankel functions.  Did I overlook these
guys anywhere?  Anyway, since the latter are just linear combinations
of the Bessel J and Y functions, it shouldn't be difficult to define
them.

I'm interested in hearing what you think.  I know that there are some
stability issues with computing Bessel functions for complex
arguments, so I want to thread carefully....

All the best,
Joris

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to