franko / gsl-shell

GSL library shell based on LuaJIT2
http://franko.github.io/gsl-shell/
GNU General Public License v3.0
92 stars 12 forks source link

Does gsl-shell come with the full gsl for Windows #37

Open chetWS opened 1 year ago

chetWS commented 1 year ago

Hello,

Does gsl-shell for Windows come with the full gnu scientific library for accessing functions not yet implemented in the shell itself, but could still be accessed through the FFI (such as BDF method for ODEs) ?

I'm asking because there doesn't seem to be an easy binaries install for gsl for Windows. I'm not much of a computer science guy so I'm not too confident building the gsl myself. Accessing the gsl through the FFI doesn't look too bad thanks to the example in the manual. This would also be a way users could gain indirect access to gsl functions that haven't been fully implemented yet (such as many of the ODE solvers) until they eventually are integrated into the shell.

Thank you, Carl

franko commented 1 year ago

Hi,

in the past GSL Shell was supplied with the whole GSL library available to be used using the FFI module. With recent version I am now leaving out a few parts, here an extract from the main meson file:

foreach module_name : ['siman', 'wavelet', 'sparse', 'ode', 'monte', 'integ', 'min', 'fit']
    libgsl_options += module_name + '=false'
endforeach

where you can see which parts are left out. So that means that you can use with FFI any functions except those provided but the parts above.

If you want I may provide an "experimental" build of GSL Shell with the whole GSL library, that's pretty easy to do, just let me know.

Otherwise, if there are parts of the GSL library you are interested in that is missing from GSL Shell feel free to make a request, I will be probably able to implement whatever is missing. The only difficult could be for functions requiring callbacks functions.

chetWS commented 1 year ago

Hello,

Thank you very much for the quick response. I’d also like to thank you for your efforts on this neat project. Especially on the user manual. As you know, user manuals for FOSS projects are notoriously poorly done. Gsl-shell is the opposite. Even I can get started with it, lol. I very much appreciate your implementation offer as I’m not much of a coder (never cared for C’s cryptic style much less its overuse of pointers). For a feature request, gsl-shell has the ODE solvers DP8 and the ever popular RK45 implemented. These two methods are good for nonstiff equations, but the shell could use a stiff equation solver. One possibility is a backward differentiation formula (BDF) method (such as the gsl function *gsl_odeiv2_step_msbdf)?

Much appreciated, Carl

franko commented 1 year ago

Hi Carl,

an implicit method for stiff differential equations is actually needed for GSL Shell. One would need to implement such a method completely in Lua because we don't use the GSL library for algorithms that requires a callback function like an ODE solver.

What I did for the Prince-Dormand method was to transcribe the GSL library implementation in Lua.

There are a few choice to make at the beginning like: implement to solve for a variable number of variables stored in an array or implement for a fixed number of variables and generalize to any number using a template for on-the-fly code generation.

I propose that, if you have some spare time and the motivation, you begin the work by choosing an algorithm and provide a first implementation either for a fixed number of variables either for in array form. If you are ok with that I can give you some directions and I can later catch up to implement the more tedious technical bits to make it works with GSL Shell.

Otherwise you may just make the preliminary study about which algorithm to implement and provide a plan for its implementation, either an article of a translation of an existing implementation, possible one of the GSL library itself.

I could be also fine to begin with a "toy" but working implementation to improve upon it incrementally.