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

454 comments

  1. Who needs it? by Anonymous Coward · · Score: 0

    This is interesting because I always found Mathematica hard to use and I majored in Math in college. I found that I didn't need to use the package at all.

    1. Re:Who needs it? by ihateashcroft · · Score: 1
      I found that I didn't need to use the package at all.

      Of course you don't need to use it but it sure saves a hell of a lot of time and effort. I have better things to do than take up multiple pages of paper taking the derivative of some complicated function (and probably switching a sign somewhere...).

  2. 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 2names · · Score: 1, Informative

      I use CHALKBOARD. It rocks. Doesn't use up all my system's resources, no licensing fee, and I can share it among my friends without getting sued. :)

      --
      "I'm just here to regulate funkiness."
    2. 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.
    3. 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
    4. Re:Octave by TennesseeVic · · Score: 1

      Anything like *what*? Octave is a very good Matlab clone (except that it doesn't do sparse data out of the box), but it has not symbolic math built-in. Maple and Mathematica are best for symbolic math, not so good for numerical work. Different products completely. (Matlab can have symbolic math, but I think they only give you a toolbox for accessing maple, which you need to purchase separately.) V.

    5. 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
    6. 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.

    7. 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.
    8. Re:Octave by Anonymous Coward · · Score: 5, Informative
    9. 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?
    10. Re:Octave by s20451 · · Score: 1

      Thanks, but for some reason, RedHat includes the latest unstable release of Octave, rather than a stable release. When started, this version warns against using it for general purpose use and points to the stable release, which is not reassuring. I've found the same to be true for the version of Octave in the FreeBSD ports collection. I also have yet to find a reliable source of Octave binaries or rpm's.

      --
      Toronto-area transit rider? Rate your ride.
    11. 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.

    12. 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.

    13. Re:Octave by meowsqueak · · Score: 1

      I used Octave quite extensively for some DSP work I did last year. It doesn't have a lot of the nice filter design tools that Matlab has, but as far as simple filter design goes, it isn't too bad at all. From a mathematical point of view, I think it's quite adequate for a lot of problems, especially those involving matrices.

    14. Re:Octave by Monkey-Man2000 · · Score: 1

      Keep in mind that a lot of Matlab's functions are implemented in M-files, so you can look at the source as well for them.

      --
      This post was generated by a Cadre of Uber Monkeys for Monkey-Man2000 (603495).
    15. Re:Octave by Anonymous Coward · · Score: 0

      Fantabulous... so if I don't run Redhat, and I don't run Linux, and I don't even run x86, I'm SOL. Thanks for the advice. I have tried compiling Octave and I gave up... I found it easier to download Matlab from my alumni university account and crack FlexLM on it.

    16. Re:Octave by urbi · · Score: 1

      Octave is a lot behind Matlab these days. I really miss cell arrays (broken/unimplemented in octave), and a lot of advanced math is just not there (I needed linear regression). One area where octave is better IMO is plotting - or maybe I'm just more used to gnuplot command syntax... so I actually use both systems.

    17. Re:Octave by CanadaDave · · Score: 0, Flamebait
      You idiot, why'd you compile it? Just get the binaries. Compiling is a gigantic pain in the ass for any package, don't single out Octave.

      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.

      Yes I've once said myself that the only thing that separates Matlab from Octave is the makefiles. Har har har.

    18. Re:Octave by CanadaDave · · Score: 1

      Use Debian.

    19. Re:Octave by thrillseeker · · Score: 1

      APL is the only way to fly.

    20. 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.

    21. Re:Octave by CanadaDave · · Score: 1

      Yeah, but chalk makes your hands all "chalky".

    22. Re:Octave by blair1q · · Score: 1

      And it fucked me in the ass.

      When it installed itself, it somehow altered something in the configuration of my Cygwin environment, which it really shouldn't have touched.

      Now I can't get Cygwin/XFree86 to run. I may have to reinstall that after uninstalling Octave.

      And people wonder why unix/linux/open source software doesn't get serious traction on the modern desktop...

    23. Re:Octave by blair1q · · Score: 1

      Okay.

      I got semi-lucky.

      I didn't have to reinstall all of Cygwin. Just Cygwin-XFree86.

      That's two hours out of my life I want those incompetent fucks at the GNU project to pay for.

    24. Re:Octave by Anonymous Coward · · Score: 0

      What the hell does the GNU project have to do with Cygwin? Let alone XFree86. Neither Cygwin nor XFree86 are maintained by the GNU project.
      RedHat produces Cygwin, and (er) the XFree86 team produce XFree86.

      Stop mudslinging. More sticks to you than to the GNU team.

    25. Re:Octave by s20451 · · Score: 1

      Thanks, but I like RedHat, I've always used RedHat, and I see no reason to change for one package. Isn't open source about choice, and not being locked in?

      --
      Toronto-area transit rider? Rate your ride.
    26. Re:Octave by H.G.+Pennypacker · · Score: 1
      Thanks, but I like RedHat, I've always used RedHat, and I see no reason to change for one package. Isn't open source about choice, and not being locked in?
      That's a contradiction if I've ever heard one.
      --
      -- HG Pennypacker, wealthy industrialist and philanthropist
    27. Re:Octave by decoutt · · Score: 1

      No, you can't. You cannot investigate the source, just the script that uses the compiled objects. You cannot see the source of the objects. Do you know what is meant by ``open source''?

      --
      .sig
  3. MATLAB by Anonymous Coward · · Score: 0

    MATLAB is the Shiznit. With my optimization toolbox I be f*cking all ya'll up.

    I don't need no fool mouse

    1. Re:MATLAB by Anonymous Coward · · Score: 0

      hell yes! when you need to actually solve a problem, and not cheat in intro calculus, which is the only thing matehmatica is good for.

    2. Re:Matlab by Anonymous Coward · · Score: 0

      Man, you don't have to rub it in..

    3. Re:MATLAB by Anonymous Coward · · Score: 0

      Herbert: next time your Kornfeldness is in town, let me know. We party.

    4. Re:MATLAB by Yue · · Score: 1

      Matlab was good. Newer versions are worse and the
      backwards compatibility lacks. The so called compiler depends on system's libraries and works only on the exact software used by Mathworks when the version of Matlab was released. This is usually far behind the latest release (in 2001 the Matlab-to-C translator was relaying on libraries from Redhat 5.1, i.e. 4 years behind).
      The tendency in the Math Dept where I work is to drop Matlab in favor of octave and scilab.

  4. 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 Anonymous Coward · · Score: 0

      Mathcad is a good program if a bit slow. One thing Mathcad does better than any of math package is handle units.I use Mathcad for most of my engineering problems and break out Mathmatica when the math gets hardcore.

    6. 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.)

    7. Re:MathCad? by nat5an · · Score: 1

      The MATLAB documentation available online is actually pretty decent. They have a getting started section as well as lots of examples that use actual numbers instead of a bunch of variables and theorems. ;-)

      --
      Head down, go to sleep to the rhythm of the war drums...
    8. Re:MathCad? by blair1q · · Score: 1

      DO NOT BUY MATHCAD!

      Every time I make this mistake, I have to fight through daily crashes.

      The thing does math okay, but it's catastrophically buggy software nonetheless, and has been buggy through the several major revs that I've tried (3, 5, and 8, iirc).

      I'm not plugging any other package. I'm just saying that one is perennially broken, and not worth the risk.

    9. 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?
    10. Re:MathCad? by Anonymous Coward · · Score: 0

      Just a tip: pressing enter will move all equations below the red plus symbol down, keep pressing enter to keep moving formulas down.

      And pressing backspace will move equations upward.

    11. Re:MathCad? by saforrest · · Score: 1

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

      I'm amused that you actually got an "informative" mod point for this. :)

    12. Re:MathCad? by franimal · · Score: 1

      I realize that's how it's supposed to work ... unfortunately it often doesn't. For instance, if two regions are too close to eachother (there are several ways this could happen) pressing enter won't do the trick. You'll just end up in the lower region. Basically, I think the total lack of realtime region positioning (I dunno what else to call it) is a real killer. To my dismay, I find myself continually dragging and entering when it works and aligning and so on.

    13. Re:MathCad? by Mac+Degger · · Score: 1

      either that or just use the documentation/tuts provided with matlab itself. If you know Maple, then it'll be pretty much selfexplanatory after you get past the first hurdles...and Simulink is dead easy to model with :)

      --
      -- Waht? Tehr's a preveiw buottn?
    14. Re:MathCad? by ishmaelflood · · Score: 1

      Switch 'regions' on and at least you can see why it is being so recalcitrant.

      I've got to say that I've been using Mathcad since v1.0, and in my opinion it jumped the shark at v5.0 Plus, any later versions have been going backwards in usability faster than they have added more features. The best single step was going to Windows, purely because of the memory issues with the DOS versions.

      Sometime around the 2001 edition they introduced a rather unpleasant looking programming language, which has solved its major weakness in my opinion. However, if I don't need loops, I use 5.0 Plus.

      The big advantage to me in using MathCad (say comapred with Matlab, Octave etc) is that you can show someone a worksheet and even if they have never seen MathCad before they can check your working. Also everything is there on the screen, unlike Excel, so nasty little things like:

      if answer is in (very small range) then substitute wrong answer

      are much more difficult to implement.

    15. Re:MathCad? by Anonymous Coward · · Score: 0
      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.


      MathCAD is a spreadsheet not a word processor. Each of those boxes is a cell in the spreadsheet. The 'annoying' behavior is an artifact of the underlying spreadsheet engine. You will only encounter greef attempting to use MathCAD like MS Word. Use it like Excel instead.
  5. 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]
    1. Re:useful by Anonymous Coward · · Score: 0

      Any message that uses 'u' instead of 'you' as this one does should automatically recieve negavive moderation points. In addition to that, the author of this post refused to use even a single capital letter or punctiation mark. Spew like this is excessively hard to read. If you know how to write properly in English, please do so! If you don't, learn!

    2. Re:useful by Ataru · · Score: 0

      recieve -> receive
      negavive -> negative
      punctiation -> punctuation
      pot -> kettle -> black

    3. Re:useful by RackinFrackin · · Score: 1

      it takes longer to figure the gui

      I couldn't agree more. That's one of the reasons I really like Magma. It's really nice to be able to write up a Magma program in an editor and execute it with the command line.

      When I was in grad school, I'd routinely leave magma programs running that searched for combinatorial objects. I'd redirect the output to a file, and have a cron job periodically copy the file to my public_html directory so that I could check the progress from anywhere.

    4. Re:useful by mrtroy · · Score: 1

      I am really glad someone pointed out your horrible spelling mistakes while you were being critical of me. I was making a point, not attempting to win a spelling bee. Secondly, you made a completely offtopic post in reply to my point concerning the discussion; THAT should lose points. Just for good measure, this post is gramatically correct and has proper punctuation.
      Oh, and go to hell you anonymous coward.

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

    I use `expr`.

    1. Re:Heh ... by Anonymous Coward · · Score: 0

      and i use calc.exe

    2. Re:Heh ... by Mignon · · Score: 1
      That's no joke. I find that I tend to do just about all arithmetic on the bash command line. On the off chance that someone else wants to know how to do this and can't be bothered poring over the bash man page, here's two simple examples:

      echo $((1+2))
      echo $((1+(2*3)))

      Note there are normally two pairs of parentheses and that you can use more parentheses inside for order of operations.

      It uses integer division, so if I want more decimal places, I just multiply by some power of 10 inside the expression, then count off that many places from the result.

      In addition to the laziness factor of not having to start (or switch to) another program, I like that I can see my entire expression this way.

  7. 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 slimak · · Score: 1

      How is MatLab considered "black box"? Tons of *.m files are included and cover almost every matlab function except for built in routines (i.e. FFT). In addition, most of MatLab's supplied routines fall in the catagory of utility functions. They simply provide you with a solid foundation to start your new research so that you don't have to waste you time reinventing the wheel. If anything MatLab is less black box than C/C++ as the code is more high-level and the source is generally available.

    2. Re:Fortran by Entropy_ah · · Score: 1

      I'm sorry, but the correct spelling of that is FORTRAN. :-)

      --
      my other penis is a vagina
    3. Re:Fortran by jdoff · · Score: 1

      I know you were just picking nits, but it has actually been "Fortran" since Fortran 90. Previous versions, like 77, are "FORTRAN".

    4. Re:Fortran by Anonymous Coward · · Score: 0

      hmmmm. Doesn't that depend on your particular architecture .... for example Unix linkers basically tolower() all symbols. So I gues you write in FORTRAN, but link in fortran.

    5. Re:Fortran by wcspxyx · · Score: 1

      My father just retired as a prof in Nuke Engineering . There is just an incredible amount of code that is used in this field, and I have to concur. It's all done from scratch because you can tweak the hell out of it and get the result you want just that much faster.

      He taught a course that was called something like 'Applications of Numerical Analysis in Nuclear Reactor Sheild Theory' or something like that. In it, every two weeks, the students coded a different major numerical method that was commonly used in Nuclear Engineering (BTW, the CompSci deptartment at the same school thought that just one of the two-week assignments in this undergrad Nuke class was a semester long graduate level project for a CompSci student. Whatever.).

      Anyway, the registrar thought the class name was too long and told my Dad to change the name. So he asked his class what would be a good name. They discussed, and voted, and the new proposed name was sent to the registrar. The name change was denied.

      The proposed name? "To Hell and Back".

      I think they ended up changing the name to "Reactor Physics II". BORING!

      --
      Sig? What sig? Do I have to have a sig!?!?
    6. Re:FORTRAN by Gambrinus · · Score: 1

      My advisor was the same way. He was bound and determined to use these ancient FORTRAN programs. I ended using Perl to generate data files and run batch jobs with the Fortran programs. He was in awe how I could run 300 different data sets overnight when it took him an hour to run 4 or 5 different sets and he had to be there the whole time.

      What type of fiber modelling are you doing?

    7. Re:Fortran by Anonymous Coward · · Score: 0

      Of course it helps that most ENP's are pretty competant with computers and electronics (amoung other things)....except sex and interpersonal relationships with the opposite sex.

    8. Re:Fortran by foog · · Score: 1
      (BTW, the CompSci deptartment at the same school thought that just one of the two-week assignments in this undergrad Nuke class was a semester long graduate level project for a CompSci student. Whatever.).

      There are a few things going on here:

      First, (some) nuke people have this nuke-navy dicksizing legacy of thinking it's cool to be unreasonable with anyone they have power over. "To Hell and Back" indeed. Your dad sounds like an asshole.

      Second, I have a hard time believing anyone's semester long graduate level project was really equivalent to a two-week assignment---maybe the code produced was equivalent, but I'd expect the research and write-up to be much more extensive. These latter items take a lot of time and effort to do right. In other words, I have no trouble imagining taking something your dad would teach in two weeks in a survey course and making it a subject for detailed semester-long project for graduate students.

      That said, I've heard horror stories of lax standards in comp sci departments too.

    9. Re:Fortran by Mainframes+ROCK! · · Score: 1
      No, I always thought it was FORTRAN too, but its really Fortran!

      Check out this, the very first Fortran manual, October 15th,1956, by John Backus.

    10. Re:Fortran by Anonymous Coward · · Score: 0
      There is a healthy schepticism of "black box" programs and libraries so programs like Mathematica and Mathlab are pretty much not used.

      And as a result, physicists (who generally don't really know numerical analysis: witness Numerical Recipes) waste hundreds of man-years trying to reproduce the functionality of LAPACK, ARPACK, FFTW, etc., which were carefully written and tested by people who know what they are doing.

      Moreover, none of these are black boxes. Full source is available at netlib. Matlab and octave use these packages to perform basic operations, so you can't really call Matlab a black box either.

    11. Re:FORTRAN by Anonymous Coward · · Score: 0

      So what if you *perceive* his Fortran code to be written in an old and ugly language. It's possible to write elegant and fast code in most any language (well 'cept maybe Java or other OO-dogmatic, garbage collectin' pieces of crap). To him your C-code probably looks like a random string of symbols fit to manage a computer not to solve a math problem. To you his code looks like dinosaur doo. The important thing is that given underlying infrastructure you can invoke dinosaur doo routines when convenient and (mostly) he can call your magic random symbol code.
      Arguing about languages is a stupid as the original post .... programming is about SOLVING problems. The optimal solution space is defined by the confluence of what you know, what you need to do and how the available tools map onto the problem you are to solve.

    12. 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!?!?
    13. Re:Fortran by zerus · · Score: 1

      Same kinda stuff that I used to have to run when doing code runs. Set up the fortran compiler to run and make all the tables, then run the matlab scripts to analyze everything that came out of the fortran code and make it look pretty. Matlab is more of the experimenters program while Maple is more of a student's diff eq class project in a way. I never used Maple for anything more than plotting graphs from differential equations or solving systems of equations. Matlab just seemed the better pick for large amounts of data since it merges so well with fortran. Maple still has all the bells and whistles just about anyone would need though. I haven't used mathematica or mathcad too much to be able to give a good description of them though.

    14. Re:FORTRAN by Entropy_ah · · Score: 1

      Ha! I do the exact same thing with perl.
      Its a fiber model that models the behavior of individal fibers under compression. I'm not doing any of the math, just animating the compression.

      --
      my other penis is a vagina
    15. 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

    16. Re:Fortran by monopole · · Score: 1

      As a PhD in physics (Optical not Nuclear) and a BA (Lake Forest only gives BAs go figure) in Comp Sci, I suspect much of the FORTRAN use is Atomic and Nuke macho coupled with simple ignorance of programming language issues.
      FORTRAN compilers are generally regarded to have the best parallel optimization code, and often physicists need cutting edge meath methods to do their work. Remember the vast majority of applied math was developed by physics for physics. Finally, the tendency in physics is to start from first principles, I don't know how many optics derivations I have seen that start with Maxwell's equations.
      Unfortunately, this is often balanced with a particularly nasty "Not Invented Here" attitiude. Grad Students get heat for taking EE or CS courses, the ignorance of discrete mathematics, data structures (other than sparse matricies) and structured (much less object oriented programming) in some physics department can be astounding. Much of this is due to the lack of skill that CS types have with calculus and continuous math. Our present CTO who can't boot a computer to save his life said "It can't be too tough, since it's just integers and arithmetic!". As a result, many Physics students are autodidacts whith considerable gaps in their CS knowledge.
      As a result you often get spectacular hacks which are coded and optimized down to the bare metal (with some reactive ion etching to strip off the last ten atom thick oxidation layer) with GUIs and IDEs a few steps removed from punchcards. They often miss Hamming's assertion that numerical analysis is about insight not numbers. It's a perfect case of the dictums that "You can code FORTRAN in any language" and "When all you have is a hammer everything looks like a nail".
      This is not to say that there are an awful lot of very good Physics/CS hybrids out there at the bleeding edge of both fields. It's just that the old guard has to die out before the practices are absorbed into formal training. Remember, Newton worked out the inverse square law very quickly, but spent years figuring out how to explain it without calculus (since only he and Leibnitz knew calculus at the time).
      I personally use any tool which speeds development. Matlab is fantastic for rapid prototyping of and quick analysis of complex data ('tho the data structures stink on ice). I presently use a lot of Numerical Python for the data structures and the ability to incorporate numerical analysis into realtime system (I use pygame, Numerical Pythonfor Lie Group math, and VTK in the same programs).
      Onn very nice language I didn't see yet is the Integrated Data Language (IDL), a bastard coupling between APL and FORTRAN, combining the brutal elagance of APL with the numerical power of FORTRAN. It's far more consistent and elegant than Matlab. To my knowlege it's heavily used in medical imaging.

  8. Old Fashioned by Anonymous Coward · · Score: 0

    I just use my trusty abacus most of the time.

  9. 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.

    1. Re:age-old answer: it depends by I'm+a+racist. · · Score: 1

      Just like all software, this should be "the best tool for the job." It is often determined by arbitrary personal preferences and resource availabilities (using Matlab over Mathematica just because there are licenses laying around).

      I've done some genetics work using combinations of Matlab, Perl and C. I used Matlab for the heavy algorithmic implementation, with the really intense bits in C, and Perl to do the pre/post-processing. I've also used the Simulink package in Matlab to do some chemical signal modelling.

      I've used the above software on combinations of Intel/Windows and SPARC/Solaris platforms (my employer didn't mind if I burned CPUs over the weekend). In that case, taking advantage of all that hardware (a few million $s worth) influenced my choice of language/toolkit. I know that a lot of quantitative analysts seem partial to C++. Many professors, especially the older crowd, use a lot of FORTRAN. One guy I know, doing high-energy work at CERN, uses Java. Some students, when I was an undergrad (late 90s), used something called IDL (maybe it's "Interactive Data Language") to process some astronomical data.

      As another poster mentioned, physicists (which is mainly the category I fall into) tend not to trust any off-the-shelf stuff (hardware or software) and will typically look to build things themselves (or at least understand what they've bought in intense detail). Although, I've never gotten involved in serious computational physics (other than typical post-processing and visualization on data I've collected).

      One statistical mechanics grad student knew all the details of the least-squares and regression implementations in Excel. Actually, you'd be surprised how many people will use Excel for simple calculations and visualization. It's quick and easy, once you know what you're doing, so why mess around doing it with GNUPlot or something else (which is equally/more efficient, but is another tool to learn)?

      In the end, whatever requires the least amount of the researcher's time is the best solution. A little extra computing time (in many, but not all, cases) is negligble when compared to the time spent coding. The UI doesn't need to be slick, the performance (probably) doesn't need to be great (except for detector software that's generally real-time). All that matters is that the results are correct/accurate (and hopefully repeatable).

      --


      Down with Saudi Arabia!!!
    2. Re:age-old answer: it depends by jdh-22 · · Score: 1

      For a research mathematician, you might wanna go back to counting numbers:

      1 - a
      2 - b
      3 - c
      4 - d
      5 - e

      So the answer is D all of the above! :p

      --
      Every Super Villan uses Linux.
    3. Re:age-old answer: it depends by mebert · · Score: 1

      I agree. For hardcore numerical work, most people write custom code. In our group, it's C/Fortran 90 with LAPACK, FFTPACK, mpi, ... libraries. For data analysis and visualization, Mathematica and IDL are our tools of choice.

      --
      I John 4:7-8
    4. Re:age-old answer: it depends by faqBastard · · Score: 1

      (matlab and mathematica are too slow for big computations).

      Of course, you could just use the Matlab compiler to generate executables.

    5. Re:age-old answer: it depends by b_pretender · · Score: 1
      As a Systems engineer at Lockheed Martin we used the following:
      - Matlab for prototyping, visualization, and quick rough estimates (image processing library is awesome)
      - C/C++ for implementation and productization (combined with ImageMagick and a proprietary Linear Algebra library)


      Mix into a large bowl and apply a generous amount of Perl.

      Basically, we would start every new problem or algorithm in Matlab and as we would begin to test and reuse these algorithms, they would slowly be converted to C/C++. For products that were implemented on runtime machines (mail sorting machines/image processing-OCR algorithms), we would rewrite in C/C++.

    6. Re:age-old answer: it depends by johnnyb · · Score: 1

      I'm curious if you've ever used Maxima (maxima.sourceforge.net), and, if so, what you think it's good for.

    7. Re:age-old answer: it depends by sunhou · · Score: 1
      I'm an applied mathematician (mathematical biologist) and use a very similar set of tools:
      • Matlab for code that isn't too computation-intensive, and for visualization. I like Matlab's "pcolor" function to plot a raster image of a 2-D array (unfortunately Octave couldn't do that last time I tried; I used to use Gnuplot all the time, but outgrew it when I started wanting to plot these 2-D raster images).
      • C code for the big simulations that involve trillions of random events. In some cases, Matlab code that I translated to C ran 300 times faster. What took hours in Matlab takes seconds in C. I tried that Matlab compiler, but never had much luck with it.


      Putting it all together, I usually write Perl scripts that run my C simulation programs many times; those programs dump out data arrays which I read into Matlab to visualize.
    8. Re:age-old answer: it depends by namespan · · Score: 1

      Every time this is discussed, I see matlab, mathematica, C, fortran, Maple, etc come up. That's great if you're working primarily in modeling or mathematical research.

      However, I'm looking into policy research, and in that area, statistics focused software is king. I've managed to learn the barest bit of SAS, which may or may not do me any good. I'm told I should get STATA down. I'm wondering if there are any comparable open source apps with this statistical focus.

      Anyone know?

      --
      Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
    9. Re:age-old answer: it depends by Anonymous Coward · · Score: 0

      > my own c/c++ code, with a lapack backend [..] for big computations

      That's also the solution I favored. Simple C++ for coding facilities over Fortran, and LAPACK as backend. An API with function names close to Matlab, so that it is easy to reuse algorithms and the code can be read by non-C++ developpers too.

      Here is the project, together with docs, examples, a neural network and an optimizer framework: CheapMatrix

  10. Depends on your needs by Anonymous Coward · · Score: 0

    All of these packages are extremely useful. But they are designed for different needs. From my expericence: Maple does symbolic maniuplation (good for verify homework), Matlab is good for matrix manipluation (both have nice IDEs). And LEDA is useful graph/geometry work.

  11. Matlab is quite dominant in engineering over here by Anonymous Coward · · Score: 0

    I study engineering and we most frequently use Matlab. It's good at numerical computation, it's simple to code something and draw graphs, interpret your results... Maple and mathematica both do symbolical math but for engineer's that's less important. Really over here everybody seems to use matlab from control theory to acoustics to electronics

  12. Calculator by Anonymous Coward · · Score: 0

    I use a calculator, but then again I'm not very smart.

  13. Maxima by Anonymous Coward · · Score: 0
    The oldest is the best: Maxima is what you should use.

    In general, if you are not teaching yourself and your students to work real math with computer aids you are limiting yourself to pre-1960 technology. This applies to most math in the US. Students should be taught to use proof engines like larch to enter axioms and check and generate theorems.

    1. 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.)

  14. Good general packages? by Tyler+Eaves · · Score: 1

    Is there a good gneral math package that provides "virtual calculator" type functionality? Something that provides features akin to A Ti-8x (Minus the graphing, of course) would be ideal.

    --
    TODO: Something witty here...
    1. Re:Good general packages? by JohnFluxx · · Score: 1

      No, but you can get TI-86 emulators that require an illegal bootrom.

    2. Re:Good general packages? by dk.r*nger · · Score: 1
      Derive is the software of IIRC the TI89. It does everything it does, including graphing, on a windows pc.. The interface is not fantastic, but useable.

      If you ask me, it's not worth the effort, I used it in high school to format equations for math and physics, which is otherwise a bitch in Word. But I have since discovered LaTeX and AMSMath :)

    3. Re:Good general packages? by Anonymous Coward · · Score: 0

      There's nothing illegal about having the boot rom as long as you own the calculator. I own several different calculators, and have downloaded their roms for emulators. Same thing goes for video game roms, amiga roms, etc... As long as you own the product, you can use the rom code however you please.

    4. Re:Good general packages? by Anonymous Coward · · Score: 0

      There's a program called X48, which is and HP48-GX emmulator for OS X. The look and feel is very authentic looking. I think the story is that HP made the ROM publicly available.

    5. Re:Good general packages? by Anonymous Coward · · Score: 0

      There's a plethora of HP emulators for all OS's. http://www.hpcalc.org/hp48/pc/emulators/

    6. Re:Good general packages? by jkauzlar · · Score: 1
      Try Hartmath.


      It is a GPLed Java calculator-like application that does symbolic integration, graphing, and all the basic ti-8x style math functionality. Very nicely built and its still being developed.

  15. 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.
    2. Re:Perl Data Language by Dr.+Zowie · · Score: 1
      I've advocated here before, so was going to refrain from posting -- but since sleepingsquirrel posted... :-)

      PDL is great for numerical work and data analysis. I use it to reduce image sequence data and to simulate the "small-scale" dynamo on the surface of the Sun (the domain of a typical simulation is about 30,000 km across).

      The array slicing and indexing operators are the most powerful I've come across. There are several graphics output packages, including a Tcl-based interface, PGPLOT, PLPLOT, and OpenGL. I use mostly the PGPLOT interface because of its extreme device independence, but the others have advantages too. As sleepingsquirrel pointed out, you get all of the goodness of perl/CPAN too -- PDL is just a set of modules that you use in perl scripts, so you can readily use all the database-horking, XML-parsing, Morse-code-spewing CPAN modules that you've come to know and love.

      PDL doesn't do analytical math parsing at all. It wasn't clear from the original question whether CEHT is looking for an analytical resolver or a numerical package.

      It's a little bit of a pain to get PDL all installed right (you need to get several packages from several places), but hopefully the next release will mitigate that by including a "complete" package with most of the external libraries as well as the actual PDL module set.

    3. Re:Perl Data Language by ajs · · Score: 1

      Ok, get your BSD flamethrowers ready (the FreeBSD ports folks will recognize why in a sec), but I'm firmly of the opinion that Perl should include a full PDL tree with the language.

      Perl + PDL is perhaps the strongest argument I've ever seen for using high-level languages such as Perl. However, distribution vendors seem intent on keeping this wonderful tool out of their distributions by default, and leaving the integration of its various dependancies up to the users (CPAN does a good job of this for most modules, but PDL depends on several libraries and program suites external to Perl like g77 and Mesa).

      It's time to admit that PDL is a package which is as valuable and worth having as Perl itself for everything from simple matrix operations to analysis of time-series data to image data manipulation to rendering visualization and far, far more....

      But then, perhaps I'm just wierd because I feel the same way about DBI, libwww-perl and Parse::RecDescent.

      These are not simply libraries, but the tools which make Perl what it is. Failing to install them is like failing to install libc with a C compliler and saying, "heck, you've got crt0.o; you can link; what's your problem?!"

    4. Re:Perl Data Language by Anonymous Coward · · Score: 0

      PDL is included in recent releases of RedHat. Nothing to compile there.

    5. Re:Perl Data Language by t · · Score: 1
      I recognize this argument, although not in relation to PDL. What is needed is the equivalent of an iso distribution except that the distribution would contain all the various math packages et al and run on any distro. Something like texlive for LaTeX.

      Many packages also need lapack, fftw, etc....

  16. [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

    1. Re:[none] by ak3ldama · · Score: 1

      i agree ... fortran has the goods to get a math job done quite nicely
      it's also supposed to be a fairly fast language, especially for math (maybe the g77 people could comment)
      for those that have never used the language, it's worth a shot to learn
      the problem is that there aren't really any good books around for beginners in the language.
      i enjoyed one called "fortran for programmers" (or something like that), but it's quite old.

      --
      "but money is the God of Algiers & Mahomet their prophet." - Rich. O'Bryen June 8th 1786
  17. Nothing to add here.. by Anonvmous+Coward · · Score: 1

    I'm an artist, and as such I'm not expected to know a lot of math. So I obviously have nothing to suggest to this guy.

    But I would like to share my own method for solving some problems, mainly geometry problems. I work in 3D, Lightwave to be specific, and I've helped engineering solve some mathematical problems with it. For example, there was a question about how to build a sphere with each face being in the shape of a pentagon. They needed to know what the angles of some of the vertices were. While the engineers were busy pushing numbers around on paper, I built the model in Lightwave and used its tools to get the right measurements. Actually got it done before they got their equations done. That was kind of cool.

    As I said, that doesn't really help that guy. I just thought solving a math problem like that using a 3D app was kind of interesting. New? No. Just interesting. Math is not my favorite subject but at least I've got tools today that prevent that from being a huge disadvantage to me.

    1. Re:Nothing to add here.. by foog · · Score: 1

      Yeah, CAD programs in general (Solidworks or even better, Vellum) are great for that kind of geometric noodling.

      I've wondered from time to time if funky stuff like Dr. Genius (formerly Dr Geo) would prove useful for that kind of problem but I never had the time to spend playing with Dr Geo.

    2. Re:Nothing to add here.. by Anonymous Coward · · Score: 0

      Reminds me of the time my 7th grade teacher told me you can't trisect an angle. Naturally I tried to trisect an angle for two weeks. My father grabbed my compass, made a couple of marks on the paper and eyeballed it up, and then pronounced he had just trisected the angle, what's the big deal.

    3. Re:Nothing to add here.. by Anonvmous+Coward · · Score: 1

      "Reminds me of the time my 7th grade teacher told me you can't trisect an angle."

      Why did your teacher think it was impossible? Did she have a reason for it?

      Out of curiosity, is this the answer?

      http://www.jedi-knight2.de/prefabs/bilder/triforce .jpg

    4. Re:Nothing to add here.. by Anonymous Coward · · Score: 0

      How nice that your problem can be represented using 3-dimensional space.

    5. Re:Nothing to add here.. by Anonymous Coward · · Score: 0

      Thats funny, I'm an artist too, and I love math. Thats one reason why I'm a programmer today. Have you ever looked at the language Renderman? To understand how raytracing works requires an understanding of surface calculus. This is normaly introduced in Calc III. I have found Linear Algebra, Differential equations, abstract algebra, and Fractal geometry, to be usefull also. But thats just me. Fortunatly, these days we have some great tools to isolate the art from the mechanics.

      Your solution was clever. I had a simular experience. I was making an aqua-terrarium. I had a piece of plexi and a nice 45 gallan breader tank. I wanted to divider for the "pond" to be angeled both verticaly and horizontaly. So I grabbed a pen and pad and went to work. It took me two days of working on this in spare moments, befor I thought of doing it with CAD software. I kicked myself for days for being so slow. I went back when I had time and solved the problem just for fun. But thats just me.

    6. Re:Nothing to add here.. by Anonymous Coward · · Score: 0

      Reminds me of the tale of Edison's assistant who was trying to analytically calculate the volume of a light bulb, and Edison beat him to it by just filling the bulb with water and then measuring out the water.

  18. 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 koehn · · Score: 1

      Mathematica, for one, is symbolic: it doesn't convert your result into a number until you tell it to. At that point, it's as precise as you want it to be, so you can have pi be 3, 3.14, 3.14159, if that's accurate enough, or you can just leave it as pi and it will be exact (no rounding errors).

    2. Re:Inexact floating point calculations... by Big+Mark · · Score: 1

      I'm not sure of the exact implementation, but they must use custom data types to store numbers in, as a) they can store oodles of digits in a single number (e.g. factorial 2000 is well bigger than any int this side of the moon!) and b) they will do as many decimal places as you ask of them.

      Put it this way - floating point accuracy is NOT an issue with these programs.

      Trying to figure out how to get them to do the differentials, though, can be a bitch...

      -Mark

    3. Re:Inexact floating point calculations... by eomir · · Score: 1

      I know that Maple simply keeps things in symbolic form until you ask it to do a floating point evaluation. It also has a lot of other cool features like generating code for C, Fortran, and Java.

    4. 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.
    5. 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.

    6. Re:Inexact floating point calculations... by Anonymous Coward · · Score: 0
      Actually, floating point is independent of the language you use, and it is inexact (unless of course the numbers you deal with can be expressed finitely within the floating point representation system). There are arbitrary precision packages out there (especially useful with large integer problems like cryptography) but by and large most numerical problems lie in the realm of floating point operations.


      HOWEVER, it is worth noting that packages like Mathematica and Maple can do *some* exact calculation solutions, for example some algebraic problems (see Wolfram's discussion) and a few integral problems that happen to have known "named" transcendantal solutions (you know, Pi, Euler's number, and so forth). Beyond that, you're in the realm of floating point and all the hassles that entails -- a subject worthy of a quarter's or semester's study in understanding how these errors propagate and how to minimize the impact of such inaccuracies.

    7. Re:Inexact floating point calculations... by Griffy · · Score: 1

      Mathematica uses symbolics (sqrt(2) vs 1.4142...) until you actually ask for a numerical answer. Mathematica can do arbitrary precision floating point (via N[expression,sigdig]) when you want a number "made" out of your symbolic result. (This presumably takes an absurd amount of time if your symbolic result is complicated.)

      --Griffy, Server Janitor, Math@Univ of MD

    8. 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.)

    9. Re:Inexact floating point calculations... by waterbear · · Score: 1

      "... 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 ...
      What do the "pure" math programming languages do with this issue?"

      AFAIK it's not so much a language issue, as a numerical analysis thing -- the shape of the cure can depend on the kind of problem. Guard digits (extra unneeded precision) can sometimes help. But if its an integration problem errors can sometimes cause unstable exponentially growing error solutions and swamp the wanted solution, and guard digits don't cut it, but a cure can be to change the model e.g. to integrate in a direction in which error solutions decay instead of grow, & so on.

    10. 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.

    11. 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
    12. Re:Inexact floating point calculations... by rangek · · Score: 1
      Do any of the listed tools/languages take care of this problem for me?

      Sure. At the expense of CPU time. Lots of CPU time. For most things, plain old 64-bit FP math is good enough if you are mildly careful. And if it isn't you better hope that you problem is simple enough to do in some sort of exetended/infinite precision because that takes many orders of magnitude more CPU.

    13. Re:Inexact floating point calculations... by mysterious_mark · · Score: 1

      The trick is to make sure that the floating point precision used in the code is much greater than the precision required for you algorithm, genrally good algorithms will converge to machine precision which will have many more sig figs than that required by the solution. MM

    14. Re:Inexact floating point calculations... by CEHT · · Score: 1

      There are always ways to get around these problems. You can try to use libraries like GMP with C/C++ where you can store data in rational numbers instead of floats. And then you do the convertions at the very end. However, if your calculation starts out in numeric (i.e. calculating regression) instead of symbolic (i.e. polynomials or linear algebras), you cannot use this trick. Library like GMP do the job really well if you want to get around floating point errors with your regular C code. There are other tricks which I don't remember right now. Try the C Primer, or Stroustrup

      --

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

    15. Re:Inexact floating point calculations... by dbindel · · Score: 1

      Floating point arithmetic is not the same as real arithmetic -- but neither is it fuzzy. Well-behaved floating point, like that specified by the IEEE 754 standard, actually allows you to simulate higher precision. Doug Priest's thesis explains how such simulated high precision works in detail, and software packages by , Yozo Hida, and others let you use fast high-precision arithmetic from languages like C++ and Fortran.

      The widely used 1 + epsilon model of arithmetic is useful for proving algorithms are accurate, but it is only a model. Some computations in floating point are exact; for instance, the difference of any two positive floating point numbers that are within a factor of two of each other is computed exactly -- see Doug Priest's appendix on computer arithmetic in P&H.

    16. Re:Inexact floating point calculations... by Anonymous Coward · · Score: 0

      The problem with matricies is exasperated when matricies approch sigularity. Most accepted matrix math packages use quality factors to assertain the suceptibility to small number errors. All these packages are writen in FORTRAN, though there are C and C++ wrapers, and translations of some of this. Regardless of the package though, one should format the problem such that it ovoids problem areas. For example avoid matrix inverses if possible. This will also do wounders on execution time.

    17. Re:Inexact floating point calculations... by realnowhereman · · Score: 1

      'Fraid not. Here's a calculation for you:

      0.2

      Can't be represented exactly in base two. Whoops. Similarly for a whole series of other numbers. Just as 1/3 cannot be represented exactly in base ten.

      --
      Carpe Daemon
    18. Re:Inexact floating point calculations... by dbindel · · Score: 1

      Of course not all real numbers (or even rationals) can be represented as finite binary fractions -- let alone onex that fit into 53 bits! But floating point numbers are numbers, not fuzz. Add 0.5 and 0.5 in floating point, and you'll get 1.0 exactly -- not 1.0 plus or minus a unit in the last place.

      Why does this matter if you can't represent your original data exactly? Because in intermediate computations, we rely on certain relationships holding. This is important in geometric computation, for example, since we'd like a consistent view of the world. Three ordered points on the plane should be listed clockwise or counterclockwise, or be colinear -- but not more than one of those. See the papers on robust geometric predicates by Jonathan Shewchuk, or papers on floating point computation by W. Kahan for details.

  19. 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.

  20. 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
    1. Re:For our research... by Anonymous Coward · · Score: 0

      I use C, and GMP for work with large integers, and make output in matlab friendly format so I can graph my systems. Works great, code is portable, and my output looks nice.

    2. Re:For our research... by tellezj · · Score: 1
      The trick for fast MATLAB execution is using their vector routines properly. The general rule is that if you ever use a for loop in MATLAB, you're wrong. If you do things right, you can get extremely good performance improvements (much closer to compiled code performance). In fact, most of the time when I use the MATLAB compiler and compare it to the native MATLAB performance, they are nearly the same.

      It may mean using n-dimensional arrays and such, but it's worth the effort. Not to mention it can be a fun challenge.

      --

      End of Line.

    3. Re:For our research... by Anonymous Coward · · Score: 0

      It's not necessarily true that for loops are always bad. MathWorks (the company that makes MATLAB) have added an accelerator to MATLAB 6.5 that can make for loops almost as fast as C (which isn't bad for an interpreted language.) Look here for more info.

  21. Maculay by Anonymous Coward · · Score: 0

    I have heard of some very serious algebra/algebraic geometry being done with Maculay (a fast specialized algebra system).

  22. 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.

    2. Re:Python and Numeric by Anonymous Coward · · Score: 0

      I'm surprised Python + Numeric has not had more attention on this topic.

      Python really scores over Matlab etc. when you come to scale up your algorithms into a larger application. The OO structure is essential for building managable data-acquisition applications, for example.

      for data analysis, I use the SciPy library (www.scipy.org): it adds some great stuff on top of Numeric and it's FAST.

      For 3D visualisation I use the VTK toolkit. It's more flexible than anything Matlab has to offer, but the learning curve is steeper.

      2D plotting is the remaining weakness of python-for-data-analysis: This is being addressed by the scipy-chaco packages under heavy development now.

    3. Re:Python and Numeric by eiben · · Score: 1

      I agree, I would expect R should attract researchers from Universities where money can be an issue, R being both free and open source and available for both Linux and Win32.

      It could be that because R has been more focused on the areas of data analysis (although it is of course not limited to that only).

      I personally love the package and do all kinds of calculations in it, though mostly statistics/data stuff.

    4. Re:Python and Numeric by monopole · · Score: 1

      I use python+numeric+VTK on beowulf clusters to do real time interactive visualization on our autostereoscopic (3D) monitors.
      (And before you say: Imagine a Beowulf cluster of... we are metaclustering our clusters)
      I toss pygame and SWIG into the mix to provide realtime six degree of freedom control through consumer joysticks.
      SWIG (Simple Wrapper and Interface Generator) provides semi-automatic wrapping of C/C++ and FORTRAN libraries. This allows for the simple binding of libraries to python.
      The elegant OO design of python and powerful data structures make rapid prototyping very pleasant. After prototyping it is possible to profile and replace hotspots with C code for acceleration.
      The capacity for exception handling and easy socket communications is very handy as well.
      The really neat thing about python is that it is well suited to real time operation and laboratory control, thus you can integrate data collection, analysis, and visualization into the same program.
      For example, last month I wrote a program that fused nasa blue marble data detailed topography and then accepted a socket from the flightgear flight simulator and plotted the flight trajectory over the terrain stereo in real time! Try doing that in FORTRAN.

  23. 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.

  24. moron seeking to achieve covetdead last post by Anonymous Coward · · Score: 0

    darn difficult it is too, what with va lairIE's patentdead PostBlock(tm) device kicking US around.

    the trick is....

  25. NAG by Anonymous Coward · · Score: 0

    NAG is the package favored for heavy-duty stuff where I work (finance) and MATLAB for general purpose use. All the PhDs I work with are too lazy to write their own FORTRAN code :)

    1. Re:NAG by GlobalEcho · · Score: 1

      NAG generally rocks, but I have to say I've been disappointed of late with their nonlinear optimizers. Case in point: the SQP optimizer allows minor iterations to wander outside the parameter space boundaries. OK, fine, you say. I'll just return NaN for some objective function components. Whoops! That makes your program crash. Not just return an error code, but crash, because they try taking a square root.

      If they're going to wander like that, they should check return values, or at least the sum of components, for NaN.

      Another case in point -- just last week we fed the same 5 dimensional nonlinear problem to both the MS Excel optimizer (MS calls it the "Solver" and it has historically been famously bad bad bad), and to every one of the NAG optimizers, even slow ones like simplex. Result: Excel beat them all. I was shocked.

      In NAG's favor, we have another optimization problem we ask it to do in about 400 dimensions. Granted, that objective function is closer to quadratic, but even so I was impressed with NAG's performance -- always finding the unique minimum, even when it had to run for days.

      Oh, and BTW, if anyone ever tells you computers are "fast enough" now, they're not.

    2. Re:NAG by Anonymous Coward · · Score: 0

      I had to use NaN values in a code recently and I
      didn't want it to throuw an exception. Apparently
      there's a "quiet" NaN and a "loud" NaN. Operating
      on the quiet NaN is supposed to simply return
      another NaN value and not make the program crash.

      To generate that quiet NaN, I used
      "strtod("+NAN",NULL)" in my code.

  26. It depends.... by cerebrum · · Score: 1

    It all depends... How much money do you have? Do you need answers fast? Do you need fast answers? Is it a learning experience?

    I think the obvious answer, to a point, is use the right package for the right situation. But that implies you can purchase as many packages as you want and that you want to learn to code in any of them.

    My preference is to go with something like Matlab (which is what I use) for most of the work. It is relatively fast, not too expensive and does everything I want. It is extremely simple to code things up. I also use Mathematica for symbolic processing, but no real reason why I use that over Maple.

    So, it really seems it comes down to the (obvious) question, What do you want to do with it?

    C

  27. All I need by kvman · · Score: 1

    As a compiler researcher, lp_solve is all I need.

    s bbminPERLth\nb.s xmix\u$&x.s dMidMad.s yPERLyjunay.print

  28. Maple sucks.... by virtualXTC · · Score: 1

    Well at least that was the slogan of nearaly all the freshmen at my school who took any form of calculus, as we all had to learn (or try and figure out how to ge the TA to do it for us) Maple. Now that I'm a little more familar with programming it's not so bad, however back then Matlab would have been without a doubt more prefered, as it was much more intuitve. However, the school was getting a big pay off from Maple (one of the founders or key programmers wrote the damn thing) to teach it. Finally my senior year the Matlab people came to campus and got a huge petition together. Both softwear apps are now available on campus, but I'm not sure if they are both taught... I guess if you want more people to be able to go back and manuipluate yer data, I'd use Matlab...

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

      Explain to me how you would do calculus with matlab?

      --

      All is Number -Pythagoras.

    2. Re:Maple sucks.... by ihateashcroft · · Score: 0

      You would install this and us "diff" and "int", among others.

    3. Re:Maple sucks.... by coult · · Score: 1
      Quote from the page:
      The Symbolic Math Toolbox combines the symbolic mathematics and variable precision arithmetic capabilities of the Maple 8symbolic engine with the powerful numeric and visualization capabilities of matlab.

      i.e. the matlab symbolic toolbox is actually just , you guessed it, maple!
      --

      All is Number -Pythagoras.

    4. Re:Maple sucks.... by ihateashcroft · · Score: 0

      True, and I would never use Matlab to do symbolic math, but I was just answering your question.

    5. Re:Maple sucks.... by Anonymous Coward · · Score: 1, Insightful

      Maple and Matlab serve fundamentally different purposes. You can say that one is better than another for a particular application, but trying to compare them in general is like apples and oranges.

      Maple and Mathematica use symbolic representation, and imho that makes them much better for tools in a calculus class. They will be able to integrate and differentiate and produce results that look like Math instead of a bunch of numbers.

      Matlab is entirely numerical. It will only give you numbers as answers, which can be very nice if you only need an approximate result good to a known tolerance for a problem that CAN'T be solved exactly.

  29. 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.

    1. Re:Other trade offs by Anonymous Coward · · Score: 0

      Try Maxima. Even more extensible than Mathematica because it is GPL'd. Yum, 30 years of solid DOE/MIT lisp goodness... Mathematica is somewhat of a cheap Macsyma knock-off. Maxima is the GPL'd release of DOE Macsyma. maxima.sourceforge.net. Stay away from the stale utexas site, please.

      There is a very strong rift between Worfram Research and the mathematicians, researchers and developters that actually developed most of the techniques in Macsyma. Many of these researchers feel that Wolfram stole their work to build a proprietary system and is getting rich off thier labor.

  30. Pen & paper by Anonymous Coward · · Score: 0

    As an undergraduate studying math I have used Matlab, Mathematica and GAP to some extent, but mostly to verify work already done by hand.

  31. 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.

    1. Re:MatLab, Mathematica by coult · · Score: 1
      If your matlab code is mostly level 2 or level 3 linear algebra computations involving medium-sized problems, then you are probably write -- matlab is as fast as c/c++ code.

      For solving lots of really small problems, c/c++ can be way faster due to pipelining/loop-unrolling that can't happen in interpreted matlab code.

      For solving really large problems, matlab's memory management is too inefficient; you have to carefully control memory usage for large problems, so you need to write c/c++/fortran code for that.

      --

      All is Number -Pythagoras.

    2. Re:MatLab, Mathematica by js7a · · Score: 1
      For solving lots of really small problems, c/c++ can be way faster due to pipelining/loop-unrolling that can't happen in interpreted matlab code.

      The new version of Matlab is a just-in-time compiler, so this is no longer entirely true.

      For solving really large problems, matlab's memory management is too inefficient; you have to carefully control memory usage for large problems, so you need to write c/c++/fortran code for that.

      That is true, but what was a big problem a few years ago is now medium-sized, as Moore's law marches on.

    3. Re:MatLab, Mathematica by Odds · · Score: 1
      I'm a grad student in computer graphics, touching on computer vision as well.

      I also find Matlab invaluable for prototyping. For matrix operations, it's quite quick and well assembled, and not even much of a "black box", since Matlab/C source for most routines is available. For image processing - well, it's okay, but I can definitely write faster code myself. I often prototype in Matlab, and then translate to C++ for a final, fast edition.

      For computer graphics, Matlab is awkward. When you need complicated data structures for 3D objects (like a winged-edge mesh), Matlab just gets painful.

      In C++, I've tried a few matrix libraries. The Matrix Template Library (MTL) was okay but ugly and not very well maintained. I've heard good things about Blitz, but it wasn't quite right for my problems. Lately, I've preferred Boost's uBLAS library for a clean, STL-style templated C++ matrix library. In the end, your choice of library will depend heavily on your application.

      - David

    4. Re:MatLab, Mathematica by skeedlelee · · Score: 1

      I'm a graduate student in biophysics (protein folding, assembly, thermodynamics, mostly expereimental).

      I've got to second your point regarding Mathematica's notebook interface. My first experiences with mathematica as an undergrad were all from the command line and they were not pleasant. However, my lab has more or less standardized on Mathematica these days. this is largely because of the notebook interface in Mathematica. We do a lot of procedures fairly often and using a notebook as a template is a great way to start. Also, most people in the lab have zero computer programming experience so the notebook interface reduces a bit of the fear involved with learning Mathematica. That said, it still usually takes a while for people to pick it up.

      Generally, I'd say our experiences with Mathematica have been good but a few problems have come up...
      First, the registration procedure is a pain, especially given the cite license gymnastics we go through here. Second, there are some operations that seem very optimized and others which are astoundingly slow. For example, most reading of data is typically really, really slow, for some inexplicable reason. Binary read operations are particularily bad, but text reading isn't much better. Finally, mathematica has been a great example of 'it takes a computer to really screw things up.' Simple mistakes like inadvertantly printing a large amount of text to the screen (say a list of 40,000 data points or something) can take many minutes to execute. Also, the simplicity of the interface means that people can make silly programming mistakes because they don't know some programming basics.

      As far as serious number crunching, we only do a little and people are typically happy to use a combination of fast computers and great patience. In practice, some of what we do would benefit greatly from working in an optimized, compiled environment. On the other hand, even in the case of slow calculations, we usually spend a lot more time figuring out how to perform an operation than actually performing it, which means that a nice interface (and one that makes it easy to change a little and re-run a calculation) is VERY important.

    5. Re:MatLab, Mathematica by bawheid · · Score: 1

      We played with blitz for a while - blindingly fast, however the thing that surprised me was that the size of the compiled binary for adding two 6 x6 matrices together and printing the answer on the console came to over 1MB. This was a while ago, granted, but it surprised me......

  32. Mathematica, Matlab and F90 are all good by Anonymous Coward · · Score: 0

    It depends on the task. Recently I've had instances where I need to do statistical experiments and data analysis, vector field visualization, and general testing of algorithm parts. In terms of the statistical side of things, I usually code up things in Fortran 90 - it's an array language that is just good at doing things with time-series style data. For visualization, Matlab is very good for experimenting with things, although I usually code up C and OpenGL for things that need speed. For testing algorithms, Mathematica is the way to go, although coding an algorithm up in Matlab is very nice if you're porting to F90/95 - the languages are very similar.

  33. Fav packages by BWJones · · Score: 1

    It's been my experience that most folks tend to focus on one package for their work. Commonly it is Matlab or Mathematica it seems and each package has its strengths and weaknesses with Mathematica being the better choice for symbolic math while Matlab is used more for building applications to perform specific tasks. Mathematica is a favorite of mine and works well in solving problems related to applied mathematics.

    For a couple of reviews of Mathematica, see Applelust Scientia

    --
    Visit Jonesblog and say hello.
  34. 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
  35. What happen?? by Anonymous Coward · · Score: 0

    Why isn't anybody modding down the trolls?

    Mod me down. Please! MOD ME DOWN!

  36. Mathematica and Matlab by Anonymous Coward · · Score: 0

    I used to dabble in MathCAD for undergrad. It was nice to use to lay stuff out and solve some things but it was a little cumbersome, if you ask me. I've now switched to LaTeX for printing out equations. I've ended up using Mathematica to solve things symbolically and Matlab to do my differential equation solving and plotting. I stick with Matlab mainly becuase I'm comfortable with it.. I'm aware that Mathematica and other programs can do the same job.

  37. 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.

  38. Packages by Freedryk · · Score: 1

    I think this depends a lot on the kind of research you do. I do ocean modeling, and beyond the actual model code, which is written mostly in Fortran, the only packages I use are Matlab, Scientific Python, and an open source oceanography analysis package called Ferret. This is mostly because I don't have to solve any equations; all my results are based on number crunching. If you are doing theoretical work, and have to find polynomial roots or something, you use something different.

    Actually though, I am trying to get away from Matlab more and more. It has some terrible features in it (Like a completely botched graphics library and a for loop command that takes EONS to run) and it costs at least $100 for a personal copy. Sci Py is free and does most of the same things, except that it has no standard plotting routines. At least, none I am aware of...

  39. Practical uses by Anonymous Coward · · Score: 0

    I am but an ignorant college student, so I'm wondering - under which circumstances do you actually USE programs such as Matlab and Mathematica? I'd be happy if someone could share some insight to me and possibly others like me by maybe giving an example. :)

  40. rapid dev enivronments by djdead · · Score: 1

    i use matlab and GNU octave for most of my research. but then i deal mostly with matrices for which these are particularly suited.

    however what matlab really is is a rapid development environment. it's great for quickly taking an idea you want to use and coding an algorithm from it and running it, but it's not super fast. most of the people that i know who are doing research may prototype in matlab, but then they almost invariably write their final stuff in FORTRAN/C because of increased speed and reduced overhead.

    the program(s) you want to use are dictated more by your requirments, i.e. what sort of problem are you trying to answer and how do you plan to attack it.

    --
    -1: flamebait should really be -1: inciteful
  41. Maxima by Anonymous Coward · · Score: 0

    Maxima ( http://maxima.sourceforge.net) is a GPL'd package that can perform a good subset of what Mathematica or Maple can do. Since all the code is available, you're free to examine it and decide whether to trust it or not. Given that it's been in use for roughly 35 years, much of its code is pretty thoroughly debugged...

  42. Common 'Corportate Research' by L7_ · · Score: 1

    In the years that I was working as a researcher at a company doing primarily mathematical based physical systems modelling, we used two languages:


    1. IDL from Research Systems, Inc.
    2. Fortran

    IDL is alot like Matlab in that it is a scripting language with a vast library of common mathematical functions.

    Fortran is fortran. There are *alot* of legacy sytems that depend on libraries written in fortran, and oftentimes most research development would rather call these libraries directly from fortran and not have to worry about the extendability of the code, thus they keep developing in Fortran. [Well, and its 'faster'.]

    But I digress, the only mathematical code "librarys" that I used were from Numerical Recipes. Which is common practice among scientists that want a black-box type library for C and Fortran applications.
  43. Python by Anonymous Coward · · Score: 0

    I like python and that other scripting language, PERL. I've been a mathematician since 1977, and the tools have developed quite a lot I must say. Although, really, what else do you need besides good ol' C++? As my youngest says, "Fo sheezy my neezy, its' the c-dizzy" Both of us like to hit the bong, a lot.

  44. MATLAB. by cybermace5 · · Score: 1

    I like it because I've used it. But it does have very powerful DSP tools, controls simulation (Simulink!!!), ability to code anything you need or buy it, also interfaces to external device through the serial port (for example), and allows you to develop algorithms for embedded systems.

    Never had to use it for much besides 36-hour suicide class project marathons, but it was reliable and easy to work with.

    --
    ...
  45. try again sucker by Anonymous Coward · · Score: 0

    you're probably won of those who has yet to take the free visual studio test drive? damn you. damn all of you foems.

    the source forgerIE will live on. there'll be no 'last post'. not in your tiny lifetime.

    look for va.msn.?NET? (VAST)?

    even more bull.

  46. MATLAB and C or Java by skurken · · Score: 1

    I study control theory at a university in Sweden and there we use MATLAB for a lot. When the speed of MATLAB routines doesn't suffice, we use MATLAB C-extensions (mex-files) and some commercial Fortran-based packages (e.g. NPSOL). Prototyping is very often done in MATLAB, where the built in libraries and matrix manipulation capabilities take you a long way before you have to do anything complicated on your own. Simulink (a MATLAB tool) useful for creating models of dynamic systems but I hear that Modelica is also used sometimes.

  47. Music Technology by RobPiano · · Score: 1

    Basically uses MatLAB exclusively. Its very powerful, has a large user base, and has native components for signal processing.

    It isn't very hard to learn how to use and you can get an academic version for a reasonable price.

    I recommend it,
    Rob

  48. Not just a weekend hack by pongo000 · · Score: 1

    If not, do researchers write C/C++ programs and use GMP or Matpack to solve math problems?"

    Writing a robust, efficient, and accurate numerical analysis library is not something you do in a weekend. There's not much to improve upon with packages such as LAPACK and their kin: They've been proven to be accurate and reliable over years of use. There's really nothing to reinvent.

    I'ver personally used LAPACK for digital terrain matrix (3D) processing of satellite stereo images and the mapping of spherical coordinates to and from various "flat-plane" projections generated by the IKONOS sats. There were simply no other viable alternatives to LAPACK in terms of speed and accuracy, and we certainly weren't arrogant enough to think we could write a better numerical analysis program.

  49. I still have to do the TPS reports after all*sigh* by beacher · · Score: 1

    I do package volume analysis for one of the bigger shipping companies and when I first saw the headline, I thought I could finally install something and let it run and that I would never have to do the TPS reports ever again.
    FINALLY! No more Package Analysis worksheets! No more sending out reports! Looked closer and saw what they were really talking about...

    *sigh* Back to being a troll in a data mine....

    -beacher

  50. GiNaC by gouldtj · · Score: 1

    I personally like GiNaC for stuff like that. Basically the authors were in a similar possition, they wanted the power of C++, with the symbolic solving of Maple. It doesn't have every feature in the world, but it works for what I do. They've used it for research, although I haven't directly.

  51. Re:I hate the way Americans talk about Math by Anonymous Coward · · Score: 0

    eat it you bastard

  52. 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.

    2. Re:Mathematics past by ecloud · · Score: 1

      I looked up "computer" once in an 1828 Noah Webster dictionary reprint. The definition was "one who computes." I think mathematicians employed assistants much as engineers employ technicians, to do the time-consuming grunt work.

      Johannes Kepler had this problem (trying to emperically verify his theories, I suppose) and tried to build a fairly complex mechanical calculator, but failed to finish it before he died. This was long before Babbage.

    3. Re:Mathematics past by luzrek · · Score: 1

      Fortran and Tektronics 4010 terminals. Apparently 4010s were one of the first devices which could display graphics. However, they were around well before there was enough RAM in a computer to hold the display in memory. They worked by using a high intensity electon beam to write on the inside of a cathode-ray-tube, a low energy continuous emitance of electrons to maintain the writing, and a high energy pulse to erase what had been drawn. The number crunching was done by a Fortran program and the 4010 was used to display it. For those of you on *nix boxes the xterm (and friends) terminals still contain 4010 emulations. I think it is accessed by "control + right mouse button", but it could be shift or alt.

      --

      Galium Arsenide is the material of the future, and always will be.

    4. Re:Mathematics past by Shadow+Wrought · · Score: 1
      That is an amazing feat!

      I had forgotten about all the tables that were created by hand for mass dissemenation.

      --
      If brevity is the soul of wit, then how does one explain Twitter?
    5. Re:Mathematics past by OsamaBinLogin · · Score: 1

      I did that too! Boy, that dates me. Us. We're talking 1980.

      --
      Marketing-driven companies end up over-marketing their products. Engineering-driven companies end up over-engineering
    6. Re:Mathematics past by dvdeug · · Score: 1

      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?

      Left them alone. For example, fractals as a consistent theory was never persued prior to modern computers. The Mandelbrot fractal took several minutes to draw on my old 386; think of trying to work it out by hand. Even if someone discovered it (they discovered the related Julian set), it's a lot harder to work with when you can't see what's going on quickly, and it's a lot less interesting. Fractals were generally considered monsters, and hedgewords were added to all the appropriate theory to exclude that hairness.

    7. Re:Mathematics past by sbeitzel · · Score: 1

      Well, Europeans were fooling around with logarithms and making tables of logarithms in the 17th century. In only a few years after tables of logarithms were published, the slide rule was invented.

      So really, ask rather, "What complex problems were being worked on and solved before slide rules?" And how many significant digits did people care about? For most purposes, three significant digits (and the appropriate unit of measure) are all you need.

      --
      Oh, go on, check out my job.
    8. Re:Mathematics past by Anonymous Coward · · Score: 0

      Some mathematical problems couldn't be practicably done before these tools were available. The first time someone went through the maths to forecast a day's weather from the previous days' observations, for instance, it took a year of calculations by hand (and the prediction was wrong, natch). Even so, it was a great achievement at the time.

    9. Re:Mathematics past by craw · · Score: 1

      A long time ago, people actually wrote their own programs to execute these nifty numerical methods. But before you wrote the programs, you first had to understand the methodology.

      Getting your hands on someone else's code was a gift from god. I had to do a lot of eigen-analysis, and luckily, my Prof had a serviceable SVD subroutine. Give me the eigenvalues and eigenvectors, and I could manipulate them with my own code.

      Then case IMSL with their "comprehensive" set of subroutines; fortunately, my grad school purchased a license for IMSL. However, you had to use the mainframe computer (IIRC, a IBM 370), which was slow and old. But wait, somebody had the requirement that the IMSL package had to work with WATFIV.

      To compile a WATFIV program, you needed access to ALL the source code!:-) I figured out a way to snatch all the IMSL subroutines that I needed to do my research. Then I snared a copy of LINPACK! Then EISPACK! Back then, the hunt was more fun than the kill.

      I should point out, that some my classmates took an undergraduate Differential Equations class; one homework assignment was for them to solve a problem using the Runge-Kutta method. They had to write their own R-K program. Another undergraduate Solid Mechanics class made their students write their own Finite Element analysis program. This was a year-long project, but it did teach them the basics of this relatively new methodology.

    10. Re:Mathematics past by wmspringer · · Score: 1

      Well, for those employed at universities, I imagine they made good use of their grad students..

    11. Re:Mathematics past by Paul+Komarek · · Score: 1

      "The History of Modern Computing" claims that this definition of "computer" didn't change until the 50's or so. I've lent out my copy of that book, and can't check.

      In response to the parent post: people studied different things. For instance, "data mining" is something very new that requires computers to be reasonable. Differential equations is something old, but has benefitted from computers on the "applied" side (if you're not a math person, "applied" probably means something different than what you think it means ;-). Nearly all of mathematics doesn't need computers in any way, but that will probably change now that the cold war is over and funding of math theory is (has been) in decline. Of course GW might start a new cold war.

      -Paul Komarek

  53. S-plus / R? by alansz · · Score: 1

    I have gone several ways on this question. Mathematica for symbolic solving, coding my own in C for mathematical modeling. But I did once use S-plus which is a fairly nifty matrix algebra system that might be useful to you. An open source variation is R

  54. One tool? by nimrod_me · · Score: 1

    Although there will probably never be this OnePerfectTool that will solve all your problems, I tend to agree that some integration can be useful.

    For example, one can get the symbolic toolbox for MATLAB and mix symbolic computations with numeric computations.

    Similarly, if you are looking for a free alternative you may take a loot at Octave which has an experminal library linking it with GiNaC:

    http://users.powernet.co.uk/kienzle/octave/

    I personally really like the freedom and ease of expression of a good symbolic algebra system (I have used Maple before). But the truth it, they never have the performance necessary to do any real world computations.

  55. 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 superflex · · Score: 1

      One caveat should be pointed out here: given that the poster was enquiring about free software options, I might suspect his/her budget isn't enormous.
      That being said, LabView is crazy expensive. Furthermore, the graphical programming model might not be desirable either, and I have no idea what kind of documentation NI offers regarding the algorithmic implementation of the math routines, if that is a significant factor.

      --
      sigs are for suckers
    2. Re:Matlab, C, VB, local scripting by foog · · Score: 1

      using Numerical Recipes, especially in this age of the web, is a sign of incompetence.

      http://www.colorado.edu/ITS/docs/scientific/fort ra n/numrec.html

    3. Re:Matlab, C, VB, local scripting by foog · · Score: 2, Interesting

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

    4. 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.

    5. Re:Matlab, C, VB, local scripting by sstory · · Score: 1

      First you say the "best researchers select the most appropriate tool for the job", then you explain that this is not really true, 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." IMHO, the second part is correct. The absolute best tool for a certain job I do might be Scilab, but IDL, for instance, might be 99% as good and I already know it. So the best option is not always to simply pick the best tool for the job.

    6. Re:Matlab, C, VB, local scripting by JPZ · · Score: 1
      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.

      Speaking of aberrations, check out my (inappropriately named) sendmail for Matlab script. It doesn't get more aberrated than that!

      Joris

  56. Complementary Tools by Brackney · · Score: 1

    While I don't do so much with it any more, in my university days I found Maple to be an extremely complementary tool to MATLAB. MATLAB is a powerful UI for numerical analysis, while Maple (Macsyma, Mathematica, etc.) are suited for symbolic manipulation of expressions. It's not uncommon for folks to (for example) derive differential equations of motion using a symbolic math package, then export the results to a numerical analysis package for simulation. I had very good success using Maple for this purpose with both MATLAB and EASY-5 for simulations of very complex systems.

    As an aside, The Mathworks has attempted to create an integrated wrapper around Maple for MATLAB, but the versions I used always felt clunky and bolted on.

  57. 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.

    2. Re:Maxima! by Anonymous Coward · · Score: 0

      Maxima is now undergoing active development again. check out http://maxima.sf.net Any help appreciated :-)

  58. skeptical by Maelikai · · Score: 1

    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.

    I'll admit to limited experience with matlab but I find this very hard to believe. My undergraduate computational physics was taught with matlab but since I was learning C I chose to write all my programs in C (ah, Turbo C 2.0 -- now _that_ was a good product).

    I was no C wiz, and of course the other students weren't matlab experts, but there was orders of magnitude difference in execution speed.

    Perhaps matlab has evovled a lot, or what you are doing has few enough iterations that you don't notice the difference, but I'd guess anything that had lots of iterations would quickly show a marked divergence in execution time.

    1. Re:skeptical by ihateashcroft · · Score: 1, Interesting

      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.

    2. Re:skeptical by Pig+Bodine · · Score: 1

      As the poster said, this is based on the assumption that matrix operations are used. If you make heavy use of matrix operations on large matrices via the builtin functions, which is what Matlab is intended for, then the speed will be largely determined by the code that Matlab uses. (LAPACK I believe for matrix operations.) Unless you are an expert at this sort of thing and have a lot of free time you aren't going to write C code to beat LAPACK.

      On the other hand, if you write a lot of your own loops, work with lots of small problems or force Matlab to do lots of stupid allocations for matrices to contain temporary results, then it will be very slow. However this shouldn't be a problem if your problem is at all suited to MATLAB; if your code doesn't require pretty heavy use of matrices, a MATrix LABoratory might not be the right tool for the job.

    3. Re:skeptical by blakestah · · Score: 1

      Unless you are an expert at this sort of thing and have a lot of free time you aren't going to write C code to beat LAPACK.

      I must be an expert. I needed to solve a matrix equation involving a 1700x1700 autocorrelation matrix.

      Try defining that in Matlab.

      I hacked it up in C, used gsl to solve the matrix, and had results MUCH faster than Matlab can provide them. And, the kicker in this case was that the memory usage of C was trivial compared to that of matlab - gsl used about 25 MBytes, Matlab threw the 256 M RAM machine into swap.

      Matlab is a toy scripting language that is good for small data sets, where memory dwarfs the problem at hand, and when the speed of prototyping the algorithm is the limiting factor (which is really really often).

      But still, get down to serious crunching, and people are rewriting algorithms in C or ForTran to save time.

      Matlab has evolved considerably from a Matrix Laboratory to a general all purpose numerical programming and plotting scripting language. Kinda like a blunt swiss army knife.

    4. Re:skeptical by Pig+Bodine · · Score: 1
      I must be an expert. I needed to solve a matrix equation involving a 1700x1700 autocorrelation matrix.

      Algorithms for such matrices which usually have Toeplitz or Toeplitz-like structure (depending on whether it is an actual autocorrelation matrix or computed from samples) is my field of research. Is this matrix structured? The fastest algorithms are then O(nlog^2(n)) using O(n) storage. O(n^2) Schur or generalized Schur algorithms are well known and easy to code. Using general system solvers is not the way to go. If you want references, just let me know here. Otherwise do a search on the "generalized Schur algorithm". Even inefficient Matlab implementations of these algorithms should be fine. 1700x1700 is really small if the matrix is structured.

      I hacked it up in C, used gsl to solve the matrix, and had results MUCH faster than Matlab can provide them. And, the kicker in this case was that the memory usage of C was trivial compared to that of matlab - gsl used about 25 MBytes, Matlab threw the 256 M RAM machine into swap.

      It's easy to make poor use of memory with Matlab. If you don't put some thought into memory management, you can easily write code that allocates lots of unecessary temporary storage. Without seeing your Matlab code, I can't really comment. If you are just using the "\" operator for solution, it should go to LAPACK for Gaussian elimination. And I stand by my claim that you probably aren't going to do better than that in C. I will concede that Matlab won't do an in-place factorization, but 1700x1700 isn't particularly huge. So one extra 1700x1700 matrix shouldn't be your problem with swapping. In fact, I just used "\" to solve a 1700x1700 autocorrelation system (without exploiting Toeplitz structure) and it took my system less than 45 seconds. There was no swapping and I also have 256M. Whatever is making your code run with problems it isn't solution of a 1700x1700 system.

      Matlab is a toy scripting language that is good for small data sets, where memory dwarfs the problem at hand, and when the speed of prototyping the algorithm is the limiting factor (which is really really often).

      Matlab is a scripting language for putting together quite good matrix solvers. If you use it for anything else, I agree it will not be efficient. But the mistake made is usually using it incorrectly or for the wrong problem. Other than the fact that you might be not exploiting matrix structure, it doesn't sound like your problem is something Matlab couldn't handle. But perhaps there is more to your problem than the autocorrelation matrix.

      But still, get down to serious crunching, and people are rewriting algorithms in C or ForTran to save time.

      Sure, especially if they have an even somewhat novel algorithm that isn't based on basic matrix operations. But not if they value their time and their code is just glueing together some system solvers or FFTs or the like.

      Matlab has evolved considerably from a Matrix Laboratory to a general all purpose numerical programming and plotting scripting language. Kinda like a blunt swiss army knife.

      People do use it like that, perhaps when they shouldn't. But strictly speaking if you use it like a scripting language it is fine (i.e. if you use it for glueing together LAPACK solvers, or other optimized internal Matlab functions that do most of the work). What it sucks at is being a general purpose programming language; that I agree with.

  59. 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 GlobalEcho · · Score: 1

      Two notes:

      (1) Mathematica is not so hot for processing data sets. Since it works so symbolically, you can try some transformation and end up waiting forever for an endless symbolic expression to appear on the screen, all because of a typo. This can be mitigated using $PrePrint=Short[#,7]&, but that has its own problems.

      (2) Anything using Numerical Recipes is immediately suspect (not to mention the license issues). There used to be a document at JPL about this. For a critique, see this compilation.

    2. 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.

    3. Re:A problem I've struggled with ... by Clipper · · Score: 1

      With respect to Maple, the "built-in" capabilites that you describe generally add bloat to a math package's kernel. To circumvent this, Maple has placed much of its functionality in packages:

      • Plotting: with( plots ):
      • Statistics: with( stats ):
      • Numerical Analysis: with( numtheory, numapprox, padic ):
      --
      /<en
    4. Re:A problem I've struggled with ... by johnnyb · · Score: 1

      Have you tried Maxima? http://maxima.sourceforge.net/

    5. Re:A problem I've struggled with ... by Somnus · · Score: 1
      Your complaints have merit, esp. the cost. Luckily, I had the fortune of entering an IDL work environment that already had a lot of these issues taken care of (a gov't atmospheric physics group), via wrapper code, if necessary. To address some of these issues specifically (viz. IDL 5.4):
      • Off-by-one pixel -- I have not encountered this when being careful to use cubic splines; perhaps I am mistaken, since my data sets were huge and with small changes element-to-element. Obviously you have to take care of end cases, and there's no uniform way to do that.
      • FOR loop limits -- Just use a long integer as your index, like in C(++).
      • Structs syntax -- Just pretend they're C structures, and regard the hash-type functionality as something that should be used sparingly.
      • module isolation -- This is a fundamental design drawback from the days of yore, but it would break too much code to fix it now. Python, Ruby, Perl, etc. all handle this much better, obviously; but, how many interpreted specialty languages want to make this overhead-v.-robustness tradeoff?


      All things considered, I hope PDL, Python + extensions or Octave prove to be viable alternatives. As another insightful poster wrote, inertia/legacy is the biggest factor in deciding what to use. Some people use C/Fortran because it's the lowest common denominator, but the cure is worse than the disease. Good design, internally and in the user interface, is the way to go.

      Now, when will there be a viable free alternative to Mathematia? Sorry, Maxima just doesn't cut it.
    6. Re:A problem I've struggled with ... by amundson · · Score: 1

      I will not argue that Maxima is currently ready to challenge Mathematica. We are working on it, however. What about Maxima doesn't "cut it" for you? The more we know about what users want the more likely we are to meet their needs in the future.

  60. 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.

    1. Re:Which package... by johnnyb · · Score: 1

      have you tried Maxima? I'm curious what you thought about it.

    2. Re:Which package... by digitalhermit · · Score: 1

      My original post should have read "I can use Mathematica for almost all of my dabbling. Sometimes I play with MuPAD, R, GnuPLOT, Octave or Maxima."

      It's a good package. Very stable and can handle everything I've needed. Honestly though, I've not used it extensively so it's easier for me to work with Mathematica or even MuPAD. After looking at it again, it looks like it's been improved considerably (nicer frontend) so I'll give a whirl.

  61. Igor Pro by Anonymous Coward · · Score: 0


    Wavemetric's Igor Pro is in general a far better package than the Matlab. It was originally just available on the Mac but has been available on the PC for several years now. It is quite powerful, particularly at curve fitting and graphing, and the built-in c-like programming language is very flexible. It can also be easily extended with your own c/c++ code. One thing it doesn't do is symbolic computations. For that you will have to with Maple or Mathemcatica.

    It is used more by the scientific community rather than the engineering community. The only reason Matlab is used instead of Igor is due to inertia and legacy code in the engineering community.

  62. Calc.exe by Anonymous Coward · · Score: 0

    I like c:\winnt\system32\calc.exe. It rocks!

  63. back in the day... by alyandon · · Score: 1

    I used lots of numerical methods related libraries from netlib.org back in the day. For symbolic manipulation (rarely important to me as I solved most stuff by hand anyway) I relied on Maple.

  64. Re:I hate the way Americans talk about Math by Anonymous Coward · · Score: 0

    Another nit-picking EUian. Why do they do it so much? Dick-size / soverign nation envy.

  65. 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.

    1. Re:depends, or, if you have to ask slashdot... by foog · · Score: 1

      oh yeah, almost forgot: friends don't let friends use mathcad.

    2. Re:depends, or, if you have to ask slashdot... by iggymanz · · Score: 1

      Would certainly have been more useful / helpful to know what in the world CEHT's (the person asking) field and class of problems are being considered? Are you trying to do numerical methods to solve PDE or DE? Stats with regression analysis? Throw us a bone here!

    3. Re:depends, or, if you have to ask slashdot... by Anonymous Coward · · Score: 0

      two different classes of software: "numerical linear algebra packages" and "computer algebra systems". Maple and Mathematica are the latter, Matlab is the former.

      Matlab has a symbolics package which integrates Matlab pretty well with Maple. (Just in case you didn't already know.) To me, this is by far the most useful package you can get for Matlab.

    4. Re:depends, or, if you have to ask slashdot... by civilizedINTENSITY · · Score: 1

      You can use Atlas to optimize BLAS for Octave, too. Octave is mostly wrappers around LINPACK/LAPACK, etc...

    5. Re:depends, or, if you have to ask slashdot... by supergiovane · · Score: 1

      Yeah, I used a spreadsheet to solve civil engineering problems (concrete and steel design) when I was an undergraduate student. It was very useful for simple computations. I remember a peoject in which I had to solve a problem (design of an aqueduct) with around 60 unknowns and nonlinear, piecewise defined equations. It took me two hours to write the problem in Excel from scratch and 5 minutes to solve it with Solver on a P2 266. My teachers were impressed when I showed them that thing (they teached us to linearize the problem and solve it with a linear solver, and they didn't know that Excel had a solver). Now I'm a PH.D. student in computatinal mechanics, I use Mathematica and (serious) Fortran 90, I'm learning parallel programming and when I need a spreadsheet I use Openoffice.

      --
      Signatures are for stupids.
    6. Re:depends, or, if you have to ask slashdot... by monopole · · Score: 1

      Python also has an atlas interface via numerical python.

  66. what I have used by jldrew · · Score: 1

    For a text retrieval / linear algebra project (latent semantic indexing, et cetera), I used Matlab for quick testing and experimentation. Then, when it was time to write some stand-alone code to accompany my paper, I used the GNU Scientific Library (GSL). In addition to its own operations, it provides an interface to CBLAS (C Basic Linear Algebra Subprograms) which are pretty useful themselves. I considered LAPACK, but the documentation seemed less accessible. Both LAPACK and GSL are based on BLAS (Basic Linear Algebra Subprograms).

    For a non-research project (nautilus shell simulation for the Ball State University math department), I used Maple and the Geometer's Sketchpad.

    josh

    1. Re:what I have used by Anonymous Coward · · Score: 0
      I also did a project on LSI, but I used Java with the Jama matrix package. That way, I could use the HTML parser in swing to read web pages for my documents.

      I also just now compiled GSL since this was the first I've heard of it. It looks like I'll be using it for my current project on fast American swaption pricing.

  67. What? by Xipe66 · · Score: 1

    Why not learn a language to a level of proficiency that you can use it well and adopt to the problems?

    Maybe math programming is different from regular application programming, but few developers switch languages until they're forced to (i.e. when they get a job that only allows VB in-shop, or such).

    It's not the tools, it's the wielder.

    Seriously, if you have to ask... maybe it's time you started to learn _one_ language well. ...and if you're a non-programmer kind of guy, go with the flow - chose the language with the most support available - that way you can ask your way through....

    --
    Civilization is the process of setting man free from men.
    1. Re:What? by Anonymous Coward · · Score: 0

      "Maybe math programming is different from regular application programming" ..it is!

    2. Re:What? by johnnyb · · Score: 1

      "Why not learn a language to a level of proficiency that you can use it well and adopt to the problems?"

      Most languages, at least the ones worth knowing, have features simply not available elsewhere, or at least not available to as useful of a degree.

      For example, if I need something which has compile-time policy classes, I'll use C++.

      If I want something that is excellent at text manipulation, I will _only_ use Perl.

      If I need advanced flow control semantics, I need to use a functional language like Scheme or SML that has continuation support.

      Most of the time it's nice to have closures, but they don't exist in C or C++, which are often required.

      For simple SQL web-based apps, PHP can't be beat.

      For doing Mathematics, where you have very complicated constant quantities, you need a specialized language.

      Anyway, there are a _lot_ of non-trivial differences between languages, and language choice really makes a difference in implementation time.

  68. Easy, use Lisp! by SaXisT4LiF · · Score: 1

    I would have to say LISP would be your best bet.

    There are major several advantages.
    Lisp
    * comes with an console interpreter. Very handy for quick calculations.
    * can define functions on the fly.
    * can manipulate symbols.

    And for a quick rundown:

    CLICC produces compilable C code.
    CLISP also compiles to byte code, but still needs an interpreter.
    Lush allows inline C code!

    You can find lisp bindings to do just about anything... especially in Lush

    I'd boast more about how awesome LISP is but I've got a midterm in Real Analysis to study for, so just google it.

    --
    Fight or flight its all the same
    Live to die another day

    --Ryan
    1. Re:Easy, use Lisp! by Anonymous Coward · · Score: 0

      I wanted to learn lisp ever since reading about it on slashdot:
      http://slashdot.org/interviews/01/11/03 /1726251.sh tml
      I wrote a few simple programs, but never really took off with it.

      Mathematica was nice because I could start using functional programming more gradually while working real problems, falling back on other paradigms when stuck. I'm using the functional model more and more now. Functional programming is cool.

      >Lisp
      > * comes with an console interpreter. Very >handy for quick calculations.
      > * can define functions on the fly.
      > * can manipulate symbols.
      Mathematica can do all of this too.

    2. Re:Easy, use Lisp! by Anonymous Coward · · Score: 0

      GNU Common LISP (GCL) is also very nice. It has the added benefict of compiling using gcc and allowing the mixing of the resulting .o files with others made with other languages. Also very portable, runs just about everywhere.

    3. Re:Easy, use Lisp! by nossid · · Score: 1

      You have got to be kidding me!

      (((If you have ((a) (degree in CS)) then (you) might actually make use of it). (Most (people dont and will) (((just get lost in the jungel.)) I for one) would (look elsewhere (to get ((the) job) done.)) ((Perhaps (if I had) (loads of) ((sparetime) (but that wont) ((happen) anytime) (soon.)))))))

      If you matched the parenthesis above by instinct then you can you ahead, otherwise move right along.

    4. Re:Easy, use Lisp! by Anonymous Coward · · Score: 0

      Clueful people who program in Lisp use an editor that highlights matching parens. The editor can also autoindent using the parens. Given all that, the parens are a feature, not a bug.

  69. Re:faggot by Anonymous Coward · · Score: 0

    faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot
    what faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot faggot
    what 098009a8fu09ds8fg0asb89s0def89a09fejawlkfjsadv09aj 49rtjh0a4932wj 02a9ra0fj0d9s8fj asdfa9sidf dsf9dsf sd09fs0fkjw304j2 32 4234 24 3 akljdf a999dsfaspweorhqwnd,.xc9-99df -f df9723324js;a;

  70. OH SHIT! by Anonymous Coward · · Score: 0

    Here go all my plans for my upcoming website, getting laid etc. CHEERS!!

  71. Re:I hate the way Americans talk about Math by GlobalEcho · · Score: 0, Flamebait

    Mathematics is not a plural. Thus, you don't need the "s".

  72. emacs calc by Anonymous Coward · · Score: 1, Interesting

    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.)

  73. Depends, many good options. by mysterious_mark · · Score: 1

    I've used everthing for computational projects fro VBA to Fortran, as well as C, C++, and Java. It really depends on what your doing, what the end use is, and what your existent code base is. There are still a lot of peaple using FORTRAN, it ain't pretty but it works, the NAG libraries are pretty satndard, and very powerful, widely used in computational physics, CFD etc. For really simple and ad-hoc problems why not use Excel? it does matrix inversions etc, and is really easy to use. Also I've used C and C++, for math libraries you can get the source code from "Numerical Recipes in C". Also I've written orbital simulation software in Java, people may scoff but the clean OO features of Java make it great to work with and maintain, compile to native code for max performance. I started in comp physics 12 years ago, but the tools we have today are really incredible and we have tons of options, I guess its a tough call as what to use, everyone needs to use there own judgement, but at leat keep an open mind and look at all the new tools, API's etc we to choose from. Happy coding. Mark

  74. Right Tool for the job by Anonymous Coward · · Score: 0

    The problem you are trying to solve, along with what personal libraries you have developed to solve other problems, define what tool you will use. Researchers, at least in Physics, don't fall prey to a large learning curve since they can pick up a new tool/language and begin using it very quickly. So, we choose the tool/library that can best describe the problem. If one doesn't exist only then would we build it from scratch using C/C++/Fortran. In the past I've used Mathematica, Matlab, Octave, Maple, locally developed algebraic programs, and IMSL w/ Fortran, but (in direct answer to the origional question) not at the same time for the same problem. Being able to state the problem in the tool is the real deciding point. One order of magnitude speed difference is irrelevant. Two or more is another story (hence the use of IMSL & C/Fortran).

  75. code reuse? by Maelikai · · Score: 1

    I'm surprised you mention such a large difference in coding time between matlab and C/C++. I would think that if you have existing programs that do something similar it would be pretty fast to tweak them to do something slightly difference.

    For green field stuff, however, I can certainly believe it.

  76. Re:I hate the way Americans talk about Math by ihateashcroft · · Score: 0

    Yeah, and I suppose "Econonomics" should be refered to as "Econs", right? Quit whinging, you daft wanker. Cheers.

  77. Computational Neuroscience and Neural Networks by Brown+Eggs · · Score: 1

    I am a biophysics grad student doing Computational Neuroscience research. Our lab uses Matlab exclusively, and so do most of our collaborators here. In this field it is considered the standard, unless you are doing large biophysically detailed neuron models, in which case you would use Neuron or Genesis or some other modeling software.

    The reason Matlab is used is because most things in Computational Neuroscience are easily implemented as matrices. Specifically, inputs and outputs are generally stored as long vectors, and connection weights are stored in large matrices. Matlab is ideally suited for this, because of all the functions available specifically for dealing with matrices. Also it is very simple to manipulate them - and the syntax to do so is very simple.

    I have heard that a lot of computational biology people use matlab for their modeling. Those that require speed just code in matlab and then compile it in C.

    If you want an idea of the kind of research we do with matlab, go to our lab website at:
    http://csn.beckman.uiuc.edu

  78. Useful tools, foriegn languages by dmiracle · · Score: 1

    I am a grad student in physics and I use a number of different math languages. The first language I ever learned was C so this gave me a natural disposition towards Matlab. Matlab is very powerful and allows visualization options that I do not know how to code in C. Concepts like vectors and matricies make Matlab very useful in data analysis.

    Recently in a research project we came across a problem that someone else had solved, but in IDL (another math package). In moving our work to IDL I found that Matlab and IDL had many of the same functionalities, just different syntax. Sort of like starting to program in fortran after learning C. You know how the If...then statement works, you just don't know how many tabs to put before the arguments or were you left your punch cards.

    As a student I love Mathematica. No more integral tables or special functions tables. The power of mathematica to do 19th century computations is unparalleled. But I find using it for data analysis difficult.

    So my recomendation is the same as if you were going to a foriegn country where many languages are spoken. Pick the most popular one, or the easiest to learn, first. As you want to do more learn more languages.

  79. 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
    1. Re:C and Python by Anonymous Coward · · Score: 0

      Fortran often crunches numbers faster than C, since it doesn't have the annoying aliasing restrictions of C that inhibit the really major optimizations.

  80. Remember by labratuk · · Score: 1

    SciLab,

    the healthy open source alternative. (tm)

    Might not have all the features but looks pretty decent.

    --
    Malike Bamiyi wanted my assistance.
    1. Re:Remember by Phragmen-Lindelof · · Score: 1

      I agree. I am using Scilab in a course (ODE) and it works well in our 33 (Linux) computer classroom (with "all the bells and whistles"). I have only used Fortran for scientific computations, however.

  81. 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.

    1. Re:MATLAB: Costly but extemely effective by Anonymous Coward · · Score: 0

      There are three options to the high cost of Matlab ownership, not all are legal (thus AC posting).

      1. Borrow a copy of the discs from a friend and get the license file at the same time.

      2. Fly to a semi-regulated country and purchase a pirate copy there. I've seen Matlab, with license files, sell for the equivalent of USD 2 (yes, two dollars); makes the cost of flying there not so high in comparison to the cost of purchasing a legal copy, and if so inclinded, you can purchase other software at the same time. Blatently illegal, yes, but emminently possible.

      3. Use Octave, an open-source clone which is a couple of generations behind in implementation, the last time I checked (eg, no cell arrays).

      Naturally these options don't come with any kind of Mathworks support, but given that released code has actually been evaluated by willing beta testers (*cough* Microsoft *cough*), support isn't that much of an issue.

      I love Matlab, and think it's great that the Mathworks can make a profit on a clearly substantial amount of intellectual property. But the prices are a little steep, especially once you fold in the costs of the various toolboxes.

    2. Re:MATLAB: Costly but extemely effective by Anonymous Coward · · Score: 0

      For individual or student use just get it off the edonkey network. Saves a lot of hassle and you get the compiler and every toolkit there is (I totalled up the toolkit prices for what you get and it came out to $113,000). You also don't have to mess with FlexLM or any of that garbage.

      Place I work shells out 42 grand a year in maintnance fees... I dont feel sorry for matworks missing out on a few gs for my personal projects. Truth be told I also installed a pirated version of it on my company provided laptop. Dialing up the 56k modem thru a phone card to the company network, secureid auth, vpn, etc etc just to talk to the floating license server is fucking retarded. Im not inconveniencing myself for their anal but totally worthless and cracked in five minutes license protection scheme.

    3. Re:MATLAB: Costly but extemely effective by kotku · · Score: 1
      > However, because it's interpreted, if you have ny 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.


      This is not such an issue any more as The Mathworks have introduced new technology into the interpreter. The interpreter now contains a "Just In Time" JIT compiler that phenomenly increases the speed of looping code.



      "The JIT-Accelerator gives you the flexibility to run your code faster without having to perform vectorization.....Today with the JIT-Accelerator, you no longer need to vectorize code to speed up the execution of many applications."

      --
      The bikini - security through obscurity since 1943
  82. 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.

    2. Re:Arbitrary Precision Floating Point? by IWannaBeAnAC · · Score: 1

      The GNU multiprecision library (GNUmp) is an excellent choice for this, very fast, although it is a bit cumbersome to use directly. I use a very simple C++ wrapper, but a more sophisticated one is now included in the library. The URL is in the story I believe.

  83. 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.

  84. Re:I hate the way Americans talk about Math by mysterious_mark · · Score: 1

    Then don't talk to Americans, go somwhere else and spray.. MM

  85. 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

  86. Two Words... by Anonymous Coward · · Score: 0

    TK Solver

  87. 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 !!!

  88. Why not Numeric Python or SciPy? by LM741N · · Score: 0

    Why purchase something when you can get it for free? Numeric Python and Python with SciPy have a huge capability. Thats not even considering all of the other add-on's for plotting and presenting data in Python.

    1. Re:Why not Numeric Python or SciPy? by Anonymous Coward · · Score: 0

      Free isn't the only reason--I'd say Python/Numeric/SciPy is a better solution for most applications.

      To move applications from monolithic, text-in, text-out, legacy code bases to integrated applications with gui's and open interfaces, the best approach is to begin with a fast, OO scripting language like Python that wraps the libraries. Scientists (not just CS graduates) can extend the tools, use them from the command line interpreter, or glue them together to make a full-featured app. SciPy currently replaces 90% of MatLab functionality, often with better performance. You also get the huge Python built-ins and a real language to work with.

  89. 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.

    1. Re:Black Box by GlobalEcho · · Score: 1

      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

      Indeed. Also, they charge thousands of dollars for add-on packages that are mostly, or sometimes entirely, comprised of trivial functions. I think the basic tool is awesome for undirected number crunching, but I am less impressed with the toolboxes.

      And once you've figured out exactly how you want to crunch those numbers, naturally it is time to go to a compiled language. Mathworks tries to make that easy, but frankly I have always just started from scratch.

  90. Matlab and C/C++ by sielwolf · · Score: 1

    I usuall write binaries (since I do genetic algorithms/pattern recognition experiments) and then play with my data in Matlab (do some PCA to get the dimensions down, draw it up nicely, etc).

    I guess the issue is that the major suites have SO many tools that, once you are used to them, mesh well with your way of thinking/coding/problem solving. In that way you usually find one tool and stick with it.

    --
    What is music when you despise all sound?
  91. 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

  92. I'm surprised more mathematicians don't use... by exp(pi*sqrt(163)) · · Score: 1

    ...Haskell. See here for some advocacy.

    --
    Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  93. 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"
    2. Re:Depends by Jimmy+the+tornado · · Score: 1

      For Matrices, I recommend Newmat and MTL Newat is by Robert Davies. MTL (matrix template library)is like a university project....

  94. 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.

  95. 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.

    1. Re:Matlab is a jit compiler now by ihateashcroft · · Score: 1

      It has also gotten way too bloated. I just checked the installation on the computer I am currently using and it has over 60,000 (yes 60,000) files. Compare that with Mathematica's 1,200 and Maple's 400. For christ sake, Matlab has over 1,100 DIRECTORIES.

    2. Re:Matlab is a jit compiler now by superflex · · Score: 1

      Given the wide variety of areas Matlab can be used in, this doesn't surprise me at all. In my admittedly limited experience, the bloody thing has routines for everything I've ever needed it to do.
      Despite the large number of files, which in terms of modularity is probably a damn good thing, how big is the install of the program really going to be when over half of those files are probably m-files that are 1k in size or less?

      --
      sigs are for suckers
    3. Re:Matlab is a jit compiler now by Anonymous Coward · · Score: 0

      I recently tested the MATLAB JIT speed improvement on loops and here is what I got:

      The test was 2 nested loops (1000x1000 ops).

      With MATLAB 6.1 (release 12.1) it took 17.2 sec
      With MATLAB 6.5 (release 13) it took 0.2 sec

      I am not saying that MATLAB is fast but that Mathworks is seriously improving the execution speed. Now I spend less time trying to vectorize my MATLAB code.

      Another nice thing about MATLAB is the Profiler. It shows the execution time for each line of code, and in the latest release it shows which lines it was able to accelerate with JIT.

      Our use of MATLAB is not typical and may be of particular interest to the /. crowd. We use it to prototype network traffic analysis functions. We load packet headers (from file in PCAP format) into large arrays and then experiment with all sorts of techniques depending on what we are trying to achieve (characterization, detection, etc..). Anybody else use MATLAB to do network data analysis?

  96. This is all new work -- no code to reuse :p by JWyner · · Score: 1

    Yeah, for simple changes to the kernel -- that takes very little time in either language. But for trying something completely different, it's nice to have something like MATLAB with huge routines built in that one can mess around with. Once it works, you can go about coding up the routines you actually decided to invent/use. ;-)

    --
    "Owning a computer is like having your very own TV -- with a built in radio!" - Ed Helms
  97. Mathematics Languages by moss1956 · · Score: 1

    I am a pure mathematician, however, I use computers to do numerical simulations, and to assist in algebraic manipulation. For this kind of work it is imperative that whatever you are writing in, the language manages memory well and if... then... statements run smoothly.

    Mathematica. Although the barriers to start using Mathematica are low, branching statements really slow it down, and its use of memory is to my experience inefficient.

    Maple. It uses memory better than Mathematics. The barrier to use is quite high, because it has two heads, a Lisp like head for interactive computation and a C like head for programming,
    the rules for evaluation are different for the two modes. This makes debugging hard. The front end still uses too much memory for some things.

    MatLab. Vectors from hell. This is a great tool for engineering type applications, but for pure math it is too hard to get your conditional going and the data structures really eat memory.

    C with libraries. After I get my act together using Maple, if I still can't get the big examples to work I use C along with math libraries, including the ones mentioned but also using
    pari which does arbitrary precision arithmetic very efficiently. The advantage of C is that it is simple and... you are in complete control of what the machine is doing.

    Hope thats helpful

  98. 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).

  99. 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.)

    1. Re:Scilab by sstory · · Score: 1

      Speaking of GPL, does anyone know or use Maxima?

  100. it depends by Anonymous Coward · · Score: 0

    Most research programmers use MATLAB, etc. for prototyping and verification. Those types of applications are very fast and concise but do not compile code.

    FORTRAN is best for doing matrix calculations and it uses LAPACK, BLAS, etc. directly.

    C++ is used frequently for its support of user defined data types. F90 does too, but who uses that?

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

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

  102. Scilab by Anonymous Coward · · Score: 0

    I still prefer Matlab, but if I had to pay for licence by myself - I would utilize scilab more extensively:)

  103. 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

    1. Re:This might be useful ... by CanadaDave · · Score: 1, Funny

      What's a Gentoo laptop? Is this some new laptop company? Does it run Linux? If not, is anyone trying to hack it to run Linux? I wonder if anyone has done any Gentoo laptop case mods. Hopefully they'll be something on Slashdot about it soon.

    2. Re:This might be useful ... by Daytona955i · · Score: 0, Redundant

      Gentoo is a linux distro...
      I believe it builds everything from source code. I haven't actually tried it yet but that's what it is.
      -Chris

  104. other free software by Anonymous Coward · · Score: 1, Informative

    Think about yacas for symbolic computation and pari for some symbolis computation, high precision calculus with floats and number theory.

  105. Scilab and IDL by Bopper · · Score: 1

    I'm suprised noone has mentioned Scilab so far:

    http://www-rocq.inria.fr/scilab/

    The syntax is close to Matlab, but has slight differences. In some ways much more powerful,
    and its free.

    Another good commerical package is IDL (PV-Wave was another version of the same thing, I believe its owned by IMSL now). Although IDL is not as strong on signal processing as Matlab, it is very strong in image processing. It also has the ability to work with various data types (byte, short, long, float, double, comlex float, ...). This makes it very efficient to use to process raw data. You use to be able to download a complete working version with timed 7 minute demo mode. Lets you run the demos and try it out before buying. Highly recommended.

    http://www.rsinc.com/

    1. Re:Scilab and IDL by hute37 · · Score: 1

      IDL is the standard tool in computer vision lab in Milan

      strong in image processing and 3d data visualization
      (much better than matlab here)

  106. 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.

  107. Haskell by Anonymous Coward · · Score: 0

    Haskell an implementation of Church's lambda calculus, a form of mathematical logic. There are compilers, which generate code comparable (within 20-50%) with c and a large number of mathematics packages. compare
    Check it out!

  108. Scilab by gunix · · Score: 0

    I use Scilab instead of octave, there's no real reason for that, but it's great for writing small apps really fast, if you want to tryout any new ideas. Of course, you can do the same with octave and matlab. I feel that you can't really do that if you use Fortran or C. If I would need speed, I'd go for Fortran or C and Atlas or any other lin.alg. package.

    --
    Evolution of Language Through The Ages: 6000 BC : ungh, grrf, booga 2000 AD : grep, awk, sed
  109. reviews of various CA software by saminator · · Score: 1
    (you didn't really specify what you were trying to accomplish)
    take a look at this page for some computer algebra software reviews:

    http://math.unm.edu/~wester/cas_review.html

    For CA, I use maxima and for numerical work,
    I use the Numerical Python package or Octave.

  110. Anything out there that can handle big integers? by Anonymous Coward · · Score: 0

    I've run into a brick wall trying to find a good language that supports relatively large integers somewhat well as well...is there anything that handles these with relative ease? I'm talking around 1000+ decimal digits, and still allowing operations (add, sub, mult, div, mod) on them on x86 architecture to execute somewhat quickly. This would be a godsend for me.

  111. Absolutely, Maxima is very, very useful by ondelette · · Score: 1

    It actually allows you to do without Maple or Mathematica quite nicely. It is free and it has a great community around it. Not a few puny hackers but actual researchers who have been doing these things for decades.

    1. Re:Absolutely, Maxima is very, very useful by Piquan · · Score: 1

      Where can I find this community? I've been doing most of my Maxima stuff in isolation.

    2. 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.

  112. open source libraries by bmfs · · Score: 1

    For my projects (particle physics etc) I generally use C++ these days (farewell fortran) because of the usefulness of templates. Recently I had to use some largish matrices (1000x1000 and growing - need more memory!) for a lattice calculation and found The Matrix Template Library to be most useful for my sparse matrices - and with an easy (well, easy for someone who knows STL) interface which allowed me to add a tensor product method - nice! The beauty of MTL is that it's just a series of header files - amazing! Then for data analysis I use ROOT an object oriented data analysis framework - it does histogram plotting / fitting etc... but is much more than a simple potting tool - you can build a cross platform GUI with it if you like, but the documentation is not the best. I've also used Octave for some FFT stuff too. It's like the unix philosophy really, use the right tools for the right job and use them together.

  113. 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.

  114. 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.

  115. 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!!!

  116. Re:I hate the way Americans talk about Math by Anonymous Coward · · Score: 0

    It works either way, mathematics is a field of mathematical sciences, therefore it may be plural. On the same note one can consider all of mathematics as a single entitiy and call it mathematic.

    I'm a statistician and my field is the study of statistics, which makes perfect sense since I study a great deal more than one statistic. I also have an undergraduate degree in mathematics, and I consider myself to have studied a variety of mathematical sciences, thus I use the plural.

    IIRC throughout history both mathematic and mathematics have been used to describe the study of mathematical sciences in the english tongue, so to assume either one is correct or incorrect is purely subjective with little objective merit.

  117. What Physics people use by DrLudicrous · · Score: 1
    Well, I have seen people use either Mathematic OR Matlab, but usually not both. I am a big proponet of Mathematica, and use it on almost all of my problem sets. My advisor also uses it instead of Matlab- I am inclined to say that there is a slight preference for Mathematica over Matlab, but then again, everyone in my research group has ties to the University of Illinois, Urbana-Champaign, which is where Stephen Wolfram invented Mathematica, and where Wolfram Research is based. Dr. Wolfram was a professor at the UIUC Physics Dept.

    When I come across a more specific problem that requires large arrays, I have resorted to using a combination of C/C++ code compiled on a UNIX box with the LAPACK package. This has been rare for me to do, the last time being about 3 or 4 years ago, but it was something that Mathematica could not due easily nor quickly. I don't want to reinvent the wheel, so if it happens that something is out there already coded, and I just need to tweak the code and compile, I will resort to that in place of Mathematica.

    For quickie stuff, like generating a table of values to input to some kind of program, I tend to code something in either quickbasic for Mac, or something in C on a Unix box. If it is really simple, I will even use (gulp!) Excel. So, I use whatever will get that which I am trying to accomplish most quickly and efficiently. There is no one size fits all mathematical package/program/method for Physics.

  118. dc? by Baki · · Score: 1
    e.g. to print the first ten values of n! (ripped from the man page):

    ~> dc
    [la1+dsa*pla10>y]sy
    0sa1
    lyx
    1
    2
    6
    24
    1 20
    720
    5040
    40320
    362880
    3628800

  119. I like Maxima by Anonymous Coward · · Score: 0

    Maxima, a descendant of Macsyma, is a symbolic algebra system in Common Lisp, with the endearing ability to drop down into Common Lisp in the middle of things.

    It's very nice.

  120. Hello World by j0hnfr0g · · Score: 1

    For my "Hello World" program, I use Matlab. John

  121. 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.

    1. Re:SuperMongo... by Ambush_Bug · · Score: 1

      You analyze data in SuperMongo?

      Uggggggghhhhhhh.....

      I used to use that for plotting things until
      I found WIP.

  122. Mathcad BUGS me! by Anonymous Coward · · Score: 0

    I've had fair experience with MathCAD and that's enough to warn you that MathCAD is NOT what you want. It crashes every opportunity it has, it is full of bugs, and in some versions there's even a nice little error message that pops up from time to time to say, "No Error has occured." Which, when you think about it, is actually quite useful since whenever this box does not come up... An error is probably occuring!!!

  123. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  124. tie C/C++ to matlab by PCBman! · · Score: 1

    You do realize the mex 'compiler' uses whatever compiler it's got to compile C right? I've used it before for particularly time intensive loops (there was a better then 3x speed up for that program) by writing the loop in C and then using mex-gcc to compile the code. I know it works with borland also, as I've ported that program to a Win2k box using borland's free commandline compiler. Use the mex -setup (I think). More details are on mathwork's site.

    --
    So, when's lunch?
  125. 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.

  126. Matlab is mega bucks by Anonymous Coward · · Score: 1, Interesting

    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.

  127. reliabilty? by Anonymous Coward · · Score: 0

    this is an issue of highest importance! whick packages are known to be reliable, and which are known not to be?

  128. You're correct: by rsidd · · Score: 1
    Scilab is not GPL.

    Many linux drones use GPL as a synonym for "open source". But I don't think Scilab's licence would even pass the OSI's definition of "open source."

  129. Mathematica: programming elegance by Sgt.+Pepperoni · · Score: 1

    I'm a graduate student in Materials Science, and I'm a big fan of Mathematica.

    It takes people a while to figure out that Mathematica uses a "functional" language, and not a "procedural" language,
    but once you invest sufficient time, you can write the most elegant, easy to understand, easy to debug,
    easy to modify code that you've ever seen. You can take three hard-to-parse C++ pages of code,
    and reduce it to ten lines of beautiful code in Mathematica.

    Plus the Help browser is the most useful thing I've ever seen in any program, ever.

    The drawback, of course, is that it's slow, as with all interpreted languages, and thus can't compete with, e.g., FORTRAN.

  130. SciPy is the way of heaven by Anonymous Coward · · Score: 1, Insightful

    As you've probably figured, there isn't one answer.

    If speed (and being a black box) isn't an issue, Mathematica is probably the best symbolic math package (SciLab as free alternative) and MatLab the best numeric package (Octave as free alternative). MathCad gets honorable mention as very easy to use, but not better than either Mathematica or Matlab at either symbolic or numeric math.

    If speed (and knowing what's going on) is an issue, there is enormous amount of freely available high-quality code (mostly in FORTRAN) on netlib. My modus operandi in grad school was to look for what kinds of algorithms existed in Numerical Recipes and then grab a good implementation from netlib and wrap the fortran with C.

    If I were still doing scientific computing, I would do as much as I could using Python. It is obscenely easy to make Python modules (especially with tools like f2py) from existing code. The approach is to increase the power of the Python interpreter by packaging all that great freely available FORTRAN code in Python modules. The good news is the SciPy project (www.scipy.org) has already made great strides and you can steal their work. Better yet, make your modules available to the community and everyone benefits.

  131. down here in the basement of natural science by brmic · · Score: 1

    .. aka psychology we use Matlab for curve-fitting and implementation of localist connectionist network models. speed is not an issue, and we found Matlab to be easy to learn and teach, which is essential when in a non-technical area of research. (that is, people know nothing of matrix algebra and PC experience is limited to MS Office in most cases)[-of course, that's why we ARE working in the basement of nat sci]

  132. Re:Anything out there that can handle big integers by Anonymous Coward · · Score: 0

    C++ with overloaded operators. I'm sure there's a good bignum library somewhere.

  133. 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
  134. I am a UNIX Admin for a research dept. by fialar · · Score: 1

    Believe it or not, our Researchers use a lot of FORTRAN. The mathematical products also commonly used here are SAS (v8), SPlus, and more recently, R.

  135. VNI / PV Wave by Anonymous Coward · · Score: 0
    We use PV Wave for data visualization of building energy data. It is similar to IDL, available for both Win32 and Linux, and also runs great under WINE!

    Without knowing much about other data handling languages, I can say its most useful feature to me is the WHERE command. Want to know WHERE a variable is above or below some threhold?

    mn_val = 100.

    mx_val = 200.

    i = where(var gt mn_val and var lt mx_val)

    Returns the index of an array for those values. Seems simplistic, but is nonetheless invaluable for quickly filtering large data sets. Oh and it also has built in time/date function (great for processing time-series data!)

  136. 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?)
  137. Features and Speed Tests by marebri · · Score: 1

    Many will be served by reading a features and (speed) bechmarking report that I read a while ago from here: http://www.scientificweb.de/ncrunch/ncrunch4.pdf I have been playing around with Mathematica for quite a while, so by the time I read the report I was well aware that it provides lots of features and is great for symbolic work, and the former is borne out by this report. To me, the big surprise in the report (if you believe it) is that for number crunching work, Mathematica is bested by almost all the other packages analysed here (Gauss, Maple, Matlab, MuPAD, O-Matrix, Ox, Scilab, S-Plus). That said, I know that Mathematica has a protocol (Mathlink) that allows you to interface with your C/C++ code on most systems. This could greatly improve performance when used to implement, say, inner loops. That way, you can get a little of the best in both worlds. I am not familiar with other QPEs (Quantitative Prog. Environments) but I assume that they have similar interfacing capabilities.

  138. Kickin it Old School by cybercuzco · · Score: 1

    Im a grad student in Aerospace engineering, and I frequently have to solve Computational Fluid Dynamics problems. I typically use three programs. For solving symbolic equations, i use Mathematica, For plotting and post processing I typically use Matlab, and for the actual calculations, I use Fortran 77. Fortran sucks for plotting stuff, and it cant do symbolic calculation. Matlab rocks at plotting, but is slow in the calculation department. It has limited symbolic calculation ability. Mathematica tends to be cumbersome in plotting numerical stuff, but it rocks at solving symbolic problems.

    --

  139. ...and that's why I learned C by Maelikai · · Score: 1

    I spent a summer at the University of Missouri, Columbia working at the research reactor there. I remember my shock upon learning that all the code was in fortran, my only previous exposure to it have been from the jargon file. One of my jobs was to write code to control a sample changer (or rather to invoke the code for the sample changer and keep the samples w/the data), and they suggested that I write it in fortran.

    That just felt so wrong.

    So I talked to the staff programmer there and asked if I should take a fortran class. Lucky for me he pointed me at C instead...

  140. What we use here by IWannaBeAnAC · · Score: 1

    This is what we use here:

    Most non-numerical people use matlab, maple or mathematica when they want to solve a relatively simple problem. For bigger problems, in my experience it is easier and faster to just write (or get someone else to write) a C or C++ or Fortran program to do it, rather than use higher level tools, * unless the problem can be expressed particularly simply in mathematica and not in a general purpose programming language. I've only ever met one person who attempted running a mathematica problem on a supercomputer (although I know that people do this all the time): he basically ended up as an alcoholic dropout.

    Only the old guys use Fortran.

    Only misguided (IMO) people use C for anything big.

    Libraries: I use GMP, BLAS (usually in the form of ATLAS), LAPACK, ARPACK, MPI, pthreads (OpenMP is usually a better choice, and nowdays has pretty good compiler support - unfortunately I wrote my main codes a couple of years to early). All of these are solid, reliable and fast. GSL looks good but I havn't used it.

    Note though that none of the previous are actually C++ libraries. ARPACK++ is crap, most C++ linear algebra libraries are crap, the C++ bindings for MPI are crap, pretty much all existing scientific libraries in C++ are crap. However, some recent libraries have potential, such as the stuff on boost.org (eg, uBLAS), maybe MTL will end up being good but the existing release is not IMHO. Blitz++ is good, but the transition away from a single-developer project has been long, AFAICT it is still basically unmaintained. Pooma appears to be really solid and usable, but I've never gone beyond reading some of the web tutorials.

    But, I practically never use a non-C++ library 'raw', I always put at least a minimal C++ wrapper. With careful use of templates, you can get some pretty nice looking (and efficient) code. This is especially important for Fortran. Apart from needing platform-dependent hacks to actually call Fortran functions, I havn't yet seen a Fortran interface that I actually like. Too many parameters, obscure, historical conventions, the dreaded "reverse communication interface" etc etc.

    I also use xmgrace, recently figured out how to script it and that is a very powerful tool. I use Gnuplot for 3d plots, but I havn't really figured out how to work it yet.

    I also use Perl a bit, but mostly for job control sort of things (copying files across before the start of an MPI calculation, submitting jobs to the queue, etc).

  141. 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.

  142. This question comes up all the time by sstory · · Score: 1

    And all over the place. There's really no comprehensive, encyclopedic analysis of the various packages and libraries. I wish someone with the time would do such a thing. I use Matlab and Mathematica, and for animations Maple or MathCAD, I have a fair understanding of math and software, and I still consider myself uninformed on the question.

  143. use Math::Pari; by msouth · · Score: 1

    Way back when Math::MatrixReal 's author was hard to find and I was submitting a patch as an exension because of that, Ilya Zakharevich pointed me to this:

    http://www.cpan.org/modules/by-module/CPAN/ILYAZ /M ath-Pari-2.010201.readme

    I don't know anything about the PARI library, but google can correct that for you if you are interested in treatment. I'm just living with the ignorance.

    --
    Liberty uber alles.
  144. 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.
  145. Re:platform-optimized BLAS by fizbin · · Score: 1

    There's always atlas, an open source platform-optimized linear algebra library with a BLAS interface.

    And just because it came up in a different slashdot thread recently, I'll plug the debian packages for atlas, which are the perfect tool if your target platform is a heterogeneous x86 cluster. (Well, ok, it helps if the cluster is a bunch of Debian machines)

  146. right tool for the right job by broter · · Score: 1
    ...it all depends no what you're doing. For a lot of applied math (read as: PDE, linear algebra intensive, etc.) there's a lot of optimizations that are best done in code.

    At UCLA's math department, the applied people have a QUIST related research program that uses Fortran77 and shell scripts, and C++ for various parts of their code to implement the Level-Set method to simulate the growth of thin films (atom by atom construction of electronic devices). The language choice seems to be due to legacy reasons: the grad student that started it so long ago used it, and the code has continued to grow ever since(ie. legacy reasons).

    Although I wouldn't call it *math* research, here at MBI, bioinformatics programs run on the cluster *seem* to be written in C or C++ for the most part. I thinks it's more of the former because that's the interface for a number of bioinformatics libraries that we have licenced. Also, these things tend to be mixed heavily with shell and perl scripts; so the language is only for ease of integration with support libraries.

    For most all of my undergrad work, I saw everyone use matlab, mathimatica, and their relatives for their work. In grad school, it seems to depend more on the class and the religious leanings of the mathematician involved.

    There's a class on scientific computing that uses VC++ with fortran libraries from netlib (leveraged by f2c) solve some math implementation problem (tends to vary from year to year). Prof Anderson tends to by a junkyard warrior when it comes to math code generation. But then he's the mathematician's MacGuyver. (side note: Prof Anderson is a wonderful teacher and researcher - check out his page for some handy software tools and papers. Also, look at 270B for tidbits of linear algebra optimizations).

    The benifit of matlab-ish programs is that you can usually implement your math structure quickly. The down side is that if you want to use any advance optimization then it near impossible. On the other hand, if you don't have a numerical analysis background, then many of the things you try to do to optimize your code in more mundane languages are probably going to be *much* slower then matlab, et al.

    All of this is assuming you'r doing numerical analysis. If you're interested in abstract algebra , then I think you're stuck with maple. good program, but I don't have a review on it since I did most of my work by pencil and paper. I did use it for one of my crypto classes and found its implementation of Z_n groups very nice... although I ended up just coding it in C++ anyway :)

    Also, check out the R project as it is GNU matlab.

    --
    "One man can change the world with a bullet in the right place."
    - Mick Travis, "If..."
  147. Mathcad and related matters by gjm11 · · Score: 1

    I do industrial R&D, and get to call myself a mathematician. The main commercial package I use is Mathcad; not because I'm particularly fond of it, but because other people I work with use it.

    I find Mathcad strange. At first glance, it sounds as if its user interface ought to be just about perfect: you have an infinite canvas on which you can put text and formulae and so on, and it will leave the text alone and do what you ask it to with the mathematics. Cool. But ... somehow it doesn't work out so well.

    • Its symbolic capabilities are really rather weak. There are allegedly bits of Maple inside, but Mathcad is much less capable than Maple is. Any non-trivial symbolic operation is likely to (1) be slow and (2) report its results in some horribly anti-simplified form.
    • There are some programming facilities. They are truly awful. There's no way to include comments: the best you can do is to scatter bits of text around in the vicinity of the program and hope you always remember to move them when the program moves. The programming facilities themselves are woeful: if/then/else, loop over a predefined set of values, and, um, actually not much beyond that. Debugging is agonizing. At night, weasels come and eat your keyboard.
    • Editing hurts. The formula editor is better than Microsoft's, but that's not much of an accomplishment.
    • There are a bunch of little redraw bugs -- these do get better from release to release, though. The sort of thing I mean is: you display a big array, and it shows it in a little box with scrollbars, and then when you scroll some things change in width and suddenly you're not dragging the scrollbar any more because it's moved. Yow.
    • The only data structure is the array. Arrays have 0, 1 or 2 dimensions. The end. (Well: there are strings. And you can nest arrays inside other arrays. But nothing like C's structs; no associative arrays; nothing, in short, that really takes you out of the realm of big piles of numbers.)

    All that said, Mathcad is actually quite neat; when I have something to do that's basically about manipulating fairly small arrays, it's my tool of choice.

    I don't do enough symbolic work to need Mathematica or Maple; my prejudices favour Maple over Mathematica, but they were formed quite a long time ago now and probably Mathematica has improved a lot since then.

    For the rest: C++ and Python, with occasional smatterings of Common Lisp when my boss isn't watching. (One free Common Lisp implementation, CLISP, offers arbitrary-precision floating-point numbers. This is useful for diagnosing precision-loss problems.)

  148. 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.

  149. Maple is excellent by MarvinMouse · · Score: 1

    I have used Mathematica, Maple and Matlab, and I can state that my favourite is Maple.

    Maple is an excellent tool for doing almost anything. It's also Canadian, so that's a small plus for me as well. (I am Canadian)

    Mathematica is at par or a notch better than Maple, but the "Canadian" nature of Maple, plus the fact that more people I know use Maple so there is more help available pushes Maple above Mathematica (For now.)

    I personally just found Matlab to be incredibly frustrating to use. I didn't like the interface at all, and I found it was way too slow, unlike Maple and Mathematica, whose interfaces are fast, clean, and smooth.

    --
    ~ kjrose
  150. Magma? by nihilogos · · Score: 1

    All it has in common with the other 3 is that it starts with "Ma", I doubt most people have even heard of it.

    Having said that it is an absolutely amazing piece of software for 'experiments' in pure mathematics. Group theory, Lie Theory, Algebraic geometry, number theory. I love it.

    --
    :wq
    1. Re:Magma? by RackinFrackin · · Score: 1

      Group theory, Lie Theory, Algebraic geometry, number theory.

      Magma is also terrific for working with permutation groups and incidence structures.

  151. Matlab clone on Palm by Anonymous Coward · · Score: 0

    Don't forget LyME, a free Matlab clone for Palm,
    which has just been updated. See
    http://www.calerga.com

  152. 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.

  153. Chemometric and Data Analysis by DrRobert · · Score: 1

    I do chemometric analysis of spectroscopic data. When developing the algorithms I use Mathematica without fail; it is the most complete math program as it will do anything mathematical both symbolic and numerical. When I move to routine analysis I generally transfer the algorithm to matlab, but with the new, faster version of numerics in Mathematica that may no longer be necessary. When I move to very large scale theoretical problems, I port the mathematica code to C and call the standard LAPACK type routines. If I could have only one it would be Mathematica because it can do anything and they are improving the numerical speed.

  154. root.cern.ch...and many others by fiiz · · Score: 1

    Well,

    It's not so simple.

    As far as math packages go, matlab and mathematica are the most powerful; but they are very different.
    Mathematica is by far the best for pure maths work (the only one real mathematicians accept--it can be slow compared to others but it does real algebra), whereas matlab has more in terms of data analysis, visualisation etc.
    Maple is nice and easy to learn, but somewhat less specialised, and I see very nice thing being done in python, as remarked in earlier posts.

    In particle physics, one useful data analysis package we have is root , which is basically a collection of C++ classes and a command-line c++ interpreter, very neat, very scaleable (works with our *huge* datasets)...

    But on the whole I have found that we end up using a *lot* of different languages:
    --you write your large projects in C/C++, and that's what the particle physics community is trying to standardise on
    --interface with someone else's older code that's in fortran (a lot of it has not been ported yet.)
    --you script things in python and shell, so you can run all of it in a sequence
    --on a personal level, many people then use mathematica for the mathematical work (it's really unequalled when you want proper solutions.)
    --you also find quite a few people writing frontends in java these days...

    --

    yours ever, fz.
  155. This was recently asked... by cougartoo · · Score: 1

    The question "Mathematica vs. Matlab" was recently asked of Slashdot. The conversation was not very far-reaching but there's some good information in there.

  156. geometric ignorance by foog · · Score: 1

    There is a class of geometric construction problems that are impossible with a divider (compass) and straight edge. Basically, if you can do it with a compass and straight edge, you can do it with Euclid's axioms, so this kind of construction is a sort of analog approach to symbolic proofs.

    One of these problems is trisecting an angle, that is, dividing an angle into three equal angles. The picture you just posted has nothing to do with this problem.

    Another is "squaring a circle", that is, constructing a square that has the same area as a given circle.

    People have wasted their lives trying to do these things.

    Here's a link for the curious.
    Squaring the Circle

  157. 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.

  158. Mathematica for numerics review by em.a18 · · Score: 1

    I wrote a book chapter that talks about using Mathematics for creating interactive signal processing documents. It's online at http://rvl4.ecn.purdue.edu/~malcolm/apple/inter_si gnal.pdf.

    I also compare Mathematica to other tools.

    - Malcolm
    P.S. I still use Mathematica for derivations and documentation and Matlab for actual numerical work.

  159. Axiom by timdaly · · Score: 1

    Axiom, a general purpose computer algebra system, which used to be commercially available, has been released as open source. It is in the process of cleanup and will be available in the near future.

  160. Personal Experience by Stranger4U · · Score: 1

    It seems to be my experience that which math package you use depends partially on the task at hand and partial on the field you're in. For example:
    Most physicists I know use and love MATLAB because it works with numbers (rather than symbols) and because of it's ability with arrays.
    Mathematicians, on the other hand, really love MAPLE because it can handle some of the symbolic math.
    Now, in astrophysics/astronomy, the tendency is either for IRAF (free software from the NOAO) or IDL (which, to me, smacks highly of MATLAB) because of their inherant image processing abilities.
    Finally, I know a professor who loves Mathematica because of it's versatility. It might not be great at everything, but it's good at lots of things.

  161. good and free by wufwuf · · Score: 1

    Almost 9 years ago as an intern as NASA Ames, I wrote a Common Lisp program that used REDUCE (written in some other dialiect of Lisp) to make algebraic manipulations; it called LinPACK (Fortran) to solve linear equations; it also generated and compiled Fortran code to interface with ODEPack and CMLIB. The numerical libraries are very robust and highly optimized. Some of them are individually optimized for each architecture: processor, cache size, etc. Matlab is based on public domain code. Mathematica and Maple always have problems mainly because hard math problems for people are even harder for computers. In general, packaged commercial programs are good for scripting and experimenting with small problems. But when you are ready to attempt a very large problem, you will have to use and even hack LAPACK, etc. to suit your needs. Every piece of software has its limitations. The real gotcha is that if you don't understand the math, the algorithms and the math co-procesor, you won't be able to determine the correct program to use and the accuracy of the results that you get.

  162. Yes, what about libraries? by Anonymous Coward · · Score: 0

    I'm very interested in what you're saying in the post about multidimensional optimizers, because I do lots of statistics work, and have been recently trying to decide whether or not to write a program in C++.

    I was assuming that I'd have to write my own minimization routines, but you bring up an interesting alternative.

    I've never really looked much for general-purpose open source multidimensional optimizers. They must be out there, though.

    A quick thought--I believe that the R language has a multidimensional optimizer. Of course, you might not want to do whatever you do directly in R, but R is open source, and you might be able to find the code somewhere.

    Not particularly helpful, I know.

    Does anyone else know of any good libraries for C/C++ or Java? So far the discussion has focused mostly on Maxima/Maple/Mathematica/Matlab.

  163. Sysquake by Anonymous Coward · · Score: 0

    I use Sysquake, whose interactive graphics are very helpful in understanding problems. Its language is compatible with Matlab.

  164. Check out MuPad by Anonymous Coward · · Score: 0

    mupad.de

    I haven't used it much at all...but it handles both symbolic and numeric work. I have heard some people say it also handles parallel computation pretty well. It is free for use in academic research.

  165. Simply Put by Anonymous Coward · · Score: 0
    The following factors should determine the appropriate solution:
    • the type of problem
    • your skills, experience
    • required accuracy
    • one-time, versus repeated/production application
    • computational complexity, hardware, time
    • reproducibility
    Mathematica

    Great for symbolic algebra, symbolic integration, symbolic differentiation, symbolic linear algebra, nice looking reports, symbolic figures. Physicists, mathematicians.

    Matlab

    Matrix/Vector-based: hence good for data-analysis, signal processing, numerical linear algebra, numerical visualization, experimental image processing. Interpreted (though compilation possible), hence good for prototyping, slow for large data sets or repetitive computation. Most recent version is Java-based, which is nice because you can actually incorporate Java objects in your Matlab code, but it's a bit big in the memory department. Cheap ($100) student version available. Used by electrical engineers, aero/astro engineers, occasionally physicists.

    Fortran

    As opposed to the previous two, this is a language, not a program. Been around for a long time, hence used by many established researchers. Very fast for numerical applications. Actually faster than C in most cases, due to the highly-optimized FORTRAN compilers. While it is possible to achieve higher performance by coding in C, for a given computation and given time spent coding, FORTRAN will be less prone to bugs, faster, less lines of code. Many, many "recipes" exists for standard FORTRAN tasks. Used by physicists, mathematicians, applied physisicists, environmental engineers, structural engineers. Good partner for GNUPlot. Compilers are standard on almost all *nix installations, and starting is easy because that's all you need: no headers, includes, etc for most tasks.

    C

    More overhead than FORTRAN for same goal. "Closer to machine", i.e. can be faster if coded correctly, but also more prone to bugs. Compilers not as good as FORTRAN compilers, for numerical code, hence in practice slower than FORTRAN. Good if you also need to interface with hardware (i.e. data collection). Interacts well with other tools, for plotting and more.

    FORTH

    Great for symbolic math. Just kidding.

    Personally I've used Mathematica for problem sets, Matlab for one-off/experimental/proof-of-concept geometric analysis of architectural models, Matlab for GPS-data analysis, Matlab and Java for database-based GPS prototype coding, Fortran and C with GNUPlot for Quantum Mechanics research. A friend of mine wrote one of the premier high-end structural engineering finite-element packages, entirely in FORTRAN. It's simply the fastest option for numerical computation. Caveat: as others have noted, the options may be entirely different if you're looking at specialized or old hardware.
  166. Pragmatism: anything that gets the job done by Curl+E · · Score: 1

    Where I work (an environmental science organisation) the emphasis is on getting the job done, whichever tool is approiate for the job, or whichever tool is familiar to the scientist gets used. (I'm not saying that this is necessarily the best policy, just what happens here.)

    There are a range of programming competancies from people who take code written by someone else that they have always used and feed data through it black-box style, through to scientists who write their own F90 or C++ code with MPI and BLAS libraries for running on the HPC clusters.

    We have OpenDX, Matlab, octave, IDL, Statistica, S, SPlus, R. Programming in F90, F77, C++, C, Perl, Python. The platforms include Windows*, Linux, FreeBSD, Solaris, Tru64. Some instrument makers use labview. You name it, someone here will be using it somewhere.

    Quite often one person will develop using a particular package, then anyone s/he collaborates with will have to use the same package to read the files or run the programs.

    I've been mucking about with python and Vtk.

    --
    Backups are for wimps. Real men post their data in comments and have slashdot mirror it
  167. 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!!
    1. Re:For Statistics by namespan · · Score: 1

      Is R comparable to SAS or Stata?

      --
      Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
    2. Re:For Statistics by EnlightenedDuck · · Score: 1

      I've never heard of Stata, so I can't compare. SAS is another standard package - its used more in industry than academia. I've never used it, so I can't compare to R...but most of the methods I read about are implemented in R much quicker than in SAS or MATLAB

      --
      Quack!Quack!.....QUACK!!
    3. Re:For Statistics by StarOwl · · Score: 1
      I've used both SAS and R for statistical/actuarial work in the insurance industry. I've found R to be a little easier/more flexible to work with when dealing with smaller data sets, but SAS is what I turn to when I need to crunch on multi-gigabyte datasets.

      I'd love SAS to death if it weren't for the licensing expense. I keep wishing for an Open Source SAS-clone....

      Elsewhere in this thread, someone sings the praises of APL. APL is God, but sadly, it's a dead God whose language hardly anyone speaks anymore. I'd love to learn more APL, but I've had a horrible time finding good documentation...or even a recent set of keyboard-stickies with the fun APL character set. ;)

    4. Re:For Statistics by EnlightenedDuck · · Score: 1

      Thanks for the feedback - makes me feel better sticking to R when my datasets can always fit on a CD with plenty of room to spare:)

      --
      Quack!Quack!.....QUACK!!
    5. Re:For Statistics by openstat · · Score: 1

      R (http://www.r-project.org) implements the open-source version of the S language on which the commercial system S-Plus is based. R is more similar to Stata than to SAS, but is still very different from Stata. R is object oriented, and like Stata, holds all data in memory. Newer features in R can allow special block processing functions to be used to process large datasets in chunks. Except for non-graphical analysis of massive datasets (the only application in which SAS excels), open source R is the best statistical analysis and graphics package available today. It is also strong in linear algebra.

  168. The language J by acoustiq · · Score: 1

    No, not java. J "is a modern, array oriented, high level, high performance, general purpose programming language. J is used in a variety of industries including banking, investment analysis, insurance, derivative trading, scientific research, and education." It's available for Windows, Unix (including OS X), and PocketPC. J has many built-in functions perfect for mathematics work. There are also several free books available for download to help learn it. You'd especially want to read the excellent "J for C Programmers," to become familiar with the J way of thought (it's most likely completely different than what you're used to!).

    --

    --
    I romp with joy in the bookish dark
  169. CERN Colt by Anonymous Coward · · Score: 0

    I use CERN's Colt library for java math stuff every now and then. It's pretty easy to figure out, assuming you know what you're after.

  170. Interval Methods / GrafEq by Anonymous Coward · · Score: 0

    Interval methods automatically track all floating-point "errors". See GrafEq for an example graphing package that uses intervals: it doesn't produce incorrect graphs, even for tricky equations. (Not the case with Mathematica, Maple, etc.! They do give incorrect graphs on many simple equations.) See his siggraph paper.

  171. 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.
  172. FORTRAN by sazim · · Score: 1

    As an environmental modeller (atmospheric chemistry) I tend to use FORTRAN90 for almost all major number-crunching routines (both modelling and data analysis). As I have been using F90 for quite some time, I have a decent library of my own functions and routines (like most programmers I imagine), some of which emulate things that C does much better, like string manipulation. I have found that coding in standard FORTRAN seems to be more portable across platforms than C/C++ (MSWindows, IRIX, AIX) with very little debugging or re-validation, although this is *possibly* due to me being less familiar with the latter.

    I use a scientific spreadsheet program (Microcal Origin) to visualise the data or to perform small-scale post-processing, as it has a very decent scripting language (LabTalk - which is very similar to C) and v7 also allows actual C. I am told by colleagues that MATLAB is also excellent for this purpose (post-processing of data).

    --
    "Those who don't believe in magic will never find it." - Roald Dahl
  173. Mathematica vs. Matlab? by HarmonicSoftware · · Score: 1

    You might also look at O-Matrix, (www.omatrix.com). Much faster and less expensive than those you mentioned.

  174. For fast math work. . . by stevarooski · · Score: 1

    . . .on an intel machine, nothing beats intel's Math Kernel Libraries. You can get a free trial version off the intel website (link here). The syntax can be somewhat cryptic, but the 1000+ page manual is very nice and they are BLAZING fast for matrix and vector operations.

    However, for quick alogorithm prototyping, matlab is the tool of choice around these parts. :) I've also done some of that in python.

    --

    - - - - - - - -
    Don't worry, being eaten by a crocodile is just like going to sleep in a giant blender.
  175. use both by habit+forming · · Score: 1

    While doing my thesis a friend of mine and I used maple to generate C that we compiled into a .so that was then used by a custom app. best of both worlds.

    --habit

  176. Re:Octave (useless bragging) by CanadaDave · · Score: 1

    Are you serious??!!! That's awesome! How fast does it run? I mean I know how fast the processor is roughly, but when it comes down to actually doing a calculation, is it noticeably slow? I have an HP-48G and it is brutally slow at doing some of the most simple things, and my Palm is also slow when handling large databases. The Zaurus has more juice of course, but is it enough?

  177. Excel by akgoel · · Score: 1

    Excel rocks (more so than your favorite OSS spreadsheet). It really is some good stuff for analyzing numbers.

  178. wow, I'm out of date by foog · · Score: 1

    atlas looks seriously cool. thanks.

  179. I use CLN by James+Youngman · · Score: 1
    For arbitrary-precision computation, I use Bruno Haible's excellent CLN library. This is an extremely flexible and elegant library for doing various types of arbitrary precision computation (you can increase the precision as you go, which greatly improves the performance of algorithms like root polishing).

    CLN is truly impressive. I remember reading that it switches from one multiplication algorithm to another once you get past 10,000 digits!

    The Debian project page for CLN is here

  180. Use Emacs for symbolic math! by HuguesT · · Score: 1

    Don't use Mathematica, unless you want to actively sponsor stupendously annoying genius boy Wolfram to convice everybody he is the re-incarnation of Euclid, Newton and Einstein all in the one body.

    Do what every good free software person does: use Emacs for everything, in this case symbolic or numerical math.

    Try this:

    M-x calc

    (now you are in command of an RPN calculator)

    M-x describe-mode

    (for some very basic help)

    m s

    (now you are in symbolic mode)

    (x+1) RETURN
    Q
    (i.e: shift+q)

    result is:

    1: sqrt(x + 1)

    you just have defined the function x -> sqrt(X+1)

    now type:

    a i

    Emacs asks you the integration variable, answer

    x

    result is:

    2:3 (x + 1)^3:2

    Type d B to get a nicer display:


    2
    - (x + 1)^(3/2)
    3


    Which is the primitive of sqrt(1+x).

    Nice uh?

    1. Re:Use Emacs for symbolic math! by RGRistroph · · Score: 1

      I just bookmarked this post. I presume there is a collection of similar little tutorials somewhere, or should we be writing it ?

    2. Re:Use Emacs for symbolic math! by HuguesT · · Score: 1

      Hi,

      There is a manual for the Emacs calc mode with a little tutorial, but I don't find the manual very good. You have to experiment.

      Calc started as a hack but it's really useful.

  181. Mathematica (and a word on IDL) by reddish · · Score: 1

    I would recommend Mathematica for any serious work. It has (is) a beatiful functional language that allows you to express problems very consisely. This contrast greatly to most other math programs I have used, where you can often still smell the Fortran-66 legacy, or have much less expressive power (i.e., Maple, which has an imperative Algol/Pascal-like core language).

    On top of that, Mathematica has probably the best GUI I've ever seen in any program; with some practice and twiddling of settings you can produce high-quality mathematical documents that get close to (La)TeX typesetting. Furthermore, the amount of mathematical knowledge and algorithms that it contains is quite formidable (about on-par with Maple, I'd say).

    One other language you might consider is IDL (http://www.rsinc.com). Just mentioning it, since I didn't see any posts (and I have been doing a lot of work-related programming for it lately). It's in the same class as Matlab/Octave/Scilab, i.e., it does numerical computations pretty well but cannot do symbolic computation. It's quite big in astronomy and earth observation, but I suspect that has more to do with community inertia than the product's merits.

  182. IMSL libraries by pao93 · · Score: 1


    I have used the IMSL libraries extensively in the past (only the fortran ones though). They are very efficient, fast, and easy to interface with and stick into your code. These libraries are quite robust as well, having been developed over a couple of decades. As a matter of fact, the original versions of IMSL included all the source code! Sadly, I don't think that is the case anymore....

    Recently I switched to a new company and was unable to use IMSL, and had to scour archives looking for routines that would do the same thing. I finally found what I was looking for, but it took ages and was a bit cludgy. IMSL is definetly worth the money if you can afford it!

    c

  183. Re:Octave (useless bragging) by Mac+Degger · · Score: 1

    And for those of you who use a PalmOS device, try CplxCal and MatrixCal. That'll sort you for the kind of engineering problems you're going to do on a palmtop, anyway.

    --
    -- Waht? Tehr's a preveiw buottn?
  184. MATLAB vs. Maple by Anonymous Coward · · Score: 0

    I use MATLAB, because maple is a sub language of sorts within MATLAB. Lots of mathmaticians like Maple, because it is written for them, but MATLAB does everything that Maple does plus a lot more. To me, Maple just doesn't cut it.

  185. MathCad and C++ by kravlor · · Score: 1

    My research is in atomic physics, and the data analysis routines we currently use are written in MathCad worksheets. While MathCad is great at (and easily readable for) simple integrals or sigma-summations, it gets very slow and incredibly difficult to read.

    So difficult, in fact, that this past summer, one of our team members started hard-coding some of our more commonly used custom MathCad routines in C++ and compiling them into .dll files. This offered significant improvements in performance, between thirty and seventy percent increases in speed. Despite that, due to the vast amounts of data we need to analyze, it just isn't enough.

    The real reason we had switched to MathCad in the first place was because some of our old C++ programs had become antiquated and we were shifting from UNIX-based to Windows-based machines; the ease of programming in MathCad won out over the performance gains of hard-coding. Now, that decision is beginning to haunt our research group, and I will be working on a new data analysis program, written from scratch, in C++.

    The point is, for some applications, speed is essential. Case in point: with our old applications, a typical fit of data would require around 10 seconds on a 486. With our MathCad versions, it takes anywhere from 20 minutes to two hours, depending on the machines (currently Pentium 4 boxes)!

  186. Mathematical Software by Solaristrum · · Score: 1

    As a former mathematician I can state that I have used nearly all the packages listed in the question. Why did I use all of them? Because each one is better at doing one thing rather than another.


    Want to make some pretty pictures or symbolic computations, use Mathematica. Want to take those pictures/graphs and rotate or manipulate them in real time (or Canada), use Maple (it originated in Canada and has an academic pentration there different from Mathematica). Want to do computationally intensive matrix work to arbitrary precision, use Matlab. Want more numerical control and flexibility to define adaptive grids or meshes, then write your own C++ or Fortran code and exploit the LAPACK libraries (hundreds of contributing mathematicians can't all be wrong!). Want to do complex polynomial manipulations over abritrary rings (you know who are) then use Singular.


    It is just like fixing your car or doing any other chore: pick the tool that suits the job best. There is no universal tool that replace an entire tool box no matter what that lunatic Steve Wolfram says.

    --
    Solaristrum: One who has spent way too long staring at the Sun
  187. Mathematica and C++ by Anonymous Coward · · Score: 0

    I'm a theoretical physicist turned Wall street quant. I LOVE high level languages and have used lots of them over the years. The paradigm I have settled into is --

    Mathematica for concept development, analysis, visualization, documentation and, of course, anything requiring symbolic manipulation.

    The notebook feature is especially powerful. I now have thousands of notebooks with derivations, key formulae, past analyses, etc. I can do a system's level search on a keyword and pull up relevant work from years ago that I had completely forgotten. And that work is immediately reproducible and extendible!

    C++ for compute intensive tasks and objects:

    Speed is a point here but the real gain is object orientation. After you have built up classes for your general areas of interest, the construction of code for a particular task is very easy.

    I generate numerical results in C++ and ship them to Mathematica for analysis via files. More sophisticated modes of interaction are possible but -- for me -- not worth the overhead.

    As Feynman said -- it's the pleasure of finding things out.

    tom.gladd@citigroup.com

  188. Math packages in Research by Anonymous Coward · · Score: 0

    When doing research in Physics, I used IDL, mostly on SGIs, which was quite nice. I searched a lot for free equivalents and found PerlDL (though haven't used it much) and GNUdl (again, didn't try it out seriously. I think it's gone...). I also tought Matbab but didn't use it much. Colleagues also used Mathematica a lot, the NAG Fortran library, their own C/C++ code, Numerical Recipes in C, and a bit of MAPLE and MathCAD (which is very nice!). For statistics, use R (cran.r-project.org) - it's very powerful. Octave is also a great replacement for Matlab. Above all, I found the most useful tool to be pen an paper (highly recommended). My father used a "slide rule". I think a long time ago people used a package called "an abacus". Anyway, best of luck!

  189. Re:Octave (useless bragging) by theLOUDroom · · Score: 1

    It actually runs quite well. It's totally usable, although I haven't tried to do anything with really large matrices yet.

    The Zaurus SL-5500 that I have has a 206MHz ARM processor, which is basically an order of magnitude faster than that inside a graphing calculator/older palm device. The Zaurus coming out soon (SL-5600) will have a 400Mhz Xscale processor.
    The HP48G runs at 4MHz and has a 4-bit datapath. I imagine it is pretty slow. My TI-89 isn't very fast either. I think it runs at around 12MHz.

    As far as a real benchmark goes, post an m-file and I'll tell you how fast it runs.

    --
    Life is too short to proofread.
  190. 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.

  191. lots of software by gimpboy · · Score: 1

    i'm a chemical engineer, and i'm working on a phd in a process control research group. as a result there is alot of process simulation and optimization. for the simulation stuff we use matlab exclusively. i would rather use octave, but my boss makes this decision. for solving lp and milp's we use cplex from ilog. i'm looking into gams right now for minlp stuff.

    --
    -- john
  192. Statistics, was: age-old answer: it depends by Wile+E.+Heresiarch · · Score: 1
    For statistical analysis, my advice is to go for R (GPL implementation of S, see www.r-project.org), or S+ (the commercial implementation of S). R has functionality equivalent to S+ and it's GPL. There are a lot of S language scripts to be found on the web, e.g., StatLib. Both R & S+ have very active user communities.

    Especially if you're doing policy analysis (i.e., you're not data mining a 10 million record database) R is a great environment to work in. Hmm, it might be possible to process 10 million record databases with R, I just haven't tried it.

    R has more or less equivalent functionality to Octave, but the programming language (S) is more interesting, and plotting functions are more sophisticated. For matrix operations, both R and Octave use BLAS.

    My advice is to stay away from SAS and SPSS. These two were invented back when "everybody knows using a computer is hard". Both have GUI interfaces now, but that's just an attempt to hide the essential ugliness of their command languages. If you must use a commercial product then S+ is my recommendation.

    Good luck & have fun!

  193. Re:Numerical Recipes by Ambush_Bug · · Score: 1

    That's a little harsh...

    I read the review and mainly the criticism is that the books don't necessarily use the latest methods. Bill Press (one of the authors of NR) is an astronomer by trade and actually wrote the book/code in Fortran originally back in 1986. The second edition came out in the early '90s ... it is now 2003. So yeah, if you want the latest stuff, this isn't it. That being said,
    if you're trying to develop something quickly and you don't mind trading execution time for development time, it's still okay for some applications. I don't know if I would say you were incompetent for using it, as I would say maybe you have a bad habit.

    I personally had never heard of NetLib myself before this, so pardon my ignorance...

  194. Or even better yet... by Anonymous Coward · · Score: 0
    1. Re:Or even better yet... by exp(pi*sqrt(163)) · · Score: 1

      Haskell is pure (which fits well with mathematicians' ideas of what a function should do) and good at lazy evaluation (so mathematicians can work with infinite sequences as easily as with finite sequences). And things like monads should appeal to mathematicians.

      --
      Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  195. C++ Statistics by kharchenko · · Score: 1

    Is there a good C++ (or even C) statistics library around ? I've looked for a day or so, and the closest thing I could find was GNU's Goose, wich failed to impress me after I spent an hour getting it to compile on rh8.
    I was also hoping to use R library, but they dont' really provide much aside from the interpreter call.

  196. Re:I still have to do the TPS reports after all*si by Anonymous Coward · · Score: 0

    Can explain how you do "package analysis"
    maybe someone can point you in the direction
    of usefull software.

  197. Try out J by Anonymous Coward · · Score: 0

    You guys should try out J from jsoftware.com ...

    It was created by Eric Iverson, son of Ken Iverson who wrote APL. :D

  198. Heh you suckers really fell for my troll. by Anonymous Coward · · Score: 0

    Still where I live you'd get strange looks if you referred to maths as math. The same goes for talking about sidewalks when you see some footpaths.

    Relax.

  199. Matlab + Java by Anonymous Coward · · Score: 0

    A nice combination is Matlab + Java. Current Matlab includes a builtin matlab VM (all the UI is in java), allowing matlab code and java to interoperate almost completely transparently. Considering that Java is moving up to C speeds it offers a great way to easily add high speed code to matlab as needed, with a relatively high level language like Java. Also check out Java Numerics page

  200. Re:Numerical Recipes by foog · · Score: 1

    I guess you skipped all the testimonials in that article.

    It's been easy to find devastating critiques of Numerical Recipes for about as long as there have been search engines, and hell, I remember seeing flameage about it on Usenet back when it was new.

    It's also real easy to get bitten by NR when you're green and someone who should know better shoves a copy at you and tells you to go code something. I suppose that's not incompetence on the victim's part, strictly speaking.

    I'd tell my favorite NR-correlated-with-incompetence horror story here but it is completely unrelated to the point I'm making.

    NR is fine for a lot of things, and it's not bad for a survey text (it's very accessible), but if you actually use the code in it, be sure that it is more important that your results are plausible than that they are correct. That's a tradeoff a lot of people make all the time...

  201. +1, Informative by namespan · · Score: 1

    Thanks much. I assume S+ is the same package that's often referred to as SPLUS or S-PLUS? Either way, R sounds interesting, and I'll be happy to try it out!

    --
    Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
  202. Try Euler by Anonymous Coward · · Score: 0

    because its a fairly decent Maple replacement.

    There is a windows version (by the original author), I believe a command line version, and a gtk+ port that is fairly decent.

    I use Euler for my circuits class. I wrote a "Euler function" that reduces a matric into RREF form. Comes REALLY in handy for when the h/w is due the next day and I want to check of my mesh equations are correct :)

  203. :Mathcad doesn't BUG me by ishmaelflood · · Score: 1

    I've used various versions since version 1, and the one thing it hasn't been is buggy. Irritating, yes. Inconsistent, occasionally. Buggy, no.

    There are bugs, obviously, but most have work arounds, and I've never been stopped dead by one.

    As a general purpose mathematical program for use by engineers (note emphasis) that non-users can understand (ie as a COMMUNICATION TOOL) it is unparalleled.

  204. Elec Eng by Anonymous Coward · · Score: 0

    I've a PhD in electronic engineering, and we mostly used MATLAB for quickly prototyping simulations. It was also quite widely used in industrial labs I have worked in.

    It's fairly easy to write your own modules and C and link them in as .mex files also (mostly used to have to do this as MATLAB runs dog slow for some of the calculations I had to do, but you can also use it as a check against your own implementations.)

  205. It's up to you and your math problem by MoobY · · Score: 1

    Hi,

    I'm a researcher at our bio medical faculty, working on bioinformatics problems. So we're facing all kinds of mathematical problems that need to be solved, in order to get sounder biological results. We use all kinds of thermodynamical simulations, over markov chain analysis and eigenvector determination up to heuristic optimization among many others, many of whose are implemented in a parallel biowulf environment. And for solving each of these problems a different computational approach needs to be designed and worked out.

    When starting on a problem, it's usually our intuition trying to solve and prototype the solution in languages like Matlab. But as soon as these prototypes become slow or otherwise limited, the problem and our strategy to try to solve it is implemented in standard programming language to process our data, such as Python as a steering mechanism for parallel processes, C/C++ for CPU intensive tasks, Mathematica for symbolic problems, and so on.

    I think intuition and experience with all these languages and their pros and cons are fairly important factors in choosing what language you will use for solving a particular problem.

    So I guess there is no simple answer to the question "what language should i use?" You should start using as many distinct as possible, and use the one that you think is most suited for solving this or that problem, just as the choice of language is important in solving any other non-research problem.

    --
    --- Sigmentation Fault - Comments Dumped
  206. Nickle by po8 · · Score: 1

    Nickle is an interesting approach. Strictly numeric, but with arbitrary-precision integers and rationals, settable-precision floating point, convenient numeric I/O, GC, and much more. Plus it's a first-rate desk calculator. It's intended for prototyping numeric algorithms, among other things.

  207. Online Math by Anonymous Coward · · Score: 0

    What else do you need than just Rascal?? Actually that system is a front-end for c/c++ code, making flex, bison-parsers usable for the masses.. :)

  208. Lots of stuff by Anonymous Coward · · Score: 0
    In physics lots of stuff is being used.


    * Maple & Mathematica & Macsyma for algebra stuff and "simple" things.

    * Matlab, Octave, IDL for analysis and plotting.

    * Fortran77 (sic!), Fortran90 and C for coding.
    If e.g. want to find the eigenvalues of a 1G*1G
    sparse matrix.

    * Many libraries is used: blas, lapack, arpack etc
    see: www.netlib.org

    * Parallell programming: MPI, OpenMP and parallell libraries as Scalapack and e.g SGI Scientific Library.

    * Editors: Emacs (of course)

    * Script languages to move data and some analysis stuff: Python, perl, bash , csh.

    * xmgrace is great for 2D plotting.

    * CVS is wildly used.

    * And some cracy hacks as using Fortran to generate
    raw PostScript code.

    It's a jungel and it takes some time to find your way, however it's great fun! Happy hacking!

  209. Pentagons and spheres.Re:Nothing to add here.. by RosCabezas · · Score: 1

    I hope you were not tryng to make a solid with al of its faces being regular pentagons. If Lightwave can do that, it's a much better package than I thought, cause it happens to be impossible.
    If you add a handful of exagons, trouble is much less.

    And you cannot trisect an angle too, with divider and straight ruler. Just numeric solutions for this one

  210. what depressing choices by g4dget · · Score: 1
    Matlab and Mathematica are widely used, but they probably are "worst of breed". Both are based on haphazardly designed languages with flaky implementations. And when you graduate, you'll discover that in the real world, those packages are also hugely expensive.

    Pick up some better tools than that. For numerical stuff, consider Numerical Python. For symbolic math, Maxima is probably still better, although it has a very steep learning curve; but I have rarely found symbolic math program useful at all--usually, a good change of variables makes the derivation simple.

  211. Re:Engineers & Visulisation by Becquerel · · Score: 1

    I'm in civil engineering research and we do most of our stuff (mainly Finite Element Analysis) in Fortran (95) as it provides a nice bridge between the more mathsey Matlab, etc and the more hardcore c++,etc. It does pretty much everything I need it for.

    The trouble with most accademic programming is that once the app is programmed, in whatever language, the results need to be visualised. In Matlab (and nodoubt other similar) Visualisation is relatively straightforward, giving good results quickly and easily. Wheras Fortrans graphics options are very limited and vairly complex, so it is easier to use an external visualiser, like AVS Express, which is very powerful, and makes viewing 3D data a doddle.

    --
    My spelling isn't bad, I'm evolving the language
  212. Yorick by jnikkel · · Score: 1

    Check out:
    ftp://ftp-icf.llnl.gov/pub/Yorick/doc/index. html

    This is an interpreted c-like language
    that we have used in our labs for years.
    There are a number of built in 2-D and
    3-D plotting functions, and it is very
    easy to use it to talk to various
    instruments via the GPIB bus or serial
    ports. It is also straightforward
    to patch the binary (as in one command)
    so that it can call your own compiled
    C code from the interpreter. All in all
    a very nice language and I highly recommend
    it to people that have to interface with
    instruments and do analysis at the same time. ...@/

  213. Magma is the king! by geordsta · · Score: 1

    Dear all, Magma is the most fanstastic program I've ever used. It enforces discipline in your approach to the problem initially which is rewarded later on. I strongly recommend magma as a choice for the up and coming maths programmer -- it will reward you with years of satisfaction, especially if you are a algebraist!

  214. Where can I get chalkboard? by throwaway18 · · Score: 1

    I havn't bneen able to find CHALKBOARD using a few search engines, it's too common a term. Anyone have a link to this software please?
    zaphodbond@yahoo.com

    1. Re:Where can I get chalkboard? by Anonymous Coward · · Score: 0

      MAN, I hope you're kidding...

  215. Matlab for free by Anonymous Coward · · Score: 0

    We use Matlab a lot at my uni. Students can get the full Matlab (no student or demo version) for free. Our uni has a special agreement with Mathworks. If you take a course requiring Matlab, you sign a paper saying you'll use Matlab only for the duration of the course and delete it after.

    And that's it; we always have the latest version with every addons possible.

    When you start it, it says

    This is a Classroom License for instructional use only. Research and commercial use is prohibited.

    But everything else is the same.

  216. Don't forget MuPAD or gpari by Jerry · · Score: 1

    Both excellent math tools

    --

    Running with Linux for over 20 years!

  217. Thoughts on Maple by Anonymous Coward · · Score: 0

    I first tried my hands on Maple back in grade 11. It was fascinating, to say the least, to see a computer program doing algebra smarter and faster than me. Before that I didn't know it was at all possible to do symbolic algebra on a computer.

    Fast forward to my senior year, two years ago. I took a course on symbolic computation in my last term to satisfy the requirements for both of my majors at once. The professor, who was the author of the textbook used, was (and still is, I believe) one of the researchers working on Maple before it spun off as a commercial product. Besides the fact that I got 50 in that course and (obviously) didn't understand the topic all that much, to this day I still find Maple's capabilities fascinating. Of course, being in the University of Waterloo's Faculty of Mathematics, the birthplace of Maple, I was never given a chance to touch Mathematica. :-)

    As for Matlab, it is very different from Maple. My grossly overly simplified understanding is, Matlab is a fancy calculator.

  218. Matlab and Maple by Andy+Dodd · · Score: 1

    IIRC, either some Versions of Maple contain a Matlab compatibility system that lets them run Matlab scripts or vice-versa.

    I've dealt with Both. Rutgers makes heavy use of Maple, Cornell makes heavy use of Matlab. (With a few profs using Mathematica, for VERY valid reasons.)

    From what I remember, moving from Maple to Matlab was not too difficult.

    Where I work, people use Matlab heavily.

    --
    retrorocket.o not found, launch anyway?
  219. Common front end by Anonymous Coward · · Score: 0

    Actually, now you can have the best of both worlds. Look at FrontMan which provides a common front end for Octave, Singular, Macaulay2, Yacas and support planned for R, Maxima, GAP, etc. It is in the KDE CVS repository under kdenonbeta/frontman.

  220. Ptolemy II by zbik · · Score: 1

    I have been looking at a Java-based hybrid modeling package called Ptolemy II, which does signal processing, graph theory, and linear algebra. The code looks really nice; I'm planning to use it for realtime systems analysis. Any experience with this?

  221. Matlab by roXefeller · · Score: 1

    As an engineer who does alot of development, I tend to prefer matlab. It has a lot of power, and it has libraries that rely on Mathematica and Maple, so you have the functionality of those as well.

    --
    'don't stop the roX'
  222. Lush by UtilityFog · · Score: 1
    I just recently ran into Lush, a Lisp dialect for scientific programming. It's interpreted and/or compiled, and has interfaces to a large number of packages ranging from BLAS to OpenInventor (including the GSL). It has builtin GUI and plot capabilities.

    Look at the project homepage on SourceForge.

  223. beware MathCad by Anonymous Coward · · Score: 0

    Most packages have an open, legible scripting language.
    If the enterprise fails, you can translate your project to another package's language.
    Matlab is legible by free Octave.
    S-Plus is legible by free R.
    MathCad files are illegible.
    The product is moving to strict licencing overhead.
    If they go out of business, you cannot reinstall or
    move the software and you cannot translate your
    worksheet.

  224. Ovreflow. by Petrus · · Score: 1

    Overflow - The way to GO! ;-)

    Great for DSP design. Something between Simulink and SPW. A great graphical design tool!

    http://freespeech.sourceforge.net/overflow.html

    Petrus

  225. Re::gb2gbs by zebo_2001 · · Score: 1

    lol bgs lol