Inconsistent results from Wolfram CouldFind Determinant/or Row Reduce parameter dependent matrixPack Solve...

A Riley Respite

What are the real benefits of using Salesforce DX?

How to deal with a colleague who is being aggressive?

How to know if a folder is a symbolic link?

Is it possible to remotely hack the GPS system and disable GPS service worldwide?

Python program to find the most frequent letter in a text

How should I introduce map drawing to my players?

Who will lead the country until there is a new Tory leader?

Is real public IP Address hidden when using a system wide proxy in Windows 10?

Teacher help me explain this to my students

Looking for a soft substance that doesn't dissolve underwater

Grammar Question Regarding "Are the" or "Is the" When Referring to Something that May or May not be Plural

Where's this lookout in Nova Scotia?

Why were helmets and other body armour not commonplace in the 1800s?

Why do most published works in medical imaging try to reduce false positives?

How to Pin Point Large File eating space in Fedora 18

Any advice on creating fictional locations in real places when writing historical fiction?

How to use libraries with delays inside within a time critical STM32 HAL application?

Is the Indo-European language family made up?

what kind of chord progession is this?

Alignment: "Breaking out" of environment (enumerate / minipage)

C++ forcing function parameter evalution order

How to patch glass cuts in a bicycle tire?

Sitecore 9.0 works with solr 7.2.1?



Inconsistent results from Wolfram Could


Find Determinant/or Row Reduce parameter dependent matrixPack Solve results into a vectorHow to simplify symbolic matrix multiplication results?LUDecomposition does not give the expected resultsHow to interpret the results of PCAWhy do ReplaceAll and With give different results?Nearest non-collinear/non-coplanar pointsObtaining the determinant from a LinearSolveFunction objectRowReduction: Wolfram Alpha vs MathematicaEigenvectors calculation doesn't match from two identical results













1












$begingroup$


More specifically, I was using the "no sign-in" option of Wolfram Programming Lab



I was trying to solve a matrix problem, with the following code:



ClearAll["Global`*"]
m={{2,0},{0,1}}*2500;
k={{3,-1},{-1,1}}*20000 Pi^2;
w1=N[2Pi,5];
w2=6.2832;
D1=Det[k-w1^2*m]
D2=Det[k-w2^2*m]


Since the numerical values of w1 and w2 should be close, I expect the numerical values of D1 and D2 should also be close. Strangely, Wolfram Cloud gives very different values:



enter image description here



It took me a whole night to pin down this segment of code. I don't know if this is only due to my computer/browser, or some one else, if runs the same code, will have same problem? What happened?





Edit



Suppose I would like to compare the determinant using exact symbolic $2pi$ and function N[2Pi,5]



ClearAll["Global`*"]
m={{2,0},{0,1}}*2500;
k={{3,-1},{-1,1}}*20000 Pi^2;
w1=N[2Pi,5];
w2=2Pi;
D1=Det[k-w1^2*m]
D2=Det[k-w2^2*m]


The result is not exactly the same:
enter image description here



So, is N[2Pi,5] exactly equal to $2pi$ or not? What does the function N actually do?










share|improve this question









New contributor



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






$endgroup$








  • 3




    $begingroup$
    Suppose small epsilon then ClearAll["Global`*"]; m={{2,0},{0,1}}*2500; k={{3,-1},{-1,1}}*20000 Pi^2; w1=2Pi+epsilon; FullSimplify[Det[k-w1^2*m]] returns 12500000*epsilon*(epsilon - 2*Pi)*(epsilon + 4*Pi)*(epsilon + 6*Pi) and for small epsilon that is approximately 12500000*epsilon*-2*Pi*4*Pi*6*Pi== -600000000*epsilon*Pi^3` so any small error in w is multiplied by about 1.86*10^10 in the determinant.
    $endgroup$
    – Bill
    8 hours ago








  • 2




    $begingroup$
    No, N[x, p], represents, if possible, the value of x approximated to a precision of p digits. Read the documentation on N.
    $endgroup$
    – Michael E2
    3 hours ago






  • 2




    $begingroup$
    See reference.wolfram.com/language/tutorial/NumbersOverview.html, esp. the tutorials about exact, approximate and arbitrary-precision numbers.
    $endgroup$
    – Michael E2
    3 hours ago
















1












$begingroup$


More specifically, I was using the "no sign-in" option of Wolfram Programming Lab



I was trying to solve a matrix problem, with the following code:



ClearAll["Global`*"]
m={{2,0},{0,1}}*2500;
k={{3,-1},{-1,1}}*20000 Pi^2;
w1=N[2Pi,5];
w2=6.2832;
D1=Det[k-w1^2*m]
D2=Det[k-w2^2*m]


