A=matrix([[0.4,1.2],[1.7,-3.2]]) # Coefficients of the variables
print 'Matrix=\n',A
b = vector([-2.0, 8.1]) 
sol = A.solve_right(b)# Solution of the Matrix
A * sol
x, y = var('x, y')
print "\nResult of the Expressions:"
solve([0.4*x+1.2*y==-2.0, 
       1.7*x-3.2*y==8.1], x, y)# Displaying the Values of x and yre!

SageDays/Kreyszig-6.3-2 (last edited 2010-08-11 13:37:36 by Mahesh Goheja)