Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#8752 closed defect (duplicate)

Can't evaluate numerically symbolic expression resulting from integral().

Reported by: Laurent Fousse Owned by: Burcin Erocal
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: calculus Keywords: integral, numerical conversion
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Consider the following (in sage 4.3.5):

sage: integral(exp(-x^2), x, 17, 42)   
-1/2*sqrt(pi)*erf(17) + 1/2*sqrt(pi)*erf(42)
sage: N(-1/2*sqrt(pi)*erf(17) + 1/2*sqrt(pi)*erf(42))


sage: N(integral(exp(-x^2), x, 17, 42))              
TypeError                                 Traceback (most recent call last)

/opt/sage-4.3.5/<ipython console> in <module>()

/opt/sage-4.3.5/local/lib/python2.6/site-packages/sage/misc/functional.pyc in numerical_approx(x, prec, digits)
   1161             prec = int((digits+1) * 3.32192) + 1
   1162     try:
-> 1163         return x.numerical_approx(prec)
   1164     except AttributeError:
   1165         from sage.rings.complex_double import is_ComplexDoubleElement

/opt/sage-4.3.5/local/lib/python2.6/site-packages/sage/symbolic/ in sage.symbolic.expression.Expression.n (sage/symbolic/expression.cpp:17043)()

TypeError: cannot evaluate symbolic expression numerically

Change History (3)

comment:1 Changed 13 years ago by Jason Grout

Resolution: duplicate
Status: newclosed

In 4.4.alpha1:

sage: N(integral(exp(-x^2), x, 17, 42))   

I believe this was taken care of in #3863.

comment:2 Changed 13 years ago by Jason Grout

Milestone: sage-duplicate/invalid/wontfix

comment:3 Changed 13 years ago by Laurent Fousse

Indeed, it is fixed. Thanks for the prompt reply, sorry for the duplicate.

Note: See TracTickets for help on using tickets.