org.apache.commons.math3.analysis.differentiation
Class RiddersDifferentiator

java.lang.Object
  extended by org.apache.commons.math3.analysis.differentiation.RiddersDifferentiator
All Implemented Interfaces:
UnivariateFunctionDifferentiator

public final class RiddersDifferentiator
extends Object
implements UnivariateFunctionDifferentiator

Implements Ridders method of polynomial extrapolation for differentiation of real univariate functions.
The algorithm implemented in this class comes from Numerical Recipes in Fortran 77 : the art of scientific computing.
With respect to the UnivariateDifferentiableFunction implementation, since this class uses a specific differentiation algorithm, the returned DerivativeStructure instances are constant ( they cannot provide derivatives other than the first order already computed when they are created).

Since:
1.2
Version:
$Id: RiddersDifferentiator.java 7740 2013-02-18 13:55:09Z CardosoP $
Author:
Tiziana Sabatini
Concurrency :
immutable

Constructor Summary
RiddersDifferentiator(double step)
          Constructor.
 
Method Summary
 double differentiate(double x, UnivariateFunction f)
          Differentiates a UnivariateFunction on a single point using the Ridders method.
 UnivariateDifferentiableFunction differentiate(UnivariateFunction function)
          Create an implementation of a differential from a regular function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RiddersDifferentiator

public RiddersDifferentiator(double step)
Constructor.

Parameters:
step - estimated initial stepsize: it needs not be small, but rather should be an increment in x over which the function changes substantially
Method Detail

differentiate

public double differentiate(double x,
                            UnivariateFunction f)
Differentiates a UnivariateFunction on a single point using the Ridders method.

Parameters:
x - value for the computation
f - function to be derivated
Returns:
the derivative value f'(x)

differentiate

public UnivariateDifferentiableFunction differentiate(UnivariateFunction function)
Create an implementation of a differential from a regular function.

Specified by:
differentiate in interface UnivariateFunctionDifferentiator
Parameters:
function - function to differentiate
Returns:
differential function


Copyright © 2016 CNES. All Rights Reserved.