tharwan.de

Some Words About Physics, Python And The World In General

MATLAB is not for Science

Currently I am working a lot with MATLAB®. Actually knowing how to use MATLAB got me a job in the first place. Nevertheless I could not really overcome my dislike for it even though I become more and more accustomed to its quirks. It is not so much that the idea of MATLAB as a tool for easy and fast numerical prototyping is a bad one in it self. It is not even the case that it is a bad tool in it self. It is only that there are some parts of the execution that are just poor or a bad fit.

I held a talk about MATLAB versus my go to language Python for use in our physics department (slides in German) which was very well received but sadly did not lead to any changes yet. The worst thing about MATLAB in scientific use is that it is closed source and therefore not freely available for everyone. And its open source clone (Octave) is simply not a full replacement.

Open Source? Aren‘t you an Apple fanboy?

The bad thing about the usage of MATLAB, and all other closed source tools for science, is that they destroy what could makes computer science and science on computers such a great thing: that almost everyone has the tools to do it. To trap a single atom in a quantum well and find out how its absorption spectrum changes is an expensive experiment to setup. Simulating it on a computer is almost a trivial task nowadays.

But if the knowledge you base your own simulations on is build up with tools you do not have access to, you will have a very hard time to setup your "virtual experiment" too. Or you have to swallow the pill and buy and use the same closed source tools all over again.

I think scientist should devote themselves to use open source for all their publications, if possible in any way, because it is the nature of science to be reproducible. It is sad that we cannot do high energy particle physics in our backyard or in our lecture halls. But we have a way to make the simulations useable for everyone and we should use it.

Where MATLAB excels

And here I am, telling you that Python might be a better alternative, yet earning money programming in MATLAB. Actually I did try to convince my employer to let me use Python and got some good reasons to use MATLAB. It is more or less the same reason why large cooperation‘s use Windows and Office: it comes with a promise of service and completeness and it seams to be a carefree package. It is some kind of outsourcing. You have someone that is responsible and is not you. You have some kind of stability. And the biggest point of all: it is the go to standard in the industry (and in science). Sadly.

The Story goes like this: your company wants to develop some kind of image processing software. You need something to prototype your algorithms in that just works. MATLAB provides you with almost all the things you need. You install it on your machine and you are ready to go. Having used MATLAB for exactly this case, I must admit it is very nice to have almost anything your can whish for already implemented and very well documented bundled in an almost care free package to play around with.

Money is the solution

For a company it is more or less no problem to pay the price for a MATLAB installation (some k€), even if it is only used for a single project. For a private user the price would be nuts. There exists a student version that is priced much lower (~150€ without any toolboxes) but based on my observations is not justifiable for most students. This might be because of the availability of pirated versions (almost anyone I know has one) or the versions that are accessible on the university owned PCs.

I think the price for MATLAB is justified; it is a useful tool with a small target audience that has the financial resources to pay for it, if you look at commercial use of it. I have no idea what it costs as a university to get a campus license, but no matter what it is the price for educational users is ridiculous. Especially if you consider that a lot of the useful and important functions are bundled in so called toolboxes, which will milk some extra money out of you. Though you can argue that it lowers the price of the basic version.

To make the situation a little bit more vivid here: for a lot of courses in engineering you have to use MATLAB. And while it is usually provided by the university, you can only use it in the computer lab which are natuarly to small for the whole university and not accessible at any time and so on. (The issue can partly be solved via remote desktop access) But the plan of MathWorks is not to provide an easy way for a university to give MATLAB to its students, since they already have paid for the license, instead it wants you as a student to pay again.

Making the educational version of MATLAB free would solve the problem of the software availability as a scientific tool for everyone while providing MathWorks the advantage that it will be used even more broadly in publications, manifesting its position as the go to tool. But as it already is the go to tool there is very little incentive for MathWorks to do so other then to be nice. The only way to push them in this direction would be to build on open source languages and toolboxes to challenge this status.

Basically I have no problem with MathWorks earning money with their software. I think the situation is not there fault (even if they could solve it). I also would not argue that everything should be free for education and science. But in the case of scientific software we have an alternative, which we do not have for hardware, that would strengthen the foundation of science and therefore we should use it.