Changes between Version 8 and Version 11 of Ticket #11225


Ignore:
Timestamp:
06/25/16 18:33:21 (5 years ago)
Author:
mkoeppe
Comment:

Updated description for new piecewise (#14801). Didn't check the xmin/xmax etc. behavior that is mentioned in the description.

This can probably be closed when the old Piecewise (now deprecated) is removed completely.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11225

    • Property Cc jondo kcrisman vbraun slelievre mkoeppe eviatarbach rws added
    • Property Keywords piecewise added
    • Property Dependencies changed from to #14801
  • Ticket #11225 – Description

    v8 v11  
    1 Until we actually totally rewrite piecewise functions, we should improve some things.
     1Until we actually totally rewrite piecewise functions (done in #14801), we should improve some things.
    22
    33For concreteness, here is one thing that should work but doesn't. I'm sure there are more - add to this list, and then whatever isn't fixed in this ticket can be moved to another ticket.  I just want to make sure they're listed in one place, not ten tickets.
     
    1616AttributeError: PiecewisePolynomial instance has no attribute '__float__'
    1717}}}
     18
     19  Both examples work in the new `piecewise` (#14801):
     20{{{
     21sage: f = piecewise([[(0,1),x^3], [(1,2),x^2]], var=x)
     22sage: plot([f,x^3],(x,0,2))
     23}}}
     24{{{
     25sage: f = piecewise([[(-2,1),1],[(1,4),x]])
     26sage: g =  piecewise([[(-2,1),1],[(1,4),2*x]])
     27sage: plot([f,g], xmin=-3, xmax=5)
     28}}}
     29
    1830 * plotting a product of a piecewise with a symbolic (well, the problem is multiplying the two, but still worth putting here - see [http://groups.google.com/group/sage-support/browse_thread/thread/7357d08529de32dd this sage-support thread])
     31
     32  fixed in new `piecewise`
     33
    1934 * Maybe unify with `plot_step_function`, which currently is sort of its own thing?
    2035 * In this example:
     
    3449   * You can try plot(g), but that turns out to uncover a very strange error that may or may not be a bug.
    3550
     51  In new `piecewise` (#14801) 0 is no longer in the domain (open intervals?); and there is now support for unbounded intervals.
     52{{{
     53sage: zero_func(x)=0
     54sage: g = piecewise([[(-1000,1),zero_func],[(1,1000),(x-1)^3]])
     55sage: G = g.plot()
     56sage: G.show(xmin=-5,xmax=5,ymax=100)
     57Launched png viewer for Graphics object consisting of 1 graphics primitive
     58sage: g(1)
     59ValueError: point 1 is not in the domain
     60}}}
     61
    3662See also #1773.