tags:

views:

118

answers:

1

Hi,

I'm trying to rewrite a fairly simple MATLAB script in Haskell. I'm looking for an equivalent to MATLAB's fsolve (numerical root finder) and ode15s (one of the ODE solvers). On Hackage there seems to be a MATLAB interface package. Is this the way to go (in terms of speed, simplicity, etc.) or are there other packages that would be more suitable?

Thanks, Ben

+6  A: 

I haven't used the MATLAB interface, but I've had good results with hmatrix. It exports GSL functions, including ODE solvers and nonlinear multidimensional root finding, which I think will do what you require. It looks like ode15s is comparable to Numeric.GSL.ODE.odeSolveV with either Gear1 or Gear2 as the method, although one of the other methods may be better suited to your problem. It also exports the LAPACK interface, which is very useful.

Which is easier to build/install depends upon your OS and available libraries. On Linux or Unix they should be equally simple, but if you're on Windows installation of either could be painful. If you use hmatrix you'd be able to run the software on systems without Matlab which could be a benefit.

I found hmatrix easy to use even with no prior GSL or LAPACK experience; it's well-documented and has very good performance. From a cursory inspection it appears that you'd need to be familiar with Matlab's C API to make good use of the bindings.

John
Thanks! I've been reading the very useful tutorial: http://code.haskell.org/hmatrix/ It seems to be just what I need. :)
Ben