CurveFitting Spline Interpolation - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

CurveFitting Spline Interpolation

Description:

1. Curve-Fitting. Spline Interpolation. 2. Curve Fitting. Regression. Linear Regression ... For some cases, polynomials can lead to erroneous results because of ... – PowerPoint PPT presentation

Number of Views:813
Avg rating:3.0/5.0
Slides: 25
Provided by: laiwa
Category:

less

Transcript and Presenter's Notes

Title: CurveFitting Spline Interpolation


1
Curve-FittingSpline Interpolation
2
Curve Fitting
  • Regression
  • Linear Regression
  • Polynomial Regression
  • Multiple Linear Regression
  • Non-linear Regression
  • Interpolation
  • Newton's Divided-Difference Interpolation
  • Lagrange Interpolating Polynomials
  • Spline Interpolation

3
Spline Interpolation
  • For some cases, polynomials can lead to erroneous
    results because of round off error and overshoot.
  • Alternative approach is to apply lower-order
    polynomials to subsets of data points. Such
    connecting polynomials are called spline
    functions.

4
(No Transcript)
5
  • Linear spline
  • Derivatives are not continuous
  • Not smooth
  • (b) Quadratic spline
  • Continuous 1st derivatives
  • (c) Cubic spline
  • Continuous 1st 2nd derivatives
  • Smoother

6
Quadratic Spline
7
Quadratic Spline
  • Spline of Degree 2
  • A function Q is called a spline of degree 2 if
  • The domain of Q is an interval a, b.
  • Q and Q' are continuous functions on a, b.
  • There are points xi (called knots) such that
  • a x0 lt x1 lt lt xn b and Q is a polynomial
    of degree at most 2 on each subinterval xi,
    xi1.
  • A quadratic spline is a continuously
    differentiable piecewise quadratic function.

8
Exercise
  • Which of the following is a quadratic spline?

9
Exercise (Solution)
10
Quadratic Interpolation
  • Observations
  • n1 points
  • n intervals
  • Each interval is connected by a 2nd-order
    polynomial Qi(x) aix2 bix ci, i 0, , n1
    .
  • Each polynomial has 3 unknowns
  • Altogether there are 3n unknowns
  • Need 3n equations (or conditions) to solve for 3n
    unknowns

11
Quadratic Interpolation (3n conditions)
  • Interpolating conditions
  • On each sub interval xi, xi1, the function
    Qi(x) must satisfy the conditions
  • Qi(xi) f(xi) and Qi(xi1) f(xi1)
  • These conditions yield 2n equations

12
Quadratic Interpolation (3n conditions)
  • Continuous first derivatives
  • The first derivatives at the interior knots must
    be equal.
  • This adds n-1 more equations

We now have 2n (n 1) 3n 1 equations. We
need one more equation.
13
Quadratic Interpolation (3n conditions)
  • Assume the 2nd derivatives is zero at the first
    point.
  • This gives us the last condition as
  • With this condition selected, the first two
    points are connected by a straight line.
  • Note This is not the only possible choice or
    assumption we can make.

14
Example
  • Fit quadratic splines to the given data points.

15
Example (Solution)
  • 1. Interpolating conditions

2. Continuous first derivatives
3. Assume the 2nd derivatives is zero at the
first point.
16
Example (Solution)
We can write the system of equations in matrix
form as
Notice that the coefficient matrix is sparse.
17
Example (Solution)
The system of equations can be solved to yield
Thus the quadratic spline that interpolates the
given points is
18
Efficient way to derive quadratic spline
19
Efficient way to derive quadratic spline
20
Efficient way to derive quadratic spline
21
Cubic Spline
  • Spline of Degree 3
  • A function S is called a spline of degree 3 if
  • The domain of S is an interval a, b.
  • S, S' and S" are continuous functions on a, b.
  • There are points ti (called knots) such that
  • a t0 lt t1 lt lt tn b and Q is a polynomial
    of degree at most 3 on each subinterval ti,
    ti1.

22
Cubic Spline (4n conditions)
  • Interpolating conditions (2n conditoins).
  • Continuous 1st derivatives (n-1 conditions)
  • The 1st derivatives at the interior knots must be
    equal.
  • Continuous 2nd derivatives (n-1 conditions)
  • The 2nd derivatives at the interior knots must be
    equal.
  • Assume the 2nd derivatives at the end points are
    zero (2 conditions).
  • This condition makes the spline a "natural
    spline".

23
Efficient way to derive cubic spline
24
Summary
  • Advantages of spline interpolation over
    polynomial interpolation
  • The conditions that are used to derive the
    quadratic and cubic spline functions
  • Characteristics of cubic spline
  • Overcome the problem of "overshoot"
  • Easier to derive (than high-order polynomial)
  • Smooth (continuous 2nd-order derivatives)
Write a Comment
User Comments (0)
About PowerShow.com