Numerical value of Determinant far from what it is supposed to beFind Determinant/or Row Reduce parameter dependent matrixEigenvalues and Determinant of a large matrixSolving determinant of a Kronecker product of matrices gives a numerical error - why?Analytic determinant of a sparse 25x25 matrix?Eigenvectors of numerical matrixmore numerically accurate inverse matrixSolving simultaneous and determinant given constant value and variable T (temperature)Determinant of Large Sparse MatrixObtaining the determinant from a LinearSolveFunction objectBad result from evaluating a determinant

Can the Witch Sight warlock invocation see through the Mirror Image spell?

Idiom for feeling after taking risk and someone else being rewarded

How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?

Giving a career talk in my old university, how prominently should I tell students my salary?

"If + would" conditional in present perfect tense

Is divide-by-zero a security vulnerability?

What will happen if my luggage gets delayed?

If nine coins are tossed, what is the probability that the number of heads is even?

I reported the illegal activity of my boss to his boss. My boss found out. Now I am being punished. What should I do?

Can I take the the bonus-action attack from Two-Weapon Fighting without taking the Attack action?

Why is there an extra space when I type "ls" on the Desktop?

Why do we say 'Pairwise Disjoint', rather than 'Disjoint'?

Does an unused member variable take up memory?

Do similar matrices have same characteristic equations?

Will expression retain the same definition if particle is changed?

School performs periodic password audits. Is my password compromised?

LaTeX logo in tufte-book

How do spaceships determine each other's mass in space?

Create chunks from an array

Do Cubics always have one real root?

Why is it common in European airports not to display the gate for flights until around 45-90 minutes before departure, unlike other places?

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

Short scifi story where reproductive organs are converted to produce "materials", pregnant protagonist is "found fit" to be a mother

Can I negotiate a patent idea for a raise, under French law?



Numerical value of Determinant far from what it is supposed to be


Find Determinant/or Row Reduce parameter dependent matrixEigenvalues and Determinant of a large matrixSolving determinant of a Kronecker product of matrices gives a numerical error - why?Analytic determinant of a sparse 25x25 matrix?Eigenvectors of numerical matrixmore numerically accurate inverse matrixSolving simultaneous and determinant given constant value and variable T (temperature)Determinant of Large Sparse MatrixObtaining the determinant from a LinearSolveFunction objectBad result from evaluating a determinant













2












$begingroup$


I have a large matrix with numerical components and want to set the determinant to zero using the parameter h (see below). Naively, I would have expected that h sets the determinant to (approximately) zero, which isn't the case. On top of that, the order of applying the rule sol seems to affects the final outcome for a reason to don't see.



My output of the code below is:



h -> -0.744736 + 4.42008 I

0.0445865 - 0.0285418 I

0.0545654 - 0.114258 I


I am not familiar with how Mathematica handles floating point numbers so that's probably where my error lies. I have also tried to increase the precision with SetPrecision, but without success.



