From: Jan Simon on
Dear Bruno!

> The runge-kutta scheme (ode45) *is* a predictor-corrector method.

No, Runge-Kutta 45 uses the two different methods "4" and "5" to estimate the local error and control the step size. But it is not a predictor-corrector method, e.g. as an Adams-Bashforth-Moulten method.

Kind regards, Jan
From: Jan Simon on
Dear Manuel!

> The calculation of the forces is correct. But if you look at the first time-step, the ode-solver accesses the force calculation and then integrates the equation of motion. The magnitude of the force changes during the time-step. For instance, ode starts at t_0 and calculates F, integrates the equation and reaches time-step t_1 = t_0 + h, with h being the step-size. The magnitude of F at time, let's say, t = t_0 + h/2, is different, due to the displacement x, but the integration is based on F(t_0,x_0,dx_0). So does ode take care of this inexactness?

The ODE45 method takes care of this inexactness. For the calculation of a single time step, several intermediate values of the forces, velocities and accelerations are evaluated. The ODE uses two schemes to calculate a step with a 4th and 5th order method and if the results are greater than a certain absolute or relative limit, the step size is reduced.
But of course every single step integration method has a discretization error by dividing the time in a finite number of steps. Nevertheless, if you try to increase the accuracy by using a tiny step size for small discretization errors, the computer calculates a ridiculous number of steps and the global error will be dominated by the increasing accumulated rounding errors! So a so-called valid integration is a balance between the local discretization error and the loss of accuracy due to rounding.
To control the global error, you can vary the initial conditions by a small value and examine the difference of the results.

Kind regards, Jan
From: Bruno Luong on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <ho8kh8$nia$1(a)fred.mathworks.com>...

>
> No, Runge-Kutta 45 uses the two different methods "4" and "5" to estimate the local error and control the step size. But it is not a predictor-corrector method, e.g. as an Adams-Bashforth-Moulten method.
>
> Kind regards, Jan

It seems you are right Jan. I stand corrected.

Bruno
From: Manuel on
I think ode does solve the problem properly.
Thanks a lot for your help.
Regards.