Opened 4 years ago
Last modified 4 years ago
#23964 new defect
f.subs(I==...) does not work — at Version 7
Reported by: | zimmerma | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.1 |
Component: | calculus | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Minimal case:
sage: (I*x).subs(I==0) I*x
Originally:
the substitute
command does not work with I
:
sage: f = sin(x*I)+I*x^2+cos(exp(I)) sage: f.subs(I=0) I*x^2 + cos(e^I) + sin(I*x)
Change History (7)
comment:1 Changed 4 years ago by
comment:2 Changed 4 years ago by
thank you. Should I open a new ticket for this bug? Or simply change the ticket description?
comment:3 Changed 4 years ago by
- Summary changed from f.subs(I=...) does not work to f.subs(I==...) does not work
Done. I think I will restrict the numerics that can be replaced (not 0
nor 1
).
comment:4 Changed 4 years ago by
- Summary changed from f.subs(I==...) does not work to f.subs(I=...) does not work
btw it is strange that you get I*sinh(x)
since with Sage 8.0 I get sin(I*x)
, i.e., this term is unchanged.
comment:5 Changed 4 years ago by
- Summary changed from f.subs(I=...) does not work to f.subs(I==...) does not work
comment:6 Changed 4 years ago by
sorry we edited the ticket simultaneously and I discarded your edit in the title and maybe in the description. I've put the title back to ===
but I'm not sure about the description.
comment:7 Changed 4 years ago by
- Description modified (diff)
Yeah that was an enhancement in a recent Pynac (#23820).
The documentation:
Substitute with keyword arguments (works only with symbols):
. For youI
is a symbol but for Pynac it's numeric. Just use dictionary or relational syntax:As you can see the
I
insidecos(e^I)
is now replaced. I agree that the otherI
s not being replaced is a bug. The bug is independent of which numeric is to be substituted: