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

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

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

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 )

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

Example Write cardinal functions and give the Lagrange interpolating polynomial for

Other Methods Direct Evaluation n+1 coefficients n+1 Data Points Interpolating Polynomial should represent them exactly

Other Methods Direct Evaluation

Other Methods Solve Using any of the methods we have learned

Other Methods Not the most efficient method Ill-conditioned matrix (nearly singular) If n is large highly inaccurate coefficients Limit to lower order polynomials

Inverse Interpolation Xr=? Yr=Given

Xr=? Switch x and y and then interpolate? Not a Good Idea! Yr=Given

Inverse Interpolation Fit and n th order polynomial to x, f(x) data Solve Equation Xr=? Yr=Given

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)

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)

Splines

Piecewise smooth polynomials

E.G Quadratic Splines Function Values at adjacent polynomials are equal at interior nodes

E.G Quadratic Splines First and Last Functions pass through end points

E.G Quadratic Splines First Derivatives at Interior nodes are equal

E.G Quadratic Splines Assume Second Derivative @ First Point=0

E.G Quadratic Splines Assume Second Derivative @ First Point=0 Solve 3nx3n system of Equations

Spline Interpolation Polynomial Interpolation Spline Interpolation Polynomial Interpolation

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

Similar presentations