Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugs in evaluation of spherical bessel function #2494

Closed
williamstein opened this issue Mar 12, 2008 · 6 comments
Closed

bugs in evaluation of spherical bessel function #2494

williamstein opened this issue Mar 12, 2008 · 6 comments

Comments

@williamstein
Copy link
Contributor

BUG 1:

Hi,
I was just trying to calculate some stuff with spherical Bessel
functions and got this error message:

sage: spherical_bessel_J(3,.1)


....
6823         return x
  6824     except SyntaxError:
-> 6825         raise TypeError, "unable to make sense of Maxima
expression '%s' in SAGE"%s
  6826     finally:
  6827         is_simplified = False

<type 'exceptions.TypeError'>: unable to make sense of Maxima
expression '9.5185197208655641L-6' in SAGE
sage:
KeyboardInterrupt

I checked it, it happens for small values of the argument x.
Does anyone has a solution or work around?

Greets,

schorsch

BUG2

sage: spherical_bessel_J(3,.1, algorithm='scipy')
---------------------------------------------------------------------------
<type 'exceptions.NameError'>             Traceback (most recent call last)

/Users/was/Downloads/z/<ipython console> in <module>()

/Users/was/build/sage-2.10.3.rc3/local/lib/python2.5/site-packages/sage/functions/special.py in spherical_bessel_J(n, var, algorithm)
    782         ans = ans.replace(")","")
    783         ans = ans.replace("j","*I")
--> 784         return sage_eval(ans)
    785     elif algorithm == 'maxima':
    786         _init()

/Users/was/build/sage-2.10.3.rc3/local/lib/python2.5/site-packages/sage/misc/sage_eval.py in sage_eval(source, locals)
    108     p = preparse(source)
    109     try:
--> 110         return eval(p, sage.all.__dict__, locals)
    111     except SyntaxError, msg:
    112         raise SyntaxError, "%s\nError using SAGE to evaluate '%s'"%(msg, p)

/Users/was/Downloads/z/<string> in <module>()

<type 'exceptions.NameError'>: name 'array' is not defined

Probably many of the special functions in functions/special.py have similar bugs.

Component: numerical

Author: Mike Hansen

Reviewer: Alex Ghitza

Merged: sage-4.3.2.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/2494

@aghitza
Copy link

aghitza commented Aug 24, 2009

comment:2

Note that BUG 1 has disappeared in sage-4.1.1:

sage: spherical_bessel_J(3,.1)
9.51851972087e-06

BUG 2 is still there.

@mwhansen
Copy link
Contributor

Author: Mike Hansen

@mwhansen
Copy link
Contributor

comment:3

Attachment: trac_2494.patch.gz

@aghitza
Copy link

aghitza commented Jan 23, 2010

Reviewer: Alex Ghitza

@aghitza
Copy link

aghitza commented Jan 23, 2010

comment:4

Looks good and passes tests.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jan 24, 2010

Merged: sage-4.3.2.alpha0

@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Jan 24, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants