sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.34k stars 460 forks source link

Substitutions inside piecewise functions don't work #22102

Open rwst opened 7 years ago

rwst commented 7 years ago

Not implemented at the moment

sage: f = piecewise([((0,1), x^2), ([-1,0], -x)], var=x);
sage: f.subs(x=-1)
1
sage: f.subs(x=y)
...
ValueError: substituting the piecewise variable must result in real number

Component: symbolics

Author: Ralf Stephan

Branch/Commit: u/rws/substitutions_inside_piecewise_functions_don_t_work @ 98cab8b

Issue created by migration from https://trac.sagemath.org/ticket/22102

rwst commented 7 years ago
comment:1

It may be desirable to substitute inside the piece expressions only, and require the user to generate a new function for a variable change.

rwst commented 7 years ago

Branch: u/rws/substitutions_inside_piecewise_functions_don_t_work

rwst commented 7 years ago

Author: Ralf Stephan

rwst commented 7 years ago

New commits:

98cab8b22102: remove restrictions in piecewise._subs_
rwst commented 7 years ago

Commit: 98cab8b

rwst commented 7 years ago
comment:4

21071 requires a different approach.

fchapoton commented 3 days ago

see #38706 for some progress