Matlab vs Mathematica for DiffEqs: Accuracy?

  • Context: MATLAB 
  • Thread starter Thread starter ENDLESSYOU
  • Start date Start date
  • Tags Tags
    Mathematica Matlab
Click For Summary

Discussion Overview

The discussion centers on the accuracy of MATLAB versus Mathematica when solving differential equations, particularly in the context of the restricted circular three-body problem. Participants explore various numerical methods and their implications for accuracy, stability, and user experience.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • Some participants question what is meant by "accuracy," suggesting it could refer to numerical errors, bugs, or the specific methods used.
  • One participant notes that both software packages have been extensively used, implying that significant accuracy issues are unlikely.
  • Another participant suggests that both MATLAB and Mathematica are likely comparable in numerical accuracy for most cases, but emphasizes the need for specific test cases for a fair comparison.
  • Participants discuss the use of different numerical methods, with one suggesting that ode45 might generally be preferable for the three-body problem, while another argues that ode15s could be more suitable for stiff equations.
  • Concerns are raised about the stability of results between different operating systems when using Mathematica, with one participant sharing an experience of obtaining different results on Windows and Ubuntu.
  • There is a suggestion to compare results from ode15 and ode45 to evaluate their performance in this context.

Areas of Agreement / Disagreement

Participants express differing views on the accuracy and stability of MATLAB versus Mathematica, with no consensus reached on which is definitively better for solving differential equations. The discussion remains unresolved regarding the best approach for the specific problem at hand.

Contextual Notes

Participants highlight the importance of specific problem contexts and numerical methods, indicating that the choice of solver may significantly affect results. There are also mentions of potential differences in global parameters between software versions that could impact outcomes.

ENDLESSYOU
Messages
29
Reaction score
0
I wonder which one is more accurate when solving differential equations?
 
Physics news on Phys.org
Accurate in which way?
Smaller numerical errors? Depends on the way you try to solve it, internal details of the programs and the accurary you need.
Less bugs? No idea
 
Since both have been used extensively for a long time, the chance of "accuracy" problems is very small. I would use the one that that I was most familiar with.

Generally, software that is inaccurate or does calculations incorrectly either gets corrected by its authors or people stop using it. And users find something that does work as intended.
 
All things being equal, they're probably about the same numerically in most cases and they both have symbolic DE solvers that cover a reasonable number of physical cases ... I think you'd have to have something in mind or a set of test cases to make a comparison. If you were to hold a pistol against my head, I'd probably guess Mathematica ... but I'm rather unlucky ... I once failed an ESP test dismally (least sensitive person they'd ever seen, apparently), I got 100% wrong. :frown:
 
Thanks. I'm dealing with the restricted circular three-body problem and solving the differential equations though numerical methods, ode15s on MATLAB and NDSolve on mathematica.
 
ENDLESSYOU said:
Thanks. I'm dealing with the restricted circular three-body problem and solving the differential equations though numerical methods, ode15s on MATLAB and NDSolve on mathematica.
Hmm. I would have thought ode45 would be a better choice for that problem in most cases. It's the one Mathworks use in their documentation - http://www.mathworks.co.uk/help/matlab/math/ordinary-differential-equations.html?s_tid=doc_12b

What led you to ask the question? Do you see any significant differences between Mathematica and Matlab? It doesn't address your particular case, but several years ago I partially-validated Matlab 6-dof simulation in Mathcad - the two applications gave very good agreement using a fixed 4th-order RK.
 
NemoReally said:
Hmm. I would have thought ode45 would be a better choice for that problem in most cases. It's the one Mathworks use in their documentation - http://www.mathworks.co.uk/help/matlab/math/ordinary-differential-equations.html?s_tid=doc_12b

What led you to ask the question? Do you see any significant differences between Mathematica and Matlab? It doesn't address your particular case, but several years ago I partially-validated Matlab 6-dof simulation in Mathcad - the two applications gave very good agreement using a fixed 4th-order RK.

They're stiff differential equations so ode15s might be a better choice. In my experience, MATLAB is more 'stable' than Mathematica. I once executed a same nb file on Windows and Ubuntu, but I got two different results.
 
ENDLESSYOU said:
They're stiff differential equations so ode15s might be a better choice.
Are running modified DEs or getting very close to the "mass" centres? IME, the 3-body problem isn't generally treated as still, and the adaptive rk45 solver is usually good enough. Have you compared the results of running ode15 vs ode45?

In my experience, MATLAB is more 'stable' than Mathematica. I once executed a same nb file on Windows and Ubuntu, but I got two different results.
OK, that would make the Mathematica implementation a bit more suspect. Are there global parameters in the 2 versions of Mathematica that might be different? How does the Mathematica version compare to the Matlab in the same environment?
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K