Hi happy new year.
I add Modematrix for jordan form.
please test this.
Maybe,I hope this code is robust.
After test,I hope to add this in share/mat at new version.
By cauchy integral formula,if f(x) is analytic and
mat=diag([JF(m1,n1),,JF(mk,nk)]),then
f(mat)=(ModeMatrix)^^-1*diag([f(JF(m1,n1)),,f(JF(mk,nk))])*ModeMatrix.
Now,we can allmost calc this way.soon I write a program for(f(JF(m1,n1)).
(D1) diag.mc
(C2) load("data1.mc");
(D2) data1.mc
(C3) a
;
[ 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 ]
(D3) [ ]
[ - 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 ]
(C4) jordan(a);
(D4) [[2, 3, 3, 1], [3, 1]]
(C5) mm:ModeMatrix(a,jordan(a));
[ 0 0 1 0 0 0 0 0 ]
[ ]
[ 0 1 0 0 0 1 0 0 ]
[ ]
[ 1 - 4 0 0 1 0 0 0 ]
[ ]
[ 0 2 0 0 0 0 1 0 ]
(D5) [ ]
[ 2 - 7 0 0 2 0 0 0 ]
[ ]
[ 1 9 0 0 0 0 2 0 ]
[ ]
[ 15 - 34 0 - 1 7 0 0 0 ]
[ ]
[ 0 28 - 117 0 - 2 15 1 1 ]
(C6) (mm^^-1).a.mm;
[ 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 ]
(D6) [ ]
[ 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 ]
Gosei Furuya (go_furuya@infoseek.jp)
>
> 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