how to define var vector?
sage: a,b,c=var("a,b,c")
sage: v = vector(QQ, ["a", "b", "c"]);v
...
TypeError: unable to convert a to a rational
cannot run
asked 2014-10-22 13:58:43 +0100
This post is a wiki. Anyone with karma >750 is welcome to improve it.
sage: a,b,c=var("a,b,c")
sage: v = vector(QQ, ["a", "b", "c"]);v
...
TypeError: unable to convert a to a rational
cannot run
There are two errors in your code.
First: you define variables a,b,c , that's ok, but you use strings in the list of vector entries.
Second: a,b,c are elements of the symbolic ring and cannot be converted to elements of QQ
sage: a,b,c=var("a,b,c");v = vector([a,b,c]);v
(a,b,c)
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2014-10-22 13:58:43 +0100
Seen: 994 times
Last updated: Oct 23 '14