How to obtain eigenvalues as functions of a variable?
이전 댓글 표시
I want to solve an eigenvalue problem as such:
In which the matrix B is constant, and the matrix A varies with the term u. My objective is to analyze the variation of each eigenvalue with u (for example):
u=0:100;
B=[1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 16];
lambda=zeros(size(B,1),size(u,2));
for i=1:size(u,2)
A=[u(i)*5 7 u(i)*10 9;10 15 17 20;11 13 12 20;3 7 1 9];
lambda(:,i)=eig(A,B);
end
If I am not wrong, I believe that each time MATLAB solves the eigenvalue problem, the order in which it places each eigenvalue in the output column vector is completely random (please correct me if I am wrong). For me, this is a problem because I want to determine how each eigenvalue varies, so I would like the '"same" eigenvalue to be placed (or sorted) in the same position (row) every time. Because I am working with big matrices, with complex eigenvalues, in which the variations are very unpredictable, I have no criteria to use the function sort().
I have also tried to use symbolic computation, defining u as a symbolic variable, and trying to obtain each eigenvalue as symbolic expressions, functions of u (for example):
syms u
B=[1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 16];
B=sym(B);
A=[u*5 7 u*10 9;10 15 17 20;11 13 12 20;3 7 1 9];
S=B\A;
lambda=eig(S);
But this solution proved to be unsustainable, due to my computer's poor memory (I don't know if there is any way to improve this approach).
Is there any way to keep track of each eigenvalue and know to which eigenvalue it "corresponds"? (sorry if I am not very clear)
댓글 수: 3
Ameer Hamza
2020년 3월 31일
Since you mentioned that there are no criteria for sorting the eigenvalues, how do you determine which order is correct? For example, for one value of u, the eigenvalues were
diag([0.1 0.5 -0.2 -0.3])
and then after changing the value of u, you get
diag([1 2 -0.9 -0.2])
How do you determine if the 2nd order is consistent or not? If you can describe the criteria in words, then most probably it can be implemented in the code.
Pedro Camacho
2020년 3월 31일
David Goodmanson
2020년 3월 31일
Hi Ameer,
You can sort the eigenvalues with, say, sort(eigvalues,'abs') and get a dependable order. But if you want to follow the eigenvalues by continuity in the variable u, you might have to use small steps for u. That works, but it is of course a time comsuming process .
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!