Sorting an n x n matrix in the Jordan form.
16 次查看(过去 30 天)
显示 更早的评论
Assume I have a matrix J (n x n dimension), the matrix is originally obtained from MATLAB using the 'jordan' function which returns the matrix in the Jordan canonical form. MATLAB always returns the matrix J sorting the diagonal from lowest to highest, until it encounters repeated eigenvalue(s), which are sorted in Jordan blocks in the lower right corner of the matrix. Here's an example:
A = [0 1 0 0 0;
0 0 1 0 0;
0 0 0 1 0;
0 0 0 0 1;
-18 -57 -68 -38 -10];
J = jordan(A)
J = [-2 0 0 0 0;
0 -3 1 0 0;
0 0 -3 0 0;
0 0 0 -1 1;
0 0 0 0 -1]
The question is, is it possible to sort Matrix J's diagonal from highest to lowest (e.g. here [-1;-1;-2;-3;-3]) while keeping the Jordan blocks associated with each repeated eigenvalue?
In my example I want J to look like
[-1 1 0 0 0;
0 -1 0 0 0;
0 0 -2 0 0;
0 0 0 -3 1;
0 0 0 0 -3],
I want to make this transformation to any matrix of order n (n x n).
Thank you in advance.
Regards, M Ayoub.
1 个评论
回答(1 个)
David Goodmanson
2017-3-25
Hello Mohammad, I believe the following code works for a given Jordan matrix J.
a = sort(diag(J),'descend');
d = diff(a)==0; % look for repeated elements
Jnew = diag(a) + diag(d,1);
This code does not permute the elements of the original Jordan matrix but rather sorts the diagonal elements, so it is sensitive to any very small unintended numerical differences in the diagonal elements. The Jordan decomposition itself has the same issues so I don't think that this process adds new complications.
1 个评论
Martin Seltmann
2018-11-28
编辑:Martin Seltmann
2018-11-28
The proposal seems to assume that identical eigenvalues belong to the same Jordan block. But this does not have to be the case, there could be several Jordan blocks for the same eigenvalue.
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!