Given a big square matrix and some eigenvalues, how to find the corresponding eigenvectors?
6 visualizaciones (últimos 30 días)
yi yang el 2 de En. de 2023
My computer configuration: CPU: 8 cores 4.6GHz, 16GB memory.
I have a big matrix A with size(A) = (3072,3072)
I can get the eigenvalues by doing
v = eig(A)
But my computer dies if I do
[V,D] = eig(A)
I need the corresponding eigenvectors of some of the eigenvalues in v, saying I need 180 eigenvectors, and the corresponding eigenvalues are biggest among v. How to do it?
Christine Tobler el 3 de En. de 2023
Editada: Christine Tobler el 3 de En. de 2023
I wouldn't expect a 3072-by-3072 matrix to be a problem on the machine you describe. Could you try to run the following on your machine?
A = randn(3072, 3072);
% A = A + A'; % if your original matrix is symmetric, please also symmetrize here
[U, D] = eig(A);
I'd like to find out if it's any matrix of this size that's causing an issue, or just your particular one.
Más respuestas (2)
John D'Errico el 2 de En. de 2023
Editada: John D'Errico el 2 de En. de 2023
A = magic(8)
format long g
[V,D] = eig(A); d = diag(D)
Now we wish to solve for the eigenvector, corresponding to one of the eigenvalues, as if we did not know the eigenvector already. In this case, we know it, but we need to check how well we did.
eigenvec = @(A,e,n) [A - e*eye(n);[1,zeros(1,n-1)]]\[zeros(n,1);1];
All I did there was to enforce that the first element of the eigenvector is 1. This arbitrarily scales the eigenvector. But except for rare occasions, when the first element of the corresponding eigenvector would have been exactly zero, this will make the system non-singular.
n = size(A,1);
V1 = eigenvec(A,d(1),n);V1 = V1/norm(V1);
In some cases, the two vectors will differ by a factor of -1, but that should be all.
Honestly what I'm not sure I know is why your computer is failing to compute the eigenvectors. 3024 is a pretty small system these days. My computer did not even make a small hiccup when I try that.