Slashdot Mirror


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?"

89 of 454 comments (clear)

  1. Octave by tanpiover2 · · Score: 4, Insightful

    Whenever I need to do anything like that, I use Octave.

    --

    But masters, remember that I am an ass: though it be not written down, yet forget not that I am an ass.
    1. Re:Octave by s20451 · · Score: 4, Insightful

      Octave is a great idea, but also a gigantic pain in the ass. I don't think I have ever successfully compiled it without serious tweaking on any system I have ever owned. The Octave team needs to spend a little time improving their configuration and make files before that package can be considered a serious alternative to Matlab.

      --
      Toronto-area transit rider? Rate your ride.
    2. Re:Octave by robbyjo · · Score: 2, Informative

      Although Octave is great to mimic Matlab 5.2, some neat features in Matlab 6.0 are not there yet.

      Another drawback is... just like Matlab... It's Slow, with a capital S. I won't recommend it for serious number crunching like encryption or gene data manipulation unless you have really good CPU power and godly patience.

      --

      --
      Error 500: Internal sig error
    3. Re:Octave by decoutt · · Score: 5, Interesting

      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
    4. Re:Octave by klokwise · · Score: 2, Informative

      hmm, having used octave recently, i have to disagree with you. i grabbed the latest release off the site and only had to update my version of readline to get it to compile. also, i really only see octave being used in an educational or small-time commercial sense. it's great to learn on and give you a taste, but is no where near as efficient as matlab.

    5. Re:Octave by SquadBoy · · Score: 3, Informative

      I'm just in one of those moods today.

      apt-get install octave or if you really like to have it build on your box apt-build install octave. :)

      --

      Cypherpunks: Civil Liberty Through Complex Mathematics. Those who live by the sword die by the arrow.
    6. Re:Octave by Anonymous Coward · · Score: 5, Informative
    7. Re:Octave by Karn · · Score: 4, Insightful

      Actually, I think you have it backwards.

      First, Redhat (I'm sure other distros as well) INCLUDE OCTAVE. That's right, you don't NEED to compile it because it comes with your distro. You can't get much easier to install than selecting the package at OS install time.

      Second, Octave doesn't require a user to jump through 8 hoops to run it on your system. No FlexLM, no licence files, no keys, no giving Mathworks your hostID when you change computers, etc.

      Finally, most people don't compile from source. And those who do are usually experienced enough to figure out how to get things compiled.

      --


      Why do I keep typing pythong?
    8. Re:Octave by GlobalEcho · · Score: 2, Funny

      Although Octave is great to mimic Matlab 5.2, some neat features in Matlab 6.0 are not there yet.

      Three-dimensional arrays come to mind. Grrr.

    9. Re:Octave by blair1q · · Score: 2, Informative

      No pain at all.

      Download the binary distro of Octave for Windows.

      I just did, now I'm going to go play with it.

    10. Re:Octave by CanadaDave · · Score: 3, Informative

      The thing I like best about Octave is that includes lots of things that are "add-ons" for Matlab. The the Matlab Control Toolbox, which must be purchased on top of the base package. But Octave includes most of these functions.

  2. MathCad? by Joe+Jordan · · Score: 3, Insightful

    Now, I'm only in college, but while we did dabble a bit in Maple and a few others that you mentioned, the only Math software package I've used extensively is MathCad. I've found it to be the most user friendly of the bunch, and they have a new version out: MathCad.com

    1. Re:MathCad? by Big+Mark · · Score: 3, Insightful

      MathCad is far too limited in power and scope to be of any real use. Maple is my package of choice; admitedly it's hardly the most intuitive or user-friendly software around but hey, neither's Linux. Give it a few weeks of tinkering and you'll learn to love it.

      I want to learn how to use Matlab more effectively as it's (apparently) the most effective for physical modelling, but we don't get taught it over here (Mathcad, Maple and Mathematica are all these scuzzers will teach us); anyone know a good intro to it on the web?

      -Mark

    2. Re:MathCad? by DuckDodgers · · Score: 2, Informative

      I was forced to learn Maple. Maple isn't particularly user friendly, but it's pretty powerful.

      We did, in no particular order: differential equations, groups, rings, RSA encryption, McLaurent series, and matrix manipulation.

      But I can't compare it to any of the other programs because it's the only one I used.

    3. Re:MathCad? by CEHT · · Score: 2, Insightful

      MathCad is probably good for undergrad / highschool math problems, but I doubt it will do stuff like nullspace calculation with a 200x200 matrix.

      --

      ============
      Mathematics will always come back to hunt you down, in so many ways

    4. Re:MathCad? by franimal · · Score: 5, Informative

      User friendly? Are you talking about the program that I use on a daily basis? Surely not. MathCAD is without a doubt the prettiest of all the options but it is among the worst in user interface.

      For those of you who are not familiar with MathCAD, it works like this:

      Anything and everything that you want to input into MathCAD is in it's own little box. Be it a text or an equation box.

      The horrid part is trying to organize all these boxes on the page. Putting everthing in a box means that it operates completely contrary to what most people are used to with MS Word. Say you enter some equations and then decide you want to add a few more in the middle. You can't just hit the up arrow and start typing with maybe an enter. Instead, you'll often have to select the later equations and drag them down to make room for the new. Then, if you have a lot of equations you likely didn't move all of them down. So, you have to select the equations that now overlap and select 'Separate Regions' from a menu. This gets to be very tedious.

      Furthermore, is it too much to expect MathCAD to figure out that I don't want have my equation on page one and the rest on page two? Why should I have to go and select "Reimpaginate' from a menu before I print?

      Entering equations is no joy either. I'm constantly frustrated when I try and do something as simple as add antoher term to an equation, like changing x^2 - 3 to x^2 + x - 3. I find myself starting over and at times typing 1 + 1 - 1 and then replacing the ones. I mean, come on, I've seen many math typeing solutions that are far better, in MathType, and LyX for example.

      Sure you might have a nice looking document but was it really worth the pain? Furthermore, I find MathCAD to be seriously lacking in function compared to Maple et al.

      Of course, Maple et al. all have their problems with user interface. Why should I have to end with a semi-colon? And you have to realize that it's never going to look the way you want it to. So you have to suck it up and do the math without worrying about the beauty of the output.

      Not to sell MathCAD short, there are some things that it does do well:

      • Units, the best unit management system I've had the joy to use. Very nice.

      • The output is beatiful.

      • Simple math that doesn't require big complicated equations and lots of loops.

      Personally, I can do the easy math by hand. For more advanced stuff check out SciPy.org. They provide a python interface to established numerical algorithms in C and Fortran. But it's much quicker and 'funner' to use. Unfortunately they are only at alpha right now. But, you can't be the price and for the most part, I've found the optimization sections to be quite stable. Combine it with pychart and your've got a good science package for free.

      Otherwise, the only package that I've actually heard people rave about is Matlab.

    5. Re:MathCad? by saforrest · · Score: 2, Informative

      We did, in no particular order: differential equations, groups, rings, RSA encryption, McLaurent series, and matrix manipulation.

      Er, you mean either "Maclaurin" series or "Laurent" series.

      A Maclaurin series is the Taylor expansion of a function about 0.

      A Laurent series is like a Taylor series, but with the range of exponents going from -infinity to infinity instead of 0 to infinity.

      (Maple is capable of doing both of these.)

    6. Re:MathCad? by BitterOak · · Score: 2, Informative
      A Maclaurin series is the Taylor expansion of a function about 0. A Laurent series is like a Taylor series, but with the range of exponents going from -infinity to infinity instead of 0 to infinity.

      Right, so a McLaurent series is like a Taylor series, expanded about x=0, with exponents ranging from -infinity..+infinity.

      --
      If I can be modded down for being a troll, can I be modded up for being an orc, or a balrog?
  3. useful by mrtroy · · Score: 2, Informative

    maple and matlab i have found to be useful

    but that is only if u are doing a highly intensive amount of math

    otherwise it takes longer to figure the gui and usefulness out than to figure out the problem on your own

    matlab rules for matrix math

    --
    [I can picture a world without war, without hate. I can picture us attacking that world, because they'd never expect it]
  4. Heh ... by B3ryllium · · Score: 4, Funny

    I use `expr`.

  5. Fortran by luzrek · · Score: 4, Interesting

    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.

    1. Re:Fortran by wcspxyx · · Score: 2, Interesting

      Your points are well taken given the data you got from my first message. But you miss the mark. Allow me to explain.

      I took a few classes from my Dad, so I do know how he tought, and I know what he expected of his students and I know how hard he worked with his students to help them succeed. So he may have been (or still is) an asshole, but he really cared about his students and that they succeed. He also felt that this was information that his students needed to learn and, since the CompSci dept. at that school wasn't interested, he did it himself.

      And there is no nuke-navy thing going on here. My Dad never served in any military outside of ROTC Marching Band when he was an undergrad. It wasn't any macho attitude that made him make his classes difficult. It was respect for the material and respect for what his students were going to be asked to do with thier knowledge once they graduated. Nuclear Engineering is some serious shit. Not to be taken lightly. My Dad may have been an asshole. But students graduating from his department could run circles around graduates from other schools.

      Now, as I said before, I went to the same school. The CompSci department was horrible. I know of very few CompScis from that school that learned anything in their classes. Most learned on their own or brought their knowledge with them. And I know even fewer of my friends from school that graduated with a CompSci degree that are still working as CompScis. The profs spent most of their time teaching how to format your code so that it prints nicely and how to use canned routines and other such sillyness.

      To give you an example, there was a Numerical Analysis course that was required for most engineers. The did about 5 programs over the course, and it was required that the code be done in FORTRAN using LINPACK. It was trivial. I don't think any of the code that I wrote for that class was longer than 50 lines of FORTRAN. Didn't learn a thing. IMHO, there is no real benefit to doing something like this. It's especially not a semester long course. You just get your 'A' and go on.

      And I'm sorry; Gear method is about a 3 day coding project, tops. The freaking pseudo-code is in the textbook fer cryin' out loud. It's not like you are inventing a wheel, just implementing one. If it were a graduate level project, I would assume that there was some research going on there, something interesting or new, not a simple implementation. I agree with you there. But that's not what was implied in the argument I had with the prof. He said that any implementation of the Gear method would be a semester long grad project. And to this day I disagree. Especially since a dozen or so undergrads a year did it in my Dad's course.

      --
      Sig? What sig? Do I have to have a sig!?!?
    2. Re:Fortran by dragonsister · · Score: 2, Interesting

      Wow. You come from a place full of TLAs, don't you? (Three Letter Acronyms.)

      I handed in my PhD thesis in nuclear physics earlier this month ("The effect of ground-state spin on fission and quasi-fission anisotropies" - I'm in fusion-fission research.) I used basically nothing but FORTRAN all the way through. One of the reasons this was practical was that my work involved only a few new equations - not all that much symbolic manipulation to be done. Further, it was reasonable to tweak and optimize the FORTRAN to get faster calculation times ... when the newest Alpha in the department takes four days to crunch a single data point, believe me you devote a little time to optimizations and evaluating approximations!

      For relatively pure and simple number-crunching like I was doing, FORTRAN is pretty well suited to the task. However, that isn't the real reason I used it. I used FORTRAN because everyone else in the department (and in most of the rest of the discipline, world wide) used FORTRAN - when I start my new job in may, the rest of my research group can look at my documentation and source code, and tweak and change it as required. And send it to other researchers who can do likewise. (A common type of change is to track and output a variable not previously considered important. This may be hard to introduce into Math-something calculations.)

      (I write Perl for a website at home. Oh, the contrast!)

      I've met Radware, but did most of my Nuclear Spectroscopy (during my honours year) using a solution peculiar to the ANU nuclear physics department; DCP. This in-house program slices, dices, drops the knife and needs to be poked or re-started occasionally ... Argh; it gets the job done, and I understand many of its important features are not available in other programs, but it would really benefit from a total rewrite from a highly trained, intelligent, and approachable programmer like my partner. (The author of DCP is a prickly old fellow with lots of experience and (to the best of my knowledge) no theory to speak of. DCP reflects its author.)

      What is the best tool for the job? Depends on the job, and the skills of you and the people around you.

      Rachel

  6. age-old answer: it depends by coult · · Score: 5, Interesting
    I'm a research mathematician, and I use lots of tools:

    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.

  7. Perl Data Language by sleepingsquirrel · · Score: 4, Interesting

    Let's not forget about PDL, the Perl Data Language. Think of Matlab combined with the goodness (i.e. CPAN packages) of perl.

    1. Re:Perl Data Language by liquidsin · · Score: 4, Funny

      What a wonderful idea! Perl is so terribly simple to read that it *needs* some highly complex math thrown in to keep us from getting bored.

      --
      do not read this line twice.
  8. [none] by WetCat · · Score: 2, Insightful

    "If not, do researchers write C/C++ programs and use GMP or Matpack to solve math problems?"
    No! They use FORTRAN!
    Surely it's still much better language for numeric stuff

  9. Inexact floating point calculations... by $$$$$exyGal · · Score: 3, Interesting
    A general question. With some programming languages... floating point is by its nature inexact. It is probably best if you imagined that after every floating point operation, a little demon came in and added or subtracted a tiny number to fuzz the low order bits of your result. (I quoted that from here).

    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
    1. Re:Inexact floating point calculations... by dlakelan · · Score: 2, Informative

      Floating point numbers are by their nature inexact. it is impossible to make them exact, though you can make them arbitrarily high precision.

      When people need exact answers they do exact math using a combination of symbolic computations and arbitrary sized integers and rationals.

      ie. the answer you might get from doing an operation like sqrt(2) would be "sqrt(2)", doing an operation like area_of_circle(r=1) would be "Pi"

      an operation like 2^128/3^45 would be some ratio of enormous integers expressed as x/y where x and y are the integers 2^128 and 3^45

      does that help?

      --
      ((lambda (x) (x x)) (lambda (x) (x x))) http://www.endpointcomputing.com a scientific approach to custom computing.
    2. Re:Inexact floating point calculations... by TennesseeVic · · Score: 2, Informative

      Yes, floating point calcs are inexact. That's why numerical mathematicians for agest (well, since 1960-something) have been doing error analysis of programs. Basically, you show that your algorithm will not stray too far under small errors. Some algorithms that look entirely plausible do stray far, so those don't get used.

      Packages that work exact (maple, mathematica) can run only at a fraction of the speed of numerical packages, so big simulations (how high should this airplany engine be mounted) are simply not done that way.

      V.

    3. Re:Inexact floating point calculations... by Exitthree · · Score: 2, Interesting

      That's true with all programming languages, not just some. Floating point accuracy is an inherited limitation of using a computer, you can partly work your way around it, but it never really goes away.

      One way of getting around it is making your own method for storing a floating point number, not using a built-in type with so many bits (like using more than 32-bits). Now, you can keep adding "bits" in your interpretation of a floating point number until you reach the desired accuracy.

      I can make a list of booleans to represent a floating point number and have the list longer or shorter depending on how precise I want the number to be. Then I use my own addition, multiplication, etc. algorithms on this number to get my result. This makes the process slower since you are basically rewriting the functionality of a chip to accomodate a higher number of bits than which it was designed, but it's possible.

      As for mathematical tools dealing with the issue for you, I think you can specify the precision you would like, and it adjusts the answer accordingly. (At least I believe it is the case with Mathematica.)

    4. Re:Inexact floating point calculations... by Piquan · · Score: 2, Informative
      As others have mentioned, Mathematica and Maple-- like Maxima-- use symbolic manipulation to give exact answers. For example, Maxima tells me that the integral of x^2+2*sin(x) from -5 to 4 is 2 COS(5) - 2 COS(4) + 63. It can't reduce that further without introducing inexactness from the irrational functions. (If it could, it would; the same integral over -5 to 5 is reported as 250/3.)

      Some math packages and programming languages-- such as Common Lisp-- have bignums (infinitely long, perfect precision integers) and rationals, which are also infinitely long and perfect precision. So the value of (/ 1 3) is not 0.3333, it's 1/3.

    5. Re:Inexact floating point calculations... by sckienle · · Score: 3, Insightful

      It's been a while since my Senior Independent project, but it was on products like these. I did a lot of the symbolic maths on the packages to describe and document what they were doing. As part of that, I had to look into how they handled floating point errors. I don't remember the package I was specifically working with; and my copy of the SIP is at home.

      With that as an introduction, for the "pure computational" packages,the problem you point out is real. Floating point errors when ignored will slowly move further and further into the significant digits of the FP calculations. For a package to be even reasonable, it must be able to describe in mathematical expressions and textual dialog how it will manage FP errors to keep them in the least significant digits of the number. If you review a package, look and ask specifically how the package does that.

      Some may ask why is this important, don't modern languages handle all this according to the FP Specs? Well, basically the specs are not good enough for large computation tasks. When you start multiplying several matrices together, you end up doing so many FP operations, that without carefully written and mathematically backed code the errors will pratically zoom "to the right." This is compounded by the fact that not all chips comply with the specs in exactly the same way, most of these packages will have a lot of conditional code to handle each chip set's specific particularities. Something else to look for: if a package claims one size fits all, and doesn't talk about OS and HW specific compiles, take extra care checking the FP issues out. They may be taking a worst possible processing approach, which will work but at the expense of speed, or they may be taking a more "mean" processing approach, which may end up with different results on different OS and HW combinations.

      Now, after all that, the reality is that most of these packages, at least if they have been around a while, have the mathematical grounding and programming "backgrounds" to handle FP operations pretty darn well. After all, this was a fairly well known and documented issue back in 1983 when I wrote my SIP.

      The "symbolic" packages seem to side step this by first taking the equations and modifying them in "symbol" form before performing their calculations. Thus, the differential of X^2 is changed to 2x by the program before any FP operations happen. But this does not mean that FP operations do not occur. If your equations still deal with matrices, then a lot of FP operations will have to be done to come up with a numeric answer, no matter what.

      --
      I don't see things in black and white; I see the gray. Heck, I actually see in color, which makes things more difficult
  10. a couple other packages by RhettR · · Score: 3, Informative

    I have used a few other packages, command-line utilities, which I find useful: Recently I'm using one for my honors research project (I'm an undgergrad): GAP and another I've used which I like: PARI-GP. GAP tends to deal with group-theoretical functions, and GP tends to deal more with number theory, but both shouldn't be ignored.

  11. For our research... by JWyner · · Score: 2, Insightful

    I find that each package is well suited for a particular use...

    MATLAB is great for off-the-cuff research. I can open it up, and program image processing routines in 30 minutes or less. This would take hours in C/C++. Additionally, I can take the M-file and dump it from my computer onto a workstation running MATLAB and get some decent speed and batch processing done.

    C/C++, however, gives you so much more control and execution speed, that often you either use the MATLAB --> C compiler, or end up writing a final routine in C directly. I believe for image processing, as an example, you can get over a 100x speed increase just by using the MATLAB --> C compiler.

    Just my $0.02.

    --
    "Owning a computer is like having your very own TV -- with a built in radio!" - Ed Helms
  12. Python and Numeric by kognate · · Score: 2, Interesting

    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.

    1. Re:Python and Numeric by Chundra · · Score: 2, Informative

      Yeah, numpy rules. Not to name names, but I know some DoE labs use it quite a lot. It's very slick. So are many of the other python number crunching tools.

  13. What I use (probably different from your needs) by Papineau · · Score: 2, Informative

    For my research in mechanical engineering (more specifically regarding tolerances), I use Matlab since it's what I'm most comfortable with. Maple is also used at my Uni, but I don't have much experience with it (other than it's symbolic kernel since it's available with Matlab) so I don't end up using it.

    It mostly depends on what you're doing. Depending on your area of research, you may find that one of those is more popular because it solves these types of problem better. If speed is an issue for you, you can easily port your algorithm to a compiled language if you prototyped on an interpreter, even interfacing the two in some cases.

  14. Other trade offs by briancnorton · · Score: 4, Interesting
    The trade offs are a lot more than you mentioned. If you are doing MATHEMATICAL research, Mathematica AFAIK has the most extensive capabilities for expansion and programmability. If you are doing somethign like environmental modelling or complex systems analysis, then something like Matlab may be more important.

    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.

  15. MatLab, Mathematica by Pemdas · · Score: 4, Informative
    I'm a graduate student studying robotics. YMMV.

    For most computer vision code, Matlab is a must for prototyping. It's useful in other areas, and, if you know how to use it, reasonably fast. If you're doing particularly involved matrix manipulations, it takes a lot of work to come up with C/C++ code that will work faster then well-written matlab code.

    Personally, I also use Mathematica for doing real math work. If I need to derive something that's particularly complex, then Mathematica's notebook style is really nice to work with, and it makes possible extremely clear and concise mathematical arguments while limiting stupid human errors when doing drudgery like taking derivatives and the like.

    I hear Maple and MathCad are both good, too, but I've never used them.

  16. FORTRAN by Entropy_ah · · Score: 2, Informative

    I'm working on a thesis with a math professor here at school. We're working on a mathematical fiber model which requires a whole lot of computation and a whole lot of data. My advisor does all the computations by writing FORTRAN programs and running them on an SGI Octane. Yeah the language is really old an ugly, but it's still useful for mathematics and its what a lot of mathematicians use in academia.

    --
    my other penis is a vagina
  17. Multiple tools? Never! by jkastner · · Score: 2, Informative

    My experience (Ph.D. in applied mathematics, and employment at a mathematical consulting firm) is that researchers only use their favorite package and will rarely use anything else, despite the fact that their favorite may not be appropriate for the job at hand. To that end, I use Mathematica for nearly all my prototyping, except for brief excursions to Matlab which is much better at image analysis. But both of these have speed issues, and when it came down to serious buisness I would often roll my own C,C++ or FORTRAN code for the problem at hand.

  18. Re:Maple sucks.... by coult · · Score: 2, Insightful

    Explain to me how you would do calculus with matlab?

    --

    All is Number -Pythagoras.

  19. Mathematics past by Shadow+Wrought · · Score: 2, Interesting

    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?
    1. Re:Mathematics past by doctorwes · · Score: 3, Insightful

      Yes, they did calculations by hand. Mathematicians were more patient in those days. For example, in 1863 Kulik published a table listing the least prime factor of every number less than 100,330,200. It filled 4212 pages and took him twenty years to complete.

  20. Matlab, C, VB, local scripting by pz · · Score: 4, Insightful

    Having traversed from a predominantly engineering realm (computer science) to a predominantly scientific realm (neurobiology), my observations have been that the tools are selected mostly on habit or previous knowledge rather than fitness for use.

    The most commonly-used analytical platform is probably Excel (or some similar tool like Statistica), but the more serious researchers, who are also the more mathematically-aware, nearly all use Matlab in my experience.

    When efficiency is an issue, nearly everyone I've worked with turns either to IDL (a Matlab competitor that has more arcane syntax, but much higher processing speed) or writes a C/C++ program by taking algorithms from "Numerical Recipes in C".

    Recently, I've also seen a rising use of Visual Basic, especially to do experimental control (although some Matlab hooks do exist for such), and, of course, LabView. Some diehards use LabView for data analysis as well, but their results are suspect just because the tool is so poorly fitted to the task.
    And, of course, many data collection hardware manufacturers (CED, National Instruments, TDT, etc.) supply scripting languages to control their hardware and perform rudimentary and sometimes not-so-rudimentary calculations.

    The best researchers select the most appropriate tool for the job, but, again in my experience, it seems the selection is normally based on previous experience and inertia. Those who know a particular tool well (eg, Excel, Matlab, SPSS, Mathematica) tend to keep using that tool, even if it is not well-suited. This means you get abberations like Matlab programs that control real-time experiments and LabView programs that do higher-order mathematics.

    Why?

    Because the largest fraction of a scientists' time should be spent on data collection, not experimental implementation, and the amount of time (for nearly all fields except those with astronomical amounts of data) spent executing code is dwarfed by the time developing it. 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.

    Since data analysis is such a huge, broad field, I expect to see radically different answers from other posters!

    --

    Put my fist through my alarm clock with its ding-dong death inside my ear. - The Blackjacks.
    1. Re:Matlab, C, VB, local scripting by foog · · Score: 2, Interesting

      oof. here's the link:
      Numerical Recipes -- not so good

    2. Re:Matlab, C, VB, local scripting by the+gnat · · Score: 2, Interesting

      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.

  21. Maxima! by Piquan · · Score: 3, Informative

    I use Maxima for my work. It's a continuation of Macsyma, the computer math program that was the inspiration for Mathmatica. Macsyma was tied up in copyrights for a while, but now it's public domain. So Maxima updated it to modern computer environments, added in a GUI (with web browser) and ties to modern programs like GnuPlot, and now there's a good, open-source symbolic math utility / programming language.

    1. Re:Maxima! by billwgd · · Score: 2, Informative

      It's misleading to call Maxima a "continuation of Macsyma". In the early 1980's MIT Macsyma was forked into a public-domain version (DOE Maxima) and a commercial version (Macsyma). Maxima has had very little development since then, whereas the commercial version has had many significant enhancements, keeping it competitive with Mathematica and Maple. Unfortunately the commercial product is now in limbo since Macsyma Inc. went bankrupt a few years ago.

      For further details see the newsgroup sci.math.symbolic

      Disclaimer: I am one of the developers of Macsyma, both at MIT and later commercially.

  22. A problem I've struggled with ... by Somnus · · Score: 2, Insightful
    I've used a number of different packages, with varying results. Here are my thoughts:
    • Mathematica -- It's good at everything: symbolic computation, statistical analysis (esp. if you deal in intricate error propagation, where symbolic computation is handy), visualization (w/ some tweaking), and even number-crunching. Has a fantastic built-in library. However, it is a blackbox solution (and I have encountered errors in the past), is awfully slow (can be sped up by accessing the kernel directly through C) and closed source.
    • IDL -- Great for crunching through large amounts of data for the end-user because it has optimized implicit array math. It has an extensive built=library and is good at producing visualizations. Drawbacks are: blackbox (though it uses well known algorithms out of Numerical Recipes, for example), closed-source, and runs best on Windoze, and has an arcane syntax which is some bastard child of Pascal, Fortran and Perl, but not too bad when you get used to it!
    • Maple -- Has all of Mathematica's weaknesses but cannot match its built-in capabilities (plotting, extensive symbolic library, statistics, numerical analysis).
    • Matlab -- Only suitable for numerical computation, and is neither as easy to use nor as replete as IDL.

    Are there any viable open-source solutions to either Mathematica or IDL?
    1. Re:A problem I've struggled with ... by Dr.+Zowie · · Score: 2, Informative

      I've used IDL a lot and found that it's great for getting the wrong answer in a hurry. The designers didn't spent a lot of time thinking about special cases, so (for example) the built-in interpolation includes unavoidable off-by-one pixel errors. By default, all FOR loops break after 32767 iterations. Structures try (and fail) to be like perl hashes. If you write two double-precision variables to a file and then read them in again (using the default I/O format), you get an egregiously wrong answer. The symbol table combines the worst of global and local lookup: array names collide with global functions, and there's no way to isolate modules (so big projects inevitably produce collisions).

      It's possible to get work done with IDL (zillions of scientists use it), but it's a tragic waste of brainspace to keep all the extra exceptions and pitfalls in mind. Writing robust code in IDL is like kicking a whale carcass across a mined Afghani battlefield.

      Oh, and the license to use it costs about as much as your workstation. I'll take PDL, NumPy, or Matlab any day over IDL.

  23. Which package... by digitalhermit · · Score: 2, Informative

    Asking this question is no different from asking, "which programming language should I use?" without stating the purpose. Bash is great for scripting a daily ftp get, but inappropriate for drawing graphics.

    I can use Mathematica for almost all of my dabbling. Sometimes I play with MuPAD, R, GnuPLOT, Octave or Mathematica to show a particular problem. Since these are also free (beer or speech, depending on package) I can be reasonably sure that everyone can get a hold of it.

    For example, Octave is suitable for matrix manipulation. It does everything that I need it to do and can replace Mathematica for me. It's also fast enough (the longest calculation has taken just over a minute but it was a huge manipulation of some graphic data).

    I've dabbled with some of the libraries but only for fun.

    I guess what it comes down to is how comfortable are you with the package. By the time I try to write something in C using a dedicated library I can most likely do the same thing in Mathematica in a tenth of the time. Even if the execution speed was 100 times slower, the "real" time may not about to much.

  24. depends, or, if you have to ask slashdot... by foog · · Score: 5, Interesting

    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.

  25. C and Python by grahamkg · · Score: 2, Insightful

    I do lots of geometric work and I depend on vector math.

    If I'm not concerned with speed, Python is very nice as I can reuse a module package I wrote that contains my most often used functions. Additionally, the fact that Python is OO is also very helpful.

    For speed, such as when I do 10^12+ math operations, I fall back to C. Nothing crunches numbers faster.

    Python and C. They're not just for breakfast anymore.

    --
    Graham
    Linux - Fast Pane Relief
  26. MATLAB: Costly but extemely effective by NoData · · Score: 4, Informative

    I use MATLAB every day for my neural network simulations. MATLAB is incredibly powerful, incredibly flexible. It is also incredibly expensive. And the decision to port it to OS X was about the best decision The Mathworks has made recently.

    MATLAB offers student versions for about $99 a pop, which is dirt cheap considering its $1000 price tag for the retail version. Many universities of course have dramatic discounts, but then, you have to have be affiliated with a univeristy. Even the student version requires you to attest that youre using it for course work or student-level research and not commercial gain.

    MATLAB has a number of drawbacks. Price is the largest. To enforce its license, MATLAB requires you to run the onerous and clumsy FlexLM license manager. FlexLM is brought to you by GLOBEtrotter....a division of that bastion of consumer rights, Macrovision. That should speak volumes. The license manager makes doing a lot of simple things stupidly difficult, especially if you're (like me) mobile and have to authenticate with a central server running the license manager. I can get into details if people have questions.

    On top of that, MATLAB requires a yearly "maintenance" fee. It's more or less software as a service. Apparently, if you let the maintenance contract lapse, you can still use MATLAB, but you get no more support and cannot apply any new updates. That may be, but the particular license my university employs will cause my copy to simply stop working after April 1 if I don't renew. (April 1 being the beginning of the Mathworks license year. I don't think they see the irony in choosing that date).

    The maintenance contract does not apply, AFAIK, to the student version.

    On top of THAT, the student version or the $1000 base retail installation just gets you the MATLAB core. Which, granted, is extremely powerful. But the Mathworks also has a couple dozen or so Toolboxes, each with a range of specialized functions and tools (i.e. Signal Processing, Image Processing, MATLAB-to-C Compiler, Symbolic Math, etc. etc.). Each of these comes for an additional price, and its own maintenance fees. IIRC, these are like $500-$700 more each.

    Did I mention all these prices are for licenses on a per seat basis? Any institution or company thinking about MATLAB is going to shell out serious bucks for the privelage.

    On the other hand...MATLAB is a serious, extensible, highly flexible platform for technical and mathematical computing. I find that I can prototype programs for solving scientific problems in MATLAB far faster than I can in any other language. And its visualization features are truly impressive...even if the Handle Graphics system it uses is SO DAMN KLUDGY to program. You can customize visualizations just about however you can imagine...ALTHOUGH, some simple customizations are going to be UNNECESSARILY tedious to program.

    Another drawback to programming in MATLAB is speed. MATLAB ("Matrix Laboratory") is exceptionally optimized for handling calculations of very large matrices. However, because it's interpreted, if you have any loops, it's going to be very slow going. There often many tricks to "vectorize" operations you'd normally do iteratively in other languages, but often the only solution is the ol' for-next or while loop. These are slow. Very very slow. Yes, there's a compiler, but in my experience the compiler isn't that great at optimizing code...and, did I mention it costs extra?

    Anyway, MATLAB is amazing in its breadth and depth of power. I haven't even touched on its capabilities for engineers, like the SimuLink system design simulator, and hardware interface toolboxes. I can't imagine a problem needing to use a "mix" of math packages (as the original poster asked) if you're using MATLAB. But the purchase and ownership costs are very steep.

  27. Arbitrary Precision Floating Point? by jvkjvk · · Score: 2, Interesting

    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?

    1. Re:Arbitrary Precision Floating Point? by dr2chase · · Score: 2, Informative
      The Constructive reals package by Hans Boehm should work for you. It "sucks bits" from subexpressions as necessary to obtain the output precision that you ask for. Beware of questions that take forever -- with unlimited precision, certain (in)equality questions can never be answered.

      I wrote some code that uses this package to test the quality of the Java Math.sin method, if you would like a starting example.

  28. Python by Anonymous Coward · · Score: 2, Informative


    In the past I've used Matlab, C/C++, and a junkyard of Perl scripts to get things done.

    Nowadays I use exclusively Python, with underlying C and C++ components when performance is at a premium. C is easy to call from Python thanks to Swig.

    Python is simply unparalleled in its simplicity and elegance, and I find that I can accomplish most of the things that Matlab is good for from a Python interactive shell using Numeric and the other various scientific Python libraries.

  29. heres one data point... by edhill · · Score: 2, Interesting

    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

  30. learning softwares vs. coding .. by MenAtWork · · Score: 2, Insightful

    I have been using matlab, mathematica, maple and mathcad for different purposes in university and currently in job. I feel matlab by far is the best of the bunch simply because it allows for a more powerful simulation experience using simulink. Here is what I feel about learning these packages vs. coding ...

    1. matlab - hard on newbies' but very powerful and elegant in the hand of intermediate and advanced users. Graphical simulations possible through simulink. Matrix computations are very fast!! and on average it takes the least amount of time to solve the problems compared to mathematica, mathcad and maple.

    2. mathcad - the first mathematical software I used, very easy to learn almost instantaneous learning!!! but that was when mathcad was still in dos mode, I saw the windows version out now and they seem to be cumbersome to get around, but then I have not been using it regularly.

    3. mathematica and maple - almost similar performance, mathematica has better interface and with a large amount of tutorials and extensive help system is easier to learn than maple.

    4. scilab - a matlab clone which is GNU (I think!!) used it couple of years back when it was not as good as matlab graphically ... maybe its better now ...

    Now, coding - yes it has to be done from time to time but I think due to these softwares it has been relegated to the sidelines when extensive run times are involved and a significant performnace gain can be derived by days of coding. I belive it may be easier given the tons of free libraries available but it still takes longer to code in c/c++ than in a 4GL (generation language) like matlab and mathematica.

    Coding still can't beat the quick prototyping mode of these softwares i.e u can do a lot of manipulations in the time u take to write and debug the code. It basically boils down to whether result or way of getting result matter most !!!

    and then don't forget sometime those big screen scientific calculators are faster to get quick results than u'r fancy softwares and codes :) ob' it may not stand the test of u'r research !!!

  31. Black Box by luzrek · · Score: 2, Interesting
    Matlab is a Black Box mostly because it has huge numbers of built in functions. In order to make sure that all of these functions work properly (you would be amazed by how many commercial functions don't actually do what is advertised) by building our own and then compairing the two.

    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.

  32. Matlab primary; old languages also used by jim_deane · · Score: 2, Interesting

    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

  33. Depends by caseydk · · Score: 4, Informative

    It depends on what you want to do.

    CHALKBOARD is great for addition and the other basic operations, but if you want to do symbolic algebra, Maple or MathCad are your best bets.

    If you want to do some sort of signal processing and/or crazy matrix applications, the Matlab is probably the answer.

    If you want to do something with statistics, Matlab or Minitab are the way to go.

    1. Re:Depends by Raiford · · Score: 2, Interesting
      I have been using math packages such as Matlab, Mathematica, Maple, Macsyma since the late 80's. I have also done my share of FORTRAN and C++ programming. It is going to depend on what your need is. If you are developing something that will be used by a group then a stand-alone application written in FORTRAN or C++ is appropriate. If it is something that you need for yourself and your require rapid prototyping of a concept or numerical experiment then a math environment is appropriate. You are not going to be doing any "grand challenge" computing with a math environment. If you don't want to deal with a bunch of graphics coding then go with the math packages. Matlab (and the GNU semi-clone Octave) are good general purpose environments. Mathematica is a great computer algebra system (and much more) but the cost is prohibitive (and getting worse). So it is really dependent on what your needs are or the needs of your group.

      --
      "player 4 hit player 1 with 0 stroms"
  34. MathForge by Anonymous Coward · · Score: 2, Informative

    MathForge is a project designed to utilize "web services" to provide interfaces to networked and local math tools. The idea being the mathforge architecture "discovers" math services depending on whatever task needs to be done.

    The base of the project is a Java environment on which programmers can build tools as needed.

    It is GPL'ed software.

  35. Matlab is a jit compiler now by js7a · · Score: 2, Insightful
    Perhaps matlab has evovled a lot

    Yes, indeed, the latest version (from less than half a year ago) was the first to include a just-in-time transparent compiler by default. Inner loops are so much faster than the old interpreted versions it's not funny.

    However, a Matlab clone called MIDEVA had the same thing three years ago. Mathworks bought them out and incorporated their tech.

  36. Use the right tool... by chhamilton · · Score: 2, Insightful

    ...for the job at hand.

    I'm a graduate student in Mathematics studying (convex) optimization problems so I see a healthy mix of pure and applied math. When I'm doing pure math the best tool for the job is a strongly symbolic math package like Maple (which I use extensively). Maple is also really good for quick visualization and helps gain insight and intuition into problems. Other offerings in this arena include Mathcad and Mathematica (however Mathcad actually uses a smaller version of Maple's symbolic engine).

    Similarily, if the task is more numeric, Matlab is the choice (actually, we use Octave, which is a GPL'd and free numeric package that has Matlab syntax; most code written for one runs in the other). I'd say Matlab/Octave are most useful for prototyping numeric algorithms, and solving medium sized numeric problems.

    Finally, when a tool is needed that performs well at one specific task (or the problem size gets really large), you can't beat writing your own tools from scratch in the compiled language of your choice. At this point, there are a variety of libraries that one may find useful (for arbitrary precision arithmetic, expression parsing, symbolic manipulation, etc).

    So I guess the answer isn't white or black, but rather varying shades of grey (as is always the case).

  37. Scilab by tie_guy_matt · · Score: 5, Informative

    I don't think anyone has mentioned scilab. It is a good GPL alternative (along with octave) to the expensive (expensive if you are a college student) matlab. It has been a while since I played with them alot but I found that matlab had the best graphing functions.

    Anyway the best package for you in part depends on what you are using it for. Matlab, scilab and octave are great for doing linear algebra things -- manipulating matrices and arrays etc. Some people complain about how slow matlab is. I find matlab is pretty fast as long as you use it for what it was designed for. You should use their built in functions as much as possible and use as few loops as possible. If you find yourself using a lot of loops try writing a mex function in C or FORTRAN.

    Maple and Mathmatica are great for Calculus differential equations etc. If you are doing a lot of matrix mulitiplies in Maple, you should be using matlab.

    Mathcad is user friendly but it is SLOW. Even old people who have been doing insane integrals in their heads since the 50's and refuse to even look at a computer can see a Mathcad print out and tell exactly what the program is doing.

    Hope this helps. Personally I like to use Octave and Scilab since they are GPL. Scilab is prettier IMHO but Octave is closer to Matlab (which I am already used to.)

  38. PARI by jasuus · · Score: 2, Insightful

    If you have lots of money, use Mathmatica. If you are poor, use PARI.

  39. This might be useful ... by Somnus · · Score: 3, Informative
    I've just built it successfully on my Gentoo laptop (everyone seems to rave about, so I thought I'd try it out). Ostensibly, whatever voodoo the ebuild script does works. Here it is:

    http://www.gentoo.org/dyn/pkgs/app-sci/octave.xml

  40. Instead of C/C++ by bauernakke · · Score: 2, Interesting

    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.

  41. Maxima can actually be *more* powerful than Maple by ondelette · · Score: 2, Informative

    For example, you can write batch scripts in Maxima a lot more easily than you can in Maple. I have scripts to automatically generate PostScript figures and I'm really not sure I could do the same with Maple.

    Maxima has some bugs, some annoyances, but at least, you can report them on sourceforge and they do get fixed. If not, someone will suggest a work-around.

  42. Too few open-source solutions and minimizers by TopherC · · Score: 2, Informative

    I'm an experimental particle physicist, and most of the mathematics packages I use are home-brew libraries (mostly C++ w/ bits of older Fortran). I think for me a multi-dimensional function minimizer is just about the most complex tool used, and it is used constantly -- tens to thousands of times per day. Unfortunately, it's not a trivial problem and different minimizers will often produce different results. The only one that I know which is semi-free and basically functional is MINUIT, part of CERNLIB (in Fortran). I've recently been searching hard for an open-source minimizer to replace this, written in C/C++. I would also like to see one in Java, for a few reasons (I'd rather an applet than a CGI script).

    The GNU scientific library has a very crude minimizer that's too simplistic for my needs (I want things like the curvature at minimum which can be inverted to give a coordinate covariance matrix). I most often use the minimizer to fit various functional forms to observed statistical distributions.

    I am surprised at the lack of an up-to-date open-source minimizer, because so many university researchers use these kinds of tools, and are in an environment where commercial solutions are painfully expensive and a schism for any multi-university collaboration. A lot of phycisists write good code prolifically, but far too few support/contribute to open-source projects!

    I was reading through Numerical Recipies recently, and was also taken aback by their licensing policies. The algorithms in the book are simple solutions which have been previously published by others in journals and such. And the code is just a direct adaptation (translation really) of the algorithm. Yet somehow their code, or any translations of it, are under copyright? I think it's foul-play like this that are the reason there are so many high-quality commercial mathematics packages, and so few open-source ones.

  43. Absolutely true, Numeric rocks+ JNumeric by ondelette · · Score: 2, Informative

    You can pretty much do everything you want using Python Numeric. It is actually a much nicer language than Matlab if you know your stuff as far as languages are concerned (OOP, functional programming and such).

    Also, there is a port of Python Numeric in java (JNumeric) which means that Numeric is extremely portable.

    All of that for free. Not just free as in free beer too... free as in free software...you can't beat that!!!

  44. Re:Maxima by amundson · · Score: 3, Informative
    The utexas.edu site for Maxima is out of date. The new Maxima site is http://maxima.sourceforge.net. The new site has the recently released Maxima 5.9.0.

    We are trying to get the old site to direct people to the new site. Since the old site is not under our direct control, it isn't as easy as one would hope. (I am the Maxima project leader.)

  45. SuperMongo... by hak+hak · · Score: 2, Interesting

    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.

  46. Phew! by jefu · · Score: 4, Insightful
    This is not a small question.

    First a global kind of classification.....

    octave/matlab... are mostly vector/array oriented languages and are useful for doing work in problems that are suited for such - you can experiment easily, then recode in C,fortran... if needed. apl and j are also in this group and should not be ignored - though they're used a bit less frequently.

    Macsyma/mathematica/maple/maxima/derive are symbolic math languages and can solve interestingly sized problems and get symbolic answers (that is, things like sqrt(pi/2)) as well as numeric approximations. This can be a very useful tool to have - depending on what I'm doing I use such things a couple times a week (nice to check results done by hand, or to handle all the crufty part of a solution). Most will emit fortran code which can also be useful.

    vtk, opendx/khoros(?) are visualization tools - most of the other packages have some visualization tools packaged in them, but vtk and opendx both offer quite a bit more power.

    Now the incredibly non specific recommendation

    My suggestion is to pick one of each of these and learn it - do enough in it so you know the language/system well. Otherwise you'll be struggling with the language as well as with the problem - and finding bugs will be close to impossible.

    If I put on my "computer science professor" hat (probably a wise thing if I'm to keep the top of my head from turning bright red with sunburn), I usually try to recommend that all CS students learn a smattering of these things as well. When you need one of these tools, knowing its there and how to use it can save large and wonderful quantities of time.

    And now some more specific comments

    On the whole my choices would be as follows - note the caveats - some of them are pretty cave-rnous (sic). I don't have piles of money to spend, so tend to prefer the open source programs just on that basis.

    For array/matrix manipulation I much prefer APL or one of its derivatives (check out aplus on sourceforge). Languages in the APL family are also fun to program once you learn how. However the terseness of the syntax (and with APL itself the odd character set) tends to make these a bit forbidding, so a more popular choice would be octave (open source) or matlab. I've had good luck with octave - it seems to handle most matlab programs well enough. If you've got piles of money, go for matlab.

    For symbolic math, maxima (sourceforge) is good. Its commercial cousin Macsyma has usually ranked as about the best symbolic math packages for accuracy and power and seems less expensive than the others. Actually writing programs in either of these requires learning quite a bit about the innards of the system though. My second choice for symbolic math would be Mathematica - its programming language is well integrated with the system as a whole and and for general goodness and niceness of the interface it can't be beat. (The other commercial products are building on the best parts of the Mathematica interface - I've not checked recently, but they're getting much better fast.) The visualization capabilities of Mathematica are also very good. Maple is probably the most popular, so using it will probably make it easier to find someone to help you, but on the whole I've just never found Maple as easy to program as Mathematica and I tend to want to program almost everything.

    For visualization both vtk and opendx are very nice systems. vtk is more aimed at a programming interface, opendx has a labviewish kind of programming environment. I like both and have both at hand. Both these systems are big enough that you'll want to make sure you understand them before you tackle a project with them.

    They don't scale well, but spreadsheets can be very convenient for small models. Careful though, its easy to have errors even in middlin sized models that can be very hard to find.

    Odd Zen Endz

    As has been noted there are other systems, some smaller, some more specifically focussed on a single domain. Those tend to be harder to match to a problem - unless the problem is right in the center of the domain in question.

    There used to be a program AXIOM which had a lot of nice features, but it seems to have gone to that Big Bit Bucket in the sky - but its base language "Aldor" is now available at aldor.org. I have a copy, but haven't looked deeply at it.

    Sourceforge is also hosting a new project "lush" - which is a lisp system that has some integration of some of these features. To the extent that I've used it I'm impressed and will probably spend some time working deeper with it in the hopes that it will prove another valuable tool.

  47. LiveMath (aka Theorist) Rocks! by OsamaBinLogin · · Score: 2, Interesting

    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.

    - 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. :-) It's designed to be interactive, rather than a programming language. Check it out at livemath.com

    (disclaimer: I'm the original author)

    --
    Marketing-driven companies end up over-marketing their products. Engineering-driven companies end up over-engineering
  48. A couple of suggestions by Goonie · · Score: 2, Informative
    GNU maxima is a free symbolic algebra package, roughly equivalent to Mathematica. It's not nearly as tidy, but I've found it handy on occasion.

    If you want to do some statistics, there's also R, a stats analysis package. It's very powerful, but it's designed for experts rather than non-statisticians who occasionally want to crunch some numbers.

    --

    Any sufficiently advanced technology is indistinguishable from a rigged demo
    --Andy Finkel (J. Klass?)
  49. Matlab vs everything else by the_pooh_experience · · Score: 2, Insightful

    So from what I have read from most others' posts, there are two camps:

    1. Use several packages depending upon application... i.e. Mathematica for symbolic math (what it is good at) and Matlab for numerical matrix math
    2. Matlab is good but expensive

    While I agree with #2, it does not really seem to answer the question. The question is: "Do researchers use only one or two packages for most of their projects?" I think the result for the most part is for mathematical calcs, the people that answered the question say most people use different programs for different goals.

    Things to think about when you are trying to pick a language:

    • How big will this get? Are we talking about 100's or 1000's of lines of code? This may filter out some languages.
    • Is this a simulation/calculation that you will be running over and over? This will help decide on efficiency of the language (especially on big projects).
    • Will others be using this code? If this becomes a group project or used by a bunch of people, maybe doing it in a common language will help.
    • If large calculations are necessary, ARE MULTIPLE PROCESSORS NECESSARY? This is a big question for larger code. Certain languages (Matlab to name one) don't naitively support SMP, while other packages (IDL to name one) do.

    These are likely to be very similar questions a computer programer asks him/herself when they are starting a new project. Okay, this post really doesn't say anything, but one last note for the major commercial packages: most of them support C/fortran/etc calls so if you are truely interested in efficiency, remember coding efficiency matters too. I am finishing up my Ph.D. Years ago, when I starting simulations for my work, I started working in C. I figured "if I am going to be working on something for X years, I may as well do it right!" While a noble goal, I really didn't know C. I subsequently spent a week trying to do something that took me roughly 2 hours to accomplish the same thing in Matlab (another language that I had no experience in).

    So what is the moral of the story?

    run... run as fast as you can and don't look back.

  50. Re:Octave (useless bragging) by theLOUDroom · · Score: 2, Interesting

    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.
  51. Invent by spectatorion · · Score: 2, Insightful

    Well, some did anyway. For example, in the early 1820's, when dealing with solving partial differential equations arising from heat conduction, Joseph Fourier came up with the foundations of Fourier Analysis, which has become an essential tool in a great deal of mathematics, science, and engineering. Where would we be today if he could just plug it into MATLAB and get an approximate numerical solution?

    Also, although I do not really know how he did it, I belive that Euler had calculated e to 7+ decimal places in the mid 1700s.

  52. Re:Absolutely, Maxima is very, very useful by amundson · · Score: 4, Informative

    The "maxima community," such as it is, exists on the maxima mailing list. Please follow the links from http://maxima.sf.net for list information, archives, etc.

  53. Be Careful Though by sstory · · Score: 3, Funny

    About keeping important bits of paper. I have MathCAD Pro 2000, and an upgrade to MathCAD 2001, both of which set me back nicely, (though I usually need Mathematica) and when I switched computers in December it was all useless because I can't find the serial number to my MC Pro 2000 disk.

  54. Back in the old days... by cachorro · · Score: 2, Funny
    Back in the old days, we were lucky if we had three significant digits. Most times we only had one or two. And sometimes we didn't have any significant digits at all.

    Have you ever tried to build a pyramid without any significant digits. You kids have it so easy these days.

  55. For Statistics by EnlightenedDuck · · Score: 2, Interesting

    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!!
  56. A Few other packages by pfafrich · · Score: 2, Informative
    The statistical community tend to use R or S or a few other statistical packages. Very effective for large matrix calculations, singular value decomposition and that sort of thing.

    I've done a lot of work in 3D pure mathematical graphics (drawing algebraic surfaces etc), and JavaView and Geomview are nice platforms for viewing 3D data.

    --
    There are four sorts of people in the world: fools, lunatics, idiots and morons. - Umberto Eco, Foucaut's pendulum.
  57. recommendations by g4dget · · Score: 2, Informative
    If you are looking for general purpose tools for numerical computing, Numerical Python and Scientific Python are excellent choices, possibly with VTK for visualization (search on Google; the projects are on Sourceforge). Octave is a Matlab clone, although, like Matlab itself, rather limited. The R system (www.r-project.org) is probably the best statistical system around and produces great plots. And for interactive symbolic math, Maxima is still very good (and you can use "texmacs" as a nicer interface to it).

    Don't underestimate the power of C++: with type checking and overloading, C++ may actually be more convenient to use for many numerical applications that even something like Numerical Python or Octave/Matlab.

    Beyond that, yes, obviously, all those libraries are in use by someone if they are maintained. If you have the need to use one of them, you will know. If not, don't worry about it.