Mantissa (Mathematical Algorithms for Numerical Tasks In Space System Applications)
Mantissa is a collection of various mathematical tools aimed towards for simulation. It is not a complete mathematical library like GSL, NAG or IMSL, but it contains various algorithms useful for dynamics simulation and 3D geometry computation.
The library error messages in exceptions are internationalized (only english and french are supported for now).
Mantissa contains a collection of algorithms, among which:
- a small set of linear algebra classes
- least squares estimator (one Gauss-Newton based, one Levenberg-Marquardt based, which should even work for over-determined systems)
- some curve fitting classes
- several ordinary differentials equations integrators, either with fixed steps or adaptive stepsize control (see below)
- vectors and rotations in a three dimensional space
- algebra-related classes like rational and double polynomials
- various orthogonal polynomials:
- some random numbers and vectors generation classes:
- Robert M. Ziff four tap shift register (contributed by Bill Maier)
- Makoto Matsumoto and Takuji Nishimura Mersenne twister
- generators for vectors with correlated components
- some basic (min, max, mean, standard deviation) statistical analysis classes
- some optimization algorithms using direct search methods:
- the Nelder-Mead simplex method
- Virginia Torczon's multi-directional method
Mantissa is devoted to be a general purpose library, however, its most popular feature is an extensive package for Ordinary Differential Equations integration. This package is intended to be very efficient and provide a complete ODE integration framework with many practical controls while still remaining a simple to use tool.
At the time of writing (October 2004), the integrators provided are:
- classical Runge-Kutta
- Higham and Hall 5(4)
- Dormand-Prince 5(4)
- Dormand-Prince 8(5,3)
All integrators provide dense output. This means that besides computing the state vector at discrete times, they also provide a cheap mean to get the state between the time steps.
All integrators handle multiple switching functions. This means that the integrator can be driven by discrete events (occurring when the signs of user-supplied switching functions change). The steps are shortened as needed to ensure the events occur at step boundaries (even if the integrator is a fixed-step integrator). When the events are triggered, integration can be stopped (this is called a G-stop facility), the state vector can be changed, or integration can simply go on. The latter case is useful to handle discontinuities in the differential equations gracefully and get accurate dense output even close to the discontinuity.
The solution of the integration problem is provided by two means. The first one is aimed towards simple use: the state vector at the end of the integration process is copied in a user-supplied array. The second one should be used when more in-depth information is needed throughout the integration process. The user can register an object implementing the StepHandler interface into the integrator before performing integration. The user object will be called appropriately during the integration process, allowing the user to process intermediate results. The default step handler does nothing. Mantissa also provides a special-purpose step handler that is able to store all steps and to provide transparent access to any intermediate result once the integration is over. This object is serializable, hence a complete continuous model of the integrated function throughout the integration range can be reused later (if stored into a persistent medium like a filesystem or a database) or elsewhere (if sent to another application in a distributed system).
Some integrators (the simple ones) use fixed steps that are set at creation time. The more efficient integrators use variable steps that are handled internally in order to control the integration error with respect to a specified accuracy. Adaptive stepsize integrators can automatically compute the initial stepsize by themselves, however the user can specify it if he prefers to retain full control over the integration or if the automatic guess is wrong.