0% found this document useful (0 votes)
97 views4 pages

Rayleigh Power Method for Eigenvalues

The document contains three examples of using the Rayleigh power method to find the largest eigenvalues and eigenvectors of matrices. It provides the code to initialize the method, define parameters like the number of iterations and error tolerance, run the iterative calculation, and display the results. Each example shows the input matrix, code, and output table of iterations displaying the maximum value and eigenvector components.

Uploaded by

shriomraikar217
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views4 pages

Rayleigh Power Method for Eigenvalues

The document contains three examples of using the Rayleigh power method to find the largest eigenvalues and eigenvectors of matrices. It provides the code to initialize the method, define parameters like the number of iterations and error tolerance, run the iterative calculation, and display the results. Each example shows the input matrix, code, and output table of iterations displaying the maximum value and eigenvector components.

Uploaded by

shriomraikar217
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Matrix Laboratory Manual

Lab 10) Finding largest and smallest eigenvalue by Rayleigh power method.
LAB 09) Solution of system of linear equations using Gauss-Seidel iteration.
Example 1:- Determine the largest eigen values and eigen vector
of the matrix
201
020
102
Algorithm
Step 1: Start
Step 2: Declare the variables (syms x y z )
Step 3: Read given matrix A
Step 4: Initialize vector v0 = v and
Step 5: Define the number of iterations to apply & absolute relative
approximate error
Step 6: Calculate length of second matrix(B)
Step6: Compute product of A and v0 = v
Step 7: Compute maximum value M of elements in v Divide v = v/M.
Step 8: Store the iteration in matrix form
Step 9: Check for the absolute relative approximate error
Step10: If iteration value is less than approximate error go to step 7
Step11: Display the Solution
Step12: End

Code:
A =[2 0 1; 0 2 0; 1 0 2] %intitial input matrix
v =[1;0;0] %initial choice of eigenvector
n=8; % nuumber of iteration
e = 1e-4 ; % tolerance of error
v0=v ;
N = length(v);
E =zeros(N,N); % initial matrix to store iteration
F=[0;0;0]; % initial matrix to Maximum Value
index=1;

for i = 1:n
v = A*v0 ;
M = max(v) ; %maximum value M of elements in v
v = v/M; %fresh value v

Department of Mathematics KLE Institute of Technology


Matrix Laboratory Manual

if abs(v-v0)<e
break
end

v0 = v;
E(index,:)=v();
F(index,:)=M();
index=index+1;
end

% Display the solution in form of table


p=[F,E];
V={'Max','x', 'y','z'};
T = array2table(p,'VariableNames',V)

Output:
T = 8×4 table

Max x y z
1 2 1 0 0.5000
2 2.5000 1 0 0.8000
3 2.8000 1 0 0.9286
4 2.9286 1 0 0.9756
5 2.9756 1 0 0.9918
6 2.9918 1 0 0.9973
7 2.9973 1 0 0.9991
8 2.9991 1 0 0.9997

Department of Mathematics KLE Institute of Technology


Matrix Laboratory Manual

Example 1:- Determine the largest eigen values and eigen vector
of the matrix
2 -1 0
-1 2 -1
0 -1 2
Code:
A =[2 -1 0; -1 2 -1; 0 -1 2] %intitial input matrix
v =[1;0;0] %initial choice of eigenvector
n=8; % nuumber of iteration
e = 1e-4 ; % tolerance of error
v0=v ;
N = length(v);
E =zeros(N,N);
F=[0;0;0];
index=1;
for i = 1:n
v = A*v0 ;
M = max(v) ; %maximum value M of elements in v
v = v/M; %fresh value v
if abs(v-v0)<e
break
end
v0 = v;
E(index,:)=v();
F(index,:)=M();
index=index+1;
end
p=[F,E];
V={'Max','x', 'y','z'};
T = array2table(p,'VariableNames',V)
T = 8×4 table

Max x y z
1 2 1 -0.5000 0
2 2.5000 1 -0.8000 0.2000
3 2.8000 1 -1 0.4286
4 3 1 -1.1429 0.6190
5 3.1429 1 -1.2424 0.7576
6 3.2424 1 -1.3084 0.8505
7 3.3084 1 -1.3503 0.9096
8 3.3503 1 -1.3761 0.9460
Department of Mathematics KLE Institute of Technology
Matrix Laboratory Manual

