Which Math Software Do Physics Grad Students Prefer?

  • Thread starter Zenguy
  • Start date
  • Tags
    Software
In summary: I have used Matlab for a lot of things.In summary, the three most popular math software packages are Matlab, Maple, and Mathematica. Each has its own strengths and weaknesses, so it is important to use the right tool for the task at hand.
  • #1
Zenguy
4
0
I want to get some math software, something that does everything. :)
(or as close to that as practical)

Of course I want it to be really easy to use. :) Yes, I realize that
all of the above is impossible.

I guess the best question is, which is most popular among, say,
physics grad students?

I have used Mathematica in the past, but after being initially
impressed I found I didn't like using it very much.

Thanks,

zenguy
 
Physics news on Phys.org
  • #2
I use Maple.
I am also using Python with VPython, which uses some fast linear algebra libraries.
 
  • #3
Maple is a very good math software, I use it also.
Mathematica is also decent, but I definitely prefer Maple
 
  • #4
I was going to recommend Mathematica, but seeing you tried and discarded it, I guess that's not an option. Still, it can do anything (almost anything you'd want to do in math, that is) and it can be very easy to use (though you are not restricted to making advanced use of it).
Unfortunately I have no experience with Maple.
Unfortunately I do have experience with Matlab, which I found less pleasant to work with than Mathematica, not to mention the fact it can't work symbolically.
 
Last edited:
  • #5
I use have used Mathematica, but as CQ says, I prefer Maple. I also use GNUplot for plotting and Python if I'm doing a lot of batch calculations or numerical analysis (as rob say's it's LA libraries, among others, are excellent).
 
Last edited:
  • #6
I also use Maple.

Not sure if you would consider it easy to use.
 
  • #7
CompuChip said:
Unfortunately I do have experience with Matlab, which I found less pleasant to work with than Mathematica, not to mention the fact it can't work symbolically.

matlab can work symbolically, though i do agree it is the lesser of all math software.
 
  • #8
They each have their uses. Matlab is great for building simulations, and it does have symbolic ability, though if I recall correctly it does this by using the Maple kernel or a version thereof.

Maple is nice, but I have not used it as much as Matlab.

Mathematica is wonderful, except it is ungodly expensive. Sheesh.

These days, I use Matlab (the old edition I bought in grad school), Maxima (free), and a version of MuPad Light that I registered when it was still free.
 
  • #9
Maybe the best advice is to take advantage of what you have available, using the the right tool for the task at hand. Some are better at numerical calculations, others at symbolic computations. Some are good at interactive 3D-plotting, others at publication-quality plotting. Some have an active community where you can get help. Some are free and open source.

It's sometimes helpful to write a program that outputs a code snippet for another program. For instance, in my C code, I might have some debugging output that generates Maple code that I can paste into Maple and analyze there. Scripting languages, like Perl, Python, and even bash, can reduce the tedium of repetitive operations in exchanging data and code between software packages.

In short, you shouldn't choose just ONE software package.
 
  • #10
I personally use matlab. It has many of the same features of a C-style programming language (minus pointers that i know of) and therefore can be used for complicated things such as simulations.
 
  • #11
Matlab is probably the best software there is for purely numerical simulations (not counting programming languages such as C, Fortan etc), you can really do just about anything.
I have used Fortran 77 with MPI a few times (not my choice, my collaborator at the time liked it) to write simulations for parallell computers (clusters). This is the only thing that you can't really do in Matlab (although there is now a distributed computing toolbox).
Matlab used to be a bit slow but the more recent versions of Matlab includes routines that are usally fast enough (Mathwork is now using FFTW to do FFT, you can also use NAG etc) if you are running it on a single CPU. It now uses JIT compilation (similar to Java) so you can even use FOR loops without slowing down everything (which makes programs easier to understand)
The plotting routines in the more recent versions of Matlab are also good enought to produce graphs for papers and presentations.

