opencollab / arpack-ng

Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems.
Other
284 stars 124 forks source link

Wrong results with generalized eigenvalue problem #54

Closed JsuKya closed 6 years ago

JsuKya commented 7 years ago

I'm using arpack on visual studio 2015 + intel fortran 2017 to solve generalized eigenvalue of finite element method.

I found that if nev is too small, the eigenvalue is completely error, like following: bmat = 'G', which = 'SM' N=15129, nev=5, ncv=4*nev

lambda Frequency (Hz)
0.000000000000000E+000 0.000000000000000E+000
0.000000000000000E+000 0.000000000000000E+000
0.000000000000000E+000 0.000000000000000E+000
0.000000000000000E+000 0.000000000000000E+000
0.000000000000000E+000 0.000000000000000E+000

N=15129, nev=8 , ncv=4*nev, right results

lambda Frequency (Hz)
9073.84572612423 15.1605803744355
36429.4114333670 30.3770928736707
36429.4693770658 30.3771170321782
76216.1904237645 43.9383506359923
111258.263873727 53.0867662079674
112660.851363559 53.4203397834319
168718.970107423 65.3735530512918
168719.000352898 65.3735589108999

But if I set a larger ncv for small nev, then obtain right results: N=15129, nev=5, ncv=8*nev

lambda Frequency (Hz)
9073.91416641185 15.1606375493399
36429.3509892708 30.3770676726502
36429.4365992089 30.3771033660854
76216.4177657186 43.9384161668395
111258.264313797 53.0867663129568

So, I don't know how to set ncv aromatically. Excuse me for my poor English.

fghoussen commented 6 years ago

My understanding is that there is no way to set ncv automatically: you need to estimate it.

Look documentation in SLEPc (EPSSetDimensions) : the parameters ncv and mpd are intimately related, so that the user is advised to set one of them at most. Normal usage is that (a) in cases where nev is small, the user sets ncv (a reasonable default is 2*nev); and (b) in cases where nev is large, the user sets mpd. The value of ncv should always be between nev and (nev+mpd), typically ncv=nev+mpd. If nev is not too large, mpd=nev is a reasonable choice, otherwise a smaller value should be used.

caliarim commented 6 years ago

Is it possible to close this open issue?