

Hi,
I have a set of matrices, M0 and M1 (attached), obtained from numerical discretization of a beam problem.
I am attempting to solve the eigenproblem M1 x = lambda M0 x .
Computing this with the following works fine: > m0 = load(‘M0.txt’); m1 = load(‘M1.txt’); > eig( m1, m0)
However, using eigs( m1, m0) throws the following error: error: __eigs__: eigs: error 8 in dnaupd error: called from eigs at line 285 column 18
I am not sure what could be causing this. Any guidance will be appreciated.
Thanks, Manav


Hi,
I can't reproduce in 4.4.0, which Octave version are you using? What OS?
> eigs(m1,m0)
ans =
0.00032  2672312.38464i
0.00032 + 2672312.38464i
0.00004  2639857.10699i
0.00004 + 2639857.10699i
0.00010 + 2587664.34543i
0.00010  2587664.34543i
> version
ans = 4.4.0
> which eigs
'eigs' is a function from the file /usr/local/share/octave/4.4.0/m/sparse/eigs.m
On Fri, Sep 7, 2018 at 3:02 PM Manav Bhatia < [hidden email]> wrote:
>
> Hi,
>
> I have a set of matrices, M0 and M1 (attached), obtained from numerical discretization of a beam problem.
>
> I am attempting to solve the eigenproblem M1 x = lambda M0 x .
>
> Computing this with the following works fine:
> > m0 = load(‘M0.txt’); m1 = load(‘M1.txt’);
> > eig( m1, m0)
>
>
> However, using eigs( m1, m0) throws the following error:
> error: __eigs__: eigs: error 8 in dnaupd
> error: called from
> eigs at line 285 column 18
>
> I am not sure what could be causing this. Any guidance will be appreciated.
>
> Thanks,
> Manav
>
>


Thanks for looking into this. I am running on Mac OS with octave installed through macports.
Following are the outputs on my machine.
octave:4> eigs(m1, m0) error: __eigs__: eigs: error 8 in dnaupd error: called from eigs at line 285 column 18 octave:4> version ans = 4.4.1 octave:5> which eigs 'eigs' is a function from the file /opt/local/share/octave/4.4.1/m/sparse/eigs.m octave:6>
Thanks, Manav On Sep 7, 2018, at 8:13 AM, Juan Pablo Carbajal < [hidden email]> wrote:
Hi, I can't reproduce in 4.4.0, which Octave version are you using? What OS? eigs(m1,m0)
ans = 0.00032  2672312.38464i 0.00032 + 2672312.38464i 0.00004  2639857.10699i 0.00004 + 2639857.10699i 0.00010 + 2587664.34543i 0.00010  2587664.34543i version
ans = 4.4.0 which eigs
'eigs' is a function from the file /usr/local/share/octave/4.4.0/m/sparse/eigs.m On Fri, Sep 7, 2018 at 3:02 PM Manav Bhatia < [hidden email]> wrote: Hi,
I have a set of matrices, M0 and M1 (attached), obtained from numerical discretization of a beam problem.
I am attempting to solve the eigenproblem M1 x = lambda M0 x .
Computing this with the following works fine:
m0 = load(‘M0.txt’); m1 = load(‘M1.txt’); eig( m1, m0)
However, using eigs( m1, m0) throws the following error: error: __eigs__: eigs: error 8 in dnaupd error: called from eigs at line 285 column 18
I am not sure what could be causing this. Any guidance will be appreciated.
Thanks, Manav


