Why wouldn't astronomers use Mathematica?

AI Thread Summary
Mathematica is recognized as a functional tool for astronomy data analysis, but its high cost and inefficiency in handling large datasets make it less appealing compared to Python. Python's open-source nature allows for greater transparency and flexibility, which is crucial for ensuring the reliability of results. Users highlight Python's superior performance in data processing and its extensive astronomy libraries, making it a preferred choice for many. While Mathematica excels in symbolic computations, it struggles with memory management and parallel processing efficiency. Ultimately, the discussion emphasizes that while Mathematica has its merits, Python's advantages in cost, efficiency, and community support make it the more practical option for many astronomers.
GW150914
Messages
14
Reaction score
2
Mathematica is fully functional for daily astronomy data analyzing works, and it is much more convenient than python, so why can't them use Mathematica instead of python? It's like when you have warp drive you still travel through space using chemically powered traditional rockets, which is totally unnecessary.
 
Physics news on Phys.org
There's a few reasons why that I can think of (not an astronomer, but a physicist - the arguments in physics are the same). But the biggest reason for me is that Mathematica costs money for a yearly licence. You cannot guarantee that you'll be able to run the code in 5 years time. You can in python. I do use Mathematica, but not for essential tasks. Also, the syntax of python vs Mathematica makes python more appealing for those who know other languages. It's also more naturally used in a batch/large scale mode. Also, python has absolutely brilliant astronomy libraries - when Astronomy moved away from Fortran, Python would have been the most obvious choice.
 
  • Like
Likes Ben Espen and analogdesign
Mathematica is best for symbolic manipulations. There are better programs for data analysis and numerics.
 
I can't speak for why astronomers prefer one versus the other; however, I can speak to as why a person would generally prefer to use anything else besides Mathematica. Mathematica is wildly inefficient at actually handling data. The memory overhead and the insane amount of variables that the kernel creates in loops is simply asinine. Also when one tries to use Mathematica's internal parallel computing features, it isn't exactly uncommon for a parallel job to actually run slower than the original non-parallel job. Why does this happen? Poorly coded system of communication that literally spends more time talking to each other than actually doing the computing.
 
  • Like
Likes analogdesign, StatGuy2000 and e.bar.goum
MarneMath said:
I can't speak for why astronomers prefer one versus the other; however, I can speak to as why a person would generally prefer to use anything else besides Mathematica. Mathematica is wildly inefficient at actually handling data. The memory overhead and the insane amount of variables that the kernel creates in loops is simply asinine. Also when one tries to use Mathematica's internal parallel computing features, it isn't exactly uncommon for a parallel job to actually run slower than the original non-parallel job. Why does this happen? Poorly coded system of communication that literally spends more time talking to each other than actually doing the computing.

Right. If I want to calculate an integral, I'll open Mathematica. If I want to process a 20GB data file, I'll use something else.
 
I think a lot of e.bar.goum's arguments also apply for MATLAB. It's good for high-level modeling but is inefficient and outrageously expensive. More and more of my analysis and hardware test software is moving to Python. I haven't opened MATLAB in months.
 
Agreed, include the yearly license for MATLAB being an order of magnitude higher than MATHEMATICA one can see why python is the obvious choice.
 
There is another reason not to use proprietary codes like MatLab or Mathematica in addition to the cost. That is that the codes are proprietary, so you can't know for certain what they are doing. How do you know that the person who designed the Mathematica subroutine didn't make a mistake which caused you to publish erroneous data? With an open source code like Python, you can see exactly what the code is doing.
 
  • Like
Likes fluidistic, jim mcnamara, deskswirl and 1 other person
Well you guys have made perfect sense, so perhaps I have to get use to python...
 
  • #10
analogdesign said:
I think a lot of e.bar.goum's arguments also apply for MATLAB. It's good for high-level modeling but is inefficient and outrageously expensive. More and more of my analysis and hardware test software is moving to Python. I haven't opened MATLAB in months.

I do like Python, but it is no faster than Matlab these days, actually, at least for the benchmarks I've seen. That, of course, does not account for bad code.
 
  • #11
GW150914 said:
Mathematica is fully functional for daily astronomy data analyzing works, and it is much more convenient than python, so why can't them use Mathematica instead of python? It's like when you have warp drive you still travel through space using chemically powered traditional rockets, which is totally unnecessary.

There is something truly odd here, not just with the original question, but with the responses that I have read in this thread.

First of all, no one seems to question the validity of the premise, which is, to paraphrase, "Astronomers won't use Mathematica". You guys seem to just accept that, and try to justify why that is so. I never realized that this is an accepted FACT already. I must have missed the memo.

So yes, I do question the validity of the starting premise. The OP never bothered to produce any argument or evidence to support the validity of that claim. In fact, I can show a counter example. In the book "The Paraboloidal Reflector Antenna in Radio Astronomy and Communication..." by Jacob Baars, he clearly stated this:

