Status: Valid
Owner: ----
Labels: Type-Enhancement Priority-Medium Simplify
New issue 3902 by [email protected]: simplify() should call
piecewise_fold()
http://code.google.com/p/sympy/issues/detail?id=3902
In [25]: simplify(-(r*Piecewise((4*pi/3, r <= R), (-8*pi*R**3/(3*r**3),
True)) + 2*Piecewise((4*pi*r/3, r <= R), (4*pi*R**3/(3*r**2),
True)))/(4*pi*r))
Out[25]:
⎛ ⎛⎧ 4⋅π ⎞ ⎛⎧4⋅π⋅r ⎞⎞
⎜ ⎜⎪ ─── for r ≤ R⎟ ⎜⎪───── for r ≤ R⎟⎟
⎜ ⎜⎪ 3 ⎟ ⎜⎪ 3 ⎟⎟
⎜ ⎜⎪ ⎟ ⎜⎪ ⎟⎟
-⎜r⋅⎜⎨ 3 ⎟ + 2⋅⎜⎨ 3 ⎟⎟
⎜ ⎜⎪-8⋅π⋅R ⎟ ⎜⎪4⋅π⋅R ⎟⎟
⎜ ⎜⎪─────── otherwise⎟ ⎜⎪────── otherwise⎟⎟
⎜ ⎜⎪ 3 ⎟ ⎜⎪ 2 ⎟⎟
⎝ ⎝⎩ 3⋅r ⎠ ⎝⎩ 3⋅r ⎠⎠
───────────────────────────────────────────────────
4⋅π⋅r
In [26]: piecewise_fold(-(r*Piecewise((4*pi/3, r <= R),
(-8*pi*R**3/(3*r**3), True)) + 2*Piecewise((4*pi*r/3, r <= R),
(4*pi*R**3/(3*r**2), True)))/(4*pi*r))
Out[26]:
⎧-1 for r ≤ R
⎨
⎩0 otherwise
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" 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 http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.