MATLAB Matlab vs Mathematica for DiffEqs: Accuracy?

  • Thread starter Thread starter ENDLESSYOU
  • Start date Start date
  • Tags Tags
    Mathematica Matlab
AI Thread Summary
The discussion centers on the accuracy of solving differential equations using MATLAB and Mathematica, particularly in the context of the restricted circular three-body problem. Participants note that accuracy can depend on the specific numerical methods used, such as MATLAB's ode15s or ode45 and Mathematica's NDSolve. There is a consensus that both software options have been extensively validated, making significant accuracy issues unlikely. However, users emphasize the importance of familiarity with the software and the specific requirements of the problem at hand. Some mention that MATLAB tends to be more stable, citing instances of inconsistent results between different operating systems when using Mathematica. The conversation also touches on the suitability of different solvers for stiff equations and the need for comparative testing to evaluate performance accurately. Overall, while both tools are capable, user experience and problem specifics play crucial roles in determining the best choice.
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
Views
3K
Replies
1
Views
2K
Replies
12
Views
3K
Replies
7
Views
2K
Replies
1
Views
2K
Replies
2
Views
3K
Back
Top