From the Matlab eigs
documentation:
using
'smallestabs'
, which employs a Krylov method using the inverse ofA
.
This is what I suggested above: the Julia libraries won’t do shift/invert automatically (whereas Matlab will). This can drastically change the number of iterations.
So to get a comparable number of iterations to Matlab with M \ (K + 0.1 * M)
(which is internally inverted) you’ll want to do something like:
F = cholesky(Symmetric(K + 0.1 * M))
eigsolve(x -> F \ (M * x), ..., :SM)
(:SM
is the equivalent of smallestabs
in Matlab, not :SR
, though :SR
should work as well since all the eigenvalues are real and positive). Then invert and shift the resulting eigenvalues to get the eigenvalues of the original problem.
Correction: Once you invert, you should be using :LM
to look for largest-magnitude eigenvalues (rather than :SM
).