Registered Member
|
Hello,
I'm searching eigen values (lambda vector) and eigen vectors (x) for the A.x = lambda.B.x system. A and B are 6x6 squared symetric non-inversible matrixs (see below values).
With Eigen 3, I've try the "GeneralizedSelfAdjointEigenSolver<MatrixXd>" class and the below program :
After the execution I obtain the following results :
With Eigen, I don't have a result but with the "spec" function of Scilab, I find :
I'm interrested by the smallest positive value of lambda. The last 3 values are not exact because it must be divided by zero (I've remplaced zero by %eps), but its is not my soluce. It was just for information for the Eigen developpers... Thank's for this library ! Do you know wich algorithms are used in Eigen and Scilab for this problem ? |
Moderator
|
As explain in the doc, to use GeneralizedSelfAdjointEigenSolver, B must be selfadjoint positive definite because its Cholesky factorization LL^T=B has to be formed to transform the initial problem to a standard selfadjoint eigen-problem. If you only need the eigenvalues, you can use the RealQZ factorization of Eigen.
|
Registered Member
|
Hello,
Thank's for this answer, ggael ! Yes, it's true, I have not enough read the Eigen manual... My matrix B is not positive definite. I need eigenvalues and eigenvectors, but eigenvalues is a good start, thank's ! I have not find the "RealQZ.h" file in my Eigen v3.1.1 source files... So I have copy it from the Eigen website to my hard disk. Here is my source file test :
But if you look at "Verification Q.S.Z == A ?" line, the A( 6, 6 ) value (=20) and the (Q.S.Z)( 6, 6 ) value (=-442), there is a large difference... Like for Scilab Schur decomposition ([As,Es,Q,Z] = schur(A,E) returns in addition two unitary matrices Q and Z such that As=Q'*A*Z and Es=Q'*E*Z. ), I try to compute the eigenvalues with a As(i,i)/Es(i,i) division ( diag( As )./ diag( Es ) ). The Scilab eigenvalues are very different... (I am only interrested by the smaller positive one ( 83340 ), and it's associate eigenvector.
I've look at the RealSchur Eigen function, but it seems doesn't works with two matrix for argument like Scilab [As,Bs,Q,Z] = schur(A,B)... Do you have an idea to improve my Eigen-C++ numerical results ? |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]