|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.nabla.numerical.FiniteDifferencesDifferentiator
public abstract class FiniteDifferencesDifferentiator
This class represents a differentiation scheme based on finite differences.
The differences are based on regularly distributed points around the
central test point according to a given h step.
For example a four points scheme would use a linear combination of points
f(x-2h)
, f(x-h)
, f(x+h)
and
f(x+2h)
to compute the first derivative f'(x)
(note that f(x)
by itself is not used for the evaluation of
f'(x)
, but is used to compute the value of the function
f(x)
The computed differential is only an approximation. The error depends on
the value of the high order derivatives of the function which were not
canceled by the linear combination, the number of points and the step size.
For example the four points scheme cancels the
f(2)
, f(3)
and
f(4)
high order derivatives but not the
f(5)
and higher order terms. The theoretical error
model for this scheme is -2h4/5 f(5)(x) +
O(h6)
. This model doesn't take into account numerical
cancellation which occur when the steps are too small.
The general expression of the theoretical error model is
A f(k) + O(hk+1)
where A
is the value returned by getSignedErrorScaleFactor()
and
k
is the value returned by getOrderFirstNonCanceled()
.
Constructor Summary | |
---|---|
protected |
FiniteDifferencesDifferentiator(double stepSize,
double factor,
int order)
Simple constructor. |
Method Summary | |
---|---|
int |
getOrderFirstNonCanceled()
Get the order of the first non-canceled derivative. |
double |
getSignedErrorScaleFactor()
Get the signed error scale factor for the finite differences scheme. |
protected double |
getStepSize()
Get the step size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.nabla.core.UnivariateDifferentiator |
---|
differentiate |
Constructor Detail |
---|
protected FiniteDifferencesDifferentiator(double stepSize, double factor, int order)
stepSize
- step stepSizefactor
- error scale factororder
- order of the first non-canceled derivativeMethod Detail |
---|
public double getSignedErrorScaleFactor()
The error scale factor is the value of the h-dependent
factor of the first non-canceled high order differential of the function.
For example since the error model for the four points scheme is
-2h4/5 f(5)(x) + O(h6)
,
the signed error scale factor is -2h4/5
.
getOrderFirstNonCanceled()
public int getOrderFirstNonCanceled()
The error model of the scheme depends on the first non-canceled
high order differential of the function. For example since the error
model for the four points scheme is -2h4/5
f(5)(x) + O(h6)
, the order of the first
non-canceled derivative is 5.
getSignedErrorScaleFactor()
protected double getStepSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |