Archive for the ‘Maple’ Category

June 30th, 2008

If you are a user of MATLAB’s Symbolic Toolbox then you are a user of the Maple 10 kernel since this is what MATLAB uses ‘under the hood’ in order to perform symbolic calculations. As of Septemeber 28th 2008 the Mathworks will be switching the kernel of the Symbolic Toolbox from Maple to Mupad. So should you care?

The answer is almost certainly yes. Mupad is completely different from Maple with a different set of abilities, behaviours and, inevitably, bugs. For example, things that didn’t work in Maple versions of the symbolic toolbox will start to work in the Mupad version. On the flip side, some things may stop working where there was once no problem.

I have been through this before when Mathcad switched from the Maple kernel to Mupad and there were a few issues but I support a much larger number of MATLAB symbolic toolbox users and so I am fearing the worst, but then I always do when something major changes like this.

An example of the kind of issue I came across when dealing with the Mathcad change included things like equation solvers changing their behavior due to using different algorithms internally. This sort of thing cropped up in problems that had multiple solutions such as when you try to find the roots of certain equations. Lecturers notes suddenly started disagreeing with the output because, for a given starting value, Mathcad converged to a different solution. No big deal in a class situation (in fact it might be a good learning experience) but not good if you have legacy code that depends upon that result.

Other bugs were a lot more embarrassing.

I’ll be honest – I do not know enough about either Maple or Mupad (I don’t even have access to Mupad in fact) to be able to decide if this change is going to be a good thing or not but one thing is for certain – it will be different and that will need to be managed.

The practical upshot is – when you upgrade, you should check all scripts that depend on the symbolic toolbox

June 16th, 2008

A few years ago, while working through a degree in theoretical physics at Sheffield University, I took a course on special functions in physics that was given by the legendary lecturer Dr Stoddart (saviour of many a physics undergraduate, including me, during his many years there – please leave a comment if you studied at Sheffield and remember him).

This course introduced me to the fascinating world of the so called ‘higher transcendental functions’ of mathematical physics. I remember that we covered topics such as Bessel functions, Laguerre polynomials, Hermite Polynomials and the Gamma function among others but in a one semester course we only really scratched the surface of the subject.

Since then I have come across several other special functions during the course of my work such as the LambertW function, Mathieu functions, Chebyshev polynomials and more. I used to be a physicist and so, despite the fact that the theory behind these functions can often be fascinating, all I had time to consider back then was how to evaluate them.

In fact, as far as my professional life goes, the question of evaluation is still the only thing that I get asked about regarding special functions. Questions such as ‘How can I evaluate the LambertW function in MATLAB?’ (Answer – by using this user-defined function) or ‘Do you know of a free, open source, implementation of Bessel’s function?’ (Answer – the GNU Scientific Library).

The idea for this post came to me while reading an article written in 1994 (and subsequently updated in 2000) where the authors discussed the Numerical Evaluation of Special Functions. One of the features of this document was a list of various special functions combined with a list of software packages that could evaluate them. For example it lists Dawson’s integral and tells us that if you need to evaluate this then you can use various software packages such as the NAG libraries or Numerical Recipes.

I thought that this was a very useful document but a major problem with it is that it is rather out of date! Wouldn’t it be great if someone were to create an updated version that included all of the latest advances in software libraries and applications. I even idly thought of attempting to do this myself and publish the results here but it turns out that I have (thankfully) been beaten to it.

It’s not finished yet but the NIST Digital Library of Mathematical Functions looks like it is going to be exactly what I need. Apparently this project aims to be a sort of modern rewrite of Abramowitz and Stegun’s Handbook of Mathematical Functions, a book that almost every physicist I knew had a copy of. The preview looks very promising to say the least! For example, take the section on the Gamma Function. The library contains everything you might want to know about this function such as its definition, 2D and 3D plots of its graphs, its series expansion and, of course, a list of software packages and libraries that can be used to evaluate it. I note that, for the Gamma function, one can choose from MATLAB, Mathematica, MAPLE, NAG, Maxima, PARI-GP, the GSL, Numerical Recipes and several others – not exactly short of Gamma function implementations are we?

When it’s finished, the work will be published as a book called ‘Handbook of Mathematical Functions’ but will also be available freely online as a digital library – fabulous!

May 13th, 2008

One of the many things that happened while I was away was the release of version 12 of the popular computer algebra system, Maple. I am not a Maple user myself so I cannot say very much about this new release but Maplesoft have released an extensive set of what’s new pages and a casual scan reveals a lot of interesting stuff.

I do have access to some network licenses for Maple and recently installed version 11 to try and get a taste of its abilities compared to products that I am more familiar with so I guess I will be getting access to version 12 eventually. The problem with this set-up is that it means that I can only access it from work and we are not exactly inundated with Maple queries here so it is rather low priority at the moment. Oh well, I am sure I will get around to it eventually.

If there are any Maple users out there who would like to tell me what their favorite new features are then please do so via the comments. I’d also like to hear from people who can tell me what Maple can do that Mathematica, Matlab, Mathcad etc can’t.