10
COURSE 4 Cap. 2. Polynomial spline interpolation operators 2.1. Cubic spline interpolation Lagrange, Hermite, Birkhoff interpolants of large degrees could oscil- late widely; a minor fluctuation over a small portion of the interval can induce large fluctuations over the entire interval. An alternative: to divide the interval into a collection of subintervals and construct a (generally) different approximating polynomial on each subinterval. This is called piecewise-polynomial approximation. y f (x) x 0 x 1 x 2 x j x j1 x j2 x n1 x n . . . . . . y x

COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

COURSE 4

Cap. 2. Polynomial spline interpolation operators

2.1. Cubic spline interpolation

Lagrange, Hermite, Birkhoff interpolants of large degrees could oscil-late widely; a minor fluctuation over a small portion of the interval caninduce large fluctuations over the entire interval.

An alternative: to divide the interval into a collection of subintervalsand construct a (generally) different approximating polynomial on eachsubinterval. This is called piecewise-polynomial approximation.3.5 Cubic Spline Interpolation 145

Figure 3.7

y � f (x)

x0 x1 x2 xj xj�1 xj�2 xn�1 xn. . . . . .

y

x

To determine the appropriate Hermite cubic polynomial on a given interval is simplya matter of computing H3(x) for that interval. The Lagrange interpolating polynomialsneeded to determine H3 are of first degree, so this can be accomplished without greatdifficulty. However, to use Hermite piecewise polynomials for general interpolation, weneed to know the derivative of the function being approximated, and this is frequentlyunavailable.

The remainder of this section considers approximation using piecewise polynomialsthat require no specific derivative information, except perhaps at the endpoints of the intervalon which the function is being approximated.

Isaac Jacob Schoenberg(1903–1990) developed his workon splines during World War IIwhile on leave from theUniversity of Pennsylvania towork at the Army’s BallisticResearch Laboratory inAberdeen, Maryland. His originalwork involved numericalprocedures for solvingdifferential equations. The muchbroader application of splines tothe areas of data fitting andcomputer-aided geometric designbecame evident with thewidespread availability ofcomputers in the 1960s.

The simplest type of differentiable piecewise-polynomial function on an entire interval[x0, xn] is the function obtained by fitting one quadratic polynomial between each successivepair of nodes. This is done by constructing a quadratic on [x0, x1] agreeing with the functionat x0 and x1, another quadratic on [x1, x2] agreeing with the function at x1 and x2, and soon. A general quadratic polynomial has three arbitrary constants—the constant term, thecoefficient of x, and the coefficient of x2—and only two conditions are required to fit thedata at the endpoints of each subinterval. So flexibility exists that permits the quadratics tobe chosen so that the interpolant has a continuous derivative on [x0, xn]. The difficulty arisesbecause we generally need to specify conditions about the derivative of the interpolant atthe endpoints x0 and xn. There is not a sufficient number of constants to ensure that theconditions will be satisfied. (See Exercise 26.)

The root of the word “spline” isthe same as that of splint. It wasoriginally a small strip of woodthat could be used to join twoboards. Later the word was usedto refer to a long flexible strip,generally of metal, that could beused to draw continuous smoothcurves by forcing the strip to passthrough specified points andtracing along the curve.

Cubic Splines

The most common piecewise-polynomial approximation uses cubic polynomials betweeneach successive pair of nodes and is called cubic spline interpolation. A general cubicpolynomial involves four constants, so there is sufficient flexibility in the cubic spline pro-cedure to ensure that the interpolant is not only continuously differentiable on the interval,but also has a continuous second derivative. The construction of the cubic spline does not,however, assume that the derivatives of the interpolant agree with those of the function it isapproximating, even at the nodes. (See Figure 3.8.)

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Page 2: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

Let f : [a, b] → R be the the approximating function. Examples of

piecewise-polynomial interpolation:

• piecewise-linear interpolation: consists of joining a set of data

points {(x0, f(x0)), (x1, f(x1)), ..., (xn, f(xn))} by a series of straight

lines

Disadvantage: there is likely no differentiability at the endpoints

of the subintervals, (the interpolating function is not “smooth”).

Often, from physical conditions, that smoothness is required.

