Issue 1161: Wrong result if calling Basic.subs() with a dictionary
http://code.google.com/p/sympy/issues/detail?id=1161
Comment #1 by ondrej.certik:
Indeed, great job with the debugging, thanks! This bug is still present
with our
latest git version.
So the problem is that the result of sol.subs() depends on the order of
substitution
(which gets affected for example by using either .subs(m)
or .subs(m.items())).
This is correct:
# sol.subs(m.items())
result = (-c_ + (-e_/a_)**(1/d_))/b_
result.subs(b_, 1) -> -c_ + (-e_/a_)**(1/d_)
result.subs(e_, -3) -> -c_ + (3/a_)**(1/d_)
result.subs(c_, 0) -> (3/a_)**(1/d_)
result.subs(a_, L) -> (3/L)**(1/d_)
result.subs(d_, 0.4) -> 15.5884572681199*(1/L)**2.5
So where exactly is the error here:
# sol.subs(m)
result = (-c_ + (-e_/a_)**(1/d_))/b_
result.subs(d_, 0.4) -> (-c_ + I*e_**2.5*(1/a_)**2.5)/b_
result.subs(a_, L) -> (-c_ + I*e_**2.5*(1/L)**2.5)/b_
result.subs(c_, 0) -> I*e_**2.5*(1/L)**2.5/b_
result.subs(e_, -3) -> -15.5884572681199*(1/L)**2.5/b_
result.subs(b_, 1) -> -15.5884572681199*(1/L)**2.5
on which line? Let's fix that particular substitution and all should start
working again.
Issue attribute updates:
Status: Accepted
Labels: -Priority-Medium Priority-High WrongResult
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy-issues" 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-issues?hl=en
-~----------~----~----~----~------~----~------~--~---