'eigenvectors' failed..



On Tue, 2007-04-03 at 20:44 +0900, Bowo Prasetyo wrote:
> 'eigenvectors' failed to work on numeric 2x2 matrix below..
> 
> m: matrix( [10.48273938962865,14.15187882832064],
> [21.22781824248096,31.71055763210962] );
> eigenvectors(m)
> 
> It gave the following error message..
> 
> algsys failure: the eigenvector(s) for the 1 th eigenvalue will be
> missing.
> algsys failure: the eigenvector(s) for the 2 th eigenvalue will be
> missing.
Hi,
I've also run across that problem in the past, even with much
simpler 2x2 matrices, and I find it annoying. To see where the
problem is originating, consider the following example:

(%i1) eq1:[1.41*x+1.73*y,   2.1*1.41*x+2.1*1.73*y]$

(%i2) eq2:[1.414*x+1.732*y, 2.1*1.414*x+2.1*1.732*y]$

(%i3) eq3:[1.414*x+1.732*y, 2.1*(1.414*x+1.732*y)]$

Equations eq1 and eq2 are different, but one would expect
that the degree of computing difficulty would be similar
for both. On the other hand, eq2 and eq3 are identical.
Now look at the results of solving the systems with algsys:

(%i4) algsys(eq1,[x,y]);

(%o4) [[x = %r4,y = -141*%r4/173]]

(%i5) algsys(eq2,[x,y]);

(%o5) [[x = 0,y = 0]]

(%i6) algsys(eq3,[x,y]);

(%o6) [[x = %r2,y = -707*%r2/866]]

algsys fails to find all the solutions to such a simple system
as eq2. Even if algsys is improved, I think that eigen should
use a better approach.
It currently finds the eigenvalues and then substitutes them
in a square nxn matrix that must already have rank less than n,
if the eigenvalues were correct. Of course, due to numerical
error the rank of the matrix might appear to be n, and the only
solution to the homogeneous system would be 0. eigen those
gives the eigenvalues found but no eigenvectors.

I think that a better approach would be to eliminate the last
row of the matrix and solve for a system of n-1 equations with
n-1 variables (leaving the last variable as the free parameter).
I can try to modify eigen that way, but only next week after the
5.12 CVS release branch is created. Are there any comments or
suggestions?

Regards,
Jaime