Finite Difference Method.Central Method
Constructs a new finite difference method that uses central differences
to approximate a derivative of the specified order.
Definition
Namespace: Numerics.NET.Calculus
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
A FiniteDifferenceMethod object.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
public static FiniteDifferenceMethod Central(
int derivativeOrder,
int accuracyOrder
)
Parameters
- derivativeOrder Int32
- The order of the derivative to compute.
- accuracyOrder Int32
- The accuracy order of the method.
Return Value
FiniteDifferenceMethodA FiniteDifferenceMethod object.
Remarks
The accuracy order of the method is the smallest exponent of the step size in the error of the approximation. As a result, higher order methods allow for larger step sizes.
Central finite difference methods evaluate the function at values that may be smaller or greater than the point where the derivative is requested.
Central differences are generally more accurate than both forward and backward differences using the same number of points. However, the computation may fail for points close to a singularity of the function.
Exceptions
Argument | derivativeOrder is less than zero. -or- accuracyOrder is less than one. |