Arnoldi method to find eigenvalues
28 views (last 30 days)
Show older comments
I'm trying to implement the Arnoldi method with the inverse power method to find eigenvalues of large pencil matrix.
I have followed the practical implementation in Saad's book and I started with a small matrix to check if the code work well. As I understand H is a square matrix and has size of the number of the iterations but the resulted H is of size 3x2 and V is 4x3. I'm not sure if this is correct and I do'nt know how I can find the eigenvalues of H and the corresponding eigenvectors. Here is my attempt, and I really appreciate any help..
A=[1 0 0 0;0 17 0 0;0 0 -10 0 ;0 0 0 5]
n=length(A)
B=eye(n)
a=0 %interval [a,b]
b=10
m=2; %iterations
x=ones(n,1); %constant vector
shift=0.5;
V = zeros(n,m); %orthonormal basis of Krylov space
V(:,1) = x/norm(x);
H = zeros(n,m); %upper Hessenberg matrix
C=A-shift*B;
[L, U] = lu(C, 'vector');
for j=1:m
w=U\(L\(B*V(:,j)));
for i=1:j %Gram-schmidt
H(i,j) = V(:,i)'*w;
w = w - V(:,i)*H(i,j);
end
H(j+1,j) = norm(w,2);
V(:,j+1) = w/H(j+1,j);
end
0 Comments
Answers (0)
See Also
Categories
Find more on Robust Control Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!