A=matrix([[0,10,4,-2],[-3,-17,1,2],[1,1,1,0],[8,-34,16,-10]]) # Coefficients of the variables
print 'Matrix=\n',A
b = vector([-4,2,6,4]) 
sol = A.solve_right(b)# Solution of the Matrix
A * sol
w,x, y,z = var('w,x, y,z')
print "\nResult of the Expressions:"
solve([0*w+10*x+4*y-2*z==-4, 
       -3*w-17*x+1*y+2*z==2,
       1*w+1*x+1*y+0*z==6,
       8*w-34*x+16*y-10*z==4],w, x, y,z)# Displaying the Values of w,x,y and z

SageDays/Kreyszig-6.3-15 (last edited 2010-08-11 14:00:37 by Mahesh Goheja)