An initial value problem for a simple autonomous differential equation may develop singularities that prevent most time-discrete integrators from following the trajectory reliably. An example of this phenomenon is given by the ODE

, for which the initial condition

yields the solution

. This ODE describes the rotation of a rigid body around an axis fixed in space in a formalism that describes the attitude of the body by Euler–Rodrigues parameters (instead of, say, Euler angles or orthogonal matrices). Thus we have a setting that asks for continuing the trajectory across the singularities, which occur whenever

is

plus some integer multiple of

.

In this Demonstration you see how a specific integration method (namely, the asynchronous leapfrog method) solves this problem by implementing the idea that the value range is actually a compact space by means of a one-point compactification that lets very large positive values

lie in a neighborhood of

. For sufficiently large values of

we may change

into

, thereby bringing about only a minute change.

This Demonstration lets you vary the value

at which this sign switch of

will be done. In addition, you can set the more conventional determinants of the initial value problem as

and the total number of integration steps. Further, you can enable the generation and display of the reversed trajectory. Playing with

, you can always find a value that gives good agreement between the exact solution (black dots) and the integrator-generated one. This setting shows some dependency on the step number. A robust method for continuing the trajectory with good accuracy across the singularity probably needs to use variable step size, a situation for which the asynchronous leapfrog integrator was originally designed. The details section describes the handling of a second type of singularity as it occurs for

.