Hi everyone.
I'm concerned about how subs() handles dictionaries, in which
the values of the dict contain some of the keys, such as
(x**2+y**3).subs({x: a*x+b*y, y: b*x-a*y})
Would it be preferable that the result is
(a*x+b*y)**2+(b*x-a*y)**3
? Right now subs() re-substitues terms which were already substituted
(a*x+b*y)**2+(b*(a*x+b*y)-a*y)**3
, which seems especially strange, since the dictionary does not imply
any order for the substitution. I think, if I would like to
resubstitute substituted terms, I would simply apply subs() several
times
(x**2+y**3).subs({y: b*x-a*y}).subs({x: a*x+b*y})
A possible solution would be to uniquely change the names of all variables
which are to be replaced internally, then do the substitution given as
dictionary and then rename everything back. Would this be a useful thing
to have?
Thanks,
Martin
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.