Chapter 3. Interpolation and Extrapolation Hui Pan, Yunfei Duan.

Slides:



Advertisements
Similar presentations
Mark Trew CT Halfway Down Halfway down the stairs Is a stair Where I sit. There isn't any Other stair Quite like It. I'm not at the bottom, I'm.
Advertisements

Roundoff and truncation errors
Lecture Notes #11 Curves and Surfaces II
CSE 330: Numerical Methods
Interpolation A method of constructing a function that crosses through a discrete set of known data points. .
Asymptotic error expansion Example 1: Numerical differentiation –Truncation error via Taylor expansion.
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
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
1Notes  Assignment 0 is due today!  To get better feel for splines, play with formulas in MATLAB!
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Chapter 4 Roots of Equations
Curve-Fitting Interpolation
Curve-Fitting Polynomial Interpolation
Revision.
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.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 181 Interpolation.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Interpolation Chapter 18.
CSE Interpolation Roger Crawfis.
Chapter 6 Numerical Interpolation
Chapter 3 Root Finding.
Quadrature Greg Beckham. Quadrature Numerical Integration Goal is to obtain the integral with as few computations of the integrand as possible.
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 2 Roots of Equations Why? But.
Empirical Modeling Dongsup Kim Department of Biosystems, KAIST Fall, 2004.
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
Introduction This chapter gives you several methods which can be used to solve complicated equations to given levels of accuracy These are similar to.
Scientific Computing Linear and Quadratic Splines.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Splines Vida Movahedi January 2007.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter.
June 2007 Computer Arithmetic, Function EvaluationSlide 1 VI Function Evaluation Topics in This Part Chapter 21 Square-Rooting Methods Chapter 22 The CORDIC.
Numerical Methods for Engineering MECN 3500
Splines IV – B-spline Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
12 INFINITE SEQUENCES AND SERIES. In general, it is difficult to find the exact sum of a series.  We were able to accomplish this for geometric series.
Today’s class Roots of equation Finish up incremental search
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,
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.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4.
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Copyright © 2013, 2009, 2005 Pearson Education, Inc. 1 3 Polynomial and Rational Functions Copyright © 2013, 2009, 2005 Pearson Education, Inc.
Design and Analysis of Experiments (5) Fitting Regression Models Kyung-Ho Park.
CSE 330: Numerical Methods. What is true error? True error is the difference between the true value (also called the exact value) and the approximate.
Interpolation - Introduction
NUMERICAL ANALYSIS I. Introduction Numerical analysis is concerned with the process by which mathematical problems are solved by the operations.
Computational Methods CMSC/AMSC/MAPL 460 Polynomial Interpolation Ramani Duraiswami, Dept. of Computer Science.
Chapter 8: Estimating with Confidence
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 8: Estimating with Confidence
Interpolation.
Chapter 18.
INTERPOLATION Prof. Samuel Okolie, Prof. Yinka Adekunle & Dr
Chapter 8: Estimating with Confidence
5.3 Higher-Order Taylor Methods
Chapter 8: Estimating with Confidence
Chapter 8: Estimating with Confidence
SKTN 2393 Numerical Methods for Nuclear Engineers
Chapter 8: Estimating with Confidence
SKTN 2393 Numerical Methods for Nuclear Engineers
Chapter 8: Estimating with Confidence
Chapter 8: Estimating with Confidence
2/5/ Estimating a Population Mean.
Chapter 8: Estimating with Confidence
Chapter 8: Estimating with Confidence
Presentation transcript:

Chapter 3. Interpolation and Extrapolation Hui Pan, Yunfei Duan

possible problem in physical measurement Sometimes know the value of a function f(x) at a set of points, but we don’t have an analytic expression for f(x) that lets us calculate its value at an arbitrary point.

Interpolation and Extrapolation Estimate f(x) for arbitrary x by, in some sense, drawing a smooth curve through the x i. If the desired x is in between the largest and smallest of the x i ’s the problem is called interpolation. Otherwise it is called extrapolation.

For example, suppose we have a table like this, which gives some values of an unknown function f. Interpolation provides a means of estimating the function at intermediate points, such as x = : from wiki: xF(x)

Linear interpolation Since 2.5 is midway between 2 and 3, it is reasonable to take f(2.5) midway between f(2) = and f(3) = , which yields

Polynomial interpolation f(x) = x 6 – x x 4 – x x x Substituting x = 2.5, we find that f(2.5) =

Spline interpolation In this case we get f(2.5) = Spline interpolation uses low-degree polynomials in each of the intervals, and chooses the polynomial pieces such that they fit smoothly together. The resulting function is called a spline. The natural cubic spline interpolating the points in the table above is given:

Different between interpolation and function approximation Interpolation: Given the function f at points not of your own choosing. Function approximation: Allowed to compute the function f at any desired points for the purpose of developing your approximation.

Two steps for the conceptually interpolation process: 1.Fit an interpolation function to the data points provided. 2.Evaluate that interpolating function at a target point x.

Disadvantages for the above two-stage method: 1.Less efficient. 2.More susceptible to round-off error. Many practical schemes start at a nearby point f(xi), and then add a sequence of (hopefully) decreasing corrections, as information from other nearby f(xi)’s is incorporated.

The order of the interpolation: The number of points – 1 used in an interpolation scheme. Increasing the order does not necessarily increase the accuracy, especially in polynomial interpolation. adding points close to the desired point usually does help, but a finer mesh implies a larger table of values, which is not always available.

Search with Correlated Values: Not good to do a full bisection when interpolation routines are called multiply times. Hunt method starts with a random position in the table. It first “hunts,” either up or down, in increments of 1, then 2, then 4, etc., until the desired value is bracketed. It then bisects in the bracketed interval.

hunt algorithm Function hunt( double x) { //check xx[] is monotonic increasing or decreasing //define jl as start point, ju as end point, inc as increment value //move to right side if true. if(x >= xx[jl]) { for(;;) { //update ju equal to jl plus increment value //if ju >= n-1 or x < xx[ju], break; //else update jl equal to ju, and increment * 2 } } else { for(;;) { //update jl equal to jl minus increment value //if jl = xx[jl], break; //else update ju equal to jl, and increment * 2 } bisection algorithm; }

Cubic Spline Interpolation We start from a set of points [x i, y i ] for i = 0, 1, …, n for the function y = f(x). The cubic spine interpolation is a piecewise continuous curve, passing through each of the values in the table. Spline of degree k = 3 The domain of s is an interval [a, b] S, S’, S’’ are all continuous functions on [a, b]

1.Set one or both of y 0 ’’ and y N-1 ’’ equal to 0. S’’(x 0 ) = 0, S’’(x n ) = 0. 2.Set either of y 0 ’’ andy N-1 ’’ to values calculate from first derivative function so as to make the first derivative of the interpolating function have a specified value on either or both boundaries.

The gold of cubic spline interpolation: 1.Smooth in the first derivative 2.Continuous in the second derivative. Thus means : s(x j – 0) = s(x j + 0) s’(x j – 0) = s’(x j + 0) j = 1,2, …, n - 1 s’’(x j – 0) = s(x j + 0)

Taylor series: Let x = x i + 1 So, we can get :

We can get the same result between [x i – 1, x i ]