Since the numerical values of w1 and w2 should be close, I expect the numerical values of D1 and D2 should also be close. Strangely, Wolfram Cloud gives very different values:



enter image description here



It took me a whole night to pin down this segment of code. I don't know if this is only due to my computer/browser, or some one else, if runs the same code, will have same problem? What happened?





Edit



Suppose I would like to compare the determinant using exact symbolic $2pi$ and function N[2Pi,5]



ClearAll["Global`*"]
m={{2,0},{0,1}}*2500;
k={{3,-1},{-1,1}}*20000 Pi^2;
w1=N[2Pi,5];
w2=2Pi;
D1=Det[k-w1^2*m]
D2=Det[k-w2^2*m]


The result is not exactly the same:
enter image description here



So, is N[2Pi,5] exactly equal to $2pi$ or not? What does the function N actually do?










share|improve this question









New contributor



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






$endgroup$








  • 3




    $begingroup$
    Suppose small epsilon then ClearAll["Global`*"]; m={{2,0},{0,1}}*2500; k={{3,-1},{-1,1}}*20000 Pi^2; w1=2Pi+epsilon; FullSimplify[Det[k-w1^2*m]] returns 12500000*epsilon*(epsilon - 2*Pi)*(epsilon + 4*Pi)*(epsilon + 6*Pi) and for small epsilon that is approximately 12500000*epsilon*-2*Pi*4*Pi*6*Pi== -600000000*epsilon*Pi^3` so any small error in w is multiplied by about 1.86*10^10 in the determinant.
    $endgroup$
    – Bill
    8 hours ago








  • 2




    $begingroup$
    No, N[x, p], represents, if possible, the value of x approximated to a precision of p digits. Read the documentation on N.
    $endgroup$
    – Michael E2
    3 hours ago






  • 2




    $begingroup$
    See reference.wolfram.com/language/tutorial/NumbersOverview.html, esp. the tutorials about exact, approximate and arbitrary-precision numbers.
    $endgroup$
    – Michael E2
    3 hours ago














1












1








1


1



$begingroup$


More specifically, I was using the "no sign-in" option of Wolfram Programming Lab



I was trying to solve a matrix problem, with the following code:



ClearAll["Global`*"]
m={{2,0},{0,1}}*2500;
k={{3,-1},{-1,1}}*20000 Pi^2;
w1=N[2Pi,5];
w2=6.2832;
D1=Det[k-w1^2*m]
D2=Det[k-w2^2*m]


Since the numerical values of w1 and w2 should be close, I expect the numerical values of D1 and D2 should also be close. Strangely, Wolfram Cloud gives very different values:



enter image description here



It took me a whole night to pin down this segment of code. I don't know if this is only due to my computer/browser, or some one else, if runs the same code, will have same problem? What happened?





Edit



Suppose I would like to compare the determinant using exact symbolic $2pi$ and function N[2Pi,5]



ClearAll["Global`*"]
m={{2,0},{0,1}}*2500;
k={{3,-1},{-1,1}}*20000 Pi^2;
w1=N[2Pi,5];
w2=2Pi;
D1=Det[k-w1^2*m]
D2=Det[k-w2^2*m]


The result is not exactly the same:
enter image description here



So, is N[2Pi,5] exactly equal to $2pi$ or not? What does the function N actually do?










share|improve this question









New contributor



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






$endgroup$




More specifically, I was using the "no sign-in" option of Wolfram Programming Lab



I was trying to solve a matrix problem, with the following code:



ClearAll["Global`*"]
m={{2,0},{0,1}}*2500;
k={{3,-1},{-1,1}}*20000 Pi^2;
w1=N[2Pi,5];
w2=6.2832;
D1=Det[k-w1^2*m]
D2=Det[k-w2^2*m]


Since the numerical values of w1 and w2 should be close, I expect the numerical values of D1 and D2 should also be close. Strangely, Wolfram Cloud gives very different values:



enter image description here



It took me a whole night to pin down this segment of code. I don't know if this is only due to my computer/browser, or some one else, if runs the same code, will have same problem? What happened?





Edit



Suppose I would like to compare the determinant using exact symbolic $2pi$ and function N[2Pi,5]



ClearAll["Global`*"]
m={{2,0},{0,1}}*2500;
k={{3,-1},{-1,1}}*20000 Pi^2;
w1=N[2Pi,5];
w2=2Pi;
D1=Det[k-w1^2*m]
D2=Det[k-w2^2*m]


The result is not exactly the same:
enter image description here



So, is N[2Pi,5] exactly equal to $2pi$ or not? What does the function N actually do?







linear-algebra






share|improve this question









New contributor



York Tsang 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



York Tsang 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 3 hours ago







York Tsang













New contributor



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








asked 9 hours ago









York TsangYork Tsang

1063




1063




New contributor



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