• Hermite interpolation when values of f and f ′ are known at the

points x0 < x1 < ... < xn;

Disadvantage: we need to know f ′ and this is frequently unavail-

able.

Page 3: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

• spline interpolation: piecewise polynomials that require no specific

derivative information, except perhaps at the endpoints of the in-

terval.

Definition 1 The piecewise-polynomial approximation that uses cubic

spline polynomials between each successive pair of nodes is called cubic

spline interpolation.

(The word “spline” was used to refer to a long flexible strip, generally of metal, that

could be used to draw continuous smooth curves by forcing the strip to pass through

specified points and tracing along the curve.)

Definition 2 Let f : [a, b]→ R and the nodes a = x0 < x1 < ... < xn =

b, a cubic spline interpolant S for f is the function that satisfies the

following conditions:

Page 4: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

(a) S(x) is a cubic polynomial, denoted Sj(x) on the subinterval [xj, xj+1],∀j = 0,1, ..., n− 1, i.e.,

S(x) =

S0(x), x ∈ [x0, x1]S1(x), x ∈ [x1, x2]...

Sn−1(x), x ∈ [xn−1, xn]

(b) Sj(xj) = f(xj) and Sj(xj+1) = f(xj+1), ∀j = 0,1, ..., n− 1;

(c) Sj+1(xj+1) = Sj(xj+1), ∀j = 0,1, ..., n− 2;

(d) S′j+1(xj+1) = S

′j(xj+1), ∀j = 0,1, ..., n− 2;

(e) S′′j+1(xj+1) = S

′′j (xj+1) for each j = 0,1, ..., n− 2;

(f) One of the following boundary conditions is satisfied:

Page 5: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

(i) S′′(x0) = S′′(xn) = 0 (natural (or free) boundary) natural spline;

(ii) S′(x0) = f ′(x0) and S′(xn) = f ′(xn) (clamped boundary) clamped

spline;

(iii) S1(x) = S2(x) and Sn−2 = Sn−1 (de Boor spline).

Remark 3 A cubic spline function defined on an interval divided into

n subintervals will require determining 4n constants.

We have the following expression of a cubic spline:

Sj(x) = aj + bj(x− xj) + cj(x− xj)2 + dj(x− xj)3, ∀j = 0,1, ..., n− 1.

Theorem 4 If f is defined at a = x0 < x1 < ... < xn = b, then f has

a unique natural spline interpolant S on the nodes x0, x1, ..., xn; that

satisfies the natural boundary conditions S′′(a) = 0 and S′′(b) = 0.

Page 6: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

Theorem 5 If f is defined at a = x0 < x1 < ... < xn = b and differen-

tiable at a and b, then f has a unique clamped spline interpolant S on

the nodes x0, x1, ..., xn; that satisfies the clamped boundary conditions

S′(a) = f ′(a) si S′(b) = f ′(b).

Theorem 6 Let f ∈ C4[a, b] with maxa≤x≤b

|f(4)(x)| = M . If S is the

unique clamped cubic spline interpolant to f with respect to the nodes

a = x0 < x1 <···< xn = b, then for all x in [a, b],

|f(x)− S(x)| ≤5M

384max

0≤j≤n−1(xj+1 − xj)4.

Remark 7 A fourth-order error-bound result also holds in the case of

natural boundary conditions, but it is more difficult to express.

Remark 8 The natural boundary conditions will generally give less

accurate results than the clamped conditions near the ends of the

interval [x0, xn] unless the function f happens to nearly satisfy f ′′(x0) =

f ′′(xn) = 0.

Page 7: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

Illustration. First figure shows a duck in flight. To approximate the

top profile of the duck, we have chosen 21 points along the curve

through which we want the approximating curves to pass.

158 C H A P T E R 3 Interpolation and Polynomial Approximation

Illustration Figure 3.11 shows a ruddy duck in flight. To approximate the top profile of the duck, wehave chosen points along the curve through which we want the approximating curve to pass.Table 3.18 lists the coordinates of 21 data points relative to the superimposed coordinatesystem shown in Figure 3.12. Notice that more points are used when the curve is changingrapidly than when it is changing more slowly.

Figure 3.11

