The initial value problem under consideration is

,

. The discrete trajectory gives values

for the times

. In addition to these values, the asynchronous leapfrog method gives velocities

that are defined by the time-stepping algorithm upon initialization as

.

Let

and let

,

, and

be given. Set

,

,

,

,

,

. Writing the step algorithm as a value change of the fixed variables

,

,

, it becomes shorter and more symmetrical:

,

,

,

,

. This is the form used in this Demonstration.

Although in our case

is simply real-valued, the algorithm only assumes that its values belong to some real affine space. Our adaptive step control algorithm assumes that the underlying vector space (to which the values

of

belong) is a normed linear space. With a step we associate the kink

. For this dimensionless quantity, we specify a tolerated maximum value

, for example, 1/1000. If the kink exceeds this value, this is taken as a sign that the terrain is getting more difficult. We therefore discard the present value of

and reinitialize it as

, and we decrease the step size by multiplying it by

, for example,

. If the kink is found to be smaller than

, this is taken as a sign that the terrain is getting easier, and we simply increase the step size by multiplying it with

. Computing the kink does not entail an evaluation of

. However, in the case of an objectionably large kink, we have to reinitialize, which does entail an evaluation of

. Of course, it is not mandatory to couple the parameters for treating the easy terrain and the difficult terrain in exactly the way chosen here.