3.4 Hermite Interpolation 3.5 Cubic Spline Interpolationzxu2/acms40390F13/Lec-3.4-5.pdfHermite...
Transcript of 3.4 Hermite Interpolation 3.5 Cubic Spline Interpolationzxu2/acms40390F13/Lec-3.4-5.pdfHermite...
3.4 Hermite Interpolation 3.5 Cubic Spline Interpolation
1
Hermite Polynomial
Definition. Suppose π β πΆ1[π, π]. Let π₯0, β¦ , π₯π be distinct numbers in [π, π], the Hermite polynomial π(π₯) approximating π is that:
1. π π₯π = π π₯π , for π = 0, β¦ , π
2.ππ π₯π
ππ₯=
ππ π₯π
ππ₯, for π = 0,β¦ , π
Remark: π(π₯) and π(π₯) agree not only function values but also 1st derivative values at π₯π, π = 0,β¦ , π.
2
Osculating Polynomials
Definition. Let π₯0, β¦ , π₯π be distinct numbers in π, π and for π = 0,β¦ , π, let ππ be a nonnegative integer. Suppose that π β πΆπ π, π , where π = max
0β€πβ€πππ. The
osculating polynomial approximating π is the polynomial
π(π₯) of least degree such that πππ π₯π
ππ₯π=
πππ π₯π
ππ₯π for each
π = 0,β¦ , π and k= 0,β¦ ,ππ .
Remark: the degree of π(π₯) is at most π = ππππ=0 + π.
3
Theorem. If π β πΆ1 π, π and π₯0, β¦ , π₯π β π, π distinct numbers, the Hermite polynomial of degree at most 2π + 1 is:
π»2π+1 π₯ = π π₯π π»π,π(π₯)
π
π=0
+ πβ² π₯π π» π,π(π₯)
π
π=0
Where
π»π,π π₯ = [1 β 2(π₯ β π₯π)πΏβ²π,π(π₯π)]πΏπ,π
2 (π₯)
π» π,π π₯ = π₯ β π₯π πΏπ,π2 π₯
Moreover, if π β πΆ2π+2 π, π , then
π π₯ = π»2π+1 π₯ +π₯ β π₯0
2β¦ π₯ β π₯π2
2π + 2 !π 2π+2 (π(π₯))
for some π π₯ β π, π . Remark: 1. π»2π+1 π₯ is a polynomial of degree at most 2π + 1.
2. πΏπ,π(π₯) is jth Lagrange basis polynomial of degree π.
3.π₯βπ₯0
2β¦ π₯βπ₯π2
2π+2 !π 2π+2 (π(π₯)) is the error term.
4
3rd Degree Hermite Polynomial
β’ Given distinct π₯0, π₯1 and values of π and πβ² at these numbers.
π»3 π₯ = 1 + 2π₯ β π₯0π₯1 β π₯0
π₯1 β π₯
π₯1 β π₯0
2
π π₯0
+ π₯ β π₯0π₯1 β π₯
π₯1 β π₯0
2
πβ² π₯0
+ 1 + 2π₯1 β π₯
π₯1 β π₯0
π₯0 β π₯
π₯0 β π₯1
2
π π₯1
+ π₯ β π₯1π₯0 β π₯
π₯0 β π₯1
2
πβ² π₯1
5
Hermite Polynomial by Divided Differences
Suppose π₯0, β¦ , π₯π and π, πβ² are given at these numbers. Define π§0, β¦ , π§2π+1 by
π§2π = π§2π+1 = π₯π , for π = 0, β¦ , π
Construct divided difference table, but use πβ² π₯0 , πβ² π₯1 , . . , πβ² π₯π
to set the following undefined divided difference: π π§0, π§1 , π π§2, π§3 , β¦ , π π§2π, π§2π+1 .
The Hermite polynomial is
π»2π+1 π₯ = π π§0 + π π§0, β¦ , π§π π₯ β π§0 β¦(π₯ β π§πβ1)
2π+1
π=1
6
Divided Difference Notation for Hermite Interpolation
β’ Divided difference notation: π»3 π₯
= π π₯0 + πβ² π₯0 π₯ β π₯0+ π π₯0, π₯0, π₯1 π₯ β π₯0
2
+ π[π₯0, π₯0, π₯1, π₯1] π₯ β π₯02(π₯ β π₯1)
7
Problems with High Order Polynomial Interpolation
β’ 21 equal-spaced numbers to interpolate
π π₯ =1
1+25π₯2. The interpolating polynomial
oscillates between interpolation points.
8
3.5 Cubic Splines
β’ Idea: Use piecewise polynomial interpolation, i.e, divide the interval into smaller sub-intervals, and construct different low degree polynomial approximations (with small oscillations) on the sub-intervals.
β’ Challenge: If πβ²(π₯π) are not known, can we still generate interpolating polynomial with continuous derivatives?
9
Definition: Given a function π on [π, π] and nodes π = π₯0 <β― < π₯π = π, a cubic spline interpolant π for π satisfies:
(a) π(π₯) is a cubic polynomial ππ(π₯) on [π₯π , π₯π+1], βπ =0,1, β¦ , π β 1.
(b) ππ π₯π = π(π₯π) and ππ π₯π+1 = π π₯π+1 , βπ = 0,1, β¦ , π β1.
(c) ππ π₯π+1 = ππ+1 π₯π+1 , βπ = 0,1, β¦ , π β 2.
(d) πβ²π π₯π+1 = πβ²π+1 π₯π+1 , βπ = 0,1,β¦ , π β 2.
(e) πβ²β²π π₯π+1 = πβ²β²π+1 π₯π+1 , βπ = 0,1, β¦ , π β 2.
(f) One of the following boundary conditions: (i) πβ²β² π₯0 = πβ²β² π₯π = 0 (called free or natural boundary)
(ii) πβ² π₯0 = πβ²(π₯0) and πβ² π₯π = πβ²(π₯π) (called clamped boundary)
10
Things to match at interior point π₯π+1:
β’ The spline segment ππ(π₯) is on π₯π , π₯π+1 .
β’ The spline segment ππ+1(π₯) is on π₯π+1, π₯π+2 .
β’ Their function values: ππ π₯π+1 = ππ+1 π₯π+1 =π π₯π+1
β’ First derivative values: πβ²π π₯π+1 = πβ²π+1 π₯π+1
β’ Second derivative values: πβ²β²π π₯π+1 = πβ²β²π+1 π₯π+1
11
Building Cubic Splines β’ Define:
ππ π₯ = ππ + ππ π₯ β π₯π + ππ(π₯ β π₯π)2+ππ(π₯ β π₯π)
3
and βπ = π₯π+1 β π₯π, βπ = 0,1, β¦ , π β 1.
Solve for coefficients ππ , ππ , ππ , ππ by:
1. ππ π₯π = ππ = π(π₯π)
2. ππ+1 π₯π+1 = ππ+1 = ππ + ππβπ + ππ(βπ)2+ππ(βπ)
3
3. πβ²π π₯π = ππ, also ππ+1 = ππ + 2ππβπ + 3ππ(βπ)2
4. πβ²β²π π₯π = 2ππ, also ππ+1 = ππ + 3ππβπ
5. Natural or clamped boundary conditions
12
Solving the Resulting Equations
βπ = 1,2,β¦ , π β 1
βπβ1ππβ1 + 2 βπβ1 + βπ ππ + βπππ+1
=3
βπππ+1 β ππ β
3
βπβ1ππ β ππβ1
Remark: (n-1) equations for (n+1) unknowns {ππ}π=0π .
Also, ππ β‘ π(π₯π)
Once compute ππ, we then compute:
ππ = ππ+1βππ
βπβ
βπ 2ππ+ππ+1
3 and
ππ =ππ+1βππ
3βπ for π = 0,1,2, β¦ , π β 1
13
Completing the System
β’ Natural boundary condition:
1. 0 = πβ²β²0 π₯0 = 2π0 β π0 = 0
2. 0 = πβ²β²π π₯π = 2ππ β ππ = 0
β’ Clamped boundary condition:
a) πβ²0 π₯0 = π0 = πβ²(π₯0)
b) πβ²πβ1 π₯π = ππ = ππβ1 + βπβ1(ππβ1 + ππ) = πβ²(π₯π)
Remark: a) and b) gives additional equations:
2β0π0 + β0π1 =3
β0(π1 β π0) β 3πβ²(π₯0)
βπβ1ππβ1 + 2βπβ1ππ = β3
β0ππ β ππβ1 + 3πβ²(π₯π)
14
Error Bound
If π β πΆ4[π, π], let π = maxπβ€π₯β€π
|π4(π₯)|. If π is the
unique clamped cubic spline interpolant to π with respect to the nodes: π = π₯0 < β― < π₯π = π, then with
β = max0β€πβ€πβ1
π₯π+1 β π₯π
maxπβ€π₯β€π
|π π₯ β π(π₯)| β€5πβ4
384.
15