Runge-Kutta ODE solver with adaptive step size