Hello I write program for calculating Jordan cannonical Form,and etc. diag([a1,a2,..]) each ai is square matrix or one element. Jordan cell JF(labmda,n),labmda is eigenvalue,n is size of matrix. jordan(mat) is jordan form but represented by list. we obtain matrix form ,dispJordan(this list). minimalPoly(this list) display minimalpolynomial of that matrix (M^^-1)AM=JF,I soon show maybe at this week end I intended to write this program,after saw Barton's mat_exp.mc Partially because of Mathematica BUG , a:matix( [2,0,0,0,0,0,0,0], [1,2,0,0,0,0,0,0], [-4,1,2,0,0,0,0,0], [2,0,0,2,0,0,0,0], [-7,2,0,0,2,0,0,0], [9,0,-2,0,1,2,0,0], [-34,7,1,-2,-1,1,2,0], [145,-17,-16,3,9,-2,0,3])$ Mathematica returns wrong Jordan form,my program returns correct answer for this matrix. please see http://library.wolfram.com/mathgroup/archive/2000/Dec/msg00108.html any opinion is appreciated. sample (C1) load("diag.mc"); Warning - you are redefining the MACSYMA function EIGENVALUES Warning - you are redefining the MACSYMA function EIGENVECTORS (D1) diag.mc a is above matrix. (C3) jordan(a); (D3) [[2, 3, 3, 1], [3, 1]] (C4) dispJordan(%); [ 2 1 0 0 0 0 0 0 ] [ ] [ 0 2 1 0 0 0 0 0 ] [ ] [ 0 0 2 0 0 0 0 0 ] [ ] [ 0 0 0 2 1 0 0 0 ] (D4) [ ] [ 0 0 0 0 2 1 0 0 ] [ ] [ 0 0 0 0 0 2 0 0 ] [ ] [ 0 0 0 0 0 0 2 0 ] [ ] [ 0 0 0 0 0 0 0 3 ] (C5) minimalPoly(d3); 3 (D5) (x - 3) (x - 2) (C6) diag([JF(1,7),x,JF(3,2)]); [ 1 1 0 0 0 0 0 0 0 0 ] [ ] [ 0 1 1 0 0 0 0 0 0 0 ] [ ] [ 0 0 1 1 0 0 0 0 0 0 ] [ ] [ 0 0 0 1 1 0 0 0 0 0 ] [ ] [ 0 0 0 0 1 1 0 0 0 0 ] (D6) [ ] [ 0 0 0 0 0 1 1 0 0 0 ] [ ] [ 0 0 0 0 0 0 1 0 0 0 ] [ ] [ 0 0 0 0 0 0 0 x 0 0 ] [ ] [ 0 0 0 0 0 0 0 0 3 1 ] [ ] [ 0 0 0 0 0 0 0 0 0 3 ] this program is GPL. Gosei Furuya (go_furuya@infoseek.jp)
Attached file: diag.mc