Ask Your Question

RAC's profile - activity

2014-05-10 18:38:38 +0100 received badge  Famous Question (source)
2012-10-22 15:10:56 +0100 received badge  Notable Question (source)
2012-02-11 09:11:12 +0100 received badge  Popular Question (source)
2011-02-17 11:41:38 +0100 received badge  Supporter (source)
2011-02-16 15:57:56 +0100 answered a question Using numerical solution from system of equations

Great, thanks for the help. I'm a social scientist who's trying to teach himself sage and python (and to use it for my work). The last time I had a computer science course Pascal was the in thing ;) RAC

2011-02-16 14:24:59 +0100 received badge  Student (source)
2011-02-16 13:35:22 +0100 asked a question Using numerical solution from system of equations

I want to take the numerical solution of a variable in a system of equations and use it later in the program. But all I can get is the symbolic definition. Here's a simplified example of the problem.

sage: var('x y z')

sage: eq1 = x + y + z == 6

sage: eq2 = 2*x - y + 2*z == 6

sage: eq3 = 3*x + 3*y - z == 6

sage: solve([eq1, eq2, eq3], x, y, z)

sage: v = x

sage: print v

Output:

[
[x == 1, y == 2, z == 3]
]
x

I assume the syntax for solving the system is correct because I get the right answers but I want v = 1, not v = x. Thanks.