Comment #24 on issue 2128 by [email protected]: Implement more general piecewise integration algorithm
http://code.google.com/p/sympy/issues/detail?id=2128

Meh after going through the first paper I don't think it helps. It requires the conversion of a piecewise function to the heaviside functions based on the break points. My algorithm actually handles the same cases that it does, see eq 20, where the conditions are simple, i.e. the variable of differentiation is of the form sym < real number.

Besides we will need to fix heaviside and conditional reasoning first, for example the following things kill the current implementation:

In [45]: h = Heaviside(2-x)

In [48]: integrate(h, (x, 0, 1))
Out[48]: Integral(Heaviside(2 - x), (x, 0, 1))

For some real fun, playing around with the paper's signum functions:

In [29]: s.subs(y, x)
Out[29]: Piecewise((1, 0 < x), (0, x == 0), (-1, x < 0))

In [34]: integrate(Rational(1,2) *s.subs(y, y - 2) + Rational(1,2)*s.subs(y, 2 - y), (y, -1,1))
....

Anywho, regardless of this paper we have to sweep over the domain of integration and find the break points which is what _eval_interval does. To support fancier things we need better conditional solvers. Then maybe this algorithm will help us.

--
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