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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Eigenvalues out of order

dBoggs
1-Newbie

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
BillWadsworth
5-Regular Member
(To:prop_design)

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.

Top Tags