Example02.mws

> with(linalg): #Finding the Jordan Form#

> A:=matrix([[12, 12, 0], [-3, 3, 9], [1, 1, 3]]);

A := matrix([[12, 12, 0], [-3, 3, 9], [1, 1, 3]])

> factor(minpoly(A,t));#This tells us that there is one Jordan block and its of size 3#

(t-6)^3

> kernel(A-6);

{vector([6, -3, 1])}

> kernel((A-6)^2);

{vector([1, 0, 0]), vector([0, -3, 1])}

> #We see that e.g. [0,1,0] is killed by (A-6)^3 but not (A-6)^2, so is suitable for generating a basis#

> evalm(multiply(A-6,[0,1,0]));

vector([12, -3, 1])

> evalm(multiply(A-6,[12,-3,1]));

vector([36, -18, 6])

> #The basis is [36,-18,6],[12, -3, 1],[0,1,0]#

> M:=transpose(matrix([[36,-18,6],[12, -3, 1],[0,1,0]]));

M := matrix([[36, 12, 0], [-18, -3, 1], [6, 1, 0]])...

> multiply(inverse(M), A, M);

matrix([[6, 1, 0], [0, 6, 1], [0, 0, 6]])

>