11 votes

Let's talk about computer algebra systems

I'm vaguely in the "market" for a new computer algebra system (Mathematica, Maple, Sage, SymPy, etc etc) and I am curious what experience you all might have with these types of programs. In the past I've used Mathematica, and once you get over the odd aspects of the Language (and hefty license fee), it is a pretty great piece of software. Nonetheless, now that my old student license has expired and I would have to buy a new one (though through my school I can get it at a steep discount) I'm looking at some alternatives. Sage seems particularly appealing since it is open source and apparently well documented, and of course SymPy is powerful although that as stand-alone as these other choices.

There are tons of other options as well, with a wide range of functionality (it really is amazing how much these things can do). My main use cases with these types of things are either: a) algebraic manipulation, b) linear algebra, c) visualization. For these three it does really seem that Mathematica is at the forefront, but I'm all ears for other opinions.

I'm curious, if you have used any or all of these in the past, what were you using them for and what is your opinion?

14 comments

  1. [2]
    Staross
    Link
    I've tried a couple of the open source alternatives but I never found one that was as good as Mathematica, even "basic" stuff like simplifying expressions or solving equations was either super...

    I've tried a couple of the open source alternatives but I never found one that was as good as Mathematica, even "basic" stuff like simplifying expressions or solving equations was either super slow or wasn't really working.

    They had free notebooks online for a while, not sure if that's still the case, but it was quite useful to do some quick maths.

    https://www.wolfram.com/wolfram-alpha-notebook-edition/

    4 votes
    1. leif
      (edited )
      Link Parent
      This has been my experience as well, which sucks because Mathematica’s pricing gets expensive quickly — as far as I can tell the cheapest way as a student to get two licenses is to pay 266NZD per...

      This has been my experience as well, which sucks because Mathematica’s pricing gets expensive quickly — as far as I can tell the cheapest way as a student to get two licenses is to pay 266NZD per year for wolfram one.

      3 votes
  2. [2]
    psi
    Link
    You might consider also Mathics [1], which is a an open-source alternative to Mathematica that supports Mathematica-like syntax. However, I have no experience with Mathics, and I haven't needed to...

    You might consider also Mathics [1], which is a an open-source alternative to Mathematica that supports Mathematica-like syntax. However, I have no experience with Mathics, and I haven't needed to use Mathematica in years, so I'm not sure to what extent it can be considered a full replacement.

    That said, Mathematica's success is due in part to its algorithms, which are unfortunately hidden because of its closed-source nature. Even an open-source clone with 100% compatible syntax wouldn't necessarily give the same results, particularly if you're evaluating some wicked integral or simplifying some nasty expression.


    [1] https://mathics.org/

    2 votes
    1. Gyrfalcon
      Link Parent
      In a similar vein, Octave is an open source alternative to MATLAB, that provides extra functionality on top of the SymPy functions it uses for CAS things. More targeted at numerical/engineering...

      In a similar vein, Octave is an open source alternative to MATLAB, that provides extra functionality on top of the SymPy functions it uses for CAS things. More targeted at numerical/engineering applications than Mathematica though.

      5 votes
  3. [2]
    soks_n_sandals
    (edited )
    Link
    My main CAS experience is with the TI Nspire CX CAS and it's accompanying desktop software. The desktop software is basically just an emulation of the calculator display on your machine. I found...

    My main CAS experience is with the TI Nspire CX CAS and it's accompanying desktop software. The desktop software is basically just an emulation of the calculator display on your machine. I found the ability to type formatted expressions as proper math, instead of command-line, really valuable. I didn't explore its capabilities for data import, but it can do some 3D plotting. It's CAS functions for algebraic manipulation and simplification were pretty good, though simplification wasn't perfect. It's linear algebra capabilities were what you'd need for a calculator. Imagine a core Matlab.

    I've also worked with Matlab, which has a symbolic algebra toolbox, and Matlab is quite good. Edit: I see the pricetag for Matlab is steep. The pro of the TI calculator is that it's about $170 bucks with the software bundled. Or, you can just buy the teacher software for about [$140 from a vendor, which seems like the same thing as the student software, plus some extra functionality[(https://www.calculatorsinc.com/shop/ti-nspire-cx-premium-teacher-software-single-user-license/).

    2 votes
    1. Akir
      Link Parent
      Years ago I was also using a TI CAS in the form of the TI-89 Titanium, and even though I didn't go into the upper level maths, I can say that their software is pretty darn good. When I was doing...

      Years ago I was also using a TI CAS in the form of the TI-89 Titanium, and even though I didn't go into the upper level maths, I can say that their software is pretty darn good. When I was doing the kind of math where it became useful, I also had a laptop that I would lug to school and I got a copy of Maple and found the experience using it much worse; things were very confusingly labeled and all of the benefits of having a mouse and keyboard were held back by a very confusing interface that often times did not do what I thought I told it to do. I'm sure that if I had spent more time learning its quirks I probably would have liked it much better, but the interface of the TI-89 (and of course, the fact that it didn't need me to lug around a laptop) made it the better choice.

      2 votes
  4. arghdos
    Link
    Last time I did any serious work in one of these was deriving an analytical Jacobian for a chemical kinetics application. I used SymPy as I’m most comfortable in Python. It’s been a few years, so...

    Last time I did any serious work in one of these was deriving an analytical Jacobian for a chemical kinetics application. I used SymPy as I’m most comfortable in Python.

    It’s been a few years, so the situation may have changed but broadly what I found was:

    • not great support for “array like” operations, as in the derivative of a summation like:
    d/dc_j (\sum_{i=0,N} c_i) -> Delta_{i,j}  
    
    • highly extensible, as in I was able to hack in the above in a day
    • not great for DAE’s, related to the above, e.g.,
    c_N = \sum_{i=0,N-1} c_i
    

    Wasn’t able to find a way to provide that knowledge into derivatives without doing brute force substitution.

    • good output support to LaTeX (and easily extensible in the cases where it #@!#'d up).
    • Performance of and actual reduction in equation size from "simplification" algorithms generally not worth the effort. I ended up simplifying chunks, with my own built-in "assumptions" substituting in, and ripping out user knowledge like the above c_N relation.

    Apart from the above, Sympy largely met my needs. If I had the time (i.e., wasn't a PhD candidate) I woulda tried harder to upstream my hacks to save others the pain, but... such is life.

    2 votes
  5. river
    Link
    Not exactly an algebra system but I use pari/gp for my math calculations. It handles modular arithmetic, polynomials and things like that. Then I have sage with a jupyter notebook for more...

    Not exactly an algebra system but I use pari/gp for my math calculations. It handles modular arithmetic, polynomials and things like that.

    Then I have sage with a jupyter notebook for more involved stuff.

    2 votes
  6. [3]
    Akir
    Link
    I don't really do upper-level math much anymore, but I did a little research and I think Xcas is a really good open-source option. It uses the same CAS engine that HP chose for their Prime...

    I don't really do upper-level math much anymore, but I did a little research and I think Xcas is a really good open-source option. It uses the same CAS engine that HP chose for their Prime calculators, and it has interface options to make it compatible with a handful of other more popular CAS systems. There's even a browser version if you check out the homepage.

    But if you want to use Mathmatica specifically, you can get it free on Raspberry Pi. You don't have to have a full setup to do it this way, either; the Raspberry Pi 3 models can get it's power from your laptop's USB port and also use the same USB port as a network connection so you can easily connect to it via SSH or VNC.

    2 votes
    1. [2]
      gpl
      Link Parent
      Now this gives me the idea to make a mini Pi cluster so that me and others in the department can all get Mathematica for free. Veryyyy interesting idea.

      But if you want to use Mathmatica specifically, you can get it free on Raspberry Pi. You don't have to have a full setup to do it this way, either; the Raspberry Pi 3 models can get it's power from your laptop's USB port and also use the same USB port as a network connection so you can easily connect to it via SSH or VNC.

      Now this gives me the idea to make a mini Pi cluster so that me and others in the department can all get Mathematica for free. Veryyyy interesting idea.

      2 votes
      1. Akir
        Link Parent
        This doesn't have to be that hard, even. Raspberry Pi Zero costs $5 and also has the USB Gadget functionality to run it from your laptop. Even adding the cost of the microSD card, you're looking...

        This doesn't have to be that hard, even. Raspberry Pi Zero costs $5 and also has the USB Gadget functionality to run it from your laptop. Even adding the cost of the microSD card, you're looking at less money than a scientific calculator.

        1 vote
  7. [3]
    Wulfsta
    Link
    I very much like the power that Mathematica offers, and it is the only CAS I'm aware of with an implementation of the Risch algorithm. Otherwise, SageMath is wonderful, and I'd recommend playing...

    I very much like the power that Mathematica offers, and it is the only CAS I'm aware of with an implementation of the Risch algorithm. Otherwise, SageMath is wonderful, and I'd recommend playing with it if you haven't given it a try.

    2 votes
    1. wirelyre
      Link Parent
      My experience is that Mathematica is best in class for most algebra. For FOSS alternatives SageMath is probably the best bet. I don't need a CAS all that often, but it has been flexible and...

      My experience is that Mathematica is best in class for most algebra.

      For FOSS alternatives SageMath is probably the best bet. I don't need a CAS all that often, but it has been flexible and powerful enough for everything I've tried. The packages are very well integrated.

      I strongly recommend Sage.

      This isn't an answer to the OP question, but related: Pluto.jl is a very nice reactive notebook for Julia.

      2 votes
    2. Moonchild
      Link Parent
      I believe that axiom and maxima both implement the risch algorithm.

      I believe that axiom and maxima both implement the risch algorithm.

      2 votes