The wrong result is obtained when 'u' below is replaced with a variable that
starts with a lower case letter:
>>> e
(D**3*a + D**3*b + a*u**3 + b*u**3)/Re
>>> for aa in [A, AA, Aa, aaA, aAa, aA, c]:
... print aa, collect(e.subs(u, aa).expand(), [aa**3/Re, D**3])
...
A A**3*(a + b)/Re + D**3*(a/Re + b/Re)
AA AA**3*(a + b)/Re + D**3*(a/Re + b/Re)
Aa Aa**3*(a + b)/Re + D**3*(a/Re + b/Re)
[space inserted for clarity; compare first term below with last term above]
aaA D**3*(a + b) + aaA**3*(a + b)/Re
aAa D**3*(a + b) + aAa**3*(a + b)/Re
aA D**3*(a + b) + aA**3*(a + b)/Re
c D**3*(a + b) + c**3*(a + b)/Re
--
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.