Problem for computing eigenvalues with EPSSolve

Is there any point in looking at the singular values of the stiffness matrix?
If the elements are data dependent sum you probably want to have
some idea of the quality of your model. What are the singular values with the
original FF and python coefficients? I don’t know offhand how to do
that in FF :slight_smile:

Taking the current set of eigen values, you have two of large magnitude with the
rest smaller by maybe a factor of 1e7 or so. Is this what you expect?

Hi,

To my mind, this big amplitude is expected since the eigenvalues should decay quickly with this method.
Besides, the stiffness matrix is invertible, so we can continue with the eigenvalues, there is no need to consider singular value. Some of them can be zero, but this is not a problem.

Loïc,

I guess empirically the question remains why one set of coefficients
gives the evs you expect and another does not.
I just ran this with the FF mass matrix and no change, using python mass
and FF stifness gives negative eigenvalues.

Just looking again at row 9, . some of these
are of opposite signs of the others. It could be you depend on exact equality/cancellation
of some terms. You could try the FF elements and round them - this may help
understand your model. I’ve looked at some cases of models with empircal
correlation matrix and they can be rather difficult :slight_smile:

$ grep "9 " MATRICES/*STIFF*| grep -v XX |sed -e 's/:/ /g' |  awk '{ v=$4*$4; if ( $2 =="9" ) if (v>1e-10) print $0; }' | sort -k 2 | sed -e 's/[ \t][ \t]*/ /g'
MATRICES/STIFF_ELEM_3.txt 9 11 -271.529
MATRICES/FF_STIFF_ELEM_3.txt 9 11 -271.5290039099681394
MATRICES/STIFF_ELEM_3.txt 9 12 -384
MATRICES/FF_STIFF_ELEM_3.txt 9 12 -384.00000001989764087
MATRICES/STIFF_ELEM_3.txt 9 1 -271.529
MATRICES/FF_STIFF_ELEM_3.txt 9 1 -271.5290039180919166
MATRICES/STIFF_ELEM_3.txt 9 13 384
MATRICES/FF_STIFF_ELEM_3.txt 9 13 384.00000001849349474
MATRICES/FF_STIFF_ELEM_3.txt 9 2 -383.99999996975094518
MATRICES/STIFF_ELEM_3.txt 9 2 -384
MATRICES/FF_STIFF_ELEM_3.txt 9 3 -383.99999996121590584
MATRICES/STIFF_ELEM_3.txt 9 3 -384
MATRICES/FF_STIFF_ELEM_3.txt 9 5 -383.99999999616375135
MATRICES/STIFF_ELEM_3.txt 9 5 -384
MATRICES/STIFF_ELEM_3.txt 9 9 6144
MATRICES/FF_STIFF_ELEM_3.txt 9 9 6144.0000000230411388

By the way when I consider the problem in the other way : STIFF \Phi = \lambda MASS \Phi, I find positive eigenvalues, and the same values than with Python.

I do get negative eigenvalues in both cases.

>> eig(full(A), full(B))

ans =

   1.0e+11 *

   -3.4520
   -5.0801
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000

>> eig(full(B), full(A))

ans =

   1.0e+03 *

    2.7778
    1.9891
    1.2409
    1.2537
    0.7975
    0.6569
    0.4717
    0.4620
    0.0877
    0.0875
    0.1824
    0.1825
   -0.0000
   -0.0000

What do you think of this ?

The theory and the numerics don’t always perfectly align. The last eigenvalues are just noise.

So, in the second case all the eigenvalues are positive : we don’t have to take into account the minus sign before the 0, isn’t it ?

The second case is thus in agreement with the theory and they are the eigenvalues that we expect.

Loïc,

we don’t have to take into account the minus sign before the 0, isn’t it ?

What!? These are negative eigenvalues. But again, it’s all noise.

>> v = eig(full(B), full(A));
>> v(end-1:end)

ans =

   1.0e-11 *

   -0.2705
   -0.1981

Ah okay, I was thinking that is was under the machine precision. So yes, they are clearly negative.

Loïc,

So yes, they are clearly negative.

No, you are missing the point, they are zero, but because of round-off errors, you get small negative values.

Ok okay, in this case I am in agreement with the eigenvalues calculated.

I think the big negative values in this previous case was due to round off errors too, since in the previous case the eigenvalues should be the inverse of these eigenvalues.

By considering the problem in this way, I no longer have a problem using-eps_gen_hermitian

Thanks !

Loïc,

I think the big negative values in this previous case was due to round off errors too

That’s what I’m telling you since the beginning, yes.

Did anything change playing with those parameters?
You can see how sensitivie the results are if you look at the different
STIFF files I included here. The “XX” is the python stiffness apparently
rounded . SS removed the very small values from the FF matrix.
II too the floor of the remaining elements. I may have made some mistakes
and these may not be entirely accurate but you can play with these if you like…

modified_stiff.zip (11.9 KB)

Thanks !

According my first tests, the “XX” give me the same results with Python and FreeFEM.
The other methods have little influence.

I will try to investigate this method.

Best regards,

Loïc,

There are at least a couple issues here. One of course is how the FF solvers
work on various kinds of data and how to measure or classify the data quality.
Another however is your model utility- do these numbers mean anything
or are all of them noise? Some off the smaller ones seemed to be
degenerate in pairs, does that mean anything or is it accidental?

Edit and I almost forgot, there is an FF command called display
that seems to show the sturcture of larger matricies but I could
not get it to work well with these . Taking out the small values
you could probably visualize the structure in R or matlab
and see if it makes sense.

This is rotated or reflected or something but basically it is your
stiffness matrix with size reflecting magnitude and the small values
don’t show up.
sensitive

But you also have only a few element values plus some noise. Is this
consistent with what you think your model is doing? Is there some sum
rule?

 cat stiff.txt  | mjm zed 2 | awk '{print int($1 + .5)}' | sort  -g | uniq -c
      2 -470
     12 -383
      6 -342
      6 -319
      8 -271
      4 -67
      8 -47
      4 -22
    103 0
      4 23
     14 48
      4 68
      2 320
      2 343
      8 384
      2 471
      1 608
      1 631
      4 855
      2 6144