Lecture 15: Function and Derivative Interpolation
1.Interpolation in function and derivative
values - Hermite interpolation
In addition to sampling of the function ,
information on the derivatives of might
also be available, as in the data set
|
(1) |
The extended data set can again be interpolated by a polynomial, this
time of degree
given in the monomial, Lagrange or Newton form.
Monomial form of interpolating polynomial.
Using the monomial basis
the interpolating polynomial is
with derivative
The above suggests constructing a basis set of monomials and their
derivatives
to allow setting the function ,
and derivative conditions .
The columns of are linearly
independent since
can only be satisfied for all by .
Sampling at
gives ,
e.g., for ,
the matrix is
is obtained.
In[42]:= |
V[m_,n_]:=Table[Subscript[x, i]^j,{i, 0, m},{j, 0, n}];
dV[m_,n_]:=Table[j Subscript[x, i]^(j-1),{i, 0, m},{j, 0, n}]; m=2; n=2*m+1; n1=n+1; M=Join[V[m,n],dV[m,n],1] |
For general ,
is of full rank for distinct sample points with a determinant
reminiscent of that of the Vandermonde matrix
The interpolation conditions lead to the linear system
whose solution requires operations. An error formula is again
obtained by repeated application of Rolle's theorem, i.e., for interpolant of data set ,
such that
The above approach generalizes to higher-order derivatives, e.g., for
|
(2) |
the basis set is
with interpolant
with
determined by solving
with ,
and error formula
Lagrange form of interpolating polynomial.
As in the function value interpolation case, a basis set that
evaluates to an identity matrix when sampled at
is obtained by -factorization
of the sampled monomial matrix
that for arbitrary leads to the basis set
The interpolating polynomial of data set is
where the basis functions can be expressed in terms of the Lagrange
polynomials
as
and have the properties
As, an example, consider the
-factorization
of matrix for
In[21]:= |
V[m_,n_]:=Table[Subscript[x, i]^j,{i, 0, m},{j, 0, n}];
dV[m_,n_]:=Table[j Subscript[x, i]^(j-1),{i, 0, m},{j, 0, n}]; m=1; n=2*m+1; n1=n+1; M=Join[V[m,n],dV[m,n],1] |
In[23]:= |
LU[M_] :=
Module[{m, i, j, k, L, U, Linv, Uinv}, m = Length[M];
L = IdentityMatrix[m]; U = M; Linv = L;
For[k = 1, k < m, k++,
For[i = k + 1, i <= m, i++,
L[[i, k]] = Simplify[U[[i, k]]/U[[k, k]]];
For[j = k, j <= m, j++,
U[[i, j]] = Simplify[U[[i, j]] - L[[i, k]]*U[[k, j]]]]]];
Linv = Simplify[Inverse[L]];
Uinv = Simplify[Inverse[U]];
Return[{L, U, Linv, Uinv}];];
{L, U, Linv, Uinv} = LU[M];
L |
In[26]:= |
Simplify[M.Uinv.Linv] |
The factor inverses are
The functions that result
are indeed expressed in terms of as
In[29]:= |
Simplify[{1,t,t^2,t^3}.Uinv.Linv] |
The procedure can be extended to derivatives of arbitrary order, e.g.,
the data set
is interpolated by
where the Lagrange basis polynomials are given as
Newton form of interpolating polynomial.
As before, inverting only one factor of the
mapping yields a triangular basis set
The first six basis polynomials
obtained for
are
In[33]:= |
m=2; n=2*m+1; n1=n+1; M=Join[V[m,n],dV[m,n],1] |
In[34]:= |
{L, U, Linv, Uinv} = LU[M];
Simplify[{1,t,t^2,t^3,t^4,t^5}.Uinv] |
A closer link to divided
difference and differential calculus is obtained by permuting rows of
, e.g., for
The first six basis polynomials thus obtained are
and upon rescaling generalize to the basis set
with
known as the Newton basis set with repetitions.
In[52]:= |
m=2; n=2*m+1; n1=n+1;
M=Permute[Permute[Permute[Join[V[m,n],dV[m,n],1],{1,4,3,2,5,6}],{1,2,4,3,5,6}],{1,2,3,5,4,6}] |
In[53]:= |
{L, U, Linv, Uinv} = LU[M];
Simplify[{1,t,t^2,t^3,t^4,t^5}.Uinv] |
In[48]:= |
P=Permute[Permute[Permute[IdentityMatrix[6],{1,4,3,2,5,6}],{1,2,4,3,5,6}],{1,2,3,5,4,6}] |
In[50]:= |
M=Join[V[m,n],dV[m,n],1] |
The interpolating polynomial in Newton divided difference form is
Divided difference with repeated values are replaced by their, limits,
i.e., the derivatives
The forward substitution can again be organized in a table.
|
|
Table 1. Table of repeated divided
differences. The Newton basis coefficients are the diagonal
terms.
|
Interpolation of data containing higher derivatives, or differing orders
of derivative information at each node are poissible. For multiple
repeated values arising in the limit
of sample points
the divided difference is determined by