Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unfortunately, ode_solve presently does not allow for backwards integration. (For reference, in the file "devel/sage/sage/gsl/ode.pyx", the line

while (t < t_end):

controls the loop that evolves the system) The documentation of GSL suggests that the latest versions of the library should be able to integrate backwards, but naive changes to the python interface routine didn't solve the problem for me.

work-around: you could rewrite your system in s=-t and integrate from s=-10 to 0 instead.

An alternative is scipy.integrate.odeint. I haven't found a thorough comparison of the GSL and SciPy (ODEPACK) ODE solvers, though, and I haven't checked if ODEPACK allows for backwards integration.