Integrating across Singularities

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

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 .


Contributed by: Ulrich Mutze (March 2011)
Open content licensed under CC BY-NC-SA



By checking the box "tangent squared", you replace the ODE by an ODE that is constructed such that its solution is . For this we have . The sign factor has to switch whenever the trajectory passes a singularity and also when . As the program shows, the asynchronous leapfrog integrator can easily be made to do this switching. So it is not necessary to know in advance the values for which switching has to take place.

Snapshot 1: adjusted for good representation of the exact solution

Snapshot 2: not so well adjusted; no good behavior of the reversed trajectory

Snapshot 3: set too large; complete disorder after the first singularity


[1] Ulrich Mutze, An Asynchronous Leap-Frog Method, 2008.

[2] Alternate link for [1]:

[3] Ulrich Mutze, On Vectors, Points, Rotations, and Rigid Bodies.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.