Register to reply

Matlab or mathematica

by ENDLESSYOU
Tags: mathematica, matlab
Share this thread:
ENDLESSYOU
#1
Feb17-13, 11:01 AM
P: 29
I wonder which one is more accurate when solving differential equations?
Phys.Org News Partner Science news on Phys.org
Sapphire talk enlivens guesswork over iPhone 6
Geneticists offer clues to better rice, tomato crops
UConn makes 3-D copies of antique instrument parts
mfb
#2
Feb17-13, 04:00 PM
Mentor
P: 11,589
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
jim mcnamara
#3
Feb18-13, 07:16 AM
Sci Advisor
PF Gold
P: 1,381
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.

NemoReally
#4
Feb18-13, 07:20 AM
P: 194
Matlab or mathematica

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.
ENDLESSYOU
#5
Feb18-13, 07:54 AM
P: 29
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.
NemoReally
#6
Feb18-13, 08:21 AM
P: 194
Quote Quote by ENDLESSYOU View Post
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/matl...?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.
ENDLESSYOU
#7
Feb18-13, 08:30 AM
P: 29
Quote Quote by NemoReally View Post
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/matl...?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.
NemoReally
#8
Feb18-13, 09:10 AM
P: 194
Quote Quote by ENDLESSYOU View Post
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?


Register to reply

Related Discussions
MATLAB and Mathematica help Math & Science Software 0
Matlab vs mathematica Math & Science Software 20
How write the 'for' loop in mathematica Math & Science Software 11
How to write matlab code in mathematica Math & Science Software 0
Matlab/Mathematica help! Math & Science Software 1