The "fslove function" got different answer on two computers
2 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Matt J
on 20 Feb 2019
Edited: Matt J
on 20 Feb 2019
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 Comments
Matt J
on 20 Feb 2019
Edited: Matt J
on 20 Feb 2019
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.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!