0

I'm playing with ARPACK. I looked into the examples they provide, zndrv4.f, in the ARPACK/EXAMPLES/COMPLEX/ directory. I also came cross into NAG Fortran Library. In NAG, there are some linear problem solvers F12***. The F12*** routines in NAG are equivalent to the znaupd in ARPACK. So I want to check if they will yield the same results.

I first looked into the example provided in the user guide of F12ARF at http://www.nag.co.uk/numeric/fl/nagdoc_fl22/pdf/F12/f12arf.pdf for example. In the end, it yields the results of

509.9390
380.9092
659.1558
271.9412

around the shift=500. I solved the same generalized eigenvalue problem in Matlab. Matlab gave the same results.

But when I used znaupd from ARPACK to solve the same problem, I obtained different answers. The 4 eigenvalues are now

rd1 = 501.65650188259684 
rd2 = 480.15153312181440  
rd3 = 526.52596256924164 
rd4 = 461.99019999608828

The routines in NAG and ARPACK both use SHIFTED INVERSE mode and solve a generalized problem. I'm not sure what was wrong. I attached my scripts for the ARPACK zndrv4.f (it's basically the same as the example file provided by ARPACK, I just need to change a little bit the matrices around line 174 to be the same as that in NAG.) and the Matlab file zndrv4.m.

https://www.dropbox.com/s/b9f1btl7a2ugrh3/zndrv4.f?dl=0 https://www.dropbox.com/s/pctmennp64mkn9m/zndrv4.m?dl=0

Update: The M matrix in F12ARF is normalized (entries divided by a six). I followed this and got the above wrong results in ARPACK. Now if I didn't divide the entries by six, the ARPACK script gives me the correct answer (the same as Matlab). Now I'm even more confused. It seems to say that the ARPACK routine is not robust?

jengmge
  • 77
  • 1
  • 5
  • Where the scripts that you attached? And the NAG URL you included is broken. Also, it's usually good to ask a question. I suppose you want to know you're getting different results and/or what you can do in ARPACK match Matlab/NAG? – horchler Dec 03 '14 at 23:27
  • Thanks horchler. I corrected it. And I add some update. Yes, I'm confused why the ARPACK didn't give the right answer. – jengmge Dec 03 '14 at 23:44
  • If you get no interest from this here after a few days, you might take it down and ask at [SciComp.StackExchange](http://scicomp.stackexchange.com). Or you could try flagging it and ask for it to be migrated. – horchler Dec 04 '14 at 01:44

0 Answers0