- #1
jeff.sadowski
- 11
- 0
I would like to get the eigen values of a sparse matrix
of form
[ a, b, c, d, e;
1, 0, 0, 0, 0;
0, 1, 0, 0, 0;
0, 0, 1, 0, 0;
0, 0, 0, 1, 0]
in matlab/octave I use the following to generate the matrix
% filename nfactor.m written by Jeff Sadowski
% nfactor finds the factors for an nth degree polynomial
% if you have an equation a(x^n) + b(x^(n-1)) + c(x^(n-2)) + ...
% use nfactor like so nfactor([a,b,c,...])
% example: equation=x^2 + 2*x + 1
% octave:1> nfactor([1,2,1])
% ans =
%
% -1
% -1
%
function ans=nfactor(VECTOR) vsize=size(VECTOR);
ans=eig([-1/VECTOR(1)*VECTOR(2:vsize(2));eye(vsize(2)-2,vsize(2)-1)]);
However I need higher precision than this more accurately I need a resultant formula for each eigen value. I was hoping to use something like the householder method to transform this matrix into an upper Hessenberg matrix so that I have the eigen formulas down the diagonal. Can this be done?
I found this sight
http://www.matf.bg.ac.yu/r3nm/NumericalMethods/EigenValues/Householder.html
but when I plug my matrices in the example transformation doesn't work.
So I'm guessing this method will not work for my matrices. Are there other methods (non numerical) that can be used to transform the matrix to an upper diagonal without effecting the eigen values?
of form
[ a, b, c, d, e;
1, 0, 0, 0, 0;
0, 1, 0, 0, 0;
0, 0, 1, 0, 0;
0, 0, 0, 1, 0]
in matlab/octave I use the following to generate the matrix
% filename nfactor.m written by Jeff Sadowski
% nfactor finds the factors for an nth degree polynomial
% if you have an equation a(x^n) + b(x^(n-1)) + c(x^(n-2)) + ...
% use nfactor like so nfactor([a,b,c,...])
% example: equation=x^2 + 2*x + 1
% octave:1> nfactor([1,2,1])
% ans =
%
% -1
% -1
%
function ans=nfactor(VECTOR) vsize=size(VECTOR);
ans=eig([-1/VECTOR(1)*VECTOR(2:vsize(2));eye(vsize(2)-2,vsize(2)-1)]);
However I need higher precision than this more accurately I need a resultant formula for each eigen value. I was hoping to use something like the householder method to transform this matrix into an upper Hessenberg matrix so that I have the eigen formulas down the diagonal. Can this be done?
I found this sight
http://www.matf.bg.ac.yu/r3nm/NumericalMethods/EigenValues/Householder.html
but when I plug my matrices in the example transformation doesn't work.
So I'm guessing this method will not work for my matrices. Are there other methods (non numerical) that can be used to transform the matrix to an upper diagonal without effecting the eigen values?
Last edited by a moderator: