Introduction
Numeric Differentiation Defines the approximate value of a certain derivative or high order derivative according to the function value of some discrete points. It is usually used instead of the micro-business, or the corresponding derivative of a more simple function (such as polynomial or spike function, etc.) can be used to approximate the function. For example, some common numerical microforms (such as two-point formula, three-point formula, etc.) are approximation of interpolation polynomial in an equidistant step length. In addition, numerical differential forms of each step of derivative can be established, and an extraction technique can be used to improve the accuracy of the similar value. When the function is not very good, the numerical differential is more appropriate than the polynomial interpolation. If the data on the discrete point can not be ignored, it should be used instead of the function interpolation using a curve, and then use the equivalent value of the fitted curve as the approximate value of the resulting derivative, this approach can reducing the role of random errors. Numerical differential formula or an important basis for the numerical solution of differential equations.
Finite difference method
The easiest way is to use a finite difference approach.
Simple two-point estimation method is to calculate ( x , f (x) ) and adjacent points ( x + h , f (x + h) 2 point to form a slope of the cutting line Select a small value h , indicating small changes in x However, it can be a positive or negative value. Its slope is
This representation is Newton's difference, also known as a first order.
The slope of the cutting line and the tangent slope have some differences, and the difference is approximately proportional to h . If h approximates 0, the cutting line slope is similar to the tangent slope. Therefore, the function f is truly in x is a difference between the cutting line approaches the tangent:
If h is directly replaced by zero, the calculation derivation requires some unauthorized ways.
Take the tangent, the tangent slope can also be similar to the mounting slope of X - H) and X.
Another two-point estimate is used ( xh , f (xh) ) and ( x + h , f (x + h) ) 2. The slope is
The above formula is called Symmetric differential, its primary error is equal, so the difference between the cutting line slope and the tangent slope is proportional to the
Estimation error is:
where C is a point between X-H and X + H. This error does not include rounding errors due to finite accuracy.
Many engineering computers are calculated using symmetric differentials, like Ti-82, Ti-83, Ti-83, Ti-84, Ti-83, Ti-84 and Ti-85 of Texas Instruments (Ti), H = 0.001.
Although the value of the above two methods is criticized by the researcher, especially by some researchers who encourage the use of automatic differential, because the above numerical differentiation has little accuracy If the accuracy of the calculator is a six-digit number, only the symmetric differential calculation derivative is only three-digit accuracy, and if a function of calculating a slope is found, there can be almost six-digit accuracy. For example, it is assumed that f (x) = x, with a 2X calculation slope has almost complete accuracy, and the difference is similar to the above problem.
Using the floating point number
Under the floating point calculation, the rounding error and formula error caused by different H, only the error is minimum at a particular value
< P> If the floating point number is used, it is necessary to consider h to get more. If it is too small, there will be a big rounding error after the subtraction, in fact, the entire finite difference formula is morbid, if h is small enough, the derivative is not zero, After institutional, the value of differentiation is zero, if the h size, calculating the result of the cutting slope will be more accurate, but the error of the tangent slope is estimated with a cutting line slope. A small h , but does not generate a rounding error is
The above-mentioned minimum floating point number is for dual precision (64-bit) variables, and single precision variables are hardly practical in such calculations. It is unlikely to be "integer" in binary. Although x is a number represented by floating point number, but x + h is hardly It is also a number of floating point numbers (and "different and x ), so x + h needs to be adjusted to the machine readable number, therefore Appears ( x ) - x is not equal to h , so When calculating the value with two functions, the difference is calculated, the difference in the two positions will not be h . Almost all decimal scores are cyclic decimals under binary (all like 1/3 in decimal) One, for example, h = 0.1 will be a circulating decimal in binary, is 0.000110011001100 .... So a possible calculated manner in the floating point number is:
h: = SQRT (EPS) * x; xph: = x + h; dx: = xph - x; slope: = (f (xph) - f (x)) / dx;
first calculation (< I> x+ h ) - x uses this value as a differential branchuner, but if it is calculated by computer, the compiler is optimized The functionality may be considering DX and H , thus failing the above manner. If you use C or other similar programming language, you can let xph Announce this problem to avoid this problem.
High-order method
also uses a method of higher order estimation derivatives, or estimates how high-order derivatives.
The following is a five-point law of first-order priority (one-dimensional five-point template)
in which
Differential Solving
Differential Suggestial Quadrature is the weighted and approximate derivative of functions in a specific location value, and its name is used in similar numerical points ( Quadrature, that is, the weighted and weighted and in Simpson Method, there are many ways to find weighted coefficients, which can be used to decrease in differential dense equations.
Method
Traditionally, the approximate numerical differentiation is ill, but if f is a full-purity function, the value on the real shaft is the real number, and the value of the recipient is adjacent to the position, this The way is a numerical stable manner, for example, first-order derivative can calculate the following plural derivative formula:
The above formula is only the first order derivative Effective, to expand to any stage, you need to use multiple repetitions, and the result will also be multiple replica derivatives.
and the derivative of the arbitrary order can calculate:
The integration is calculated using numerical integration.
Lyness and Moler propose the number of variables in 1967 to calculate the numerical differential. Abate and Dubner propose an algorithm based on numerical inversion with multiple Laplas conversion.