Table 3.18

x 0.9 1.3 1.9 2.1 2.6 3.0 3.9 4.4 4.7 5.0 6.0 7.0 8.0 9.2 10.5 11.3 11.6 12.0 12.6 13.0 13.3

f (x) 1.3 1.5 1.85 2.1 2.6 2.7 2.4 2.15 2.05 2.1 2.25 2.3 2.25 1.95 1.4 0.9 0.7 0.6 0.5 0.4 0.25

Figure 3.12f (x)

x

1

2

3

4

6 7 8 91 32 4 5 10 11 12 13

Using Algorithm 3.4 to generate the natural cubic spline for this data produces the coeffi-cients shown in Table 3.19. This spline curve is nearly identical to the profile, as shown inFigure 3.13.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

158 C H A P T E R 3 Interpolation and Polynomial Approximation

Illustration Figure 3.11 shows a ruddy duck in flight. To approximate the top profile of the duck, wehave chosen points along the curve through which we want the approximating curve to pass.Table 3.18 lists the coordinates of 21 data points relative to the superimposed coordinatesystem shown in Figure 3.12. Notice that more points are used when the curve is changingrapidly than when it is changing more slowly.

Figure 3.11

Table 3.18

x 0.9 1.3 1.9 2.1 2.6 3.0 3.9 4.4 4.7 5.0 6.0 7.0 8.0 9.2 10.5 11.3 11.6 12.0 12.6 13.0 13.3

f (x) 1.3 1.5 1.85 2.1 2.6 2.7 2.4 2.15 2.05 2.1 2.25 2.3 2.25 1.95 1.4 0.9 0.7 0.6 0.5 0.4 0.25

Figure 3.12f (x)

x

1

2

3

4

6 7 8 91 32 4 5 10 11 12 13

Using Algorithm 3.4 to generate the natural cubic spline for this data produces the coeffi-cients shown in Table 3.19. This spline curve is nearly identical to the profile, as shown inFigure 3.13.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

3.5 Cubic Spline Interpolation 159

Table 3.19j xj aj bj cj dj

0 0.9 1.3 5.40 0.00 −0.251 1.3 1.5 0.42 −0.30 0.952 1.9 1.85 1.09 1.41 −2.963 2.1 2.1 1.29 −0.37 −0.454 2.6 2.6 0.59 −1.04 0.455 3.0 2.7 −0.02 −0.50 0.176 3.9 2.4 −0.50 −0.03 0.087 4.4 2.15 −0.48 0.08 1.318 4.7 2.05 −0.07 1.27 −1.589 5.0 2.1 0.26 −0.16 0.04

10 6.0 2.25 0.08 −0.03 0.0011 7.0 2.3 0.01 −0.04 −0.0212 8.0 2.25 −0.14 −0.11 0.0213 9.2 1.95 −0.34 −0.05 −0.0114 10.5 1.4 −0.53 −0.10 −0.0215 11.3 0.9 −0.73 −0.15 1.2116 11.6 0.7 −0.49 0.94 −0.8417 12.0 0.6 −0.14 −0.06 0.0418 12.6 0.5 −0.18 0.00 −0.4519 13.0 0.4 −0.39 −0.54 0.6020 13.3 0.25

Figure 3.13f (x)

x

1

2

3

4

6 7 8 931 2 54 10 11 12 13

For comparison purposes, Figure 3.14 gives an illustration of the curve that is generated usinga Lagrange interpolating polynomial to fit the data given in Table 3.18. The interpolatingpolynomial in this case is of degree 20 and oscillates wildly. It produces a very strangeillustration of the back of a duck, in flight or otherwise.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

160 C H A P T E R 3 Interpolation and Polynomial Approximation

Figure 3.14f (x)

x

1

2

3

4

8 96 731 2 4 5 10 1211

To use a clamped spline to approximate this curve we would need derivative approxima-tions for the endpoints. Even if these approximations were available, we could expect littleimprovement because of the close agreement of the natural cubic spline to the curve of thetop profile. �

