Page 1 of 1

### lapack routine dsygv giving negative eigen values

Posted: Sun Mar 19, 2017 5:18 am
Hello,
just joined this forum as i got into a problem while using LAPACK routine (DSYGV). i am using fortran 95 for an eigen value analysis for type Ax=lamda B type problem. i am trying to get the eigen value using the routine, and it gives first two eigen values as -ve which is not expected. i ran previously on 5 similar models and i got the eigen values as expected.. what could be reason for this negative value in eigen value listing. I checked both matrices - A and B, they are square, symmetric and all the diagonal elements are positive elements in all 6 cases. i could upload the matrices if anyone wish to see them - they are 660 X660 matrices - around 11mb each in csv format. appreciate any guidance here.

### Re: lapack routine dsygv giving negative eigen values

Posted: Tue Mar 21, 2017 2:07 am
Hello,
just joined this forum as i got into a problem while using LAPACK routine (DSYGV). i am using fortran 95 for an eigen value analysis for type Ax=lamda B type problem. i am trying to get the eigen value using the routine, and it gives first two eigen values as -ve which is not expected. i ran previously on 5 similar models and i got the eigen values as expected.. what could be reason for this negative value in eigen value listing. I checked both matrices - A and B, they are square, symmetric and all the diagonal elements are positive elements in all 6 cases. i could upload the matrices if anyone wish to see them - they are 660 X660 matrices - around 11mb each in csv format. appreciate any guidance here. I took out the matrices A and B into Mathcad and checked for cholesky decomposition and Eigen values, they work well and gave Eigen values as what is expected. upon comparing the Eigen listing in Mathcad and dsygv listing, I found the following.
eigen value(3) in dsygv was matching eigenval(1) of mathcad, eigenval(4) was matching eigenval(2) of mathcad and so on.. looks like the 2 negative values got inserted in the listing - attached is the screenshot. could some one explain why this is happening
comparison.JPG (163.11 KiB) Viewed 2671 times

### Re: lapack routine dsygv giving negative eigen values

Posted: Tue Mar 28, 2017 12:03 am
If you can compute Cholesky decomposition of A and B, both A and B are positive definite matrices.
In the case, we should use dggsvd3.f as follows,
Cholesky decomposition A=CA^{T} CA
Cholesky decomposition B=CB^{T} CB
and compute Generalized Singular Value Decomposition(GSVD) for CA and CB.
We can regard GSVD as (CA^{T} CA) v = \lambda (CB^{T} CB) v, where CA and CB are general matrices.
From the result of GSVD, we can obtain eigenvalues of (CA^{T} CA) v = \lambda (CB^{T} CB) v, easily.
However, eigenvectors are not trivial.