Hermite interpolation: Difference between revisions

From testwiki
Jump to navigation Jump to search
 
(No difference)

Latest revision as of 11:22, 21 January 2025

Template:Short description In numerical analysis, Hermite interpolation, named after Charles Hermite, is a method of polynomial interpolation, which generalizes Lagrange interpolation. Lagrange interpolation allows computing a polynomial of degree less than Template:Mvar that takes the same value at Template:Mvar given points as a given function. Instead, Hermite interpolation computes a polynomial of degree less than Template:Mvar such that the polynomial and its first few derivatives have the same values at Template:Mvar (fewer than Template:Mvar) given points as the given function and its first few derivatives at those points. The number of pieces of information, function values and derivative values, must add up to n.

Hermite's method of interpolation is closely related to the Newton's interpolation method, in that both can be derived from the calculation of divided differences. However, there are other methods for computing a Hermite interpolating polynomial. One can use linear algebra, by taking the coefficients of the interpolating polynomial as unknowns, and writing as linear equations the constraints that the interpolating polynomial must satisfy. For another method, see Template:Slink. For yet another method, see,[1] which uses contour integration.

Statement of the problem

In the restricted formulation studied in,[2] Hermite interpolation consists of computing a polynomial of degree as low as possible that matches an unknown function both in observed value, and the observed value of its first Template:Math derivatives. This means that Template:Math values (x0,y0),(x1,y1),,(xn1,yn1),(x0,y0),(x1,y1),,(xn1,yn1),(x0,y0(m)),(x1,y1(m)),,(xn1,yn1(m)) must be known. The resulting polynomial has a degree less than Template:Math. (In a more general case, there is no need for Template:Math to be a fixed value; that is, some points may have more known derivatives than others. In this case the resulting polynomial has a degree less than the number of data points.)

Let us consider a polynomial Template:Math of degree less than Template:Math with indeterminate coefficients; that is, the coefficients of Template:Math are Template:Math new variables. Then, by writing the constraints that the interpolating polynomial must satisfy, one gets a [[system of linear equations|system of Template:Math linear equations]] in Template:Math unknowns.

In general, such a system has exactly one solution. In,[1] Charles Hermite used contour integration to prove that this is effectively the case here, and to find the unique solution, provided that the Template:Mvar are pairwise different. The Hermite interpolation problem is a problem of linear algebra that has the coefficients of the interpolation polynomial as unknown variables and a confluent Vandermonde matrix as its matrix.[3] The general methods of linear algebra, and specific methods for confluent Vandermonde matrices are often used for computing the interpolation polynomial. Another method is described below.

Using Chinese remainder theorem

Template:See also

Let Template:Mvar be a positive integer, Template:Tmath be nonnegative integers, and values Template:Tmath that are real numbers or belong to any other field of characteristic zero. Hermite interpolation problem consists of finding a polynomial Template:Mvar such that

f(xi)=yi,0,f(xi)=yi,1,,fmi(xi)=yi,mi

for Template:Tmath, where the Template:Tmath are given values in the same field as the Template:Tmath.

These conditions implies that the Taylor polynomial of Template:Mvar of degree Template:Tmath at Template:Tmath is

j=0myi,ji!(xxi)j.

In other words, the desired polynomial Template:Mvar is congruent to this polynomial modulo (xxi)mi+1.

The Chinese remainder theorem for polynomials implies that there is exactly one solution of degree less than n=i=0k(mi+1).

Moreover, this solution can be computed with O(n2) arithmetic operations, or even faster with fast polynomial multiplication.

This approach does not works in positive characteristic, because of the denominators of the coefficients of the Taylor polynomial. The approach through divided differences, below, works in every characteristic.

Using divided differences

Simple case when all k=2

When using divided differences to calculate the Hermite polynomial of a function f, the first step is to copy each point m times. (Here we will consider the simplest case m=1 for all points.) Therefore, given n+1 data points x0,x1,x2,,xn, and values f(x0),f(x1),,f(xn) and f(x0),f(x1),,f(xn) for a function f that we want to interpolate, we create a new dataset z0,z1,,z2n+1 such that z2i=z2i+1=xi.

