I think you should look at all the EPSSolve options in the SLEPc manual, and that will help you sort out the problem. My guess is that you need to specify -eps_gen_hermitian since you are solving a generalized eigenvalue problem.
I guess I could dump the matricies that have been read in and first insure that
the FF edp file read them properly or visualize them or just dump them back
out and diff the input and output txt files. I know in one case writing out
a matrix from FF I had to flush the file stream or else last value was dropped.
In phonons anyway you sometimes
see small values with the wrong sign if there is no
restoring force- the materials just falls apart.
In this case, what would large negative eignvalues mean
in your system? If you look at the eigenvectors for the negative ones
what does that suggest about your system?
I did note some of these are nearly degenerate and the solver AFAIK has
no way to pick particular vectors to span the spaces.
Are these the ev’s you got in python? I put your python coefs into
type or paste code here
`` ff-mpirun -np 1 FF_COMPUTE_EV.edp | grep lambda
35 : cout << "lambda[" << j << "] = " << ev(j) << " and " << eV(:,j) << endl;
40 : I am facing a problem with a generalized eigenvalues problem using EPSSolve in FreeFEM of the type MASS \Phi = \lambda STIFF \Phi.
lambda = 177623 and 14
lambda = 177622 and 14
lambda = 0.0114293 and 14
lambda = 0.0114082 and 14
lambda = 0.00548286 and 14
lambda = 0.00547999 and 14
lambda = 0.00216465 and 14
lambda = 0.00211984 and 14
lambda = 0.00152226 and 14
lambda = 0.00125395 and 14
lambda = 0.000805858 and 14
lambda = 0.000797636 and 14
lambda = 0.000502732 and 14
lambda = 0.000359993 and 14
I went through man solvers same result. Your python coefficients are not the same-
dod you look at the condition number or do SVD in either case? There may be
a sensivitivty problem. The eigenvalues are less than .1 and you have coefficients
as high as 13.
What is row 9 in the stiffness matrix? The diagonal element is large
, IIRC 6600, and some of the other terms look like they have similar coefs of opposite
signs. I guess if there is a delicate cancellation that could cause
numerical issues. It probably is of no significance but if you zero out the
terms less than a noise floor, like 1e-6 or so, what do you get?
Since all the solvers I tried gave more or less the same result, it
does not seem to be a quirk of any one of them with the original
I asked around, and the stiffness matrix is at least positive semi-definite (all the eigenvalues should be greater or equal to zero). The fact that everything is defined up to a constant should not lead to negative eigenvalue, but we can have eigenvalues equal to zero which corresponds to rigid body motion.
The Mass matrix is for sure definite positive (all eigenvalues strictly greater than zero).
Consequently, all eigenvalues should be positive.
By the way when I consider the problem in the other way : STIFF \Phi = \lambda MASS \Phi, I find positive eigenvalues, and the same values than with Python.
So, we think that may be, the problem is the way we compute the eigenvalues. Indeed, when computing generalized eigenvalue problem, there is often a factorization that is is done. May be the fact that some eigenvalues of the stiffness matrix is equal to zero (when I compute STIFF \Phi = \lambda \Phi, I find two eigenvalues equal to zero) and some approximations can cause a problem.