eig return complex values
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Michael cohen
el 22 de En. de 2022
Comentada: Matt J
el 23 de En. de 2022
Hello,
I'm trying to find the eigenvalues and eigenvectors of an invertible matrix. The eig function returns me complex values.
But the matrix is invertible: I invert it on Pascal.
How to explain and especially how to solve this problem please?
The matrix I am trying to invert is the inv(C)*A matrix, from the attached files.
Thanks,
Michael
5 comentarios
Respuesta aceptada
Torsten
el 22 de En. de 2022
Editada: Torsten
el 22 de En. de 2022
Use
E = eig(A,C)
instead of
E = eig(inv(C)*A)
or
E = eig(C\A)
4 comentarios
Torsten
el 22 de En. de 2022
Editada: Torsten
el 22 de En. de 2022
Although negligible, eig(A,C) produces no imaginary parts.
E = eig(A,C) solves for the lambda-values that satisfy
A*x = lambda*C*x (*)
for a vector x~=0.
If C is invertible, these are the eigenvalues of inv(C)*A (as you can see by multiplying (*) with
inv(C) ).
Más respuestas (1)
Matt J
el 22 de En. de 2022
Editada: Matt J
el 22 de En. de 2022
It turns out that B=C\A does have real eigenvalues in this particular case, but floating point errors approximations produce a small imaginary part that can be ignored.
load matrices
E=eig(C\A);
I=norm(imag(E))/norm(real(E))
So just discard the imaginary values,
E=real(E);
2 comentarios
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!