tags:

views:

1478

answers:

1

I find a lot of use for matlab, but my current employer don't have a matlab license: there is one for Comsol, which comes with comsol Script. On a first glance, comsol script is identical to matlab, but after awhile you find eerie differences. Many graphics graphics' features are not there, and you can't export figures to a vector graphics format. But worse is that the performance seems to be much more poor for heavy computations, there is a lot of crashing on trivial algorithms.

(Of course, the purpose of the comsol package is totally different, but I am only interested in using it like matlab, since we don't own a matlab license.)

Are there differences in the matlab and Comsol script cores?

Do they handle memory and matrix computation differently?

+1  A: 

Do they handle memory and matrix computation differently?

Almost certainly, yes (at an implementation level). I haven't heard of comsol before, but it's not surprising that it's slower. Mathworks has been putting a lot of effort into performance optimizations over the last few years. Using a JIT has gotten rid of a lot of the interpreter overhead. They also do cache-friendly tricks like executing

 mybigresult = big1 .* big2 + big1 .* big3

as (C-style pseudo-code)

 for (size_t i=0; i<numelement; i++) {
    mybigresult[i] = big1[i] * big2[i] + big1[i] * big3[i];
 }

instead of creating temporaries and scanning memory multiple times. Finally, in the most recent versions, they've added multithreading support to big swaths of their backend. (Note: semantically, Matlab is still single threaded).

Some free Matlab alternatives: octave (aims to be an open source equivalent), python + numpy (very different language, but with similar basic features).

If Matlab makes you much more productive, you might want to try to get your employer to pay for a license... ($50k/year salary * 10% productivity improvement) = $5k worth of extra work done if Matlab is purchased (just making up numbers here).

Mr Fooz
Comsol grew out from a module of matlab 6, all libraries, help documentation etc is identical. Unlike matlab clones, almost all matlab code can be run under comsol script with no modification whatsoever. That is why the question is relevant.
Fredriku73

related questions