In reply to this post by Juan Pablo Carbajal2
I get different results with 5.0.0
octave:627> eigs(m1,m0)
ans =
0.00018  2672287.08391i
0.00018 + 2672287.08391i
0.00027 + 2639894.41870i
0.00027  2639894.41870i
0.00024  2587680.34565i
0.00024 + 2587680.34565i
octave:628> version
ans = 5.0.0
octave:629> which eigs
'eigs' is a function from the file
/usr/local/share/octave/5.0.0/m/sparse/eigs.m
Tom Dean
On 09/07/18 06:13, Juan Pablo Carbajal wrote:
> Hi,
>
> I can't reproduce in 4.4.0, which Octave version are you using? What OS?
>
>> eigs(m1,m0)
> ans =
>
> 0.00032  2672312.38464i
> 0.00032 + 2672312.38464i
> 0.00004  2639857.10699i
> 0.00004 + 2639857.10699i
> 0.00010 + 2587664.34543i
> 0.00010  2587664.34543i
>
>> version
> ans = 4.4.0
>> which eigs
> 'eigs' is a function from the file /usr/local/share/octave/4.4.0/m/sparse/eigs.m
>
> On Fri, Sep 7, 2018 at 3:02 PM Manav Bhatia < [hidden email]> wrote:
>>
>> Hi,
>>
>> I have a set of matrices, M0 and M1 (attached), obtained from numerical discretization of a beam problem.
>>
>> I am attempting to solve the eigenproblem M1 x = lambda M0 x .
>>
>> Computing this with the following works fine:
>>> m0 = load(‘M0.txt’); m1 = load(‘M1.txt’);
>>> eig( m1, m0)
>>
>>
>> However, using eigs( m1, m0) throws the following error:
>> error: __eigs__: eigs: error 8 in dnaupd
>> error: called from
>> eigs at line 285 column 18
>>
>> I am not sure what could be causing this. Any guidance will be appreciated.
>>
>> Thanks,
>> Manav
>>
>>
>
>


On Fri, Sep 7, 2018 at 12:14 PM Thomas D. Dean < [hidden email]> wrote: I get different results with 5.0.0
octave:627> eigs(m1,m0)
ans =
0.00018  2672287.08391i
0.00018 + 2672287.08391i
0.00027 + 2639894.41870i
0.00027  2639894.41870i
0.00024  2587680.34565i
0.00024 + 2587680.34565i
octave:628> version
ans = 5.0.0
octave:629> which eigs
'eigs' is a function from the file
/usr/local/share/octave/5.0.0/m/sparse/eigs.m
Tom Dean
On 09/07/18 06:13, Juan Pablo Carbajal wrote:
> Hi,
>
> I can't reproduce in 4.4.0, which Octave version are you using? What OS?
>
>> eigs(m1,m0)
> ans =
>
> 0.00032  2672312.38464i
> 0.00032 + 2672312.38464i
> 0.00004  2639857.10699i
> 0.00004 + 2639857.10699i
> 0.00010 + 2587664.34543i
> 0.00010  2587664.34543i
>
>> version
> ans = 4.4.0
>> which eigs
> 'eigs' is a function from the file /usr/local/share/octave/4.4.0/m/sparse/eigs.m
>
> On Fri, Sep 7, 2018 at 3:02 PM Manav Bhatia <[hidden email]> wrote:
>>
>> Hi,
>>
>> I have a set of matrices, M0 and M1 (attached), obtained from numerical discretization of a beam problem.
>>
>> I am attempting to solve the eigenproblem M1 x = lambda M0 x .
>>
>> Computing this with the following works fine:
>>> m0 = load(‘M0.txt’); m1 = load(‘M1.txt’);
>>> eig( m1, m0)
>>
>>
>> However, using eigs( m1, m0) throws the following error:
>> error: __eigs__: eigs: error 8 in dnaupd
>> error: called from
>> eigs at line 285 column 18
>>
>> I am not sure what could be causing this. Any guidance will be appreciated.
>>
>> Thanks,
>> Manav
>>
>>
>
>
and I get ans =
0.000005679 + 2672294.228794384i 0.000005679  2672294.228794384i 0.000033536 + 2639901.383827801i 0.000033536  2639901.383827801i 0.000042158  2587660.262760939i 0.000042158 + 2587660.262760939i >> version ans = 4.4.1rc2 >> which eigs 'eigs' is a function from the file /usr/local/share/octave/4.4.1rc2/m/sparse/eigs.m >> 


There is a problem here. I know about roundoff error, etc. Even with
roundoff error, I believe I should get the same result every time I run
this.
octave:722> eigs(m1,m0)
ans =
0.00026  2672325.75636i
0.00026 + 2672325.75636i
0.00000 + 2639890.67488i
0.00000  2639890.67488i
0.00007  2587678.50828i
0.00007 + 2587678.50828i
octave:723> eigs(m1,m0)
ans =
0.00050  2672274.01721i
0.00050 + 2672274.01721i
0.00058 + 2639991.91956i
0.00058  2639991.91956i
0.00005  2587660.78340i
0.00005 + 2587660.78340i
octave:724> eigs(m1,m0)
ans =
0.00014 + 2672332.27197i
0.00014  2672332.27197i
0.00030  2639921.38497i
0.00030 + 2639921.38497i
0.00001  2587707.77163i
0.00001 + 2587707.77163i
With Scipy, I get the same result every time I run it. I verified that
both octave and numpy read the matrix the same way  nonzero values are
the same and in the same location.
#!/usr/bin/python3
import numpy as np
from scipy import linalg as la
m0 = np.loadtxt('/tmp/M0.txt')
m1 = np.loadtxt('/tmp/M1.txt')
e1, w1 = la.eig(m0, m1)
e2, w2 = la.eig(m0, m1)
for idx in range(len(e1)):
if e1[idx] != e2[idx]:
print(e1[idx], ' != ', e2[idx])
Tom Dean


