I'm having trouble computing a definite integral involving the sqrt of a
non-negative expression, as implemented below (computing the length of a
quadratic line in 2D). It seems to fail. I've generally had success using
sympy for integration, except for when a sqrt is present.
If anyone has any advice on how to make this work, I would appreciate it
tremendously. Thanks in advance!
from sympy import *
x0,x1,x2,y0,y1,y2,xi = symbols('x0 x1 x2 y0 y1 y2 xi', real=True)
f_squared = (-4*x0*xi + 3*x0 - 4*x1*xi + x1 + 8*x2*xi - 4*x2)**2 + (4*xi*y0
+ 4*xi*y1 - 8*xi*y2 - 3*y0 - y1 + 4*y2)**2
f = sqrt(f_squared)
integrate(f, (xi,0,1))
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/896fa9c6-2073-432e-a38a-9bb609c33e8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.