MATLAB Answers

Translated by

このページのコンテンツは英語から自動翻訳されています。自動翻訳をオフにする場合は「<a class="turn_off_mt" href="#">ここ</a>」をクリックしてください。

0

The "fslove function" got different answer on two computers

Jonathan Chen さんによって質問されました 2019 年 2 月 20 日
最新アクティビティ Matt J
さんによって 編集されました 2019 年 2 月 20 日
I recently use the "fslove function" to solve the non-linear equations,
Indeed, the function solved it successfully, however, when I used my file running on my mentor's computer,
We suprisely found that the results (solution) are different (almost every variable),
The gap between answers is quite small,
For example, one variable solved on my computer is
0.201819444801955
And on my mentor's
0.203068462986796
There is only 0.6% deviation, but still, that is different,
Becasue the file is completely identical, including the initial guess value and code, nothing makes any change,
Since that, it makes me to wonder that the computer difference or the version of MATLAB (my mentor's ver2016b) might be the reason to cause that kinds of issue?
If that so, is there any adjustment can be done to fix this difference,
Or might be simply something I wasn't aware of about the fsolve funtion?
Right now I am not sure about it, thus I come to here to leave a question.
Many thanks for your reading, if you need any information for my side, please leave a message below, I will reply it ASAP,
Thanks again!
Jonathan

  0 件のコメント

サインイン to comment.

製品


リリース

R2014a

1 件の回答

回答者: Matt J
2019 年 2 月 20 日
編集済み: Matt J
2019 年 2 月 20 日
 採用された回答

Have you checked whether both results are valid solutions to the equations? If a continuum of solutions exists, it is quite conceivable (and largely inevitable) for two different computers or Matlab versions to reach different solutions. What was the final fval and exitflag in each case.

  2 件のコメント

Hi Matt,
Thanks for your fast reply and answer,
After checking with my code,
The exitflag is 1 for sure,
and the fval as follows (there are 7 initial guesses),
-1.1123e-13 0 4.1633e-17 5.7397e-13 -5.1229e-12 0 1.3878e-17
and it seems like reasonable for both exitflag and fval running on my computer.
As for my mentor's part, I can only tell the exitflag is certainly 1 ,
But I am not sure about his fval matrix for now, I will update it once I get the result, thanks!
So, in your point of view,
That is possible to casue this various outcome due to computer/version difference,
humm, that is interesting, but it also makes the result not much robust by this variation.
Jonathan
Matt J
2019 年 2 月 20 日
humm, that is interesting, but it also makes the result not much robust by this variation.
Correct, but if the problem has a continuum of solutions, then it is the problem itself that is to blame for the non-robustness, not the software or computer that tries to solve it.

サインイン to comment.



Translated by