Copy from solar project: Dormand-Prince solver