Use of Math Languages and Packages in Research?
CEHT asks: "As a research programmer at the university, I have encountered numerous times when I need to choose which language(s) or package(s) to use for different projects. Tradeoffs and performance issues have to be considered: results from one package may be more compatible with the data from other researchers, another package may find the solution faster and use less resources, and so forth. Maple,
Matlab, Magma, and Mathematica
are among the most well-known packages. Libraries such as IMSL is also popular. Of course, there are smaller (and mostly free) packages that tend to target specific types of problem, such as LiDIA, Singular, and LAPACK.
The question is, how useful are these [and other] math packages? Do researchers use only one or two packages for most of their projects? Or do people like to mix things a little by pulling the strength of different packages together to solve a math problem? If not, do researchers write C/C++ programs and use GMP or Matpack to solve math problems?"
In Experimental Nuclear Physics (ENP) there is a healthy mix of Fortran , C, and C++ (and some others). There is a healthy schepticism of "black box" programs and libraries so programs like Mathematica and Mathlab are pretty much not used. Also, most of the problems are pretty specific (and time consumming to run) so everyone seems to run specialized code (Example: Radware is very popular in Nuclear Spectroscophy). Of course it helps that most ENP's are pretty competant with computers and electronics (amoung other things).
Galium Arsenide is the material of the future, and always will be.
matlab for design prototypes of numerical algorithms and for visualizing data.
mathematica for doing messy algebra/calculus/differential equations.
my own c/c++ code, with a lapack backend, for doing large-scale computations (matlab and mathematica are too slow for big computations).
So, the answer is e) all of the above!
All is Number -Pythagoras.
Let's not forget about PDL, the Perl Data Language. Think of Matlab combined with the goodness (i.e. CPAN packages) of perl.
Do any of the listed tools/languages take care of this problem for me? I understand the nature of the problem, but it is still very frustrating. What do the "pure" math programming languages do with this issue?
--sex
Very popular slashdot journal for adul
I've used python and Numeric and coworkers of mine have used them in real physics type stuff and it is great (I think Fermi lab uses Numeric a great deal).
I'm surprised you also haven't mentioned R. It's a stats
package (gpl'd) modled after S. http://www.r-project.org
and it is very powerful with a great community behind it. It's an amazingly powerful tool for analysis.
I am not able to articulate this well, but the type of research you are doing is MUCH more important of a consideration than computation speed or resource consumption. If you need supercomputer time, then you had better ask the admin what you need to use. I know a bunch of people that do environmental modelling, and I have never seen or heard of anybody writing their own C++ to do it. Researchers GENERALLY have better things to do than re-invent wheels.
People who think they know everything really piss off those of us that actually do.
Octave is a nice MATLAB clone, developed from chemical engineers in the beginning, but now used extensively in virtually any area that math is usefull.
Many packages have their open source counterparts: Octave for MATLAB, R-system for SPLUS (statistics algebra system), and so forth. But IMHO you raise another issue: you can use each of these packages to do whatever calculations you want, since all of them are extended in the C/Fortran end, i.e. they can use programs written in these languages. Custom code is readily integrated. And above all, the GNU Scientific Library. If you don't like or you don't trust the numerical solvers integrated in MATLAB, you can investigate the source in the GSL.
And yes, you can use all of these together. So, what is the question again?
.sig
Just out of curiosity, anyone know what mathematicians, engineers, and phycicists would do in regards to these complex problems before there were these programs mentioned? What about before slide rules?
If brevity is the soul of wit, then how does one explain Twitter?
You're talking about two different classes of software: "numerical linear algebra packages" and "computer algebra systems". Maple and Mathematica are the latter, Matlab is the former. I don't know about Magma.
Hardcore numerical programmers use LINPACK/LAPACK with platform-optimized BLAS (this latter is often commercial, or at least proprietary to the platform vendor) directly from Fortran. They usually use modern commercial Fortran 90 or Fortran 95 compilers, too.
On numerical linear algebra stuff where you aren't going to recruit and pay a Fortran programmer with a PhD in applied mathematics, most sane people use Matlab or GNU Octave or one of the many other Matlab clones. A lot of people like Numerical Python, if I had a big new project to do, I'd seriously consider it.
Yes, crazy "researchers" who don't want to learn Fortran and think Matlab is too slow or too expensive will write numerical code in C++. Some of them do fine work, too.
Excel and other spreadsheets are fine for small bits of numerical analysis, too. Don't turn up your nose at 'em, you can email your boss your whole analysis and he doesn't have to learn Matlab to do anything with it. Excel is also slowly replacing Qbasic as the computing lingua franca of the Amateur Radio/hobbyist-electronics community.
The class of people who just doodle out the singular integral equations for the airfoil design they're brainstorming seem to like Mathematica a lot. I wish I were more like that. Maxima is seeing a renaissance now that its licensing and distribution issues are cleared up (it's GPL now). I should check it out. There's also GNU (Emacs) Calc, which I use regularly as an RPN desktop calculator. It is actually much more powerful than that and will do all kinds of HP-calculator-style graphing and computer algebra with a liberal sprinkling of Mathematica-style syntax, but I don't use those features much, because they're wicked slow.
Dave Gillespie's excellent emacs package Calc ignores your floating-point hardware and instead uses lists of integers to represent floating-point numbers internally, IIRC. And you can specify how many decimal places to remember; you want to compute something to 1000 decimal places, you got it.
(I would guess some other programs do this, too, but I'm not as familiar with them, since emacs calc does pretty much everything.)
I have a related issue, in this regard. Some of the problems I am working on require arbitrary precision floating point numbers. E.g., one number might be 3.2334, but it needs to be multiplied by 3.4568902349830983945873908730987578439345, and I need all the resultant digits.
The problem is that the output of one calculation is fed into the input stage of another, that output being the input of the first calculation, in a circular style, so that small rounding changes may have a large affect on the final outcome.
Now, at some points, the precision may be truncated (where the effect will be unnoticable to the equations), but at certain points I need the exact number.
I have heard that with Lisp you can have numbers as large as you like, but I don't know how hard it is to perform complex numerical tasks in Lisp. Also, speed is an issue (I want it to be as fast as possible).
Any suggestions as to how to accomplish this?
I'm a post-doctoral researcher at a engineering college and I use Linux for all of my data acquisition and analysis. The following environments are used:
LabVIEW, PERL, shell scripts, and/or C for data acquisition
C++, MatLAB, and/or shell scripts for data analysis
and you can get some of my codes from Sourceforge:
http://sourceforge.net/projects/qaxa
http://sourceforge.net/projects/ssnooper
and others are available by sending me an email.
Ed
http://cesep.mines.edu/people/hill.htm
The other major factor is that nuclear physics is perpetually underfunded and buying commercial software is ussually not nessasary (since we would have to make sure it worked properly anyway).
BTW we do use "building block" type programs and libraries for our interfaces. A good example is SpecTCL at the National Superconductiong Cyclotron Laboratory. I have used GTK/GDK in my applications, others have used Qt. However, the numbercrunching and datacrunching parts are nearly all custom. The data processing is simply too complex and too specialized to trust to prepackaged software. The numbercrunching applications are too time consuming to use a generalized program, everything has to be optimized.
Galium Arsenide is the material of the future, and always will be.
I was taught Matlab in my computational physics graduate class, which biases me toward Matlab in my own research. I also own Mathematica, but have not taken the time to master its language and command structure. Mathematica was an award at a conference where I presented a paper, but I purchased Matlab for myself.
There are two primary advantages which I see in Matlab. The first advantage to me is its abilities with matrices and arrays; it can do things in a couple of lines of code which can take some roundabout programming and subroutines in other more conventional languages.
The second is Matlab's graphical abilities. Display of data is very important, both in the final product (thesis, paper) and in the research process itself. After a brief introduction to graphing in Matlab, it becomes a trivial task to choose and use various display options for your data.
In physics, it seems that we stick with what works until something better is found. That applies to our theories and to our tools. It is not uncommon for us to use Fortran, Pascal, or even various types of Basic to perform simple calculations and experiments.
Much of what one uses may be determined partially by chance--what software package was available at your institution, what professor did you study under, did your undergraduate degree require a programming course? The work involved in switching from one major package to another, for instance from Matlab to Mathematica, simply seems like too much effort for very little sure return.
Jim Deane
The difference in speed between Matlab and C/C++ is roughly the difference between Java and C/C++. Unless you use a few certain functions, Matlab compiles your code into Bytecode-like instructions called M-code, which is then interpreted like in Java's VM. It also has a built in converter to change M-code into C++ code that can be compiled by an external C++ compiler.
A highly unknown but very efficient (faster than Pascal w gc) and easy to program is ML (Meta Language) Seems to be perfect for Math computation.
unfortunately. We were taught it in one of our astronomy classes to analyze and plot data. It has a very arcane syntax and doesn't have a lot of capabilities (no matrices; there is a very crude way to represent square matrices as sets of vectors). I now use Octave or Matlab as much as possible for numerical work. For symbolic math, I mostly use Maple. I also have a little experience with Mathematica, but I like Maple better (although Mathematica looks nice). As far as I know Maxima, it can't do as much as Maple or Mathematica, but it should be good enough for most symbolic computations.
oof. here's the link:
Numerical Recipes -- not so good
Mathworks (the owners of Matlab) has been aggresssivley increasing prices on Matlab while reducing licensing flexibility. All this started after they bought Matrix-X (can you say monopoly... I thought you could :-).
They heavily discount for Universities and students, because that gets you hooked. Matlab scripts are so cryptic, that the idea of switching to another package causes great fear and trembling.
I've also got quite a few gripes about the language itself. Yes, matrix aware languages are great; but there are much better implementations out there. Try Mathematica or Python/Numeric.
Do yourself a favor and avoid Matlab.
Just my $20.
Clearly this breaks down for certain applications, but most of the science currently being done (read: molecular biology, and no, not bioinformatics) is not algorithm-bound.
Most of the bioinformatics being done that I'm aware of is not algorithm-bound either.
People do tend to find a language and stick to it, though. Usually Perl. You get the occasional Python diehard as well, but my experience has been that while I'd far rather use Python for a large project, I'd rather use Perl for anything with significant amounts of text processing. There are times when weird kludges and shortcuts are actually a good thing. I know someone who programs in Lisp whenever possible. C is usually the last resort of people who think it'll be faster than Perl. Sometimes this is the case. Sometimes they simply can't program worth shit.
The real problem is that many bioinformaticists have no concept of software engineering. This applies on many levels. First, they can't write reusable, maintainable code. Second, they have no concept of algorithms or recursion. Third, they never get to the point where they can write software reflexively. The best code, in my experience, is the stuff that's pounded out in under an hour, but which has been thought about for days beforehand. I think everyone wanting to do bioinformatics should be forced to take an intermediate CS class before they're allowed to do research, rather than sitting down with an O'Reilly book and starting to write code. They'll waste less of their time and everyone else's this way.
Frankly, however, two-thirds of the time of any bioinformaticist is spent interpreting and reformatting the crap data that biologists give us.
I was in the math software industry for well over a decade. My experience is that each manufacturer is irrationally optimistic about their own package, and irrationally pessimistic about competitors. Kindof like commercial software in general, but the venue is more fuzzy, lending to more irrationality.
:-) It's designed to be interactive, rather than a programming language. Check it out at livemath.com
- the way a user does this or that, varies widely. Often, methods are not obvious, so for one person, "mathblob does gizzyggy calculations" is true, for another, it's false. EG mathcad has (had?) a version of Maple inside, but it was awkward and hokey to use. BUT they could claim all of Maple's capabilities.
- The algorithms vary widely. If MathBlob has a specific optimization for gizzyggy calculations with flipex inversions, then you could say that MathBlob is great at gizzyggy calculations, and the others are useless. These optimizations can easily give you 1000x performance improvement or more (think n^n).
- The domain venues vary widely. Numerical programs typically do zero symbolic stuff, but do the numeric stuff lightyears faster than symbolic programs. A group theory program may have trouble adding floating point numbers. With hardware double floats, you can't get anything past 10^308 or so, which is a disaster to some but no big deal to others. When someone says MathBlob does EVERYTHING, really they mean MathBlob does Everything that I think is important.
So like, I once had Mathematica take like 30 seconds to add 2 + 2. (It had to load in a ton of packages.) Then it reported it was out of memory.
With that said, LiveMath is THE BEST math program in the universe, way better than any of the others here.
(disclaimer: I'm the original author)
Marketing-driven companies end up over-marketing their products. Engineering-driven companies end up over-engineering
Wanna hear something cool?
I just got Octave & Gnuplot running on my Sharp Zaurus. I can do my DSP type calculations, anywhere!
Someone is currently porting gtktiemu, at which point I'll have a TI-89 emulator, which will let me handle just abount any engineering math type stuff I need to do with one pocket-sized deivce.
Now if my fold-up keyboard would just show up.....
Life is too short to proofread.
As a statistician, I prefer R. Matlab's approach to statistics is to implement a bunch of formulas one could look up - R (or S-plus - I prefer the open source version) gives an interface that is closer to doing statistics. R has far more routines implemented than minitab (or Matlab, if one sticks to statistics). Additionally, most of the interesting applied statistical research that I've seen is implemented in R.
Quack!Quack!.....QUACK!!
"player 4 hit player 1 with 0 stroms"