#10239: Bessel method forces bessel_Y to use pari algorithm
------------------------+---------------------------------------------------
   Reporter:  jvkersch  |       Owner:  jason                  
       Type:  defect    |      Status:  new                    
   Priority:  major     |   Milestone:                         
  Component:  misc      |    Keywords:  functions, bessel, pari
     Author:            |    Upstream:  N/A                    
   Reviewer:            |      Merged:                         
Work_issues:            |  
------------------------+---------------------------------------------------
 When computing the Bessel Y-function, the `Bessel` function calls
 `bessel_Y` with a default argument of `algorithm='pari'`.  However,
 `bessel_Y` throws an exception when using anything else than scipy or
 maxima.


 {{{
 sage: f = Bessel(0, typ='Y')
 sage: f(1.5)
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /Users/Joris/Desktop/sage/build/sage-4.6.alpha2/<ipython console> in
 <module>()

 /Users/Joris/Desktop/sage/build/sage-4.6.alpha2/local/lib/python2.6/site-
 packages/sage/functions/special.pyc in __call__(self, z)
    1084             return bessel_K(nu,z,algorithm=s,prec=p)
    1085         if t == "Y":
 -> 1086             return bessel_Y(nu,z,algorithm=s,prec=p)
    1087
    1088     def plot(self,a,b):

 /Users/Joris/Desktop/sage/build/sage-4.6.alpha2/local/lib/python2.6/site-
 packages/sage/functions/special.pyc in bessel_Y(nu, z, algorithm, prec)
     938         return
 RR(maxima.eval("bessel_y(%s,%s)"%(float(nu),float(z))))
     939     else:
 --> 940         raise ValueError, "unknown algorithm '%s'"%algorithm
     941
     942 class Bessel():

 ValueError: unknown algorithm 'pari'
 }}}

 The following works fine:
 {{{
 sage: f = Bessel(0, typ='Y', algorithm='scipy')
 sage: f(1.5)
 0.382448923798000
 sage: g = Bessel(0, typ='Y', algorithm='maxima')
 sage: g(1.5)
 0.382448923797759
 }}}

 As a first solution, it would be easy to change the calling convention of
 `bessel_Y` to ensure that maxima or scipy is used.  However, it seems like
 pari does a better job at computing the Bessel functions, and therefore it
 might be better in the long run to extend `bessel_Y` to use pari (if at
 all possible).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10239>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to