mat=0.16 - (0.36 + 0.001 I) h - (1.35808 - 
0.00120116 I) h^2 - (0.49603 - 0.00137214 I) h^3 - (0.11307 -
0.00105331 I) h^4 + (0.249794 - 0.000384238 I) h^5 -
0.39204 h^6, -0.1711 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h - (1.15528 +
0.00267142 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), (0.0000353051 - 1.67323*10^-6 I) h^4,
0, -0.1711 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (19.6394 -
0.00267142 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (11.3534 -
0.00119507 I) h^2 - (0.484268 - 0.00140481 I) h^3 - (5.0714 -
0.00114074 I) h^4 + (0.27061 - 0.000416258 I) h^5 -
0.42471 h^6, -0.223386 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (4.95742 -
0.00267502 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), (0.0000484431 - 2.29589*10^-6 I) h^4, (0.0000353051 -
1.67323*10^-6 I) h^4, -0.223386 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (41.4016 -
0.00267502 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (29.348 -
0.00118803 I) h^2 - (0.470698 - 0.00144251 I) h^3 - (13.9095 -
0.00124106 I) h^4 + (0.294629 - 0.000453204 I) h^5 -
0.462406 h^6, -0.234771 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (19.0123 -
0.00267319 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), 0, (0.0000484431 -
2.29589*10^-6 I) h^4, -0.234771 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (71.32 -
0.00267319 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (55.3462 -
0.00118568 I) h^2 - (0.466163 - 0.0014551 I) h^3 - (26.6556 -
0.00127449 I) h^4 + (0.302655 - 0.000465551 I) h^5 -
0.475003 h^6;
sol = Part[NSolve[Det[%] == 0, h], 1]
Det[mat /. sol]
Det[mat] /. sol









share|improve this question









New contributor




Nils is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$











  • $begingroup$
    Correction: I get the output 0.118714 - 0.0526506 I (as the second output) and 0.106201 - 0.0979004 I (as the third output); sorry, used a different matrix. But the problem still stands.
    $endgroup$
    – Nils
    4 hours ago















2












$begingroup$


I have a large matrix with numerical components and want to set the determinant to zero using the parameter h (see below). Naively, I would have expected that h sets the determinant to (approximately) zero, which isn't the case. On top of that, the order of applying the rule sol seems to affects the final outcome for a reason to don't see.



My output of the code below is:



h -> -0.744736 + 4.42008 I

0.0445865 - 0.0285418 I

0.0545654 - 0.114258 I


I am not familiar with how Mathematica handles floating point numbers so that's probably where my error lies. I have also tried to increase the precision with SetPrecision, but without success.



mat=0.16 - (0.36 + 0.001 I) h - (1.35808 - 
0.00120116 I) h^2 - (0.49603 - 0.00137214 I) h^3 - (0.11307 -
0.00105331 I) h^4 + (0.249794 - 0.000384238 I) h^5 -
0.39204 h^6, -0.1711 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h - (1.15528 +
0.00267142 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), (0.0000353051 - 1.67323*10^-6 I) h^4,
0, -0.1711 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (19.6394 -
0.00267142 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (11.3534 -
0.00119507 I) h^2 - (0.484268 - 0.00140481 I) h^3 - (5.0714 -
0.00114074 I) h^4 + (0.27061 - 0.000416258 I) h^5 -
0.42471 h^6, -0.223386 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (4.95742 -
0.00267502 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), (0.0000484431 - 2.29589*10^-6 I) h^4, (0.0000353051 -
1.67323*10^-6 I) h^4, -0.223386 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (41.4016 -
0.00267502 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (29.348 -
0.00118803 I) h^2 - (0.470698 - 0.00144251 I) h^3 - (13.9095 -
0.00124106 I) h^4 + (0.294629 - 0.000453204 I) h^5 -
0.462406 h^6, -0.234771 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (19.0123 -
0.00267319 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), 0, (0.0000484431 -
2.29589*10^-6 I) h^4, -0.234771 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (71.32 -
0.00267319 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (55.3462 -
0.00118568 I) h^2 - (0.466163 - 0.0014551 I) h^3 - (26.6556 -
0.00127449 I) h^4 + (0.302655 - 0.000465551 I) h^5 -
0.475003 h^6;
sol = Part[NSolve[Det[%] == 0, h], 1]
Det[mat /. sol]
Det[mat] /. sol









share|improve this question









New contributor




Nils is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$











  • $begingroup$
    Correction: I get the output 0.118714 - 0.0526506 I (as the second output) and 0.106201 - 0.0979004 I (as the third output); sorry, used a different matrix. But the problem still stands.
    $endgroup$
    – Nils
    4 hours ago













2












2








2





$begingroup$


I have a large matrix with numerical components and want to set the determinant to zero using the parameter h (see below). Naively, I would have expected that h sets the determinant to (approximately) zero, which isn't the case. On top of that, the order of applying the rule sol seems to affects the final outcome for a reason to don't see.



My output of the code below is:



h -> -0.744736 + 4.42008 I

0.0445865 - 0.0285418 I

0.0545654 - 0.114258 I


I am not familiar with how Mathematica handles floating point numbers so that's probably where my error lies. I have also tried to increase the precision with SetPrecision, but without success.



mat=0.16 - (0.36 + 0.001 I) h - (1.35808 - 
0.00120116 I) h^2 - (0.49603 - 0.00137214 I) h^3 - (0.11307 -
0.00105331 I) h^4 + (0.249794 - 0.000384238 I) h^5 -
0.39204 h^6, -0.1711 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h - (1.15528 +
0.00267142 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), (0.0000353051 - 1.67323*10^-6 I) h^4,
0, -0.1711 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (19.6394 -
0.00267142 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (11.3534 -
0.00119507 I) h^2 - (0.484268 - 0.00140481 I) h^3 - (5.0714 -
0.00114074 I) h^4 + (0.27061 - 0.000416258 I) h^5 -
0.42471 h^6, -0.223386 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (4.95742 -
0.00267502 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), (0.0000484431 - 2.29589*10^-6 I) h^4, (0.0000353051 -
1.67323*10^-6 I) h^4, -0.223386 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (41.4016 -
0.00267502 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (29.348 -
0.00118803 I) h^2 - (0.470698 - 0.00144251 I) h^3 - (13.9095 -
0.00124106 I) h^4 + (0.294629 - 0.000453204 I) h^5 -
0.462406 h^6, -0.234771 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (19.0123 -
0.00267319 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), 0, (0.0000484431 -
2.29589*10^-6 I) h^4, -0.234771 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (71.32 -
0.00267319 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (55.3462 -
0.00118568 I) h^2 - (0.466163 - 0.0014551 I) h^3 - (26.6556 -
0.00127449 I) h^4 + (0.302655 - 0.000465551 I) h^5 -
0.475003 h^6;
sol = Part[NSolve[Det[%] == 0, h], 1]
Det[mat /. sol]
Det[mat] /. sol









share|improve this question









New contributor




Nils is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




I have a large matrix with numerical components and want to set the determinant to zero using the parameter h (see below). Naively, I would have expected that h sets the determinant to (approximately) zero, which isn't the case. On top of that, the order of applying the rule sol seems to affects the final outcome for a reason to don't see.



My output of the code below is:



h -> -0.744736 + 4.42008 I

0.0445865 - 0.0285418 I

0.0545654 - 0.114258 I


I am not familiar with how Mathematica handles floating point numbers so that's probably where my error lies. I have also tried to increase the precision with SetPrecision, but without success.



mat=0.16 - (0.36 + 0.001 I) h - (1.35808 - 
0.00120116 I) h^2 - (0.49603 - 0.00137214 I) h^3 - (0.11307 -
0.00105331 I) h^4 + (0.249794 - 0.000384238 I) h^5 -
0.39204 h^6, -0.1711 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h - (1.15528 +
0.00267142 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), (0.0000353051 - 1.67323*10^-6 I) h^4,
0, -0.1711 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (19.6394 -
0.00267142 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (11.3534 -
0.00119507 I) h^2 - (0.484268 - 0.00140481 I) h^3 - (5.0714 -
0.00114074 I) h^4 + (0.27061 - 0.000416258 I) h^5 -
0.42471 h^6, -0.223386 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (4.95742 -
0.00267502 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), (0.0000484431 - 2.29589*10^-6 I) h^4, (0.0000353051 -
1.67323*10^-6 I) h^4, -0.223386 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (41.4016 -
0.00267502 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (29.348 -
0.00118803 I) h^2 - (0.470698 - 0.00144251 I) h^3 - (13.9095 -
0.00124106 I) h^4 + (0.294629 - 0.000453204 I) h^5 -
0.462406 h^6, -0.234771 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (19.0123 -
0.00267319 I) h^2 - (0.637164 - 0.0009801 I) h^3 +
1. h^4), 0, (0.0000484431 -
2.29589*10^-6 I) h^4, -0.234771 h^2 ((-0.143205 +
0.000186623 I) - (0.36 + 0.001 I) h + (71.32 -
0.00267319 I) h^2 - (0.637164 - 0.0009801 I) h^3 + 1. h^4),
0.16 - (0.36 + 0.001 I) h - (55.3462 -
0.00118568 I) h^2 - (0.466163 - 0.0014551 I) h^3 - (26.6556 -
0.00127449 I) h^4 + (0.302655 - 0.000465551 I) h^5 -
0.475003 h^6;
sol = Part[NSolve[Det[%] == 0, h], 1]
Det[mat /. sol]
Det[mat] /. sol






linear-algebra






share|improve this question









New contributor




Nils is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Nils is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 1 hour ago









J. M. is computer-less

97.3k10303463




97.3k10303463






New contributor




Nils is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









NilsNils

111




111




New contributor




Nils is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Nils is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Nils is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • $begingroup$
    Correction: I get the output 0.118714 - 0.0526506 I (as the second output) and 0.106201 - 0.0979004 I (as the third output); sorry, used a different matrix. But the problem still stands.
    $endgroup$
    – Nils
    4 hours ago
















  • $begingroup$
    Correction: I get the output 0.118714 - 0.0526506 I (as the second output) and 0.106201 - 0.0979004 I (as the third output); sorry, used a different matrix. But the problem still stands.
    $endgroup$
    – Nils
    4 hours ago















$begingroup$
Correction: I get the output 0.118714 - 0.0526506 I (as the second output) and 0.106201 - 0.0979004 I (as the third output); sorry, used a different matrix. But the problem still stands.
$endgroup$
– Nils
4 hours ago




$begingroup$
Correction: I get the output 0.118714 - 0.0526506 I (as the second output) and 0.106201 - 0.0979004 I (as the third output); sorry, used a different matrix. But the problem still stands.
$endgroup$
– Nils
4 hours ago










1 Answer
1






active

oldest

votes


















4












$begingroup$

As you suspected when you mentioned SetPrecision, you are encountering numerical errors, probably catastrophic loss of precision when calculating the determinant; your calculations do in fact need to be carried out at higher precision.



If possible, you would want to use exact numbers in your matrix, or take advantage of the arbitrary-precision capabilities of Mathematica. For instance, we can convert all machine-precision numbers to arbitrary-precision ones with a number of digits of precision equal to that of common machine-precision numbers on your machine using SetPrecision (see also $MachinePrecision in the documentation):



det = Det[SetPrecision[mat, $MachinePrecision]];
sol = NSolve[det == 0, h];
det /. sol // PossibleZeroQ

(* Out:
True, True, True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True, True, True,
True, True
*)


As you can see, all those values of $h$ do bring your determinant reasonably close to zero, within machine-precision approximations.






share|improve this answer











$endgroup$












    Your Answer





    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "387"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Nils is a new contributor. Be nice, and check out our Code of Conduct.









    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f192970%2fnumerical-value-of-determinant-far-from-what-it-is-supposed-to-be%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4












    $begingroup$

    As you suspected when you mentioned SetPrecision, you are encountering numerical errors, probably catastrophic loss of precision when calculating the determinant; your calculations do in fact need to be carried out at higher precision.



    If possible, you would want to use exact numbers in your matrix, or take advantage of the arbitrary-precision capabilities of Mathematica. For instance, we can convert all machine-precision numbers to arbitrary-precision ones with a number of digits of precision equal to that of common machine-precision numbers on your machine using SetPrecision (see also $MachinePrecision in the documentation):



    det = Det[SetPrecision[mat, $MachinePrecision]];
    sol = NSolve[det == 0, h];
    det /. sol // PossibleZeroQ

    (* Out:
    True, True, True, True, True, True, True, True, True, True, True,
    True, True, True, True, True, True, True, True, True, True, True,
    True, True
    *)


    As you can see, all those values of $h$ do bring your determinant reasonably close to zero, within machine-precision approximations.






    share|improve this answer











    $endgroup$

















      4












      $begingroup$

      As you suspected when you mentioned SetPrecision, you are encountering numerical errors, probably catastrophic loss of precision when calculating the determinant; your calculations do in fact need to be carried out at higher precision.



      If possible, you would want to use exact numbers in your matrix, or take advantage of the arbitrary-precision capabilities of Mathematica. For instance, we can convert all machine-precision numbers to arbitrary-precision ones with a number of digits of precision equal to that of common machine-precision numbers on your machine using SetPrecision (see also $MachinePrecision in the documentation):



      det = Det[SetPrecision[mat, $MachinePrecision]];
      sol = NSolve[det == 0, h];
      det /. sol // PossibleZeroQ

      (* Out:
      True, True, True, True, True, True, True, True, True, True, True,
      True, True, True, True, True, True, True, True, True, True, True,
      True, True
      *)


      As you can see, all those values of $h$ do bring your determinant reasonably close to zero, within machine-precision approximations.






      share|improve this answer











      $endgroup$















        4












        4








        4





        $begingroup$

        As you suspected when you mentioned SetPrecision, you are encountering numerical errors, probably catastrophic loss of precision when calculating the determinant; your calculations do in fact need to be carried out at higher precision.



        If possible, you would want to use exact numbers in your matrix, or take advantage of the arbitrary-precision capabilities of Mathematica. For instance, we can convert all machine-precision numbers to arbitrary-precision ones with a number of digits of precision equal to that of common machine-precision numbers on your machine using SetPrecision (see also $MachinePrecision in the documentation):



        det = Det[SetPrecision[mat, $MachinePrecision]];
        sol = NSolve[det == 0, h];
        det /. sol // PossibleZeroQ

        (* Out:
        True, True, True, True, True, True, True, True, True, True, True,
        True, True, True, True, True, True, True, True, True, True, True,
        True, True
        *)


        As you can see, all those values of $h$ do bring your determinant reasonably close to zero, within machine-precision approximations.






        share|improve this answer











        $endgroup$



        As you suspected when you mentioned SetPrecision, you are encountering numerical errors, probably catastrophic loss of precision when calculating the determinant; your calculations do in fact need to be carried out at higher precision.



        If possible, you would want to use exact numbers in your matrix, or take advantage of the arbitrary-precision capabilities of Mathematica. For instance, we can convert all machine-precision numbers to arbitrary-precision ones with a number of digits of precision equal to that of common machine-precision numbers on your machine using SetPrecision (see also $MachinePrecision in the documentation):



        det = Det[SetPrecision[mat, $MachinePrecision]];
        sol = NSolve[det == 0, h];
        det /. sol // PossibleZeroQ

        (* Out:
        True, True, True, True, True, True, True, True, True, True, True,
        True, True, True, True, True, True, True, True, True, True, True,
        True, True
        *)


        As you can see, all those values of $h$ do bring your determinant reasonably close to zero, within machine-precision approximations.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 4 hours ago

























        answered 4 hours ago









        MarcoBMarcoB

        37.3k556113




        37.3k556113




















            Nils is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            Nils is a new contributor. Be nice, and check out our Code of Conduct.












            Nils is a new contributor. Be nice, and check out our Code of Conduct.











            Nils is a new contributor. Be nice, and check out our Code of Conduct.














            Thanks for contributing an answer to Mathematica Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f192970%2fnumerical-value-of-determinant-far-from-what-it-is-supposed-to-be%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

            Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

            Torre de la Isleta Índice Véase también Referencias Bibliografía Enlaces externos Menú de navegación38°25′58″N 0°23′02″O / 38.43277778, -0.3838888938°25′58″N 0°23′02″O / 38.43277778, -0.38388889Torre de la Illeta de l’Horta o Torre Saleta. Base de datos de bienes inmuebles. Patrimonio Cultural. Secretaría de Estado de CulturaFicha BIC Torre de la Illeta de l’Horta. Dirección General de Patrimonio Cultural. Generalitat ValencianaLugares de interés. Ayuntamiento del CampelloTorre de la Isleta en CastillosNet.org