1 | initial version |
This happens because of the way python handles variables, assignment, and references. Try the following:
sage: var("x,a")
(x, a)
sage: x = cos(a)
sage: a = 1/4
sage: print x
cos(a)
sage: print(a)
1/4
In this code, a
at first refers to a symbolic variable, then the name a
is reassigned to the number 1/4. When x gets printed you still see the symbolic variable there whose name is a
.
To get a value for a
substituted into x, y, z
try using the .subs method:
sage: var('a')
a
sage: x = cos(a)
sage: x.subs(a=1/4)
cos(1/4)