This looks fine. Indefinite integration is only ever defined up to a piecewise constant, so it isn't necessary to deprecate anything when changing the mathematical form a result.
Aaron Meurer On Wed, Jun 21, 2017 at 8:47 PM, Chris Smith <[email protected]> wrote: > The following comes from my current `lts` branch: > > >>>> var('A:C') > (A, B, C) >>>> i = Piecewise((A, x<1), (B, x>2), (C, True)).integrate(x); i # new >>>> continuous result > Piecewise((A*x, x <= 1), (A + C*x - C, x <= 2), (A + B*x - 2*B + C, True)) >>>> for j in range(0,6): > ... j,i.subs(x,j) > ... > (0, 0) > (1, A) > (2, A + C) > (3, A + B + C) > (4, A + 2*B + C) > (5, A + 3*B + C) >>>> pwi = Piecewise((A, x<1), (B, x>2), (C, True)).piecewise_integrate(x) # >>>> old discontinuous result >>>> pwi > Piecewise((A*x, x < 1), (B*x, x > 2), (C*x, True)) >>>> for j in range(0,6): > ... j,pwi.subs(x,j) > ... > (0, 0) > (1, C) > (2, 2*C) > (3, 3*B) > (4, 4*B) > (5, 5*B) > > The inequalities changing to equalities represents a corner case that I > haven't addressed yet. It especially shows up when the derivatives of the > integral are computed: > >>>> i.diff(x) > Piecewise((A, x <= 1), (C, x <= 2), (B, True)) >>>> pwi.diff(x) > Piecewise((A, x < 1), (B, x > 2), (C, True)) > > The reversal of args is correct in the first case: the args are ordered > according to spatial appearance along the x-axis. > > On Wednesday, June 21, 2017 at 9:21:44 AM UTC-5, Aaron Meurer wrote: >> >> Can you give an example of old vs. new behavior? Are they mathematically >> equivalent (up to pievewise constant)? >> >> Aaron Meurer >> >> On Tue, Jun 20, 2017 at 8:37 AM Chris Smith <[email protected]> wrote: >>> >>> Currently, indefinite integration of Piecewise gives the discontinuous >>> Piecewise result obtained by simply integrating the pieces of the Piecewise. >>> I propose (in PR #12587) that the `integrate` method give the continuous >>> result and a method `piecewise_integrate` be used to return the old >>> behavior. Are there other ideas? Do we need a deprecation of the old >>> behavior? >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "sympy" 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 https://groups.google.com/group/sympy. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/sympy/95872e1e-ac0e-4b3d-b1c2-43520fa88158%40googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" 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 https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/23828d79-5a21-4961-9e84-977916751c64%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sympy" 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 https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6JDTMdhp%2B%2BzhHeZxY7xYKJ8_cR8FaihbaBpjLXhLuGybA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
