Why wouldn't astronomers use Mathematica?

In summary: Nature" used Python for their article "The sky's open for business: Statistical astronomy with Python".So, not only is there evidence that astronomers use Python, but it's also a very popular choice.Now, on to the reasons that people supposedly prefer Mathematica. I can understand why someone would want to use a high-level modeling language like Mathematica. It's very convenient for doing things like that. However, I think that there are better options for doing data analysis and numerical calculations.As for the memory overhead and the insane amount of variables that the kernel creates in loops, I can understand why that would be a problem. However, I think that there are other,
  • #1
GW150914
14
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
  • #2
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
  • #3
Mathematica is best for symbolic manipulations. There are better programs for data analysis and numerics.
 
  • #4
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
  • #5
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.
 
  • #6
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.
 
  • #7
Agreed, include the yearly license for MATLAB being an order of magnitude higher than MATHEMATICA one can see why python is the obvious choice.
 
  • #8
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
  • #9
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

  • Thesis_Code.txt
    8.3 KB · Views: 385

Related to Why wouldn't astronomers use Mathematica?

1. Why is Mathematica not commonly used by astronomers?

There are a few reasons why astronomers may not use Mathematica as their primary computational tool. One of the main reasons is that Mathematica is a proprietary software, meaning it requires a license and can be expensive for individual researchers or small institutions. Additionally, astronomers often prefer open-source software that allows for more flexibility and customization. Lastly, some astronomers may not have the necessary training or experience to use Mathematica effectively.

2. Can Mathematica be useful for certain tasks in astronomy?

Absolutely! While it may not be the most commonly used tool in astronomy, Mathematica can be extremely useful for certain tasks. For example, its powerful symbolic computation capabilities make it well-suited for solving complex equations and performing data analysis. It can also be used for visualizing data and creating interactive models, which can be valuable for understanding and presenting astronomical concepts.

3. Are there any limitations to using Mathematica in astronomy?

Like any software, Mathematica has its limitations. One potential limitation is that it may not have as extensive a library of astronomical data and functions as other, more specialized software. This may make it more difficult for astronomers to perform certain tasks, such as simulating specific astronomical phenomena. Additionally, some astronomers may prefer software that is specifically designed for astronomical research and has features that are tailored to their needs.

4. How does Mathematica compare to other software commonly used in astronomy?

There is no one-size-fits-all answer to this question, as different software may be better suited for different tasks in astronomy. However, Mathematica does have some advantages over other software. For example, its powerful symbolic computation capabilities and user-friendly interface make it a popular choice for data analysis and visualization. On the other hand, specialized software such as IRAF or IDL may have more robust features for specific astronomical tasks.

5. Can astronomers use Mathematica alongside other software?

Yes, many astronomers use Mathematica alongside other software in their research. Mathematica is often used for data analysis and visualization, while other software may be better suited for tasks such as image processing or data reduction. Additionally, Mathematica has the ability to import and export data from other software, making it versatile and compatible with other tools commonly used in astronomy.

Similar threads

  • Sci-Fi Writing and World Building
Replies
15
Views
385
  • Programming and Computer Science
Replies
9
Views
3K
  • Programming and Computer Science
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
16K
  • STEM Academic Advising
Replies
11
Views
1K
  • Science and Math Textbooks
Replies
1
Views
1K
  • Programming and Computer Science
Replies
8
Views
1K
Replies
4
Views
2K
Back
Top