I fell for this several times, and didn't see the error here, either. Could either the syntax be made consistent or the error message made more informative? Now that I think about it, I would probably prefer the latter, as it would not break any code and it does not seem logical to declare the free variable if there is only one free variable allowed...

Thoughts?

Stan

On 19/01/10 21:42, Jason Grout wrote:
jeff788 wrote:
I am trying to evaluate a definite integral using SAGE and am getting
some errors.  I have evaluated the same integrals using Mathematica
without a problem.  Here is the integral in question:

integral(0.298321984000000/((13.1233333333333*X + 1)^2*
(15.7466666666667*X + 1)),(X,0.05,0.3))

I get the following error:

Inverse of zero divisor?

I then tried using the numerical_integral command:

numerical_integral(0.298321984000000/((13.1233333333333*X + 1)^2*
(15.7466666666667*X + 1)),(X,0.05,0.3))

for which I get he following error:

TypeError: unable to simplify to float approximation


The syntax for numerical_integral is different than the syntax for integral (in particular, you don't specify the variable or the range in parentheses). This works:


sage: var('X')
X
sage: numerical_integral(0.298321984000000/((13.1233333333333*X + 1)^2*(15.7466666666667*X + 1)),0.05,0.3)
(0.0033064907013495063, 3.6709421073472043e-17)

The first number is the result, the second is an error bound.

Thanks,

Jason


--
________________________________________

Stan Schymanski
Scientist
Max Planck Institute for Biogeochemistry
Postfach 10 01 64
D-07701 Jena

Phone: +49.3641.576264
Fax: +49.3641.577274
WWW: http://www.bgc-jena.mpg.de/~sschym

Biospheric Theory and Modelling Group
http://www.bgc-jena.mpg.de/bgc-theory/
_________________________________________

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

Reply via email to