% Finding the Eigenvalues of a Matrix
% Author's Data: Housam Binous
% Department of Chemical Engineering
% National Institute of Applied Sciences and Technology, Tunis, TUNISIA
% Email: binoushousam@yahoo.com
% Reference :
% Kenneth J. Beers, Numerical Methods for Chemical Engineering,
% Applications in Matlab, Cambridge University Press, 2007.
% Finding the eigenvalues using the Matlab built-in function eig
A = [1, -1, 2; -1, 5, 3; 2, 3, 5]
eig(A)
% Finding the largest eigenvalue (?=8.07888)
v=[1.,1,1]';
for i=2:10
v=A*v/norm(A*v);
end
lamda1=v'*A*v
% Finding the smallest eigenvalue (?=-0.714895)
v=[1.,1,1]';
for i=2:10
v=inv(A)*v/norm(inv(A)*v);
end
lamda2=1/(v'*inv(A)*v)
% Finding the eigenvalue near 4 (?=3.63601)
v=[1.,1,1]';
for i=2:10
v=inv(A-4*eye(3))*v/norm(inv(A-4*eye(3))*v);
end
lamda3=1/(v'*inv(A-4*eye(3))*v)+4