Hi,
I am trying to find the neig=5
smallest eigenvalues (in magnitude) of a generalised problem
(K-val*M)*vec = 0
where K
is real symmetric positive indefinite and M
is real symmetric positive definite. This is close to a question in a previous thread but here I try to use KrylovKit.jl
.
My toy problem below could use better forms of K
and M
than generalised sparse storage, but my real world problems starts with sparse matrices.
The problem is parametrised by N
so that the eigenfreqency (I do mechanics) f
, computed from the eigenvalue is independent of N
(asymptoticaly, at least). The game: scale up. But moderately: letās stay on a personal computer for now.
using SparseArrays,KrylovKit
N = 1000
neig = 5
K = spdiagm(N,N,-1=>range(-N,-N,N-1),0=>range(2N,2N,N), 1=>range(-N,-N,N-1))
M = spdiagm(N,N,0=>range(1/N,1/N,N))
vals, vecs, info = KrylovKit.geneigsolve((K/N,M*N),randn(N),
neig,
EigSorter(abs; rev = false);
maxiter = 200,
krylovdim = 100,
tol = 1e-4,
verbosity = 3,
orth = KrylovKit.ModifiedGramSchmidtIR(),
issymmetric = true,
isposdef = true)
f=sqrt.(vals[1:neig])./(2Ļ)*N
N=1000
works, but I hit the wall before N=10000
. I get some gain from scaling the matrices
(K/N,M*N)
so that they have ākind of oneā terms⦠does this mean I need a preconditionner? āKrylovā would suggest that, but the manual states ā*KrylovKit.jl does currently not provide a general interface for including preconditionersā.
I also gain from a lax tol
- all eigenvalues but the last are returned with better precision.
Any ideas on how to tweak the solver?