A=matrix([[3.0,0.5],[1.5,4.5]]) # Coefficients of the variables
print 'Matrix=\n',A
b = vector([0.6, 6.0]) 
sol = A.solve_right(b)# Solution of the Matrix
A * sol
x, y = var('x, y')
print "\nResult of the Expressions:"
solve([3.0*x-0.5*y==0.6, 
       1.5*x+4.5*y==6.0], x, y)# Displaying the Values of x and y

SageDays/Kreyszig-6.3-3 (last edited 2010-08-12 12:36:22 by Mahesh Goheja)