On 09/08/18 12:13, Thomas D. Dean wrote:
> There is a problem here. I know about roundoff error, etc. Even with
> roundoff error, I believe I should get the same result every time I run
> this.
>
> octave:722> eigs(m1,m0)
> ans =
>
> 0.00026  2672325.75636i
> 0.00026 + 2672325.75636i
> 0.00000 + 2639890.67488i
> 0.00000  2639890.67488i
> 0.00007  2587678.50828i
> 0.00007 + 2587678.50828i
>
> octave:723> eigs(m1,m0)
> ans =
>
> 0.00050  2672274.01721i
> 0.00050 + 2672274.01721i
> 0.00058 + 2639991.91956i
> 0.00058  2639991.91956i
> 0.00005  2587660.78340i
> 0.00005 + 2587660.78340i
>
> octave:724> eigs(m1,m0)
> ans =
>
> 0.00014 + 2672332.27197i
> 0.00014  2672332.27197i
> 0.00030  2639921.38497i
> 0.00030 + 2639921.38497i
> 0.00001  2587707.77163i
> 0.00001 + 2587707.77163i
>
> With Scipy, I get the same result every time I run it. I verified that
> both octave and numpy read the matrix the same way  nonzero values are
> the same and in the same location.
<snip>
If I ask eigs to return more than size(m1,1)/2 eigenvectors, I get the
same values each time. If I choose the default, or, less than
size(m1,1)/2, the values do not repeat.
eigs(m1, m0, floor(size(m1,1)/2)) ## returns the same values.
eigs(m1, m0, size(m1,1)) ## returns the same values.
eigs(m1, m0, floor(size(m1,1)/3)) ## does NOT return the same values.
eigs(m1, m0, 6) ## default. does NOT return the same values.
I can not verify the values returned are correct.
eigs(m1, m0, size(m1,1)) returns
real(e) == 0 and abs(imag(e)) > 200
paired, imag() alternating signs?
scipy returns
abs(real(e)) < 1e11 and abs(imag(e)) < 1e3
paired, imag() alternating signs
maple, using float approximation returns
abs(real(e)) < 1e9 and abs(imag(e)) < 1e3
Some of the imag() values in scipy and maple match to 6 or 8 digits.
Tom Dean


We were able to identify this to be a bug in lapack that was fixed in lapack v 3.6.
System lapack on Mac provided through the Accelerate framework is an older version of lapack and still has the bug. So, the solution is to replace it with a newer version of lapack.
I replaced this with arpack that links to lapack v 3.8 and am able to get expected results.
On a related note, is the macport build of octave handled by someone on this mailing list?
If so, I would recommend creating a variant to use lapack installed via macports. Currently the only two variants that exist are accelerate and atlas. Even with atlas, I suspect that the routines not provided by atlas will come from system lapack.
Manav
Thanks for looking into this. I am running on Mac OS with octave installed through macports.
Following are the outputs on my machine.
octave:4> eigs(m1, m0) error: __eigs__: eigs: error 8 in dnaupd error: called from eigs at line 285 column 18 octave:4> version ans = 4.4.1 octave:5> which eigs 'eigs' is a function from the file /opt/local/share/octave/4.4.1/m/sparse/eigs.m octave:6>
Thanks, Manav On Sep 7, 2018, at 8:13 AM, Juan Pablo Carbajal < [hidden email]> wrote:
Hi, I can't reproduce in 4.4.0, which Octave version are you using? What OS? eigs(m1,m0)
ans = 0.00032  2672312.38464i 0.00032 + 2672312.38464i 0.00004  2639857.10699i 0.00004 + 2639857.10699i 0.00010 + 2587664.34543i 0.00010  2587664.34543i version
ans = 4.4.0 which eigs
'eigs' is a function from the file /usr/local/share/octave/4.4.0/m/sparse/eigs.m On Fri, Sep 7, 2018 at 3:02 PM Manav Bhatia < [hidden email]> wrote: Hi,
I have a set of matrices, M0 and M1 (attached), obtained from numerical discretization of a beam problem.
I am attempting to solve the eigenproblem M1 x = lambda M0 x .
Computing this with the following works fine:
m0 = load(‘M0.txt’); m1 = load(‘M1.txt’); eig( m1, m0)
However, using eigs( m1, m0) throws the following error: error: __eigs__: eigs: error 8 in dnaupd error: called from eigs at line 285 column 18
I am not sure what could be causing this. Any guidance will be appreciated.
Thanks, Manav


