Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 22 CURVE FITTING Chapter 18 Function Interpolation and Approximation.

Similar presentations


Presentation on theme: "ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 22 CURVE FITTING Chapter 18 Function Interpolation and Approximation."— Presentation transcript:

1 ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 22 CURVE FITTING Chapter 18 Function Interpolation and Approximation

2 LAST TIME Curve Fitting Often we are faced with the problem… what value of y corresponds to x=0.935?

3 LAST TIME Curve Fitting Question 1 : Is it possible to find a simple and convenient formula that reproduces the points exactly? e.g. Straight Line ? …or smooth line ? …or some other representation? Interpolation

4 LAST TIME Curve Fitting Question 2 : Is it possible to find a simple and convenient formula that represents data approximately ? e.g. Best Fit ? Approximation

5 LAST TIME Function Interpolation Linear Interpolation Simplest Form is to connect data points with a straight line (1 st Order Polynomial) x

6 LAST TIME Linear Interpolation Slope of Line 1 st DIVIDED DIFFERENCE f [x i+1,x i ] First order interpolating polynomial

7 LAST TIME Function Interpolation Higher Order Interpolation Newton Interpolating Polynomials x

8 Last Time General Form of Newton’s Interpolating Polynomials

9 Divided Differences Given a Set of Data xf(x) xoxo f(x o ) x1x1 f(x 1 ) x2x2 f(x 2 ) …… xnxn f(x n )

10 Last Time Example

11

12

13

14

15 Lagrange Interpolating Polynomials Reformulation of Newton’s Polynomials Avoid Calculation of Divided Differences xf(x) xoxo f(x o ) x1x1 f(x 1 ) x2x2 f(x 2 ) …… xnxn f(x n )

16 Lagrange Interpolating Polynomial Cardinal Functions: Product of n-1 linear factors Skip x i Property:

17 Example Write cardinal functions and give the Lagrange interpolating polynomial for

18 Errors in Polynomial Interpolation It is expected that as number of nodes increases, error decreases, HOWEVER…. At all interpolation nodes x i Error=0 At all intermediate points Error: f(x)-f n-1 (x) f(x)

19 Errors in Polynomial Interpolation Beware of Oscillations…. For Example: Consider f(x)=(1+x 2 ) -1 evaluated at 9 points in [-5,5] And corresponding p 8 (x) Lagrange Interpolating Polynomial P 8 (x) f(x)


Download ppt "ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 22 CURVE FITTING Chapter 18 Function Interpolation and Approximation."

Similar presentations


Ads by Google