How to obtain eigenvalues as functions of a variable?
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Pedro Camacho
el 31 de Mzo. de 2020
Comentada: Pedro Camacho
el 31 de Mzo. de 2020
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 comentarios
David Goodmanson
el 31 de Mzo. de 2020
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 .
Respuesta aceptada
the cyclist
el 31 de Mzo. de 2020
Editada: the cyclist
el 31 de Mzo. de 2020
Take a look at John D'Errico's eigenshuffle function in the File Exchange. I believe it does what you want (and there is some theoretical discussion there as well).
Más respuestas (0)
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!