Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0
Syntax
C# |
---|
[SerializableAttribute] public class NumericalDerivatives |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Class NumericalDerivatives |
Visual C++ |
---|
[SerializableAttribute] public ref class NumericalDerivatives |
Remarks
NumericalDerivatives uses divided finite differences to compute the Jacobian. This class is designed for use in numerical methods for solving nonlinear problems where a Jacobian is evaluated repeatedly at neighboring arguments. For example, this occurs in a Gauss-Newton method for solving non-linear least squares problems or a non-linear optimization method.
NumericalDerivatives is suited for applications where the Jacobian is a dense matrix. All cases , , or are allowed. Both one-sided and central divided differences can be used.
The design allows for computation of derivatives in a variety of contexts. Note that a gradient should be considered as the special case with , . A derivative of a single function of one variable is the case , . Any non-linear solving routine that optionally requests a Jacobian or gradient can use NumericalDerivatives. This should be considered if there are special properties or scaling issues associated with . Use the method SetDifferencingMethods to specify different differencing options for numerical differentiation. These can be combined with some analytic subexpressions or other known relationships.
The divided differences are computed using values of the independent variables at the initial point , and differenced points . Here the , are the unit coordinate vectors. The value for each difference del depends on the variable j, the differencing method, and the scaling for that variable. This difference is computed internally. See SetPercentageFactor for computational details. The evaluation of is normally done by the user-provided method NumericalDerivatives.IFunction.F, using the values . The index j and values are arguments to NumericalDerivatives.IFunction.F.
The computational kernel of EvaluateJ performs the following steps: evaluate the equations at the point y using NumericalDerivatives.IFunction.F.compute the Jacobian.compute the difference at .
By default, EvaluateJ uses NumericalDerivatives.IFunction.F in step 3. The user may choose to override the EvaluateF method to extend the capability of the class beyond the default.
There are six examples provided which illustrate various ways to use NumericalDerivatives. A discussion of the expected errors for these difference methods is found in A First Course in Numerical Analysis, Anthony Ralston, McGraw-Hill, NY, (1965).