Why wouldn't astronomers use Mathematica?

Click For Summary

Discussion Overview

The discussion centers around the reasons why astronomers may prefer Python over Mathematica for data analysis and computational tasks in astronomy. Participants explore various factors including cost, efficiency, and usability of both software tools, as well as the implications of using proprietary versus open-source software.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Exploratory

Main Points Raised

  • Some participants argue that Mathematica is convenient for daily astronomy data analysis but question why it is not more widely used compared to Python.
  • Others suggest that the cost of Mathematica's yearly license is a significant barrier, as Python is free and ensures long-term code accessibility.
  • It is noted that Mathematica excels in symbolic manipulations, while other programs may be better suited for data analysis and numerical tasks.
  • Concerns are raised about Mathematica's inefficiency in handling data, particularly regarding memory overhead and the performance of its parallel computing features.
  • Some participants mention that proprietary software like Mathematica and MATLAB raises concerns about transparency and potential errors in published data.
  • A counterpoint is presented that questions the premise that astronomers do not use Mathematica, citing examples of its application in specific works.
  • There is a discussion about the explicit versus implicit questions regarding the use of Mathematica, with some asserting that while it is used, Python may be preferred for various reasons.
  • Participants express differing opinions on the performance of Python compared to MATLAB, with some suggesting that Python is not necessarily faster.
  • Alternative software options to Mathematica are mentioned, highlighting the variety of tools available for different needs.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the reasons for the preference of Python over Mathematica. Multiple competing views are presented, with some affirming the utility of Mathematica while others emphasize the advantages of Python.

Contextual Notes

Some arguments depend on personal experiences and specific use cases, and there are unresolved questions regarding the efficiency and effectiveness of both software tools in different contexts.

Who May Find This Useful

This discussion may be of interest to astronomers, physicists, and researchers considering software options for data analysis and computational tasks, as well as those evaluating the trade-offs between proprietary and open-source tools.

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   Reactions: 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   Reactions: 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   Reactions: 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   Reactions: 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   Reactions: 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

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
Replies
9
Views
4K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 11 ·
Replies
11
Views
17K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
2
Views
2K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
8
Views
2K