Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Problem computing determinant
Posted:
Aug 16, 1996 5:35 PM
|
|
I am having a problem computing the determinant of a matrix. Specifically, I am solving an eigenvalue problem, and then using the original matrix and one of the eigenvalues and checking that the determinant is zero.
n=5; A=random('T',1,n,n); [x,l]=eig(R); det(A-eye(size(A))*l(1,1))
From det(A-lI)=0, the eigenvalues, l, can be found. So The result of the last line of the script should be close to zero. This works acceptable for small matricies (n<8). When n>10, the value of the determinant is on the order of 0.1-1. Here the result is dependent on the numbers generated by the random statement.
For n=100, I check the orthogonality of the eigenvectors, and the results from the diagonalization of the system. For orthogonality and diagonalization, the results are accurate to at least 10e-6. However the determinant of A-lI for any of the eigenvalues found is ~10e260!
Am I trying to do something real stupid, or is it really roundoff error. Does the determinant function return the product of the diagonal elements of U from an LU decomposition?
It is hard to believe that the eigenvectors are that accurate, but the determinant cannot be found as accurate.
Thanks, Craig
|
|
|
|