> sage: n(a) # Why doesn't this return the result of numerical_integral? > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) > > /home/jason/.sage/temp/littleone/29880/_home_jason__sage_init_sage_0.py > in <module>() > > /home/jason/sage/local/lib/python2.5/site-packages/sage/misc/functional.pyc > in numerical_approx(x, prec, digits) > 765 prec = int((digits+1) * 3.32192) + 1 > 766 try: > --> 767 return x.numerical_approx(prec) > 768 except AttributeError: > 769 from sage.rings.complex_double import > is_ComplexDoubleElement > > /home/jason/sage/local/lib/python2.5/site-packages/sage/calculus/calculus.p yc > in numerical_approx(self, prec, digits) > 1514 except TypeError: > 1515 # try to return a complex result > -> 1516 approx = self._complex_mpfr_field_(ComplexField(prec))
Here's the problem: the only TypeError it recognizes is to try to evaluate a complex integral, but since sin(cos(x)) doesn't have an antiderivative Maxima knows about, it tries this. Maybe one (you? :) ) can implement a catch for the event that the integral does not completely resolve symbolically (e.g. try sage: integrate(1/ (1+x^8)) versus sage: integrate(1/(1+x^7)), where the first just returns the question but the second did the only piece of the partial fraction it could, yet both should probably have numerical_integral applied somehow when n() is called.) - kcrisman --~--~---------~--~----~------------~-------~--~----~ 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-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
