Matlab flips the eigenvalue and eigenvector of matrix when passing through singularity
8 次查看(过去 30 天)
显示 更早的评论
Problem: I have a matrix(H(3x3)) in which I vary a parameter(B) and compute the eigenvalues and eigenvectors with varying parameter. I am using the eig() function of matlab. At a particular value of B, the matrix H becomes singular and after that I see in result that the eigenvalues and eigenvectors are flipped automatically. The first and second eigenvectors and eigenvalues changes there place after passing through singularity although they are being calculated correctly. I am sure of it because I have solved the problem analytically.
Mathematical Description: H = [D-B 0 0; 0 0 0; 0 0 D+B]; D=1.5; B=0:0.1:3
eigenvector [0 1 0] corresponds to eigenvalue 0
eigenvector [1 0 0] corresponds to eigenvalue D-B
eigenvector [0 0 1] corresponds to eigenvalue D+B
First eigenvalue should not change through out the variation of parameter B, but one can check that second eigenvalue takes the place of first eigenvalue after passing through the singularity B=D.
Is there any solution for such problems, because in future I will be using higher dimension matrices where it's not analytically possible to calculate eigenvalues.
0 个评论
采纳的回答
Christine Tobler
2018-7-3
The eigenvalues don't have any intrinsic order, so for real symmetric matrices, EIG just sorts them by size. Looking at just the 0.18 matrix, there's no way for EIG to know in what order the eigenvalues are at point 0.06, and to match this up.
Check out eigenshuffle on the MATLAB File Exchange, which takes the matrices for all data points at once and shuffles their eigenvalues to match up. Note this is not an easy problem to solve, so I don't know how well it will scale for larger matrices.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!