# Inaccurate zero eigenvalues for 7*7 matrix [closed]

I have symbolic entries for all the elements of a 7*7 matrix. At the symbolic level Eigenvalues gives two zeroes and five others that are extremely complicated. At the same time Det evaluates to exactly zero.

I take this to mean that, no matter what values the symbols within the matrix are assigned, I will have at least two zero eigenvalues. Exactly zero eigenvalues.

However, when I assign values to the symbols by hand, for eg., a=10; b=50, and so on, and evaluate the same codes, Eigenvalues evaluates to give two eigenvalues of the order of 10^-12. For my purpose, this magnitude cannot be treated as a zero. And I am also in need of a different eigenvalue of the same matrix which is very small, of this order or even smaller, but is not exactly zero. So I need the zeroes to show up much more accurately.

I have tried adding $MinPrecision=50 to my code before executing the rest of it. It does not help at all. A similar question was posted, Is there a good way to check, whether a small value produced numerically is a symbolic zero? However I could not decipher anything of use out of it. My code is as follows, $MinPrecision = 50;
m = {{mm - g^2 + a^2, a*b, a*b, 30*bb1 , bb1, 0, 0}, {a*b,
mm - g^2 + h^2 + n^2 + b^2, b^2, j*b, j*b/30, -k*b, -k*b}, {a*b,
b^2, mm - g^2 + h^2 + n^2 + b^2, j*b,
j*b/30, -k*b, -k*b}, {30*bb1, j*b, j*b, 30*bb0, bb0, 0, 0}, {bb1,
j*b/30, j*b/30, bb0, bb0/30, 0, 0}, {0, -k*b, -k*b, 0, 0, bbn,
bbn}, {0, -k*b, -k*b, 0, 0, bbn, bbn}};
Eigenvalues[m][[1]]
Eigenvalues[m][[2]]
Det[m]


The result as you can check is zero for all three evaluations. However as soon as I plug values for the symbols, for example,

    mm = 10^4;
g = 10;
a = 0.01;
b = 0.01;
c = 0.01;
h = 10;
n = 10^-4;
j = 300;
k = 4000;
bb0 = 500;
bb1 = 100;
bbn = 1000;


And then evaluate,

    Eigenvalues[m]


The output is

    {16402.3, 10000.8, 10000., 8514.34, 1999.2, 2.01348*10^-12,
1.22563*10^-13}


I need the two zeroes to go to higher precision. If possible, upto 10^-60.

## closed as off-topic by Daniel Lichtblau, m_goldberg, Henrik Schumacher, b3m2a1, LCarvalhoNov 12 '18 at 9:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – m_goldberg, Henrik Schumacher, b3m2a1, LCarvalho
If this question can be reworded to fit the rules in the help center, please edit the question.

• This can't be answered without a concrete example, but very likely you used machine precision arithmetic, which works with ~15 digits. Then the result is expected. – Szabolcs Nov 10 '18 at 14:24
• 0.01 is a machine precision number. \$MinPrecision takes no effect. Try 0.0150 instead. – Szabolcs Nov 10 '18 at 22:03

By specifying exact values for the variables you use, you can get accurate values for the eigenvalues.

For example, I would write

Block[{mm = 10^4,
g = 10,
a = 1/100,
b = 1/100,
c = 1/100,
h = 10,
n = 10^-4,
j = 300,
k = 4000,
bb0 = 500,
bb1 = 100,
bbn = 1000},
Eigenvalues[m]]


The results can be converted to approximate values if needed

N[%, 30]
(* {16402.3272337221591649788834496, 10000.7999287584546436217564124, 10000.0000000100000000000000000, 8514.33972434372538655954886552, 1999.20007985232747150647793915, 0,
0} *)
`