cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Eigenvalues out of order

dBoggs
1-Visitor

Eigenvalues out of order

I have a problem with the eigenvals() function. USALLY the results are sorted from largest to smallest, but occasionally they will be out of order. I have found the following simple matrix that demonstrates this:

[A] = 1.0053 1.0053 1.0053

1.0053 2.0001 2.0001

1.0053 2.0001 3.4365

eigenvals(A) = {5.301 0.337 0.803}

This can be a tremendous problem if, for example, I have a 100x100 matrix and I only need the first 3 eigenvalues and their associated eigenvectors.

See attached mathcad sheet with demo and illustration of what I go through to sort the values and vectors properly. Surely there must be a better way!

31 REPLIES 31

Your updated post fails when used with Mcad 14, see attached pdf.  I had trouble with Ian Ward's sorting process when I moved from Mcad 11 to 14, it sometimes found complex number frequencies before the lowest ones sought. So I amended it to weed out any complex results, as shown.

hi bill,

 

yeah, the order aspect was one of the things i changed to work with mathcad 15.

Announcements

Top Tags