Jutho / KrylovKit.jl

Krylov methods for linear problems, eigenvalues, singular values and matrix functions
Other
284 stars 37 forks source link

How to use geneigsolve for a free-vibration problem #18

Closed PetrKryslUCSD closed 4 years ago

PetrKryslUCSD commented 5 years ago

I tried

eval, evec, info = geneigsolve((K, M), neigvs, :SR; krylovdim = neigvs, issymmetric = true, verbosity = 1)

Both K and M are positive definite, about 50,000 x 50,000. neigvs = 150. KrylovKit complained that krylovdim was insufficient, hence I increased it to the number of eigenvalues.

For these matrices Arpack solves the problem in 40 seconds. KrylovKit prints:

info = ConvergenceInfo: no converged values after 100 iterations and 15250 applications of the linear map;          
norms of residuals are given by (0.002396873417046488, 3.248835060602836e7, 2.7753093442263037e8, 4.9315321722871387e8, 7.748594302081199e8, 8.547390494758842e8, 3.4130731195272117e9, 2.4306401956439214e9, 5.244045970318826e9, 5.323371454557005e9, 8.310185004644285e9, 1.0643108361077374e10, 1.2894525228928179e10, 1.555410215182708e10, 1.8052112354689373e10, 2.2001736414298813e10, 2.3379073914942333e10, 2.3999892493262e10, 2.63218402446868e10, 3.115759149886282e10, 3.774859397558686e10, 3.699561047627666e10, 4.0447127619959496e10, 4.181580879356961e10, 5.275823985974196e10, 
4.768126278527812e10, 4.882031555572997e10, 5.330862193819132e10, 5.353485665490572e10, 5.6667741329282135e10, 5.733496435968245e10, 6.3448545928700806e10, 6.5015631900482185e10, 6.7404750475145256e10, 6.992019932905296e10, 7.344382026718034e10, 7.623674909270993e10, 8.279887125787743e10, 8.161285815088121e10, 8.750864463221799e10, 9.200200109475017e10, 9.942697543438498e10, 1.0421345396558173e11, 1.0849542693004073e11, 1.140218636996058e11, 1.185705367155918e11, 1.2024562750017061e11, 1.2562159433846292e11, 1.3631432243966956e11, 1.3728760123105396e11, 1.4308825857752185e11, 1.5033458874452377e11, 1.5793654872723734e11, 1.6031270399887112e11, 1.6423326876692508e11, 1.604821916559468e11, 1.686614555984489e11, 1.7345671335089658e11, 1.7434602117846674e11, 1.3436876346820663e11, 1.6606297010356393e11, 1.6658326554228894e11, 1.6418416894572073e11, 1.5374871316269406e11, 1.783107828047467e11, 1.6815619189843665e11, 1.6351392732242627e11, 1.6509436136073273e11, 1.601023400072549e11, 1.6456769821694348e11, 1.6047541818201074e11, 1.4038081600641678e11, 1.3720794169566965e11, 1.631760242331073e11, 1.4234108793806427e11, 1.8020445089496085e11, 1.51720828119771e11, 1.8464034968520828e11, 1.660626475659846e11, 1.6632630341921048e11, 1.6123468785146686e11, 1.377808422913065e11, 1.6198876300644772e11, 1.611275417938122e11, 1.3061449142377744e11, 1.6782364215299008e11, 1.5342449592515982e11, 1.735252239537415e11, 1.4547049114227682e11, 1.3628003879957086e11, 1.5560568203321463e11, 1.3683976181544379e11, 1.7975223317252618e11, 1.476248988115132e11, 1.8047591240991754e11, 1.6594854036829172e11, 1.4595864416503073e11, 1.4292860766728033e11, 1.888523385252819e11, 1.559656863079164e11, 1.8187799044350156e11, 1.783649242150821e11, 1.408815371242372e11, 1.3834326675060028e11, 1.7525667949945404e11, 1.5796171843597052e11, 2.0585757711743658e11, 1.3665030858602708e11, 1.3147173721526407e11, 1.7053953353792828e11, 2.065389321386339e11, 2.0798016142978784e11, 1.406676404428412e11, 1.3574961066155034e11, 1.4856818470185443e11, 1.3758794314976102e11, 2.0186502504187262e11, 1.526715726440403e11, 1.422192579326239e11, 1.4466740543047934e11, 1.202792375613822e11, 2.2853924388476486e11, 1.2563885264359932e11, 1.3320393849570345e11, 2.260546376076804e11, 1.2962041331021895e11, 1.2166448213725748e11, 1.2915512375891316e11, 1.1976672844963583e11, 1.2648989380452153e11, 1.3449121537950958e11, 1.4399992971674252e11, 1.5729075967673212e11, 1.8370733318267642e11, 1.2705222336777429e11, 1.3261045192382887e11, 1.2898933300171616e11, 1.4691808009139304e11, 1.3494349702638138e11, 1.6269401589458328e11, 1.717339010561835e11, 1.2377789782210353e11, 1.377322886081942e11, 1.210614217886396e11, 8.63304435006993e10, 1.6828500315167252e11, 1.5807734611546933e11, 2.1371191932422336e11, 1.8572763563475046e11, 1.3215581179489737e11).         

after about 256 seconds.

Any idea what it is I am doing wrong? Am I doing something wrong?

rveltz commented 5 years ago

Maybe increase maxiter

Jutho commented 5 years ago

If you can afford the memory, it might be good to make krylovdim even larger than number of eigenvalues. However, given the size of these residuals, there might be something else at play here. I don't have much experience with the Golub-Ye algorithm which is used in geneigsolve, and hence don't know if there exist specific situations where it works well and others where it does not.

PetrKryslUCSD commented 5 years ago

I don't know what is going on, but increasing the number of iterations or making the Krylov dimension larger does nothing. The solution still fails.

jarlebring commented 5 years ago

If you make the matrices available somehow, it is easier for others to help. If the matrices are too big, maybe just crop them at a reasonable size and see if you get the same.

Jutho commented 4 years ago

I agree that sharing the matrices will be necessary for me to be able to debug this. Until then, I will close this issue. Feel free to reopen and share the matrices.