Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2057 by asteppke: Units do not work together with evalf?
http://code.google.com/p/sympy/issues/detail?id=2057
Hi everybody,
while working with the sympy.physics module an issue with the units
appeared. I hope I am using the module correctly. While trying to calculate
some real numbers the usual f.evalf(subs=...) did not work as without the
units:
from sympy import *
from sympy.physics import units
v = Symbol('v')
# expected behavior
g = v / 100
g.evalf(subs={v:10})
0.100000000000000
g = v/units.c
g
v*s/(299792458*m)
# substitution did not happen here:
g.evalf(subs={v:10})
3.33564095198152e-9*v*s/m
# no substitution here either:
g.evalf(subs=({v:1000*units.m/units.s}))
3.33564095198152e-9*v*s/m
# but it works with this syntax:
g.evalf().subs({v:1000*units.m/units.s})
3.33564095198152e-6
Am I missing something or is this a bug that can be fixed/worked around?
Alexander
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.