Comment #11 on issue 2128 by jagermeistermeister: cannot integrate piecewise function numerically
http://code.google.com/p/sympy/issues/detail?id=2128

I found out why the error triggers.

In Piecewise._eval_interval there is this code:

            if cond.args[0] == sym:
                curr[0] = S.NegativeInfinity
            elif cond.args[1] == sym:
                curr[1] = S.Infinity
            else:
                raise NotImplementedError, \
                    "Currently only supporting evaluation with only " \
                    "sym on one side of the relation."

When I try to integrate(f.subs(x,x-y),(y,-oo,oo)), cond.args[0] becomes equal to x - y, which is never equal to sym (because sym = y in this case). I think this could be solved by checking if cond.args[0] contains sym instead of checking if it is equal to sym. However, I tried searching for how to accomplish that, without any luck so far :) Could anyone give me a step in the right direction? I'm still very new to sympy.

My thoughts so far:
1. check if cond.args[0] is an expression
2. if it is an expression, check if cond.args[0] contains sym
3. if it is not an expression, check if cond.args[0] is equal to sym

(the same goes for cond.args[1])

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
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/sympy-issues?hl=en.

Reply via email to