Numerical differentiation

from Wikipedia, the free encyclopedia
Error behavior of numerical differentiation

In numerical mathematics , numerical differentiation denotes the approximate calculation of the derivative from given function values, usually by means of a difference quotient . This is necessary if the derivation function is not given or the function itself is only available indirectly, for example via measured values. In contrast to this, with automatic differentiation the code that defines the function under consideration is extended by a derivation function.

If the distance (h) between the function values ​​is small, the approximation would initially be better if the calculation was as precise as desired. However, when calculating using floating point numbers, deletion occurs, which is why the selected h must not fall below limits that are dependent on the machine accuracy.

Alternatively, one can use differentiable approximations of functions such as cubic splines . If you are not interested in the entire course of the function, but only in individual places, special formulas exist.

In practical application, the function values ​​are often faulty. Therefore, for example, Sobel operators are used for edge detection , which simultaneously perform smoothing. Another possibility is the use of smoothed splines (also called compensation splines).

Difference quotient

An obvious approach is to use the forward difference quotient:

However, the approximation is relatively poor compared to the extinction. A better approximation can be obtained by using the central difference quotient:

This approximation can be further improved by means of local polynomial interpolation . For the -notation see Landau symbols .

Numerical differentiation using complex variables

One problem with the application of a classical difference quotient is the choice of an optimal step size . Too large leads to rounding errors, while too small leads to cancellation . The numerical cancellation due to the subtraction can be achieved by the complex-valued approximation

be prevented.

Derivation

We consider the Taylor series of at the expansion point

Breaking off after the linear term and switching to delivers the above-mentioned forward difference quotient. We now replace the real step size with the imaginary step size and get

If we now consider only the imaginary part of this Taylor series, we get

which leads to the above-mentioned approximation of the derivative with the error if the linear term is aborted .

literature

  • Hans Rudolf Schwarz: Numerical Mathematics. 4th, revised and expanded edition. BG Teubner, Stuttgart 1997, ISBN 3-519-32960-3 .
  • Martin Hanke-Bourgeois: Fundamentals of numerical mathematics and scientific computing. BG Teubner, Stuttgart et al. 2002, ISBN 3-519-00356-2 .

Individual evidence

  1. ^ W. Squire, G. Trapp (1998) Using Complex Variables to Estimate Derivatives of Real Function, SIAM Rev. , 40 (1): 110-112. doi : 10.1137 / S003614459631241X