Calculation of eigenvalues, eigenvectors fails



-----Felix E. Klee wrote: -----

>eigenvectors(matrix([0,3,2],[3,0,1],[2,1,0]));
>  `quotient' by `zero'

A workaround:

(%i1) algebraic : true$
(%i2) m : matrix([0,3,2],[3,0,1],[2,1,0])$
(%i3) charpoly(m,z);
(%o3) -z*(z^2-1)+2*(2*z+3)-3*(-3*z-2)
(%i4) tellrat(%);
(%o4) [z^3-14*z-12]
(%i5) v : matrix([a],[b],[c])$
(%i6) apply('append, args(m.v-z*v));
(%o6) [-a*z+2*c+3*b,-b*z+c+3*a,-c*z+b+2*a]
(%i7) algsys(%,[a,b,c]);
(%o7)
[[a=%r1,b=-(2*%r1*z^2-3*%r1*z-26*%r1)/5,c=(3*%r1*z^2-2*%r1*z-39*%r1)/5]]
(%i8) v : subst(%,v);
(%o8) matrix([%r1],[-(2
*%r1*z^2-3*%r1*z-26*%r1)/5],[(3*%r1*z^2-2*%r1*z-39*%r1)/5])

If you really want to, you can do untellrat(z^3-14*z-12), solve z^3 - 14 z
-12, and
paste these (huge) expressions for the eigenvalues into v.

Let's check that v is an eigenvector

(%i9) m.v - z*v$
(%i10) ratsimp(%);
(%o10) matrix([0],[0],[0])

Numerically, you can do the problem using eigens_by_jacobi. You might need
to
either do untellrat(z^3-14*z-12), or restart Maxima.

(%i1) load("linearalgebra.mac")$
(%i2) m : matrix([0,3,2],[3,0,1],[2,1,0])$
(%i3) eigens_by_jacobi (m,'floatfield);
(%o3) [[-3.2019117766787084,4.1130905843249508,-0.91117880764624293], )
(%i4) fpprec : 25;
(%o4) 25
(%i5) eigens_by_jacobi (m,'bigfloatfield);
(%o5) [[-3.201911776678708228276513b0,4.113090584324951253626655
b0,-9.111788076462430253501424b-1], ...)

Barton