New contributor




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










  • 3




    $begingroup$
    Suppose small epsilon then ClearAll["Global`*"]; m={{2,0},{0,1}}*2500; k={{3,-1},{-1,1}}*20000 Pi^2; w1=2Pi+epsilon; FullSimplify[Det[k-w1^2*m]] returns 12500000*epsilon*(epsilon - 2*Pi)*(epsilon + 4*Pi)*(epsilon + 6*Pi) and for small epsilon that is approximately 12500000*epsilon*-2*Pi*4*Pi*6*Pi== -600000000*epsilon*Pi^3` so any small error in w is multiplied by about 1.86*10^10 in the determinant.
    $endgroup$
    – Bill
    8 hours ago








  • 2




    $begingroup$
    No, N[x, p], represents, if possible, the value of x approximated to a precision of p digits. Read the documentation on N.
    $endgroup$
    – Michael E2
    3 hours ago






  • 2




    $begingroup$
    See reference.wolfram.com/language/tutorial/NumbersOverview.html, esp. the tutorials about exact, approximate and arbitrary-precision numbers.
    $endgroup$
    – Michael E2
    3 hours ago














  • 3




    $begingroup$
    Suppose small epsilon then ClearAll["Global`*"]; m={{2,0},{0,1}}*2500; k={{3,-1},{-1,1}}*20000 Pi^2; w1=2Pi+epsilon; FullSimplify[Det[k-w1^2*m]] returns 12500000*epsilon*(epsilon - 2*Pi)*(epsilon + 4*Pi)*(epsilon + 6*Pi) and for small epsilon that is approximately 12500000*epsilon*-2*Pi*4*Pi*6*Pi== -600000000*epsilon*Pi^3` so any small error in w is multiplied by about 1.86*10^10 in the determinant.
    $endgroup$
    – Bill
    8 hours ago








  • 2




    $begingroup$
    No, N[x, p], represents, if possible, the value of x approximated to a precision of p digits. Read the documentation on N.
    $endgroup$
    – Michael E2
    3 hours ago






  • 2




    $begingroup$
    See reference.wolfram.com/language/tutorial/NumbersOverview.html, esp. the tutorials about exact, approximate and arbitrary-precision numbers.
    $endgroup$
    – Michael E2
    3 hours ago








3




3




$begingroup$
Suppose small epsilon then ClearAll["Global`*"]; m={{2,0},{0,1}}*2500; k={{3,-1},{-1,1}}*20000 Pi^2; w1=2Pi+epsilon; FullSimplify[Det[k-w1^2*m]] returns 12500000*epsilon*(epsilon - 2*Pi)*(epsilon + 4*Pi)*(epsilon + 6*Pi) and for small epsilon that is approximately 12500000*epsilon*-2*Pi*4*Pi*6*Pi== -600000000*epsilon*Pi^3` so any small error in w is multiplied by about 1.86*10^10 in the determinant.
$endgroup$
– Bill
8 hours ago






$begingroup$
Suppose small epsilon then ClearAll["Global`*"]; m={{2,0},{0,1}}*2500; k={{3,-1},{-1,1}}*20000 Pi^2; w1=2Pi+epsilon; FullSimplify[Det[k-w1^2*m]] returns 12500000*epsilon*(epsilon - 2*Pi)*(epsilon + 4*Pi)*(epsilon + 6*Pi) and for small epsilon that is approximately 12500000*epsilon*-2*Pi*4*Pi*6*Pi== -600000000*epsilon*Pi^3` so any small error in w is multiplied by about 1.86*10^10 in the determinant.
$endgroup$
– Bill
8 hours ago






2




2




$begingroup$
No, N[x, p], represents, if possible, the value of x approximated to a precision of p digits. Read the documentation on N.
$endgroup$
– Michael E2
3 hours ago




$begingroup$
No, N[x, p], represents, if possible, the value of x approximated to a precision of p digits. Read the documentation on N.
$endgroup$
– Michael E2
3 hours ago




2




2




$begingroup$
See reference.wolfram.com/language/tutorial/NumbersOverview.html, esp. the tutorials about exact, approximate and arbitrary-precision numbers.
$endgroup$
– Michael E2
3 hours ago




$begingroup$
See reference.wolfram.com/language/tutorial/NumbersOverview.html, esp. the tutorials about exact, approximate and arbitrary-precision numbers.
$endgroup$
– Michael E2
3 hours ago










1 Answer
1






active

oldest

votes


















6












$begingroup$

I get the same result in Mathematica, so it's not a Mathematica Online issue. I don't think it's even a Mathematica issue. It's due to two factors:





  1. w1 is not equal to w2, because N doesn't actually truncate 2 Pi to five digits


  2. Det[k-w^2*m] changes quickly, so any little inaccuracy in w becomes a big discrepancy in Det[k-w^2*m]


