The Internet Economy

 

> with(linalg):
A:=linalg[matrix](3,3,[4,1,-5,-2,3,1,3,-1,4]);

Warning, new definition for norm

Warning, new definition for trace

[Maple Math]

> IDM:=matrix([[1,0,0],[0,1,0],[0,0,1]]);

[Maple Math]

Definition: An identity matrix is a square matrix which has one on the main diagonal and 0 everywhere else, such as the matrix IDM shown above. Multiplying Matrix A by the identity matrix would return the A matrix as expected.

> C:=evalm(A&*IDM);

[Maple Math]

We can expand a matrix by using the two commands agument or concat as shown below:

> a := matrix([[1,2],[2,3]]);

[Maple Math]

> b := matrix(2,3,[3,4,5,6,7,8]);

[Maple Math]

> augment(a,b);

[Maple Math]

> v := vector(2,[1,2]);

[Maple Math]

> concat(v,b,v);

[Maple Math]

In the above examples we create a new matrix by joining a and b, or joing a vector, a matrix and a vector. This is a useful tool for solving equation sytems. See page 223 of the text and the following example.

Suppose you want to solve the following sytems of equations for x1 and x2:

2x1 + 12x2 = 40

8x1 + 4x2 =28

> a:=matrix([[2,12],[8,4]]);

[Maple Math]

> b:=matrix([[40],[28]]);

[Maple Math]

> C:=augment(a,b);

[Maple Math]

By appropriate additions and subtractions for rows and cols, we can reduce the C matrix to:

> [Maple Math]

Note that 2 is the solution for x1, and 3 is the solution for x2, and the first part is just an identity

matrix.