But Matlab can't handle symbolic math very well (which has never been a problem for me) so if you are only planing to run relatively "simple" simulations e.g. Mathematica might be a more suitable choice. Matlab is also not very used friendly (but still much easier to use than a programming language like Python), but you get the hang of it after a while.

I have used Matlab for over 13 years now and I would literally not be able to do my job without it.
 
  • #12
At my school the math dept uses Maple in general and the physics dept uses both Maple and Mathematica. I find Maple easier to use but that is my opinion. I haven't found anything in one that can't be done with the other though. Both are good for doing numerical approximations. This can be helpful in a DE class or for a project in a math class where solving by had may be nearly impossible.
 
  • #13
I too started out with Mathematica. I prefer Maple over Mathematica for symbolic algebra, modeling and basic data analysis. I think the one thing that makes Maple really stand out is the fantastically thorough Help section. It's very detailed and there are lots of useful examples.
 
  • #14
jhicks said:
I personally use matlab. It has many of the same features of a C-style programming language (minus pointers that i know of) and therefore can be used for complicated things such as simulations.

That's the problem with Mathlab, it is no better than a C compiler with the standard libraries, for which many free choices are available.

I recommend using Mathematica. It is more powerful than Maple for symbolics, way more powerful for numerics, and I prefer the functional programming language to Maple's procedural. The only areas where Matlab is better than Mathematica are such that C is better still, so for the purpose of an expensive math software the only choice based on power is Mathematica.

But everyone agrees that Mathematica has a steep learning curve, and that is a major fault.
 
  • #15
Crosson said:
That's the problem with Mathlab, it is no better than a C compiler with the standard libraries, for which many free choices are available.

I don't agree. Matlab is much easier to use than C and the fact that it is "interactive" really helps; for most simple problems you don't have to write a script (unless you want to). Also, good built in routines for plotting etc also really helps.
It is true that you can do the same thing in C (or Python), but it takes more time and is much less convenient; >50% of my calculations only require 10-20 lines of code in Matlab.
Also, there are plenty of free toolboxes to Matlab developed by other users and it is also possible to use standard libraries such as NAG.

Also, sorry if this is slightly OT, but WHEN do you actually need symbolic manipulation? I have used that exactly once and that was during my first course in QM (many years ago) when we needed to solve some horrible integrals; I never needed it in any other course and I have never used it in my research either, mainly because most "real" systems are so complicated (at least the ones I work with) that analytical solutions are rarely useful.
But perhaps it is simply due to the fact that I am (mainly) an experimental physicists?
 
  • #16
f95toli said:
I don't agree. Matlab is much easier to use than C and the fact that it is "interactive" really helps; for most simple problems you don't have to write a script (unless you want to). Also, good built in routines for plotting etc also really helps.
It is true that you can do the same thing in C (or Python), but it takes more time and is much less convenient; >50% of my calculations only require 10-20 lines of code in Matlab.
Also, there are plenty of free toolboxes to Matlab developed by other users and it is also possible to use standard libraries such as NAG.

Also, sorry if this is slightly OT, but WHEN do you actually need symbolic manipulation? I have used that exactly once and that was during my first course in QM (many years ago) when we needed to solve some horrible integrals; I never needed it in any other course and I have never used it in my research either, mainly because most "real" systems are so complicated (at least the ones I work with) that analytical solutions are rarely useful.
But perhaps it is simply due to the fact that I am (mainly) an experimental physicists?

Symbolic Package is helpful when you do mathematical research... Once upon a time I had to verify that a function was indeed a solution to some parabolic PDE. It seems trivial calculus and yet it was so long (the function itself was half a page long with implicit function and functional everywhere) that it took 20+ hours to do it. And yes it was a simple calculus with 10 pages of calculations

I think MATLAB bind with mathematica is a very good combination to do research and verification. However if you need to do calculation you have to know C/C++ or other languages. Matlab is still too slow when you need to run large calculations. And I find maple hard to use because I am used to the powerfulness of mathematica... haha
I also personally hate the GUI of maple. making things more complicated than it can be
 
  • #17
