help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues with eigs


From: Thomas D. Dean
Subject: Re: Issues with eigs
Date: Sat, 8 Sep 2018 16:56:11 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

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 - non-zero 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)) < 1e-11 and abs(imag(e)) < 1e-3
  paired, imag() alternating signs
maple, using float approximation returns
  abs(real(e)) < 1e-9 and abs(imag(e)) < 1e-3

Some of the imag() values in scipy and maple match to 6 or 8 digits.

Tom Dean


reply via email to

[Prev in Thread] Current Thread [Next in Thread]