Search code examples
physicslinear-algebramaple

Maple genmatrix command


Does anyone know what I am doing wrong here? I am trying to generate a matrix from the linear system defined and then solve the matrix using it's inverse. For some reason it won't create the matrix.

sys := {a+.9*h+.8*c+.4*d+.1*e+0*f = 1, .1*a+.2*h+.4*c+.6*d+.5*e+.6*f = .6, 
.4*a+.5*h+.7*c+d+.6*e+.3*f = .7, .6*a+.1*h+.2*c+.3*d+.5*e+f = .5,
 .8*a+.8*h+c+.7*d+.4*e+.2*f = .8, .9*a+h+.8*c+.5*d+.2*e+.1*f = .9}:
solve(sys, {a, c, d, e, f, h});
Z := genmatrix(sys, [a, h, c, d, e, f], 'b');

Indented values are Maple's response. Third line of code should have generated a matrix, but instead is giving back my input.


Solution

  • You need to load the linear-algebra package with(linalg).

    restart:with(linalg):
    Z := genmatrix(sys, [a, h, c, d, e, f], 'b');
    

    enter image description here