Example 3:- Determine the largest eigen values and eigen vector of the
matrix
25 1 2
1 3 0
2 0 -4
Code:
A =[25 1 2; 1 3 0; 2 0 -4] %intitial input matrix
v =[1;0;0] %initial choice of eigenvector
n=8; % nuumber of iteration
e = 1e-4 ; % tolerance of error
v0=v ;
N = length(v);
E =zeros(N,N);
F=[0;0;0];
index=1;
for i = 1:n
v = A*v0 ;
M = max(v) ; %maximum value M of elements in v
v = v/M; %fresh value v
if abs(v-v0)<e
break
end
v0 = v;
E(index,:)=v();
F(index,:)=M();
index=index+1;
end
p=[F,E];
V={'Max','x', 'y','z'};
T = array2table(p,'VariableNames',V)
T = 4×4 table

Max x y z
1 25 1 0.0400 0.0800
2 25.2000 1 0.0444 0.0667
3 25.1778 1 0.0450 0.0688
4 25.1827 1 0.0451 0.0685

Department of Mathematics KLE Institute of Technology

Common questions

Powered by AI

Choosing an appropriate error tolerance level is crucial as it balances computational efficiency and solution accuracy. A tight tolerance ensures high precision but requires more iterations, while a loose tolerance may lead to premature convergence on an inaccurate solution. The document emphasizes this by setting and adjusting error tolerances to guide iterative processes effectively .

The number of iterations directly influences the accuracy of eigenvalue estimation in the Rayleigh Power Method. More iterations typically lead to better accuracy, as shown in the examples where accuracy improves significantly over 8 iterations. However, excessive iterations beyond a point yield diminishing returns as the value stabilizes around the true eigenvalue .

Convergence of the Rayleigh Power Method varies based on the spectral properties of the matrices. For example, matrices with larger spectral gaps between the largest and the second largest eigenvalues allow the method to converge faster because the dominant eigenvector's influence becomes apparent more quickly. The numerical examples in the document show different rates of convergence linked to these spectral gaps, e.g., a matrix A with a dominant eigenvalue of 25 converges faster compared to one closer to 2. An initial vector well-aligned with the dominant eigenvector speeds up convergence .

The computational cost of the Gauss-Seidel iteration mainly arises from repeated matrix and vector operations at each step, involving updating solutions component-wise until convergence criteria are met. The cost increases with system size and required precision. With iterative error tolerance mechanisms and iteration limits, computational expense is kept manageable .

Symmetric matrices often allow more efficient eigenvalue computation as they guarantee real eigenvalues and orthogonal eigenvectors, reducing computational complexity and enhancing stability. The document showcases examples where symmetry helps in assured convergence of the Rayleigh Power Method, leveraging properties like easier determinant calculation and aiding in recognizing eigenvectors' alignment .

In iterative methods like the Gauss-Seidel iteration, the stopping criterion based on 'absolute relative approximate error' ensures that iteration stops when changes between successive iterations become sufficiently small, indicating convergence. The iteration halts if the absolute difference between consecutive estimates divided by the current estimate is less than a predefined tolerance .

Potential drawbacks of the Rayleigh Power Method include its reliance on a good initial vector choice and difficulty handling matrices with closely packed eigenvalues, where convergence may be slow or inaccurate. The method can also falsely converge to smaller eigenvalues if the dominant eigenvector's initial influence is poorly captured, as hinted by inconsistent convergence speeds in the document examples .

The Rayleigh Power Method is an iterative technique used to determine the largest eigenvalue and corresponding eigenvector of a matrix. It involves initializing a vector, iteratively multiplying it by the matrix, and normalizing the resulting vector by its maximum component to converge towards the dominant eigenvector. The maximum value used for normalization approximates the largest eigenvalue .

Eigenvalues and eigenvectors play a critical role in simplifying systems of linear equations by transforming them into diagonal forms where solutions are more straightforward. The document demonstrates finding largest eigenvalues using iterative methods, which inform the stability and feasibility of solutions in linear systems by analyzing convergence through Gauss-Seidel iteration .

Initialization is crucial in iterative eigenvalue algorithms as it can significantly affect the convergence speed and direction. A well-chosen initial vector can lead to faster convergence and more accurate results, while a poor choice might slow down or prevent convergence. The initial vector should ideally have a nonzero component in the direction of the dominant eigenvector .

You might also like