Constructing a cubic spline to approximate the lower profile of the ruddy duck wouldbe more difficult since the curve for this portion cannot be expressed as a function of x, andat certain points the curve does not appear to be smooth. These problems can be resolvedby using separate splines to represent various portions of the curve, but a more effectiveapproach to approximating curves of this type is considered in the next section.

The clamped boundary conditions are generally preferred when approximating func-tions by cubic splines, so the derivative of the function must be known or approximatedat the endpoints of the interval. When the nodes are equally spaced near both end-points, approximations can be obtained by any of the appropriate formulas given inSections 4.1 and 4.2. When the nodes are unequally spaced, the problem is considerablymore difficult.

To conclude this section, we list an error-bound formula for the cubic spline withclamped boundary conditions. The proof of this result can be found in [Schul], pp. 57–58.

Theorem 3.13 Let f ∈ C4[a, b] with maxa≤x≤b |f (4)(x)| = M. If S is the unique clamped cubic splineinterpolant to f with respect to the nodes a = x0 < x1 < · · · < xn = b, then for all x in[a, b],

|f (x)− S(x)| ≤ 5M

384max

0≤j≤n−1(xj+1 − xj)

4.

A fourth-order error-bound result also holds in the case of natural boundary conditions,but it is more difficult to express. (See [BD], pp. 827–835.)

The natural boundary conditions will generally give less accurate results than theclamped conditions near the ends of the interval [x0, xn] unless the function f happens

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

1) The duck in flight. 2) The points. 3) The natural cubic spline.

4) The Lagrange interpolation polynomial.

Page 8: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

Example 9 Construct a natural cubic spline that passes through the

points (1,2), (2,3) and (3,5).

Example 10 Construct a clamped spline S that passes through the

points (1,2), (2,3) and (3,5) and that has S′(1) = 2 and S′(3) = 2.

2.2. Polynomial spline interpolation

Consider the set of linear functionals Λ = {λi | λi : Cm[a, b] → R,

i = 0, ..., n}, y ∈ Rn and

U(y) = {f ∈ Cm[a, b] | λi(f) = yi, i = 0, ..., n} . (1)

Definition 11 The problem of finding an element s ∈ U(y) such that∥∥∥s(m)∥∥∥

2= inf

u∈U(y)

∥∥∥u(m)∥∥∥

2

is called a polynomial spline interpolation problem (denoted PSIP).

Page 9: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

Remark 12 A solution of (PSIP) is the function s such that∥∥∥s(m)

∥∥∥2→

min, or the function that is as close as possible to a polynomial P ∈Pm−1 (

∥∥∥P (m)∥∥∥

2= 0), and satisfies the conditions λi(P ) = yi, i = 0, ..., n.

A solution of (PSIP) is called polynomial spline function that inter-

polates y with respect to Λ, or natural spline that interpolates y.

Remark 13 The existence and unicity of the solution (PSIP) depend

on the set of functionals Λ.

Let Λ be the set of Birkhoff-type functionals

Λ ={λij | λijf = f(j) (xi) , i = 0, ..., k, j ⊂ Ii

}, (2)

where a ≤ x0 < ... < xk ≤ b is a partition of the interval [a, b] , r0, ..., rk ∈N, with ri < m and Ii ⊆ {0,1, ..., ri} , i = 0, ..., k.

Theorem 14 (Th. of structural characterization) Let Λ be given

in (2), y ∈ Rn and U(y) the corresponding interpolation set. The

function s ∈ U(y) is a solution of a (PSIP) if and only if:

Page 10: COURSE 4 Cap. 2. Polynomial spline interpolation operators ...math.ubbcluj.ro/~tcatinas/wp-content/uploads/TAF_Course4.pdf · tracing along the curve. Cubic Splines The most common

1) s(2m) (x) = 0, x ∈ [x0, xk] \ {x0, ..., xk} ,

2) s(m) (x) = 0, x ∈ [a, x0) ∪ (xk, b],

3) s(2m−1−µ) (xi − 0) = s(2m−1−µ) (xi + 0) , µ ∈ {0,1, ...,m− 1} \ Ii,for i = 0, ..., k.

Remark 15 Solution s is a polynomial of (2m − 1) degree on each

interval(xi, xi+1

)and a polynomial of (m− 1) degree on the intervals

[a, x0) and (xk, b].