I just got Maple and since I am not a student, I bought it for about twice the student price.
Maple has a personal use license but to get this, you need to buy it directly from Maplesoft and the personal use version is not available via the web. One has to phone them to buy it.

Perhaps Wolfram has something similar for the personal (home) and non-commercial user.
If you get Maple under the personal use license, you cannot use it in any activity that generates revenue.
 
  • #18
A Specific Problem (following Einstein)

These two equations follow a derivation of the Lorentz transformation by Einstein:
(but here we are just interested in the math)

x+ct = M(y+cr)
x-ct = L(y-cr)

x & t are spacetime coordinates in one reference frame; y & r are the corresponding
coordinates in a second frame. c is the speed of light. L and M are arbitrary constants.

adding, we get:

2x = (M+L)y + (M-L)cr

Subtracting the same pair we get:

2ct = (M-L)y +(M+L)cr

Now we define:

A = (M+L)/2 and
B = (M-L)/2

substituting, we get:

x = Ay + Bcr
ct = By + Acr
----------------------------------------------------
OK, now that is all high school algebra, but I could not reproduce it with Mathematica.
I'm a beginner at Mathematica, but I can do most of the basic stuff. The problem arose trying to add two equations together. I could not get anything useful, as is done above, by adding two Mathematica equations together.

Is there a way to do it? (I mean to reproduce all of the above steps.)

Can Maple do it?

Thanks,

m
 
  • #19
i use mathematica and fortran90
 
  • #20
Zenguy: using mathematica, with a little thought on the part of the user, makes solving this problem very simple.

Code:
e1 = (x+c t == M(y + c r));
e2 = (x-c t == L(y-c r));
Solve[{e1/.M->(A+B), e2/.L->(A-B)}, {x,t}]

Returns

Code:
{{x->B c r + A y, t->(A c r + B y)/c}}

All that is required is to multiply the solution for t by c to get your desired solution. Alternatively (though the method becomes more problem specific if you do this) you could instead define ct as a single variable, and solve for it.