To see #1:



w1 == 2 [Pi]
(* True *)
w1 - w2
(* -0.0000146928 *)


To see #2:



Plot[Det[k - w^2*m], {w, 6.2831, 6.2833}]


Mathematica graphics






share|improve this answer









$endgroup$













  • $begingroup$
    Regarding #1, it appears that the determinants calculated using $2pi$ and N[2Pi,5] are not exactly the same. I have edited the question.
    $endgroup$
    – York Tsang
    3 hours ago












Your Answer








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
});


}
});






York Tsang 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%2f199048%2finconsistent-results-from-wolfram-could%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









6












$begingroup$

I get the same result in Mathematica, so it's not a Mathematica Online issue. I don't think it's even a Mathematica issue. It's due to two factors:





  1. w1 is not equal to w2, because N doesn't actually truncate 2 Pi to five digits


  2. Det[k-w^2*m] changes quickly, so any little inaccuracy in w becomes a big discrepancy in Det[k-w^2*m]


To see #1:



w1 == 2 [Pi]
(* True *)
w1 - w2
(* -0.0000146928 *)


To see #2:



Plot[Det[k - w^2*m], {w, 6.2831, 6.2833}]


Mathematica graphics






share|improve this answer









$endgroup$













  • $begingroup$
    Regarding #1, it appears that the determinants calculated using $2pi$ and N[2Pi,5] are not exactly the same. I have edited the question.
    $endgroup$
    – York Tsang
    3 hours ago
















6












$begingroup$

I get the same result in Mathematica, so it's not a Mathematica Online issue. I don't think it's even a Mathematica issue. It's due to two factors:





  1. w1 is not equal to w2, because N doesn't actually truncate 2 Pi to five digits


  2. Det[k-w^2*m] changes quickly, so any little inaccuracy in w becomes a big discrepancy in Det[k-w^2*m]


To see #1:



w1 == 2 [Pi]
(* True *)
w1 - w2
(* -0.0000146928 *)


To see #2:



Plot[Det[k - w^2*m], {w, 6.2831, 6.2833}]


Mathematica graphics






share|improve this answer









$endgroup$













  • $begingroup$
    Regarding #1, it appears that the determinants calculated using $2pi$ and N[2Pi,5] are not exactly the same. I have edited the question.
    $endgroup$
    – York Tsang
    3 hours ago














6












6








6





$begingroup$

I get the same result in Mathematica, so it's not a Mathematica Online issue. I don't think it's even a Mathematica issue. It's due to two factors:





  1. w1 is not equal to w2, because N doesn't actually truncate 2 Pi to five digits


  2. Det[k-w^2*m] changes quickly, so any little inaccuracy in w becomes a big discrepancy in Det[k-w^2*m]


To see #1:



w1 == 2 [Pi]
(* True *)
w1 - w2
(* -0.0000146928 *)


To see #2:



Plot[Det[k - w^2*m], {w, 6.2831, 6.2833}]


Mathematica graphics






share|improve this answer









$endgroup$



I get the same result in Mathematica, so it's not a Mathematica Online issue. I don't think it's even a Mathematica issue. It's due to two factors:





  1. w1 is not equal to w2, because N doesn't actually truncate 2 Pi to five digits


  2. Det[k-w^2*m] changes quickly, so any little inaccuracy in w becomes a big discrepancy in Det[k-w^2*m]


To see #1:



w1 == 2 [Pi]
(* True *)
w1 - w2
(* -0.0000146928 *)


To see #2:



Plot[Det[k - w^2*m], {w, 6.2831, 6.2833}]


Mathematica graphics







share|improve this answer












share|improve this answer



share|improve this answer










answered 8 hours ago









Chris KChris K

8,08722246




8,08722246












  • $begingroup$
    Regarding #1, it appears that the determinants calculated using $2pi$ and N[2Pi,5] are not exactly the same. I have edited the question.
    $endgroup$
    – York Tsang
    3 hours ago


















  • $begingroup$
    Regarding #1, it appears that the determinants calculated using $2pi$ and N[2Pi,5] are not exactly the same. I have edited the question.
    $endgroup$
    – York Tsang
    3 hours ago
















$begingroup$
Regarding #1, it appears that the determinants calculated using $2pi$ and N[2Pi,5] are not exactly the same. I have edited the question.
$endgroup$
– York Tsang
3 hours ago




$begingroup$
Regarding #1, it appears that the determinants calculated using $2pi$ and N[2Pi,5] are not exactly the same. I have edited the question.
$endgroup$
– York Tsang
3 hours ago










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










draft saved

draft discarded


















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













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












York Tsang 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%2f199048%2finconsistent-results-from-wolfram-could%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

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m