You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [92]: Piecewise((0, Eq(x, 0)), (sin(x), True))
Out[92]: Piecewise((0, x == 0), (sin(x), True))
In [93]: pprint(_)
⎧ 0 for x = 0
⎨
⎩sin(x) otherwise
In [94]: simplify(_)
Out[94]: Piecewise((0, x == 0), (sin(x), True))
Perhaps this should not happen automatically, but it would be nice if simplify() did it. Apologies if this is a dupe, didn't see it. Figure its related to #1009 somehow.
Very simple cases work:
In [97]: Piecewise((10, Eq(x,0)), (10, True))
Out[97]: 10
And some more complicated things work too:
In [101]: p3 = Piecewise((10, Eq(x, 0)), (y, True))
In [101]: p3
Out[101]: Piecewise((10, x == 0), (y, True))
In [102]: p3.subs(y,10)
Out[102]: 10
The text was updated successfully, but these errors were encountered:
Perhaps this should not happen automatically, but it would be nice if
simplify()
did it. Apologies if this is a dupe, didn't see it. Figure its related to #1009 somehow.Very simple cases work:
And some more complicated things work too:
The text was updated successfully, but these errors were encountered: