Ask Your Question
10

Reliability of Sage vs commercial software

asked 2011-12-21 06:47:22 +0100

god.one gravatar image

updated 2015-01-23 22:03:56 +0100

FrédéricC gravatar image

Hello everybody,

for future calculations I need a CAS. Up to now, I worked with a free mathematica student licence. But now I need a officially bought version (which I can't afford). I'm now trying to work with Sage but my head of department is no fan of open source projects and thinks, among other things, that it is probably buggy and not as powerful as said mathematica. Could you please tell me how "stable" and "correct" the sage calculations are and give me further information on this topic (I already searched the forum for some information) so that I can present him/them why we should use Sage and nothing like mathematica/mathlab/...

Please tell me if you need more information or clarification.

Thank you all in advance for your effort.

Daniel

edit retag flag offensive close merge delete

Comments

I will add one thing. Sage has been around for a much shorter time than Mathematica. The longer it is around, it will be able to do more and more bugs will be fixed. So, a few years from now, Sage will be closer to what you're looking for than it is now and it's still free.

G-Sage gravatar imageG-Sage ( 2011-12-21 13:10:39 +0100 )edit

For completion, here is a critical statement (2010! on version 4.5.3! for Mac!) I found. Since I am new here I cannot consider how much is still true about Sage this user said http://www.macupdate.com/members/profile/Karenbindash

god.one gravatar imagegod.one ( 2011-12-23 06:56:41 +0100 )edit

Like I said, you can't expect Sage to be as good as, say Mathematica, in every aspect when it's been around a few years compared to 20 years for Mathematica. The reviewer is not taking this into consideration. Also, as you can see by trac ticket the reviewer mentioned, it appears to be a problem with scipy, which is a completely different open source program that Sage uses.

G-Sage gravatar imageG-Sage ( 2011-12-29 13:45:27 +0100 )edit

ok, thanks for the information. I did not want to bash sage (up to now i like it very much) but i found this comment and i always hate it when i can only read praise and glory because it looks like there could be some kind of bias. But i get your point beating established software when your "new to the game". Again, thanks and no offense.

god.one gravatar imagegod.one ( 2012-01-01 08:05:14 +0100 )edit

5 Answers

Sort by » oldest newest most voted
7

answered 2011-12-21 07:11:21 +0100

updated 2011-12-21 07:21:34 +0100

Here is my personal point of view:

(1) Sage is a rapidly growing project. The first version was released in 2005. Thus one could expect there's a lot of space to improve. Indeed the community is very active.

(2) In terms of powerful and speed, I would think Mathematica is still better so far. I mainly use Sage or Mathematica to do symbolic calculation. I found Mathematica can do more symbolic integrations than Sage could. The ODE solver is also more convenient. Also, Sage calls Maxima to do simplifications, which is more slowly than Mathematica.

(3) In terms of stability, I have met several bugs in Sage and I would not mark it as very stable. But the good thing is the bugs breaks the calculation explicitly (by saying something is wrong), instead of give you a wrong result. Also for every bug I met, I could eventually find a workaround, with the help of very kind community.

(4) Despite (2) and (3), I am still moving my previous Mathematica work to Sage. Why? Most importantly, it is because Sage is based on Python, and Mathematica has its own language. The Python-Sage resolution has much better support on class, name-space, etc. Thus when we have a lot of codes, it is much easier to reuse them in Python than in Mathematica (including the .m package).

(5) It's also a matter of Windows / Linux. Sage is more native on Linux, while Mathematica behaves better on Windows. (I have never used Mac thus I don't have comment on that.) The Linux support (especially notebook interface) of Mathematica is very slow, and occasionally unstable.

(6) There are also a number of other differences. For example, in Sage one has to define a variable before use (although don't need to declare). Mathematica doesn't need that. The former is safer but the latter is convenient. Also, one can view source code of a function in sage by typing, e.g. expand?? . This improves my programming technique because then I easily learn how more professional people write code.

Considering the above differences, currently, if you want to use a CAS to do a number of small calculations (say, calculate a integration in your work and insert the result back to your hand-writing notes), I would recommend Mathematica (despite the price issue...). On the other hand, if you write a lot of code and want to reuse them, Sage is a sage option.

Finally, I am looking forward to seeing sage become better and better. The active development group give us end users a lot of hope.

edit flag offensive delete link more

Comments

1

I have been trying to advocate sage in my department for some time now, and I get this question very often. It will be nice if these points are on the sage website in the faqs.

Shashank gravatar imageShashank ( 2011-12-21 12:56:55 +0100 )edit
6

answered 2011-12-21 09:24:58 +0100

kcrisman gravatar image

To address your reliability or power question briefly from a different vantage point, I think it depends a lot on what you are doing. If you need the most symbolic antiderivatives you can, Maple or Mma are probably better; on the other hand, many people in "real work situations" use Maxima as a standalone program very, very effectively for symbolic DEs and such. If you are doing more numerical work, my understanding is that the Numpy/Scipy/Matplotlib stack, or the GSL (both in Sage), are pretty darn effective and not necessarily "buggy" at all. If you are doing graph theory or serious number theory, you shouldn't even be asking the question of which package to use. But either of them (or Maple) will probably do 99% of what you need to do, correctly, in most cases.

Matlab is a different situation, because of the enormous amount of third-party code and drivers available (only) for it. Octave might be a free option, but it would really depend on what you need to do.

In the end, you'll have to figure things out for yourself. If your department head is too cheap (to be crass, which is unavoidable in your situation) to buy you a Mathematica license, then they are really putting their money where their mouth is, and you should use Sage.

There are plenty of bugs in any mathematical software, and a quick internet search will find them for you. You should never ever implicitly trust output from a computer in any case, without some other means of checking it (such as "plugging in the answer"). Even when Euler proved that $\zeta(2)=\frac{\pi^2}{6}$ or that $\gamma$ exists, he also checked it by hand to an insane number of digits. Thankfully, we don't have to do that to check our work.

edit flag offensive delete link more
5

answered 2011-12-21 09:27:58 +0100

Felix Lawrence gravatar image

Compared to Mathematica 6.0.1 (the version of mathematica i bought - without paying more, they won't even let me have version 6.0.2 which fixed a bug I encountered), I have found Sage to be more reliable for what I do.

The most important difference is ease of debugging. When you make a mistake, Mathematica plows on. For example, if you forget to define a variable, Mathematica assumes it's symbolic and will keep going until it crashes, hangs, generates a meaningless expression, or you treat it as a list and slice it. if you're lucky Mathematica will give meaningless errors along the way that are hard to trace back to the problem (e.g. they occur 400 lines after the initial problem, and do not mention variable names or line numbers). If you make such a mistake in Sage, it will straight away throw up an error message with a traceback, which makes for MUCH faster debugging.

In my few years' experience using Sage, I have run into several parts that were rough around the edges (e.g. interaction with Mathematica, and to a lesser extent numpy/scipy), and found one bug that silently gave me incorrect answers (returning a vector as a row vector instead of a column vector). But then I also found an issue with Mathematica, where results were qualitatively different depending on whether it was run from a notebook or a command line (which turned out to be 32-bit vs 64-bit).

Still, I find it harder to write code that silently gives the wrong answer in Sage than in Mathematica, and it is also much easier to write code that gives the correct answer in Sage than to do the same in Mathematica, due to the errors and tracebacks that Sage provides. Sage almost always gives errors when something goes wrong, which helps you work around its inconsistencies, unlike mathematica, which hopes for the best and gives no advice as to how to work around its inconsistencies.

I have had to write my own functions and do lots of numerics - both things which Sage (which incorporates Python and SciPy) is very well suited to, and Mathematica is poorly suited to.

Other advantages Sage has, like redo/multiple level undo (provided by your text editor, or to a limited extent in your browser) are just gravy.

I don't have too much experience with symbolics. The one time I tried a full_simplify, I got a better result in Sage than in Mathematica, which surprised me.

But the biggest advantage of Sage's price tag is that you have a perpetual free trial. So give it a go - try reproducing some of your Mathematica results in Sage, and see whether it's up to scratch for your needs.

edit flag offensive delete link more

Comments

1

*a perpetual free trial* - nice way to put it.

kcrisman gravatar imagekcrisman ( 2011-12-21 09:31:44 +0100 )edit

How do you get redo/multiple level undo in Sage with a text editor (which one do you use?)? I thought there were only two ways to interact with Sage: the console and the notebook interface. When I use Sage through the notebook browser interface, I tend to overwrite wrong computations and I don't even know how to undo.

Green diod gravatar imageGreen diod ( 2012-01-28 18:11:23 +0100 )edit
0

answered 2011-12-22 02:34:16 +0100

god.one gravatar image

Since I reread the FAQ and saw this is no forum for discussions I will close now this question. But again I want to thank everybody for your answers and arguments for Sage.

Additionally I was very suprised how fast I got a helpful answer which is again a good sign for/from the Sage community :)

Probably read you soon

edit flag offensive delete link more
0

answered 2011-12-21 08:38:37 +0100

god.one gravatar image

Thanks a lot for your detailed answer. I use windows and will try sage via vm even though I do not speak any "python". One point is very interesting

But the good thing is the bugs breaks the calculation explicitly (by saying something is wrong), instead of give you a wrong result.

since some people told me even mathematica isn't perfect and messed up their calculations :)

I would still like to hear some other views or arguments about this topic so I will leave this question open.

Best Regards

edit flag offensive delete link more

Comments

Could you tell us what kind of work you are trying to do?

Shashank gravatar imageShashank ( 2011-12-21 13:01:48 +0100 )edit

I just began my PhD thesis about modeling and simulating heat transfer and infrared/optical radiation through different materials. Right now I'm working through the basics (scattering theory of Bohren/Huffman and Kerker and heat transfer in Siegel/Howell and Chandrasekhar). Since the expressions are sometimes extremly long and just to plot some examples for clarification I always used mathematica.

god.one gravatar imagegod.one ( 2011-12-22 02:29:07 +0100 )edit

When it comes to modelling and simulating heat transfer I would guess most of your work would not require symbolic manipulation that sage cannot handle. Also when it comes to numerical simulations, like solving the heat transfer equations numerically, gsl is far superior to mathematica.

Shashank gravatar imageShashank ( 2011-12-22 13:06:32 +0100 )edit

Ok, that's good to hear. The only thing I noticed so far was that sage had no solution to integrate(exp(I*n*sin(x),x pi, -pi) which wolframalpha identified as a Bessel function but up to now no other things which made sage "inferior".

god.one gravatar imagegod.one ( 2011-12-23 02:47:04 +0100 )edit
2

Do you mean `integrate(exp(ln(sin(x))),x, pi, -pi)` ?? because that's not a Bessel function, it's zero.

benjaminfjones gravatar imagebenjaminfjones ( 2011-12-23 16:23:04 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2011-12-21 06:47:22 +0100

Seen: 10,333 times

Last updated: Dec 22 '11