User Manual 4.0 Numerical differentiation and integration : Différence entre versions
m (Admin a déplacé la page Numerical differentiation and integration vers User Manual 4.0 Numerical differentiation and integration sans laisser de redirection) |
(→Package Overview) |
||
(8 révisions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
− | + | __NOTOC__ | |
− | + | ||
== Introduction == | == Introduction == | ||
=== Scope === | === Scope === | ||
Ligne 11 : | Ligne 10 : | ||
The numerical integrator objects are available in the package <code>fr.cnes.sirius.patrius.math.analysis.integration</code>. | The numerical integrator objects are available in the package <code>fr.cnes.sirius.patrius.math.analysis.integration</code>. | ||
− | | | + | {| class="wikitable" |
− | | | + | |- |
− | | | + | ! scope="col"| Library |
+ | ! scope="col"| Javadoc | ||
+ | |- | ||
+ | |Patrius | ||
+ | |[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/analysis/differentiation/package-summary.html Package fr.cnes.sirius.patrius.math.analysis.differentiation] | ||
+ | |- | ||
+ | |Patrius | ||
+ | |[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/analysis/integration/package-summary.html Package fr.cnes.sirius.patrius.math.analysis.integration] | ||
+ | |} | ||
=== Links === | === Links === | ||
Ligne 28 : | Ligne 35 : | ||
The numerical differentiation conception is described hereafter : | The numerical differentiation conception is described hereafter : | ||
− | [[File:differentiators. | + | [[File:differentiators.png|center]] |
Accuracy of integration method (all examples are based on sinus function): | Accuracy of integration method (all examples are based on sinus function): | ||
− | |= | + | {| class="wikitable" |
− | | | + | |- |
− | | | + | ! scope="col"| Default setting |
− | | | + | ! scope="col"| Value |
− | | | + | |- |
+ | |Maximum absolute error | ||
+ | |1.0e-15 | ||
+ | |- | ||
+ | |Maximum relative error | ||
+ | |1.0e-6 | ||
+ | |- | ||
+ | |Maximum number of iterations | ||
+ | |64 | ||
+ | |- | ||
+ | |Minimum number of iterations | ||
+ | |3 | ||
+ | |} | ||
Note : the accuracy of the results and the computing time are directly dependent on the value of maximum relative error. | Note : the accuracy of the results and the computing time are directly dependent on the value of maximum relative error. | ||
Ligne 45 : | Ligne 64 : | ||
==== Finite difference ==== | ==== Finite difference ==== | ||
− | + | Finite difference is the discrete analog of the derivative. The user can choose the number of points to use and the step size (the gap between each point). | |
==== Ridders algorithm ==== | ==== Ridders algorithm ==== | ||
− | + | The derivative of a function at a point x is computed using the Ridders method of polynomial extrapolation. | |
=== Numerical Integration === | === Numerical Integration === | ||
Ligne 94 : | Ligne 113 : | ||
== Contents == | == Contents == | ||
=== Interfaces === | === Interfaces === | ||
− | | | + | {| class="wikitable" |
− | | | + | |- |
− | | | + | ! scope="col"| Interface |
+ | ! scope="col"| Summary | ||
+ | ! scope="col"| Javadoc | ||
+ | |- | ||
+ | |'''UnivariateFunctionDifferentiator''' | ||
+ | |This interface represents a generic numerical differentiator. | ||
+ | |[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/analysis/differentiation/UnivariateFunctionDifferentiator.html ...] | ||
+ | |- | ||
+ | |UnivariateIntegrator | ||
+ | |Interface for univariate integration algorithms. | ||
+ | |[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/analysis/integration/UnivariateIntegrator.html ...] | ||
+ | |} | ||
=== Classes === | === Classes === | ||
− | | | + | {| class="wikitable" |
− | | | + | |- |
− | | | + | ! scope="col"| Class |
− | | | + | ! scope="col"| Summary |
− | | | + | ! scope="col"| Javadoc |
+ | |- | ||
+ | |'''FiniteDifferencesDifferentiator''' | ||
+ | |Apply the finite difference method to differentiate a function. | ||
+ | |[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/analysis/differentiation/FiniteDifferencesDifferentiator.html ...] | ||
+ | |- | ||
+ | |'''RiddersDifferentiator''' | ||
+ | |Apply the Ridders algorithm to differentiate a function. | ||
+ | |[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/analysis/differentiation/RiddersDifferentiator.html ...] | ||
+ | |- | ||
+ | |TrapezoidIntegrator | ||
+ | |The class implements the Trapezoidal rule | ||
+ | |[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/analysis/integration/TrapezoidIntegrator.html ...] | ||
+ | |- | ||
+ | |SimpsonIntegrator | ||
+ | |The class implements the Simpson rule | ||
+ | |[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/analysis/integration/SimpsonIntegrator.html ...] | ||
+ | |} | ||
+ | |||
+ | [[Category:User_Manual_4.0_Mathematics]] |
Version actuelle en date du 21 février 2018 à 08:36
Introduction
Scope
This section détails numerical differentialtion and integration (not to be misunderstood with numerical integration of ODE). A focus is realised on:
- differentiation methods of real univariate functions: Ridders and finite difference.
- integration methods of real univariate functions : Trapezoidal and Simpson.
Javadoc
The numerical differentiator objects are available in the package fr.cnes.sirius.patrius.math.analysis.differentiation
.
The numerical integrator objects are available in the package fr.cnes.sirius.patrius.math.analysis.integration
.
Library | Javadoc |
---|---|
Patrius | Package fr.cnes.sirius.patrius.math.analysis.differentiation |
Patrius | Package fr.cnes.sirius.patrius.math.analysis.integration |
Links
Links to the implemented integration methods :
http://mathworld.wolfram.com/TrapezoidalRule.html
http://mathworld.wolfram.com/SimpsonsRule.html
Useful Documents
None as of now.
Package Overview
The numerical differentiation conception is described hereafter :
Accuracy of integration method (all examples are based on sinus function):
Default setting | Value |
---|---|
Maximum absolute error | 1.0e-15 |
Maximum relative error | 1.0e-6 |
Maximum number of iterations | 64 |
Minimum number of iterations | 3 |
Note : the accuracy of the results and the computing time are directly dependent on the value of maximum relative error.
Features Description
Numerical differentiation
Finite difference
Finite difference is the discrete analog of the derivative. The user can choose the number of points to use and the step size (the gap between each point).
Ridders algorithm
The derivative of a function at a point x is computed using the Ridders method of polynomial extrapolation.
Numerical Integration
Trapezoidal method
The trapezoidal rule works by approximating the region under the graph of the function as a trapezoid and calculating its area.
UnivariateFunction f = new SinFunction(); UnivariateIntegrator integrator = new TrapezoidIntegrator(); double r = integrator.integrate(10000, f, 0, FastMath.PI);
Result : r = 1.9999996078171345 (exact result = 2)
And :
integrator = new TrapezoidIntegrator(1.e-12, 1.0e-15, 3, 64); r = integrator.integrate(10000000, f, 0, FastMath.PI);
Result : r = 1.9999999999904077
But :
integrator = new TrapezoidIntegrator(1.e-13, 1.0e-15, 3, 64); r = integrator.integrate(10000000, f, 0, FastMath.PI);
Result : r = no result (infinite time !)
Simpson method
Simpson's rule is a Newton-Cotes formula for approximating the integral of a function using quadratic polynomials (i.e., parabolic arcs instead of the straight line segments used in the trapezoidal rule). In general, this method has faster convergence than the trapezoidal rule for functions which are twice continuously differentiable, though not in all specific cases.
UnivariateFunction f = new SinFunction(); UnivariateIntegrator integrator = new SimpsonIntegrator(); double r = integrator.integrate(10000, f, 0, FastMath.PI);
Result : r = 2.000000064530001 (exact result = 2)
Getting Started
Modèle:SpecialInclusion prefix=$theme sub section="GettingStarted"/
Contents
Interfaces
Interface | Summary | Javadoc |
---|---|---|
UnivariateFunctionDifferentiator | This interface represents a generic numerical differentiator. | ... |
UnivariateIntegrator | Interface for univariate integration algorithms. | ... |
Classes
Class | Summary | Javadoc |
---|---|---|
FiniteDifferencesDifferentiator | Apply the finite difference method to differentiate a function. | ... |
RiddersDifferentiator | Apply the Ridders algorithm to differentiate a function. | ... |
TrapezoidIntegrator | The class implements the Trapezoidal rule | ... |
SimpsonIntegrator | The class implements the Simpson rule | ... |