Often times with Mathematica it is not possible to get the particular form of the solution you're looking for, as Mathematica relies on it's own rules for simplifying and ordering an expression. You can see here that I inverted your equations for A and B by myself, if this were more complicated, an extra step in between would be to first invert them using Solve[], and then use the resulting rule in the following Solve[] statement. Usually with a little careful thinking on the part of the user, you can get something pretty close to a form you like, especially if you have an idea what the solution should look like (hey, it's easier to solve by hand too if you already know the solution).
 
  • #21
NeoDevin: Thanks, that's a helpful response. The "." and "->" operators are new to me. I could not find anything about them in the documentation. They appear to designate a substitution. Also, I'm confused about your use of (A+B) & (A-B) rather than (M+L)/2 and (M-L)/2. I really don't understand how you arrived at your final result. But maybe that's because I don't understand what ".__->" does.

m
 
  • #22
f95toli said:
Also, sorry if this is slightly OT, but WHEN do you actually need symbolic manipulation? I have used that exactly once and that was during my first course in QM (many years ago) when we needed to solve some horrible integrals; I never needed it in any other course and I have never used it in my research either, mainly because most "real" systems are so complicated (at least the ones I work with) that analytical solutions are rarely useful.
But perhaps it is simply due to the fact that I am (mainly) an experimental physicists?

In general relativity, computer symbolic manipulation is used extensively. I can't imagine doing the calculations by hand for the spacetime on which I am now working.

A recent general relativity book comments on this:

"Calculating the curvature tensor from a given metric tensor is tedious and time-consuming, and seemingly innocent errors made along the way cause great chaos in the final results. In order to obtain a reliable result, every step of the calculation must be carefully verified. A relatively simple calculation typically takes several hours; in complicated cases it can extend to months...

The modern computer algebra programs are fairly easy to use, and the reduction in time and effort required to do a calculation is dramatic. Instead of doing a routine calculation for weeks, one can have the result in less than a minute. ... these calculation are done 'by hand' essentially only by students for educational purposes. In research work, the computers have taken over the field completely."
 
  • #23
with Maple?

George, you mentioned that you use Maple. Can Maple reproduce my simple algebra above?

Thanks,

m
 
  • #24
Zenguy said:
NeoDevin: Thanks, that's a helpful response. The "." and "->" operators are new to me. I could not find anything about them in the documentation. They appear to designate a substitution. Also, I'm confused about your use of (A+B) & (A-B) rather than (M+L)/2 and (M-L)/2. I really don't understand how you arrived at your final result. But maybe that's because I don't understand what ".__->" does.

m

/. means to apply a substitution rule, so if I put in an expression e1 as

e1/. M->(A+B)

that means expression e1, but that everywhere there is an M, it substitutes in (A+B). I used A+B and A-B because I inverted the relationship you gave, so that it could be substituted in. If it's a non-trivial relationship, then simply use:

Solve[{A == (M+L)/2,B == (M-L)/2}, {M,L}]

to get the expressions for M and L. I skipped that step because it's fairly straightforward.

Edit: For more info on the replacement operator, search your help/documentation for either ``/.'' or ``ReplaceAll'', and it should come up.
 
Last edited:
  • #25
Code:
restart;
S1:=solve( {x+c*t=M*(y+c*r), x-c*t=L*(y-c*r)} , {x,c*t} );
S2:=solve( {A=(M+L)/2, B=(M-L)/2} , {M,L} );
subs( S2,S1);simplify(%);
yields
[tex]
S1:= \left\{ x=-1/2\,Lcr+1/2\,My+1/2\,Mcr+1/2\,Ly,ct=1/2\,Lcr+1/2\,My+1/2
\,Mcr-1/2\,Ly \right\}[/tex]
[tex]
S2:= \left\{ L=-B+A,M=A+B \right\}
[/tex]

[tex]
\begin{align*}
\bigg\{
x&=-\frac{\left( -B+A \right) cr}{2}+\frac{\, \left( A+B \right) y}{2}
+\frac{\, \left( A+B \right) cr}{2}+\frac{\, \left( -B+A \right) y}{2},
\\
ct&= \frac{\, \left( -B+A \right) cr}{2}
+\frac{\, \left( A+B \right) y}{2}
+\frac{\, \left( A+B \right) cr}{2}
-\frac{\, \left( -B+A \right) y}{2} \bigg\}
\end{align*}
[/tex]

[tex]
\left\{ x=crB+yA,ct=crA+yB \right\}
[/tex]

Maybe the above can be streamlined.
(I cleaned up a little of Maple's [tex]\LaTeX[/tex] output.)
 
  • #26
I use Maple, but MathCAD is another good option.

CS
 

FAQ: Which Math Software Do Physics Grad Students Prefer?

What is the best math software available?

The best math software will depend on your specific needs and preferences. Some popular options include Wolfram Mathematica, MATLAB, and GeoGebra. It is important to research and compare different software to determine which one is the best fit for you.

Can math software be used for all levels of math?

Yes, there are math software programs available for all levels of math, from basic arithmetic to advanced calculus. Some programs may be more specialized for certain types of math, so it is important to consider your specific needs when choosing a software.

Is math software easy to use?

The ease of use will vary depending on the software and your level of familiarity with it. Some programs may have a steeper learning curve, while others may have a more user-friendly interface. It is recommended to try out a trial version or watch tutorials to get a better understanding of the software's usability.

Can math software solve complex equations?

Yes, many math software programs are capable of solving complex equations and performing advanced calculations. However, the accuracy of the results may depend on the program's algorithms and the user's input.

Is it worth the cost to invest in math software?

The cost of math software can vary greatly, from free open-source programs to expensive licensed software. It is important to consider your budget and the features and benefits of the software before making a decision. Some programs may offer free trials or student discounts, making them more accessible for those on a budget.

Back
Top