Ask Your Question

RAC's profile - activity

2014-05-10 11:38:38 -0600 received badge  Famous Question (source)
2012-10-22 08:10:56 -0600 received badge  Notable Question (source)
2012-02-11 02:11:12 -0600 received badge  Popular Question (source)
2011-02-17 04:41:38 -0600 received badge  Supporter (source)
2011-02-16 08:57:56 -0600 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 07:24:59 -0600 received badge  Student (source)
2011-02-16 06:35:22 -0600 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.