[Tutor] hi

Oscar Benjamin oscar.j.benjamin at gmail.com
Mon Jul 22 21:25:13 CEST 2013


On 22 July 2013 18:45, Vick <vick1975 at orange.mu> wrote:
>
> The DOPRI 8(7)13 is the Dormand Prince 8th order with 13 stages method for
> solving ordinary differential equations. It is a member of the Runge-Kutta
> family of ODE solvers. I have been able to reproduce it in Python with a
> multi-variable capability. On a particular test equation the error of the
> RK4 is about 1e-4 whereas the DOPRI 8(7)13 is about 1e-13.

At this error level you should consider using Kahan-summation for the
increment step since rounding error is likely to be significant:
http://en.wikipedia.org/wiki/Kahan_summation_algorithm

Have you verified that the result is of order 8? i.e. you should
compute the local or global error as a function of dt (or h as it's
often known) and verify that log(error) vs log(dt) has the appropriate
slope.

Out of interest why do you choose to use this particular method? It
isn't commonly used so I wonder if there a reason that it is
particularly suited to your problem or if you would be better with
something else.

> I have then used the multi-variable DOPRI to compute for the n-body problem
> using 1st order ODEs which requires you to have 4 equations for 1 planet. I
> have already made a 10-body problem through an n-body solver in python and
> using DOPRI as my integrator.

Do you have a way of testing accuracy in this situation (conservation
of energy perhaps)?


Oscar


More information about the Tutor mailing list