PRACTICAL
Name- Saloni Singhal
M.Sc. (Statistics) II-Sem.
Roll No: 2046398
Course- MATH-409 L
Numerical Analysis Lab
Submitted To: Dr. S.C. Pandey
1
OBJECTIVE
1. Create an M-file to implement
Inverse Power Method to find least
eigen value.
1. Write the program to find the
convergence.
2
Theory
The inverse power method is an iterative method to find
the smallest eigen value and corresponding eigen vector
of a matrix A. It is very similar to the power method, but
involves iterations that involve multiplication of the iterates
by A-1 (provided inverse exists) rather than A. We then
apply the standard power method to which will return the
largest eigenvalue of (say, λ’ ) and the corresponding
eigenvector (say,v’ ). The inverse of this eigenvalue, that
is, 1/λ’ will give the smallest eigenvalue of the matrix .
Please note that the eigenvector corresponding to λ in that
is, remains same as the eigenvector for 1/λ’ in A.
3
Function
File
function [vec,value]=invpow(start,A,toler)
start=start/norm(start); %initialisation
err=toler+1;
i=0;
A=inv(A); %condition for iteration
while err>toler
i=i+1 %iteration count
vec=A*start;
value=0;
for j=1:length(start)
if start(j)~=0
if 0~=vec(j)/start(j)
value=vec(j)/start(j);
end
end
end
value
vec
err=norm((vec/value)-start);
start=vec/value;
end %display eigen vector and value
vec
value=1/value
end
4
Output
5
Plot of iteration count and
falling errors
6
Codes:
x=1:i-1
err=err(2:i)
plot(x,err)
Conclusion
• Hence we can verify the least
Eigen value by the built in function
• Trace gives the sum of eigenvalues to
calculate the remaining by subtracting
the dominant and least eigen value in
a 3*3 matrix
7

Inverse Power Method

  • 1.
    PRACTICAL Name- Saloni Singhal M.Sc.(Statistics) II-Sem. Roll No: 2046398 Course- MATH-409 L Numerical Analysis Lab Submitted To: Dr. S.C. Pandey 1
  • 2.
    OBJECTIVE 1. Create anM-file to implement Inverse Power Method to find least eigen value. 1. Write the program to find the convergence. 2
  • 3.
    Theory The inverse powermethod is an iterative method to find the smallest eigen value and corresponding eigen vector of a matrix A. It is very similar to the power method, but involves iterations that involve multiplication of the iterates by A-1 (provided inverse exists) rather than A. We then apply the standard power method to which will return the largest eigenvalue of (say, λ’ ) and the corresponding eigenvector (say,v’ ). The inverse of this eigenvalue, that is, 1/λ’ will give the smallest eigenvalue of the matrix . Please note that the eigenvector corresponding to λ in that is, remains same as the eigenvector for 1/λ’ in A. 3
  • 4.
    Function File function [vec,value]=invpow(start,A,toler) start=start/norm(start); %initialisation err=toler+1; i=0; A=inv(A);%condition for iteration while err>toler i=i+1 %iteration count vec=A*start; value=0; for j=1:length(start) if start(j)~=0 if 0~=vec(j)/start(j) value=vec(j)/start(j); end end end value vec err=norm((vec/value)-start); start=vec/value; end %display eigen vector and value vec value=1/value end 4
  • 5.
  • 6.
    Plot of iterationcount and falling errors 6 Codes: x=1:i-1 err=err(2:i) plot(x,err)
  • 7.
    Conclusion • Hence wecan verify the least Eigen value by the built in function • Trace gives the sum of eigenvalues to calculate the remaining by subtracting the dominant and least eigen value in a 3*3 matrix 7