What am I Doing Wrong?

41 views
Skip to first unread message

Groover

unread,
Dec 23, 2014, 3:46:36 PM12/23/14
to sy...@googlegroups.com
Hello, I am clearly making a stupid mistake, but what?

Arc length calculation:

x = Symbol('x')
 
formula = 2 * x**2
 
d = diff(formula, x)
i = integrate(sqrt(1 + d**2), (x, 5.0, 10.0))


gives a result of 150.087

but changing the formula to this:

formula = 0.26666 * x**2

gives a result of zero. In fact any coefficient less than one gives a result of zero.

Thanks, Andy

Aaron Meurer

unread,
Dec 23, 2014, 7:03:09 PM12/23/14
to sy...@googlegroups.com
Looks like you found a bug. I get the right result with meijerg=True,
which forces it to use that algorithm.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/a04d07c6-5dfe-47dc-a90e-d89a7bae6165%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Aaron Meurer

unread,
Dec 23, 2014, 7:19:09 PM12/23/14
to sy...@googlegroups.com
I have opened https://github.com/sympy/sympy/issues/8685 for this, and
debugged the code a little bit and found the problem.

Aaron Meurer
Reply all
Reply to author
Forward
0 new messages