All mathematical calculations and their graphical or tabular results have been made with the aid of the software application Mathematica, version 5.2 from Wolfram Research.

The Mathematica expressions are assembled. There are two files, both in the usual Mathematica “Notebook” format. The smaller file (MathRoutinesBook.nb, 64 kB) contains the bare routines; the larger one (MathRoutOutputBook.nb, 4 MB) presents the same routines but with the graphical output added as illustration of the result.

The routines are listed in order of appearance in the book and identified in the text as Mat. x,y, where x is the chapter number and y the running number within the chapter. This identification is also given in the first line of each expression together with a short title.

Users with access to Mathematica can copy the individual routines into their Notebook Editor and run the routines with the input parameters adjusted to their choice.

So who said that astronomers don't use Mathematica, or wouldn't use Mathematica? You guys are trying to explain away what could possibly be a non-valid idea. That's like trying to come up with a reason why there are no pink unicorns.

Zz.
 
  • Like
Likes symbolipoint and Student100
  • #12
I think it has to do with the explicit question versus the implicit question. Surely Astronomers use mathematica and surely mathematica is valuable tool for some of them. That's the simple answer to the explicit question: Yes people use mathematica in the field of Astronomy and can do so over python if they choose. However, the implicit question seems to be that this individual appears to question why anyone would prefer python over mathematica. Thus the answers.
 
  • Like
Likes Timo
  • #13
MarneMath said:
I think it has to do with the explicit question versus the implicit question. Surely Astronomers use mathematica and surely mathematica is valuable tool for some of them. That's the simple answer to the explicit question: Yes people use mathematica in the field of Astronomy and can do so over python if they choose. However, the implicit question seems to be that this individual appears to question why anyone would prefer python over mathematica. Thus the answers.

Then you and I must read and infer things differently. I see no such inferences on a specific case or person based on (i) the topic and (ii) the very first post of this thread, which I quoted.

Zz.
 
  • #14
That's fair enough. We are different people bound to see different things occasionally.
 
  • #15
This may be of some interest:

Here is a page that describes a number of alternatives to Mathematica with varying strengths and functionalities, as well as a whole range of user licenses (some free, some paid). Good descriptions of what each software does and does not do, likely users, cost, etc.

Check it out.

http://alternativeto.net/software/mathematica/

diogenesNY
 
  • #16
I prefer Scientific Workplace and Maple for symbolic computing. For data analysis, I think Python is the most compatible with OS's and other languages (and I love Spyder!). Mathematica is good for making pretty plots and animations.
 
  • #17
boneh3ad said:
I do like Python, but it is no faster than Matlab these days, actually, at least for the benchmarks I've seen. That, of course, does not account for bad code.

It varies but a personal anecdote: I was running a PDE solver (finite difference scheme, uniform grid) on Matlab and it would take 15 minutes on my laptop. I am more familiar with Python and wanted to make some changes to the existing code, so I tediously converted the original code to Python (the syntax is fairly similar). When I ran it on Python, I got the exact same output and it took 20 seconds.
 
  • #18
TheCanadian said:
It varies but a personal anecdote: I was running a PDE solver (finite difference scheme, uniform grid) on Matlab and it would take 15 minutes on my laptop. I am more familiar with Python and wanted to make some changes to the existing code, so I tediously converted the original code to Python (the syntax is fairly similar). When I ran it on Python, I got the exact same output and it took 20 seconds.
Could it have been because you were using row-major-order or column-major-order (or vice versa) in one but not the other?
 
  • #19
Hercuflea said:
Could it have been because you were using row-major-order or column-major-order (or vice versa) in one but not the other?

Numpy uses row-order and Matlab column-order, but in my case I was considering a 2D domain with an equal number of grid points on each axis. So I doubt this was the main cause.
 
  • #20
TheCanadian said:
It varies but a personal anecdote: I was running a PDE solver (finite difference scheme, uniform grid) on Matlab and it would take 15 minutes on my laptop. I am more familiar with Python and wanted to make some changes to the existing code, so I tediously converted the original code to Python (the syntax is fairly similar). When I ran it on Python, I got the exact same output and it took 20 seconds.
Considering the huge difference in execution time, I suspect that the Matlab code was not written properly. Matlab has a few idiosyncrasies and many people who are used to languages like C often produce code that runs extremely slowly (for instance, by using loops instead of vector operations).
 
  • #21
DrClaude said:
Considering the huge difference in execution time, I suspect that the Matlab code was not written properly. Matlab has a few idiosyncrasies and many people who are used to languages like C often produce code that runs extremely slowly (for instance, by using loops instead of vector operations).

That's certainly fair. Maybe to add the example I was talking about and in case it's helpful for others, the original code is from the attached thesis (automatic download) while the text file is the Python script. (The conversion from Matlab to Python is fairly easy to see.)
 

Attachments

Back
Top