Updates:
Status: Started
Cc: andy.terrel
Comment #1 on issue 1566 by asmeurer: Allow Integral to be evaluated at
only an upper limit
http://code.google.com/p/sympy/issues/detail?id=1566
I fixed this by modifying _eval_interval(self, a, b) in Basic to evaluate
-self(a) if b is None or self(b) if a is None.
Integral uses this method, so it now works. I also modified the printer so
that it doesn't print a limit if it is None.
You get the behavior just by doing Integral(x**2, (x, None, 1)), which will
return 1/3 (the integral evaluated at
only the upper limit of 1. You can also only evaluate at the lower limit,
for the sake of completeness, so
Integral(x*82, (x, 1, None)) will return -1/3.
I will include this with my Google Summer of Code ODEs patch in a few
weeks, because I need this behavior for
my project anyway. If you want to look at it now, you can pull from
http://github.com/asmeurer/sympy/tree/odes (see commit 2f1d0b4).
The only class other than Basic that implements _eval_interval() is
Piecewise, and I was not able to figure out how
it works to make it do the same thing. It might break if you ever try to
evaluate only one limit on a Piecewise
integral, so Andy, could you possibly give me a pointer as to how to fix
this.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---