
Hi, I am new on this list and want to start a discussion if a library for solving ordinary differential equations (ODEs) would fit into boost. We are developing a lib - odeint - for such problems. odeint can be found in the sandbox: https://boost.org/svn/boost/sandbox/odeint, but the current stage is far away from being ready for release or submission. ODEs are usually solved iteratively. Therefore, we have introduced two stepper concepts, one for steppers with- and one for steppers without error estimation. At the moment some explicit solvers are implemented: Euler, RK4, Cash Karp, RK78,midpoint and Burlisch-Stoer. Here are some examples: typedef std::tr1::array< double , 3 > state_type; // define the ODE void lorenz( state_type &x , state_type &dxdt , double t ) { const double sigma = 10.0 , R = 28.0 , b = 8.0 / 3.0 dxdt[0] = sigma * ( x[1] - x[0] ); dxdt[1] = R * x[0] - x[1] - x[0] * x[2]; dxdt[2] = x[0]*x[1] - b * x[2]; } state_type x = {{ 1.0 , 0.0 , 0.0 }}; ode_step_euler< state_type > stepper; double t = 0.0; // iterate the ODE by hand with constant stepsize for( size_t oi=0 ; oi<10000 ; ++oi,t+=dt ) stepper.next_step( lorenz , x , t , 0.01 ); // integrate the ODE with constant stepsize // from t = 0.0 to t = 100.0 with dt = 0.01 // and write t and x[0] to cout integrate_const( rk4 , lorenz , 0.0 , 0.01 , x , 100.0 , cout << _1 << tab << _2[0] << "\n" ); // stepsize controller for rk5 cash-karp controlled_stepper_standard< stepper_rk5_ck< state_type > > rk5_controlled( rk5 , eps_abs, eps_rel, 1.0, 1.0); // solve the ODE with an adaptive stepsize controller size_t steps = integrate_adaptive( controlled_rk5, lorenz, x, 0.0, 10.0 , 0.01, cout << _1 << tab << _2[0] << "\n" ); Best regards, Karsten

Hi, ----- Original Message ----- From: "Karsten Ahnert" <karsten.ahnert@gmx.de> To: <boost@lists.boost.org> Sent: Sunday, December 13, 2009 4:02 PM Subject: [boost] library proposal: odeint
If you don't reach to get the link, try with http://svn.boost.org/svn/boost/sandbox/odeint/
Please, could you post in this list when some documentation will be available? I will add a link on the Libraries Under Construction wiki as soon as some documentation is available on line(http://svn.boost.org/trac/boost/wiki/LibrariesUnderConstruction) Best, Vicente

I'm sure some will be interested in this - though it isn't Boost 'mainstream' so you should not be put off if you don't get millions of replies ;-) But the name 'odeint' seems ugly (and even uninformative) to me :-( Producing some docs might usefully be your first priority. (Suggestions: Use Quickbook 1.5 from the start, and imbed your code 'snippets' using the Quickbook mechanism provided. This prevents C++ code getting out of step with the docs, always very off-putting to users. Doxygen is also a help, especially if you 'Doxygenate' all functions and parameters fully). (You might also consider how this library would fit in with other (possibly future) libraries doing similar numerical things?) Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

Without meaning to be off putting, have you looked at pure C libraries like the GNU Scientific Library to see if they contain what you need? GSL's routines [1] are quite good and cover a large number of the features you mention. You might save yourself the trouble of writing and testing everything and instead only need to wrap the GSL routines with your C++ interface. If GSL doesn't contain exactly what you want (RK78 comes to mind), you'll probably find the GSL ODE framework quite useful for writing the stepper you want. If you choose to submit it there, then everyone in C- and C++-land benefits from the submission. - Rhys [1] http://www.gnu.org/software/gsl/manual/html_node/Ordinary-Differential-Equat...

On Mon, 14 Dec 2009, Rhys Ulerich wrote:
See also Sundials https://computation.llnl.gov/casc/sundials/main.html - Daniel

On Monday 14 December 2009 17:12:05 Rhys Ulerich wrote: the GSL has a major drawback: it uses its own, double based vector structure. It also has a very bulky interface which is not very intuitive to use - at least that's our impression. Say you want to solve a ode based for N-dimensional complex valued vector - GSL requires you to transform to a 2N dimensional real valued problem. odeint doesn't. Additionally, a header-only library often leads to faster code, at least to my understanding. Anyways, wrapping the GSL is not what we want to do.
- Rhys
Regards, Mario

on 13.12.2009 at 18:02 Karsten Ahnert wrote :
Hi,
I am new on this list and want to start a discussion if a library for solving ordinary differential equations (ODEs) would fit into boost.
i'd say that the domain which covers this lib is too specific for the boost collection on the other hand it's an interesting idea to establish a context for solving odes however there are VERY broad range of specific thing you should think about anyway good luck with your initiative -- Pavel ps i bet you are already familiar with the "numerical recipes", an outstanding book! if not -- you sertainly should
participants (7)
-
DE
-
dherring@ll.mit.edu
-
Karsten Ahnert
-
Mario Mulansky
-
Paul A. Bristow
-
Rhys Ulerich
-
vicente.botet