Comment #8 on issue 3732 by [email protected]: Integration of Piecewise function should also be continuous
http://code.google.com/p/sympy/issues/detail?id=3732

Aaron, as suspected by me, the current implementation of _eval_integral for Piecewise returns incorrect results for Integral transforms on piecewise functions. For example

from sympy import *
x = Symbol('x')
k = Symbol('k')
fourier_transform(sin(pi*x)/(pi*x), x, k)
Piecewise((-k/|k| + 1, 4*Abs(k**2) > 1), (1, True))

This solution is incorrect as it returns the value 2 for k < -1/2 while it should be zero. sinc(x) = sin(pi*x)/(pi*x) and rect(x) are Fourier transform pairs( http://cnx.org/content/m32899/latest/ )

If you try the suggested implementation in the PR : https://github.com/sympy/sympy/pull/1971, by uncommenting the code I have commited, you get the correct answer.

from sympy import *
x = Symbol('x')
k = Symbol('k')
fourier_transform(sin(pi*x)/(pi*x), x, k)
Piecewise((0, 4*Abs(k**2) > 1), (1, True))

The current behavior should be reflected in any kind of integral transform, even convolution of two Piecewise functions. Any integral transform on a Piecewise function would likely be a Piecewise function and the output should be continuous as expected. This is not the currently, since the integration constant is set to zero after integrating a piece of a piecewise function.


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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 http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to