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

Thanks asmeurer and mattpap, the in operator in combination with the expression is what I'm looking for :)

Now I realise that I have been doing something the wrong way. The following error message:

                raise NotImplementedError, \
                    "Currently only supporting evaluation with only " \
                    "sym on one side of the relation."

is correct imho. Suppose I would like to integrate the following Piecewise function on the interval [-oo, oo] wrt y:

⎧1  for x - y < 0
⎨
⎩0      for 1

I have no idea how to go about that mathematically (the x-y < 0 in the condition makes it difficult for me). I think it's safe to say the functionality for that is not implemented. But please correct me if I'm mistaken.



Whenever I do f.subs(x, x-y) (where f is a Piecewise function), it substitutes x in both the expression and the condition. This is expected behaviour, but not the desired behaviour for me and I'm looking for a way to only substitute x in the expression (not in the condition). Is this possible somehow? If not, I could try to add that functionality.

Some background information about what I'm trying to do:
I have a Piecewise defined probability density function (pdf) of a random variable. I want to add this random variable to another which also has a Piecewise defined pdf (assuming they are independent). Mathematically, that goes like this (suppose f(x) and g(x) are the pdfs of random variables X and Y):
Z = X + Y
then the pdf h(x) of random variable Z is given by: h(x) = integrate(f(x-y) * g(y), (y, -oo, oo) )

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to