This is a little bit like deltaintegrate is to DiracDelta. Fixes the following issues:
Handle KroneckerDelta in Sum
http://code.google.com/p/sympy/issues/detail?id=3481
Handle KroneckerDelta in Product
http://code.google.com/p/sympy/issues/detail?id=3482
git pull https://github.com/jrioux/sympy concrete
Or view, comment on, or merge it at:
https://github.com/sympy/sympy/pull/1697
—
Reply to this email directly or view it on GitHub.
Is it possible to reuse the exact same code from deltaintegrate?
That code was indeed my starting point, and it has morphed into what I pushed here. There are differences that allows to simplify the algorithm. I should add that this is work in progress; the code handles most examples I could come up with, but there are at least a couple wrong results to fix.
That code was indeed my starting point, and it has morphed into what I pushed here. There are differences that allows to simplify the algorithm.
Well, at least for the summation case, you should be able to make them exactly the same, if I'm not mistaken, since a summation is an integral when viewed correctly (and the Kronecker delta is the Dirac delta). The biggest difference is that KroneckerDelta takes two arguments whereas DiracDelta takes one. But KroneckerDelta(n - m, 0)
is the same as KroneckerDelta(n, m)
, no?
For products, it probably can't generalize, but the delta formula for products doesn't even seem useful, unless you have something a little more complicated, like Product((1 - KroneckerDelta(n, m)))
.
I should add that this is work in progress; the code handles most examples I could come up with, but there are at least a couple wrong results to fix.
Maybe add those as tests so that this won't be merged until they are fixed. And by the way, I wouldn't be surprised if there aren't similar issues in deltaintegrate.
SymPy Bot Summary: Passed after merging jrioux/concrete (e86edd6) into master (d503614).
PyPy 2.0.0-beta-1; 2.7.3-final-42: pass
Python 2.7.2-final-0: pass
Python 3.2.1-final-0: pass
Sphinx 1.1.3: pass
Docs build command: make clean && make html-errors && make latex && cd _build/latex && xelatex sympy-*.tex
SymPy Bot Summary: Failed after merging jrioux/concrete (e86edd6) into master (8083428).
@jrioux: Please fix the test failures.
Python 2.5.0-final-0: pass
Python 2.6.6-final-0: pass
Python 2.7.2-final-0: fail
Python 2.6.8-final-0: pass
Python 2.7.3-final-0: fail
PyPy 2.0.0-beta-1; 2.7.3-final-42: pass
Python 3.2.2-final-0: pass
Python 3.3.0-final-0: pass
Python 3.2.3-final-0: pass
Python 3.3.0-final-0: pass
Python 3.3.0-final-0: pass
**Sphinx 1.1.3:** pass