Now, we create a divided differences table for the points z0,z1,,z2n+1. However, for some divided differences, zi=zi+1f[zi,zi+1]=f(zi+1)f(zi)zi+1zi=00 which is undefined. In this case, the divided difference is replaced by f(zi). All others are calculated normally.

A more general case when k>2

In the general case, suppose a given point xi has k derivatives. Then the dataset z0,z1,,zN contains k identical copies of xi. When creating the table, divided differences of j=2,3,,k identical values will be calculated as f(j)(xi)j!.

For example, f[xi,xi,xi]=f(xi)2 f[xi,xi,xi,xi]=f(3)(xi)6 etc.


A fast algorithm for the fully general case is given in.[4] A slower but more numerically stable algorithm is described in.[5]

Example

Consider the function f(x)=x8+1. Evaluating the function and its first two derivatives at x{1,0,1}, we obtain the following data:

Template:Math Template:Math Template:Math Template:Math
−1 2 −8 56
0 1 0 0
1 2 8 56

Since we have two derivatives to work with, we construct the set {zi}={1,1,1,0,0,0,1,1,1}. Our divided difference table is then: z0=1f[z0]=2f(z0)1=8z1=1f[z1]=2f(z1)2=28f(z1)1=8f[z3,z2,z1,z0]=21z2=1f[z2]=2f[z3,z2,z1]=715f[z3,z2]=1f[z4,z3,z2,z1]=610z3=0f[z3]=1f[z4,z3,z2]=154f(z3)1=0f[z5,z4,z3,z2]=121z4=0f[z4]=1f(z4)2=0121f(z4)1=0f[z6,z5,z4,z3]=121z5=0f[z5]=1f[z6,z5,z4]=154f[z6,z5]=1f[z7,z6,z5,z4]=610z6=1f[z6]=2f[z7,z6,z5]=715f(z6)1=8f[z8,z7,z6,z5]=21z7=1f[z7]=2f(z7)2=28f(z7)1=8z8=1f[z8]=2 and the generated polynomial is P(x)=28(x+1)+28(x+1)221(x+1)3+15x(x+1)310x2(x+1)3+4x3(x+1)31x3(x+1)3(x1)+x3(x+1)3(x1)2=28+28218x+56x63x+15x+28x263x2+45x210x221x3+45x330x3+4x3+x3+x3+15x430x4+12x4+2x4+x410x5+12x52x5+4x52x52x5x6+x6x7+x7+x8=x8+1. by taking the coefficients from the diagonal of the divided difference table, and multiplying the kth coefficient by i=0k1(xzi), as we would when generating a Newton polynomial.

Quintic Hermite interpolation

The quintic Hermite interpolation based on the function (f), its first (f) and second derivatives (f) at two different points (x0 and x1) can be used for example to interpolate the position of an object based on its position, velocity and acceleration. The general form is given by p(x)=f(x0)+f(x0)(xx0)+12f(x0)(xx0)2+f(x1)f(x0)f(x0)(x1x0)12f(x0)(x1x0)2(x1x0)3(xx0)3+3f(x0)3f(x1)+2(f(x0)+12f(x1))(x1x0)+12f(x0)(x1x0)2(x1x0)4(xx0)3(xx1)+6f(x1)6f(x0)3(f(x0)+f(x1))(x1x0)+12(f(x1)f(x0))(x1x0)2(x1x0)5(xx0)3(xx1)2.

Error

Call the calculated polynomial H and original function f. Consider first the real-valued case. Evaluating a point x[x0,xn], the error function is f(x)H(x)=f(K)(c)K!i(xxi)ki, where c is an unknown within the range [x0,xN], K is the total number of data-points, and ki is the number of derivatives known at each xi. The degree of the polynomial on the right is thus one higher than the degree bound for H(x). Furthermore, the error and all its derivatives up to the ki1st order is zero at each node, as it should be.

In the complex case, as described for example on p. 360 in,[5] f(z)H(z)=w(z)2πiCf(ζ)w(ζ)(ζz)dζ where the contour C encloses z and all the nodes xi, and the node polynomial is w(z)=i(zxi)ki.

See also

References

Template:Reflist

Template:Authority control