<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://patrius.cnes.fr/index.php?action=history&amp;feed=atom&amp;title=User_Manual_4.2_Math_frameworks</id>
	<title>User Manual 4.2 Math frameworks - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://patrius.cnes.fr/index.php?action=history&amp;feed=atom&amp;title=User_Manual_4.2_Math_frameworks"/>
	<link rel="alternate" type="text/html" href="https://patrius.cnes.fr/index.php?title=User_Manual_4.2_Math_frameworks&amp;action=history"/>
	<updated>2026-04-08T01:21:59Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://patrius.cnes.fr/index.php?title=User_Manual_4.2_Math_frameworks&amp;diff=2170&amp;oldid=prev</id>
		<title>Admin : Page créée avec « __NOTOC__ == Introduction == === Scope === This section describes PATRIUS handling of low-level math frameworks. A low-level math framework provides simple math operations... »</title>
		<link rel="alternate" type="text/html" href="https://patrius.cnes.fr/index.php?title=User_Manual_4.2_Math_frameworks&amp;diff=2170&amp;oldid=prev"/>
		<updated>2019-01-14T14:59:56Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « __NOTOC__ == Introduction == === Scope === This section describes PATRIUS handling of low-level math frameworks. A low-level math framework provides simple math operations... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
=== Scope ===&lt;br /&gt;
This section describes PATRIUS handling of low-level math frameworks.&lt;br /&gt;
A low-level math framework provides simple math operations such as sin, cos, exp, etc. Before PATRIUS 4.2, the only existing framework is &amp;lt;code&amp;gt;FastMath&amp;lt;/code&amp;gt;.&lt;br /&gt;
Since version 4.2, the notion of math framework has been generalized and the user can use various framework:&lt;br /&gt;
* FastMath&lt;br /&gt;
* JAFAMA 2.1.0 FastMath&lt;br /&gt;
* JAFAMA 2.1.0 StrictFastMath&lt;br /&gt;
* Its own defined framework&lt;br /&gt;
&lt;br /&gt;
JAFAMA is a fast open-source Math library. To be usable in PATRIUS, a dependency to JAFAMA 2.1.0 has been added in PATRIUS pom.xml file.&lt;br /&gt;
&lt;br /&gt;
=== Javadoc ===&lt;br /&gt;
The math framework classes are available in the package &amp;lt;code&amp;gt;fr.cnes.sirius.patrius.math.framework&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Library&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Javadoc&lt;br /&gt;
|-&lt;br /&gt;
|Patrius &lt;br /&gt;
|[{{JavaDoc4.2}}/fr/cnes/sirius/patrius/math/framework/package-summary.html Package fr.cnes.sirius.patrius.math.framework]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
One of the framework available is JAFAMA. JAFAMA is an open-source library under Apache 2.0 licence.&lt;br /&gt;
More information can be found at https://github.com/jeffhain/jafama&lt;br /&gt;
&lt;br /&gt;
=== Useful Documents ===&lt;br /&gt;
None as of now.&lt;br /&gt;
&lt;br /&gt;
=== Package Overview ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features Description ==&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
A low-level Math framework is a class implementing all the original &amp;lt;code&amp;gt;FastMath&amp;lt;/code&amp;gt; functions (sin, exp, min, atan, etc.).&lt;br /&gt;
All low-level Math framework should implement the &amp;lt;code&amp;gt;MathLibrary&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
Currently there are three implementations of the MathLibrary interface:&lt;br /&gt;
* &amp;lt;code&amp;gt;FastMathWrapper&amp;lt;/code&amp;gt; which is a wrapper for FastMath static class.&lt;br /&gt;
* &amp;lt;code&amp;gt;JafamaFastMathWrapper&amp;lt;/code&amp;gt; which is a wrapper for JAFAMA FastMath static class.&lt;br /&gt;
* &amp;lt;code&amp;gt;JafamaStrictFastMathWrapper&amp;lt;/code&amp;gt; which is a wrapper for JAFAMA StrictFastMath static class.&lt;br /&gt;
The user can also define its own low-level Math framework by providing its own implementation of the &amp;lt;code&amp;gt;MathLibrary&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
Then in order to use the chosen low-level Math framework, the user must use the static class &amp;lt;code&amp;gt;MathLib&amp;lt;/code&amp;gt;:&lt;br /&gt;
* By first defining the Math framework to use with methods &amp;lt;code&amp;gt;MathLib.setMathLibrary()&amp;lt;/code&amp;gt; if different from FastMath.&lt;br /&gt;
* By then using the MathLib functions like the FastMath functions: &amp;lt;code&amp;gt;MathLib.sin(...)&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: by default, FastMath is set as the low-level Math library.&lt;br /&gt;
Note 2: inner PATRIUS functions call MathLib which by default call FastMath. Hence there is strictly no numerical differences between use of PATRIUS 4.2 or older versions of PATRIUS.&lt;br /&gt;
&lt;br /&gt;
When the user defines a low-level math framework then all PATRIUS operations are performed using this framework.&lt;br /&gt;
&lt;br /&gt;
=== Performances of available Math framework ===&lt;br /&gt;
&lt;br /&gt;
==== Computation times ====&lt;br /&gt;
&lt;br /&gt;
Here are displayed computation time gains with using JAFAMA library (reference: FastMath).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Jafama FastMath&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Jafama StrictFastMath&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Numerical propagation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;center&amp;gt;≈ -10%&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;≈ -10%&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Analytical propagation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;center&amp;gt;≈ -30%&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;≈ -30%&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Attitude computation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;center&amp;gt;≈ -10%&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;≈ -10%&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: these are averaged orders of magnitude and may vary from one case to another.&lt;br /&gt;
&lt;br /&gt;
==== Accuracy ====&lt;br /&gt;
&lt;br /&gt;
As stated in JAFAMA website, relative accuracy of operations is 1E-15 (no regression would required a relative accuracy better than 1E-16). As a result, use of PATRIUS with JAFAMA will lead to slightly different results. This will not occur on all operations.&lt;br /&gt;
&lt;br /&gt;
Here are displayed absolute/relative error for standard PATRIUS uses with using JAFAMA library (reference: FastMath).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Item&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Jafama FastMath&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Jafama StrictFastMath&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Framework functions&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-15 rel.&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-15 rel.&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Low-level space mechanics functions&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-15 rel.&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-15 rel.&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;LEO propagation on 24h&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-6m&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-6m&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GEO propagation on 24h&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-5m&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-5m&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;GTO propagation on 24h&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-6m&amp;lt;/center&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;&amp;lt;1E-6m&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Roughly, an absolute accuracy on position of 1E-6m for LEO orbits means a relative accuracy of 1E-12.&lt;br /&gt;
&lt;br /&gt;
The accuracy (with respect to FastMath) is directly correlated to the number of used JAFAMA operations. To get an idea of what accuracy to expect:&lt;br /&gt;
* 1 single JAFAMA operation leads to a relative accuracy of 1E-15 or better&lt;br /&gt;
* 1 propagation over 24 h (with millions calls to JAFAMA) leads to a relative accuracy of 1E-12&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
In the following section are defined potential use of Math framework.&lt;br /&gt;
&lt;br /&gt;
=== Simple user ===&lt;br /&gt;
&lt;br /&gt;
This user does not want to change anything with PATRIUS 4.2 upgrade. He has two options:&lt;br /&gt;
* Continue to use FastMath and do nothing in particular:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;final double y = FastMath.sin(x);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Still use FastMath through the use of MathLib&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;final double y = MathLib.sin(x);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note: by default, MathLib calls FastMath.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate user ===&lt;br /&gt;
&lt;br /&gt;
This user wants to use another Math framework (here FastMath from JAFAMA):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
MathLib.setMathLibrary(MathLibraryType.JAFAMA_FASTMATH);&lt;br /&gt;
final double y = MathLib.sin(x);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced user ===&lt;br /&gt;
&lt;br /&gt;
This user wants to use his own math framework:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;final MathLibrary myOwnFramework = new MathLibrary() {&lt;br /&gt;
    public double sin(final double x) {&lt;br /&gt;
        return ...;&lt;br /&gt;
    }&lt;br /&gt;
    ...&lt;br /&gt;
}&lt;br /&gt;
MathLib.setMathLibrary(myOwnFramework);&lt;br /&gt;
final double y = MathLib.sin(x);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contents ==&lt;br /&gt;
=== Interfaces ===&lt;br /&gt;
The library defines the following interfaces related to math frameworks:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Interface&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Summary&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Javadoc&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;MathLibrary&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Interface for low-level Math framework&lt;br /&gt;
|[{{JavaDoc4.2}}/fr/cnes/sirius/patrius/math/framework/MathLibrary.html ...]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Classes ===&lt;br /&gt;
The library defines the following classes related to low-level Math frameworks:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Class&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Summary&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Javadoc&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;MathLib&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Static class for generic low-level math functions use&lt;br /&gt;
|[{{JavaDoc4.2}}/fr/cnes/sirius/patrius/math/MathLib.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;MathLibraryType&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Enumeration for currently available Math framework in PATRIUS&lt;br /&gt;
|[{{JavaDoc4.2}}/fr/cnes/sirius/patrius/math/framework/MathLibraryType.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;FastMathWrapper&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Wrapper of FastMath class implementing MathLibrary interface&lt;br /&gt;
|[{{JavaDoc4.2}}/fr/cnes/sirius/patrius/math/framework/FastMathWrapper.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;JafamaFastMathWrapper&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Wrapper of Jafama FastMath class implementing MathLibrary interface&lt;br /&gt;
|[{{JavaDoc4.2}}/fr/cnes/sirius/patrius/math/framework/JafamaFastMathWrapper.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;JafamaStrictFastMathWrapper&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Wrapper of Jafama StrictFastMath class implementing MathLibrary interface&lt;br /&gt;
|[{{JavaDoc4.2}}/fr/cnes/sirius/patrius/math/framework/JafamaStrictFastMathWrapper.html ...]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;FastMath&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Original class from PATRIUS providing low-level math functions&lt;br /&gt;
|[{{JavaDoc4.2}}/fr/cnes/sirius/patrius/math/FastMath.html ...]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Manual_4.2_Mathematics]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>