Would matlab be faster than Mathematica for this?

In summary, the speaker is facing an optimization problem in Mathematica with a non-linear function that takes too long to compute. They are considering using Matlab instead, but are unsure if it will be any faster. They also question if the complexity of their program is the cause of the slow computation time.
  • #1
jimmy1
61
0
I have an optimization problem which I cannot seem to solve in Mathematica as the computation time takes too long, and I'm wondering whether things would improve if I performed the same task on a program such as Matlab?

The task is to find the maximum of a non-linear function (the function is an n dimensional multivariate normal pdf, with n >10, and the elements of the covariance matrix are also nonlinear functions).
Now the problem is, even when I try to define this function in mathematica (using the MultinormalDistribution[...] function), the mathematica kernel seems to crash! I just can't seem to define any complicated mulinormal pdfs in mathematica. The computation time takes forever! After hours of waiting still no results produced!

So my question is, is this because mathematica is just a slow program or is my function too complicated for any program? Is it worth purchasing Matlab to do this instead? Will it be any faster?
 
Physics news on Phys.org
  • #2
jimmy1 said:
So my question is, is this because mathematica is just a slow program or is my function too complicated for any program? Is it worth purchasing Matlab to do this instead? Will it be any faster?
This cannot be concluded unless we know what computer you are using (that is, your RAM, processor, OS, etc.) I haven't heard that Mathematica is slow compared to Matlab, so there are chances that the complexity of your program will make it run slow in Matlab too.
 

1. Would matlab be faster than Mathematica for this?

It depends on the specific task you are trying to perform. Matlab and Mathematica have different strengths and weaknesses, so it is difficult to make a general statement about which one would be faster.

2. Can you give an example of a task where matlab would be faster than Mathematica?

Matlab is typically faster for numerical computations, such as matrix operations and solving systems of equations. It also has a larger library of specialized functions for engineering and scientific applications.

3. Are there any tasks where Mathematica would be faster than matlab?

Yes, Mathematica excels at symbolic computations and has sophisticated algorithms for working with symbolic expressions. It is also more efficient for handling large datasets and complex data structures.

4. Does the hardware of the computer affect the speed of matlab and Mathematica differently?

Yes, the hardware can have an impact on the performance of both matlab and Mathematica. However, the specific impact may vary depending on the task and the specific hardware configuration.

5. Is there a way to optimize the speed of both matlab and Mathematica for a specific task?

Yes, both matlab and Mathematica have various optimization techniques and settings that can be adjusted to improve their performance for specific tasks. It may require some experimentation and tweaking to find the optimal settings for a particular task.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
996
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
16K
  • Science and Math Textbooks
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
6K
Back
Top