Monday, April 25, 2011

GNU Science Library

In our quest to get better and running simulations of networks of neurons, we've been trying to replicate a number of papers covering a variety of techniques. For example, we looked at the integrate-and-fire model of Hansel 1998 and the modified Hodgkin & Huxley approach of Rubin and Terman 2004.

Part of the problem in running these simulations is developing and properly understanding the numerical methodology responsible for cranking through the differential equations. There are a number of available techniques, and up until now we'd been basically hand coding them (we're developing our simulations in GNU C/C++ since we want these sims to run quickly over tens of thousands of neurons, which basically rules out Matlab). Forward Euler is pretty easy to code but is numerically very limited and requires small step sizes (meaning large numbers of calculations). More advanced methods such as Runge-Kutta and the adaptive step-size method of Runge-Kutta-Fehlberg can get away with far fewer calculations but require more coding and are therefore more prone to coding mistakes. All that extra code has to be tested and validated, a time consuming process.

We were pleased then to discover that the GNU Science Library (or GSL for short) has built in support for Ordinary Differential Equations. Although I'd used GSL before because of its matrix library (which its cumbersome to use - I now prefer to use openCV's matrix library instead), I hadn't been aware of its ODE capabilities. The solver supports a range of algorithms including the embedded Runge-Kutta Prince-Dormand method and the august Bulirsch-Stoer method that actually required a Jacobian in addition to the actual differential equations themselves.

If I have some time later this week I'll post some benchmarks to give an idea on the savings of computation time.

1 comment:

  1. Am One of the happiest woman on earth since my son was cured from the problem of seizure,which he has been having for eight years now,he do have the attack two to three times a week,which was affecting his education and his life.i got the contact of doctor Williams from the post of one Mr Paul thanking him for curing his seizure problem,i got the contact and contacted him then he made me to know that the medication is a permanent cure, and that was how i got the medication which i used on my son,and for six month now there have been no sign of seizure in him again.any one with such problem can contact him on his email on drwilliams098675@gmail.com for more information.  

    ReplyDelete