On 09/09/18 09:41, Manav Bhatia wrote:
> Please see the discussion here:
> https://github.com/opencollab/arpackng/issues/149#issuecomment419715128>
> We were able to identify this to be a bug in lapack that was fixed in
> lapack v 3.6.
>
> System lapack on Mac provided through the Accelerate framework is an
> older version of lapack and still has the bug. So, the solution is to
> replace it with a newer version of lapack.
>
> I replaced this with arpack that links to lapack v 3.8 and am able to
> get expected results.
Ubuntu 16.04
> dpkg l  grep i lapack
ii liblapackdev 3.6.02ubuntu2
amd64 Library of linear algebra routines 3 
static version
ii liblapack3 3.6.02ubuntu2
amd64 Library of linear algebra routines 3 
shared version
> dpkg l  grep i arpack
ii libarpack2 3.3.01build2
amd64 Fortran77 subroutines to solve large
scale eigenvalue problems
ii libarpack2dev 3.3.01build2
amd64 Fortran77 subroutines to solve large
scale eigenvalue problems (development)
Looks like I should not have this problem???
Tom Dean


Ubuntu 16.04
> dpkg l  grep i lapack
ii liblapackdev 3.6.02ubuntu2
amd64 Library of linear algebra routines 3 
static version
ii liblapack3 3.6.02ubuntu2
amd64 Library of linear algebra routines 3 
shared version
> dpkg l  grep i arpack
ii libarpack2 3.3.01build2
amd64 Fortran77 subroutines to solve large
scale eigenvalue problems
ii libarpack2dev 3.3.01build2
amd64 Fortran77 subroutines to solve large
scale eigenvalue problems (development)
Looks like I should not have this problem???
I think Manav is talking here about the original problem ("error 8")...
I have lapack 3.8.0 and I also see fluctuations in eigs output. It looks to me some variable (initial guess?) is not defined and it
is picking up some junk.
Tom Dean
Dmitri. 


On 09/09/18 14:01, Dmitri A. Sergatskov wrote:
<snip>
> I have lapack 3.8.0 and I also see fluctuations in eigs output.
> It looks to me some variable (initial guess?) is not defined and it
> is picking up some junk.
I think you are correct.
n = size(m1,1)
eigs(m1, m0, struct("v0", zeros(n,1), "p", n))
Seems to always return the same value. Maybe incorrect value???
Octave, Scipy, and Maple2018 all do not agree! Even to 1 digit!
I know this problem is difficult to solve, as are many real world
problems. But, ...
Tom Dean


On 09/09/18 14:01, Dmitri A. Sergatskov wrote:
<snip>
> I have lapack 3.8.0 and I also see fluctuations in eigs output.
> It looks to me some variable (initial guess?) is not defined and it
> is picking up some junk.
I think you are correct.
n = size(m1,1)
eigs(m1, m0, struct("v0", zeros(n,1), "p", n))
Seems to always return the same value. Maybe incorrect value???
Octave, Scipy, and Maple2018 all do not agree! Even to 1 digit!
I know this problem is difficult to solve, as are many real world
problems. But, ...
Apparently this is not a bug, but a feature:
(from help eigs)
'v0' The starting vector for the algorithm. An initial vector close to the final vector will speed up convergence. The default is for ARPACK to randomly generate a starting vector.
<<< eigs selects the starting vectors in a reproducible manner using a private random number stream. Changing the random number seed does not affect the starting vector. >>>
Tom Dean
Dmitri. 

