Skip to content

Substitutions inside piecewise functions don't work #22102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rwst opened this issue Dec 27, 2016 · 7 comments · Fixed by #38706
Closed

Substitutions inside piecewise functions don't work #22102

rwst opened this issue Dec 27, 2016 · 7 comments · Fixed by #38706

Comments

@rwst
Copy link
Contributor

rwst commented Dec 27, 2016

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 rwst added this to the sage-7.5 milestone Dec 27, 2016
@rwst
Copy link
Contributor Author

rwst commented Dec 27, 2016

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
Copy link
Contributor Author

rwst commented Dec 27, 2016

@rwst
Copy link
Contributor Author

rwst commented Dec 27, 2016

Author: Ralf Stephan

@rwst
Copy link
Contributor Author

rwst commented Dec 27, 2016

New commits:

98cab8b22102: remove restrictions in piecewise._subs_

@rwst
Copy link
Contributor Author

rwst commented Dec 27, 2016

Commit: 98cab8b

@rwst
Copy link
Contributor Author

rwst commented Dec 28, 2016

comment:4

#21071 requires a different approach.

@fchapoton
Copy link
Contributor

see #38706 for some progress

vbraun pushed a commit to vbraun/sage that referenced this issue Sep 27, 2024
sagemathgh-38706: better subs on piecewise functions
    
This will allow to change variable for another variable in piecewise
functions.

This will fix sagemath#22102

### 📝 Checklist

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.
    
URL: sagemath#38706
Reported by: Frédéric Chapoton
Reviewer(s): Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 28, 2024
sagemathgh-38706: better subs on piecewise functions
    
This will allow to change variable for another variable in piecewise
functions.

This will fix sagemath#22102

### 📝 Checklist

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.
    
URL: sagemath#38706
Reported by: Frédéric Chapoton
Reviewer(s): Travis Scrimshaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants