Matlab vs Mathematica for DiffEqs: Accuracy?

In summary: 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.I see. So that would make the Mathematica implementation a bit more suspect. Do you have a link to Mathworks' documentation for ode45?
  • #1
ENDLESSYOU
29
0
I wonder which one is more accurate when solving differential equations?
 
Physics news on Phys.org
  • #2
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
 
  • #3
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.
 
  • #4
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:
 
  • #5
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.
 
  • #6
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.
 
  • #7
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.
 
  • #8
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?
 

1. What is the main difference between Matlab and Mathematica for solving differential equations?

The main difference between Matlab and Mathematica for solving differential equations is their underlying programming languages. Matlab uses a proprietary language, while Mathematica uses its own programming language called Wolfram Language. This can affect the syntax and commands used for solving differential equations.

2. Which software is more accurate for solving differential equations?

Both Matlab and Mathematica are highly accurate for solving differential equations. However, Mathematica is known for its symbolic computation capabilities, which can lead to more accurate solutions for certain types of differential equations.

3. Which software is better for beginners in differential equations?

For beginners, Matlab may be a better choice as it has a more user-friendly interface and a larger community for support and resources. However, both Matlab and Mathematica have a learning curve and require some programming knowledge for solving differential equations.

4. Can I use both Matlab and Mathematica for solving differential equations?

Yes, you can use both Matlab and Mathematica for solving differential equations. Some researchers and scientists use both software to compare and validate their results. However, it may require some additional effort to learn and use both programs effectively.

5. Are there any limitations in using Matlab or Mathematica for solving differential equations?

Both Matlab and Mathematica have their own limitations when it comes to solving differential equations. For example, Matlab may struggle with certain types of complex equations, while Mathematica may have difficulty with certain boundary conditions. It is important to carefully consider the specific needs of your research before choosing a software for solving differential equations.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
Back
Top