1 Chapter 4 Interpolation and Approximation. 2 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.

Slides:



Advertisements
Similar presentations
Lecture 10 Curves and Surfaces I
Advertisements

CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
© University of Wisconsin, CS559 Spring 2004
Data mining and statistical learning - lecture 6
MATH 685/ CSI 700/ OR 682 Lecture Notes
Selected from presentations by Jim Ramsay, McGill University, Hongliang Fei, and Brian Quanz Basis Basics.
Basis Expansion and Regularization Presenter: Hongliang Fei Brian Quanz Brian Quanz Date: July 03, 2008.
Chapter 18 Interpolation The Islamic University of Gaza
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
1 Curve-Fitting Spline Interpolation. 2 Curve Fitting Regression Linear Regression Polynomial Regression Multiple Linear Regression Non-linear Regression.
Computational Methods in Physics PHYS 3437
EARS1160 – Numerical Methods notes by G. Houseman
ES 240: Scientific and Engineering Computation. InterpolationPolynomial  Definition –a function f(x) that can be written as a finite series of power functions.
Splines II – Interpolating Curves
Curve-Fitting Interpolation
Curve-Fitting Polynomial Interpolation
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 181 Interpolation Chapter 18 Estimation of intermediate.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 23 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Interpolation Chapter 18.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
1 Wavelets Examples 王隆仁. 2 Contents o Introduction o Haar Wavelets o General Order B-Spline Wavelets o Linear B-Spline Wavelets o Quadratic B-Spline Wavelets.
NUMERICAL METHODS WITH C++ PROGRAMMING
Chapter 6 Numerical Interpolation
Subdivision Analysis via JSR We already know the z-transform formulation of schemes: To check if the scheme generates a continuous limit curve ( the scheme.
Chapter 3 Root Finding.
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
ORDINARY DIFFERENTIAL EQUATION (ODE) LAPLACE TRANSFORM.
Chapter 9 Function Approximation
CIS V/EE894R/ME894V A Case Study in Computational Science & Engineering HW 5 Repeat the HW associated with the FD LBI except that you will now use.
Scientific Computing Linear and Quadratic Splines.
Simpson Rule For Integration.
V. Space Curves Types of curves Explicit Implicit Parametric.
Introduction to Computer Graphics with WebGL
1 Interpolation. 2 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a.
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Polynomial Interpolation You will frequently have occasions to estimate intermediate values between precise data points. The function you use to interpolate.
Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
1. Interpolating polynomials Polynomial of degree n,, is a linear combination of Definitions: (interval, continuous function, abscissas, and polynomial)
Chapter 7 Inner Product Spaces 大葉大學 資訊工程系 黃鈴玲 Linear Algebra.
Scientific Computing General Least Squares. Polynomial Least Squares Polynomial Least Squares: We assume that the class of functions is the class of all.
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
Computers in Civil Engineering 53:081 Spring 2003 Lecture #15 Spline Interpolation.
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b,
Mohiuddin Ahmad SUNG-BONG JANG Interpolation II (8.4 SPLINE INTERPOLATION) (8.5 MATLAB’s INTERPOLATION Functions)
Cubic Spline Interpolation. Cubic Splines attempt to solve the problem of the smoothness of a graph as well as reduce error. Polynomial interpolation.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 15 General Least Squares and Non- Linear.
 3.3 Hermite Interpolation Chapter 3 Interpolation and Polynomial Approximation -- Hermite Interpolation Find the osculating polynomial P(x) such that.
MA2213 Lecture 2 Interpolation.
By: Mark Coose Joetta Swift Micah Weiss. What Problems Can Interpolation Solve? Given a table of values, find a simple function that passes through the.
5. Interpolation 5.1 Definition of interpolation. 5.2 Formulas for Interpolation. 5.3 Formulas for Interpolation for unequal interval. 5.4 Applications.
MA4229 Lectures 15, 16 Week 13 Nov 1, Chapter 18 Interpolation by piecewise polynomials.
Interpolation - Introduction
Curve-Fitting Spline Interpolation
Numerical Analysis Lecture 25.
Interpolation.
Interpolation Estimation of intermediate values between precise data points. The most common method is: Although there is one and only one nth-order.
Chapter 18.
Chapter 18.
Chapter 9 Function Approximation
Spline Interpolation Class XVII.
Warm-up: Find the equation of a quadratic function in standard form that has a root of 2 + 3i and passes through the point (2, -27). Answer: f(x) = -3x2.
Numerical Analysis Lecture 23.
Numerical Analysis Lecture 26.
Splines There are cases where polynomial interpolation is bad
SKTN 2393 Numerical Methods for Nuclear Engineers
Numerical Analysis Lecture 24.
Theory of Approximation: Interpolation
Presentation transcript:

1 Chapter 4 Interpolation and Approximation

2 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation problem can be posed in one of two ways:

3

4

5

6 Example 4.1 e -1/2

7

8 Discussion The construction presented in this section is called Lagrange interpolation. The construction presented in this section is called Lagrange interpolation. How good is interpolation at approximating a function? (Sections 4.3, 4.11) How good is interpolation at approximating a function? (Sections 4.3, 4.11) Consider another example: Consider another example: If we use a fourth-degree interpolating polynomial to approximate this function, the results are as shown in Figure 4.3 (a). If we use a fourth-degree interpolating polynomial to approximate this function, the results are as shown in Figure 4.3 (a).

9 Error for n=8

10 Discussion There are circumstances in which polynomial interpolation as approximation will work very well, and other circumstances in which it will not. There are circumstances in which polynomial interpolation as approximation will work very well, and other circumstances in which it will not. The Lagrange form of the interpolating polynomial is not well suited for actual computations, and there is an alternative construction that is far superior to it. The Lagrange form of the interpolating polynomial is not well suited for actual computations, and there is an alternative construction that is far superior to it.

Newton Interpolation and Divided Differences The disadvantage of the Lagrange form The disadvantage of the Lagrange form If we decide to add a point to the set of nodes, we have to completely re-compute all of the functions. If we decide to add a point to the set of nodes, we have to completely re-compute all of the functions. Here we introduce an alternative form of the polynomial: the Newton form Here we introduce an alternative form of the polynomial: the Newton form It can allow us to easily write in terms of It can allow us to easily write in terms of

12

13 =0

14 Example 4.2

15 Discussion The coefficients are called divided differences. The coefficients are called divided differences. We can use divided-difference table to find them. We can use divided-difference table to find them.

16 Example 4.3

17

18 Example 4.3 (Con.)

19 Table 4.5

Interpolation Error

Application: Muller’s Method and Inverse Quadratic Interpolation We can use the idea of interpolation to develop more sophisticated root-finding methods. We can use the idea of interpolation to develop more sophisticated root-finding methods. For example: Muller ’ s Method For example: Muller ’ s Method Given three points we find the quadratic polynomial such that 0,1,2; and then define as the root of that is closest to. Given three points we find the quadratic polynomial such that 0,1,2; and then define as the root of that is closest to.

22

23

24 compare

25 Discussion One great utility of Muller ’ s method is that it is able to find complex roots of real-valued functions, because of the square root in the computation. One great utility of Muller ’ s method is that it is able to find complex roots of real-valued functions, because of the square root in the computation.

Application: More Approximations to the Derivative depends on x

Application: More Approximations to the Derivative The interpolating polynomial in Lagrange form is The interpolating polynomial in Lagrange form is The error is given as in (4.20), thus The error is given as in (4.20), thus We get We get

28 We can use above equations to get:

Piecewise Polynomial Interpolation If we keep the order of the polynomial fixed and use different polynomials over different intervals, with the length of the intervals getting smaller and smaller, then interpolation can be a very accurate and powerful approximation tool. If we keep the order of the polynomial fixed and use different polynomials over different intervals, with the length of the intervals getting smaller and smaller, then interpolation can be a very accurate and powerful approximation tool. For example: For example:

30

31

32

33 Example 4.6

34

35

An Introduction to Splines Definition of the problem Definition of the problem

37 Discussion From the definition: From the definition: d : degree of approximation d : degree of approximation Related to the number of unknown coefficients (the degrees of freedom) Related to the number of unknown coefficients (the degrees of freedom) N : degree of smoothness N : degree of smoothness Related to the number of constraints Related to the number of constraints

38 Discussion We can make the first term vanish by setting We can make the first term vanish by setting This establishes a relationship between the polynomial degree of the spline and the smoothness degree. This establishes a relationship between the polynomial degree of the spline and the smoothness degree. For example: cubic splines For example: cubic splines

Cubic B-Splines B-Spline: assume a uniform grid B-Spline: assume a uniform grid

40 Cubic B-Splines How do we know that B ( x ) is a cubic spline function? How do we know that B ( x ) is a cubic spline function? Computer the one-sided derivatives at the knots: Computer the one-sided derivatives at the knots: and similarly for the second derivative. and similarly for the second derivative. If the one-sided values are equal to each other, then the first and second derivatives are continuous, and hence B is a cubic spline. If the one-sided values are equal to each other, then the first and second derivatives are continuous, and hence B is a cubic spline. Note that B is only “ locally defined, ” meaning that it is nonzero on only a small interval. Note that B is only “ locally defined, ” meaning that it is nonzero on only a small interval.

41

42 A Spline Approximation We can use B to construct a spline approximation to an arbitrary function f. We can use B to construct a spline approximation to an arbitrary function f. Define the sequence of functions Define the sequence of functions

43 x i =0.4 h =0.05 x i =0.75 h =0.05

44 n +1 equations in n +3 unknowns

45 A Spline Approximation Now, we need to come up with two additional constraints in order to eliminate two of the unknowns. Now, we need to come up with two additional constraints in order to eliminate two of the unknowns. Two common choices are Two common choices are The natural spline: The natural spline: A simple construction A simple construction Leads to higher error near the end points Leads to higher error near the end points The complete spline: The complete spline: Better approximation properties Better approximation properties Do not actually require the derivative at the end points Do not actually require the derivative at the end points

46 Natural Spline From n -1

47 Complete Spline From n+1

48 Example 4.7

49

50

51

52

53

54

55 Example 4.8

56

57

58

59

60 Discussion The advantage of spline interpolation lies in the smoothness of the approximation. The advantage of spline interpolation lies in the smoothness of the approximation.

Application: Solution of Boundary Value Exercises Consider the two-point boundary value problem: Consider the two-point boundary value problem: We construct the uniform grid of points: We construct the uniform grid of points: We now look for our approximation in the form of a cubic spline define on this grid. We now look for our approximation in the form of a cubic spline define on this grid. Consider the function: Consider the function:

62 The advantage of this approach is we can get a continuous smooth function. The advantage of this approach is we can get a continuous smooth function. Because we know the values of and its derivatives at each of the nodes, we can easily reduce this to the system of equations: (n+1 equations in n+3 unknown) Because we know the values of and its derivatives at each of the nodes, we can easily reduce this to the system of equations: (n+1 equations in n+3 unknown) where where

63 We can eliminate the two extra unknowns by imposing the boundary conditions on the approximation: We can eliminate the two extra unknowns by imposing the boundary conditions on the approximation: Substitute these into the first and last equations of the rectangular system, we get Substitute these into the first and last equations of the rectangular system, we get

64 We are then left with the square system: We are then left with the square system: where where

65 Example 4.9

66 where The solution we get

67

Least Squares Concepts in Approximation An introduction to data fitting An introduction to data fitting

69 Least Square Data Fitting

70

71

72 Example 4.10

73

74 Example 4.11

75

76

77

78

Least Squares Approximation and Orthogonal Polynomials Let, we can seek such that is minimized. Let, we can seek such that is minimized.

80 Inner Productions Inner productions of functions: Inner productions of functions: Inner product on real vector spaces: Inner product on real vector spaces:

81

82 The definition of inner product will allow us to apply a number of ideas from linear algebra to the construction of approximations. The definition of inner product will allow us to apply a number of ideas from linear algebra to the construction of approximations.

83 The system can be organized along matrix-vector lines as The system can be organized along matrix-vector lines as If our basis function satisfy the orthogonality condition If our basis function satisfy the orthogonality condition the special basis functions that satisfy this equation are called orthogonal polynomials. Then the above matrix is a diagonal matrix, and we very easily have Then the above matrix is a diagonal matrix, and we very easily have

84

85 Orthogonal Polynomials Legendre polynomials: Legendre polynomials:

86 Example 4.12

87

88

89 Example 4.13

Advanced Topics in Interpolation Error You can read it by yourselves. You can read it by yourselves.