SPLINE INTERPOLATION

Size: px
Start display at page:

Download "SPLINE INTERPOLATION"

Transcription

1 Spline Background SPLINE INTERPOLATION Problem: high degree interpolating polynomials often have extra oscillations. Example: Runge function f(x = 1 1+4x 2, x [ 1, 1]. 1 1/(1+4x 2 and P 8 (x and P 16 (x Piecewise Polynomials provide alternative to high degree polynomials: approximation interval [a, b] is subdivided into pieces [x 1, x 2 ], [x 2, x 3 ],..., [x n 1, x n ] with a = x 1 < x 2 < < x n = b, and a low degree polynomial is used to approximate f(x on each subinterval.

2 Piecewise Linear Approximation S(x: S(x = f(x j + (x x j f(x j+1 f(x j x j+1 x j, if x [x j, x j+1 ] 2 Splines are piecewise polynomial approximations, connected at x j s with various continuity conditions.

3 Cubic Interpolating Splines for a = x 1 < < x n = b with given data (x 1, y 1, (x 2, y 2,..., (x n, y n. Properties of Cubic Interpolating Spline S(x, a S(x is composed of cubic polynomial pieces S j (x S(x = S j (x if x [x j, x j+1 ], j = 1, 2,..., n 1; b S(x j = y j, j = 1,..., n. (interpolation; c S j 1 (x j = S j (x j, j = 2,..., n 1 (S C[a, b]; d S j 1 (x j = S j (x j, j = 2,..., n 1 (S C 1 [a, b]; e S j 1 (x j = S j (x j, j = 2,..., n 1 (S C 2 [a, b]; f two end conditions: some possible choices i S (x 1 = S (x n = 0 ( natural or free spline; or ii S (x 1 = f (x 1, S (x n = f (x n (complete or clamped spline; or iii S 1 (x 2 = S 2 (x 2, S n 2(x n 1 = S n 1(x n 1 (not-a-knot; or iv S 1 = S n 1 = 0 (parabolically terminated. Notes: i if S j (x = a j + b j (x x j + c j (x x j 2 + d j (x x j 3, condition a provides 4(n 1 free parameters; b-f give n + 3(n = 4(n 1 constraints; ii spline word from thin metal strips that were used for drafting. 3

4 4 Example: n = 3, natural, data (1,2, (2,3, (3,5. S 1 (x = (x (x 13, S 2 (x = (x (x (x 23.

5 Cubic Interpolating Spline Construction Spline Linear System: let h j = x j+1 x j, and start with S j (x = a j +b j (x x j +c j (x x j 2 +d j (x x j 3 = y j +b j (x x j +c j (x x j 2 +d j (x x j 3. c S j+1 (x j+1 = S j (x j+1, implies (with y j = y j+1 y j y j+1 = y j + b j h j + c j h 2 j + d j h 3 y j j; = b j + c j h j + d j h 2 h j. j Notice S j (x = 2c j + 6d j (x x j, so e S j+1 (x j+1 = S j (x j+1, implies 2c j+1 = 2c j + 6d j h j ; d j h j = c j /3, with extra unknown c n = S n 1(x n /2 added. Then y j = b j + c j h j + c jh j = b j + (c j+1 + 2c j h j ; h j 3 3 = 3 y j+1 3 y j = 3 b j + (c j+2 + 2c j+1 h j+1 (c j+1 + 2c j h j. h j+1 h j Also S j (x = b j + 2c j (x x j + 3d j (x x j 2, so d S j+1 (x j+1 = S j (x j+1, implies b j+1 = b j + 2c j h j + 3d j h 2 j ; rewritten b j = 2c j h j + (c j+1 c j h j = (c j+1 + c j h j 5 = 3 y j+1 h j+1 3 y j h j = c j h j +2c j+1 (h j +h j+1 +c j+2 h j+1, for j = 1, 2,..., n 2.

6 Natural Splines: S (x 1 = S (x n = 0, so c 1 = c n = 0 Linear system equations are a tridiagonal system (0h 1 + 2c 2 (h 1 +h 2 + c 3 h 2 = 3 y 2 h 2 3 y 1 h 1 c 2 h 2 + 2c 3 (h 2 +h 3 + c 4 h 3 = 3 y 3 h 3 3 y 2 h 2.. c n 3 h n 3 + 2c n 2 (h n 3 +h n 2 + c n 1 h n 2 = 3 y n 2 h n 2 3 y 3 2 h n 3 c n 2 h n 2 + 2c n 1 (h n 2 +h n 1 + (0h n 1 = 3 y n 1 3 y n 2. h n 1 h n 2 which can be solved uniquely for c j s with O(n work. Equations d j = c j /(3h j, and b j = y j /h j c j h j d j h 2 j can be used to find remaining coefficients for S j (x s. If all h j = h, a simpler tridiagonal system has c j + 4c j+1 + c j+2 = 3 2 y j /h 2. Example: n = 3, natural, with data (1,2, (2,3, (3,5, so h 1 = h 2 = 1, y 1 = 1, y 2 = 2, 2 y 1 = 1. Only one equation 4c 2 = 3(1, so c 2 = 3/4, d 1 = 1/4, d 2 = 1/4; b 1 = 1 0 1/4 = 3/4, b 2 = 2 3/4 + 1/4 = 3/2. 6 S 1 (x = (x (x 13, S 2 (x = (x (x (x 23.

7 7 CUBIC SPLINE INTERPOLATION Alternate form without b s and d s: S j (x = c j (x j+1 x 3 + c j+1 (x x j 3 + ( y j c jh j 3h j 3h j+1 h j 3 (xj+1 x+ ( y j+1 c j+1h j+1 (x xj. h j+1 3 For the natural spline example: S 1 (x = (x 1 3 /4 + 2(2 x + 11(x 1/4; S 2 (x = (3 x 3 /4 + 11(3 x/4 + 5(x 2. Another Example: Runge function f(x = 1, x [ 1, 1], 1+4x 2 with n = 5, x i s = 1,.5, 0,.5, /(1+4x 2, S(x and P 4 (x

8 Clamped Splines: given S (x 1 = y 1, S (x n = y n, so y 1 = b 1, y n = b n 1 + 2c n 1 h n 1 + 3d n 1 h 2 n 1 Using y j h j = b j + (c j+1+2c j h j 3, 3h j d j = (c j+1 c j, 1 st and n th equations are: 3y 1, and c n 1 h n 1 + 2c n h n 1 = 3y n 3 y n 1 h n 1. 2c 1 h 1 + c 2 h 1 = 3 y 1 h 1 Linear system equations are a tridiagonal system 8 2c 1 h 1 + c 2 h 1 = 3 y 1 h 1 3y 1 c 1 h 1 + 2c 2 (h 1 +h 2 + c 3 h 2 = 3 y 2 h 2 3 y 1 h 1.. c n 2 h n 2 + 2c n 1 (h n 2 +h n 1 + c n h n 1 = 3 y n 1 h n 1 3 y n 2 h n 2 c n 1 h n 1 + 2c n h n 1 = 3y n 3 y n 1 h n 1. Example: n = 3, clamped, with data (1,2, (2,3, (3,5, and y 1 = 1, y 3 = 2. Three equations: 2c 1 + c 2 = 3(2 1 3, c 1 + 4c 2 + c 3 = 3, c 2 + 2c 3 = 6 3(2, with solution c 1 = c 3 = 1/2, c 2 = 1; S 1 (x = (2 x 3 /6 + (x 1 3 /3 + 13(2 x/6 + 8(x 1/3, S 2 (x = (3 x 3 /3 (x 2 3 /6 + 8(3 x/3 + 31(x 2/6.

9 Parabolically Terminated: S 1 = S n 1 = 0; d 1 = d n 1 = 0, c 1 = c 2, c n 1 = c n. Linear system equations are a tridiagonal system c 1 c 2 = 0 c 1 h 1 + 2c 2 (h 1 +h 2 + c 3 h 2 = 3 y 2 3 y 1 h 2 h 1.. c n 2 h n 2 + 2c n 1 (h n 2 +h n 1 + c n h n 1 = 3 y n 1 3 y n 2 h n 1 h n 2 c n 1 c n = 0. 9 Example: n = 3, parabolically terminated, with data (1,2, (2,3, (3,5. One equation: 2c 2 = 3(2 1, with solution c 2 = 3/2 = c 1 = c 3 ; S 1 (x = (2 x 3 /2 + (x 1 3 /2 + 3(2 x/2 + 5(x 1/2, from S 2 (x = (3 x 3 /2 + (x 2 3 /2 + 5(3 x/2 + 9(x 2/2, S j (x = c j (x j+1 x 3 + c j+1 (x x j 3 + ( y j c jh j 3h j 3h j+1 h j 3 (xj+1 x+ ( y j+1 c j+1h j+1 (x xj. h j+1 3

10 Not-a-Knot Splines: S 1 (x 2 = S 2 (x 2, S n 2(x n 1 = S n 1(x n 1, so d 1 = d 2, d n 2 = d n 1, and S 1 = S 2, S n 2 = S n 1. Then (c 2 c 1 /h 1 = (c 3 c 2 /h 2, (c n 1 c n 2 /h n 2 = (c n c n 1 /h n 1, so 1 st and n th equations become c 1 h 2 c 2 (h 1 + h 2 + c 3 h 1 = 0, and c n 2 h n 1 c n 1 (h n 2 + h n 1 + c n h n 2 = 0. Linear system equations are a tridiagonal system c 1 h 2 c 2 (h 1 + h 2 + c 3 h 1 = 0 c 1 h 1 + 2c 2 (h 1 +h 2 + c 3 h 2 = 3 y 2 3 y 1 h 2 h 1.. c n 2 h n 2 + 2c n 1 (h n 2 +h n 1 + c n h n 1 = 3 y n 1 3 y n 2 h n 1 h n 2 c n 2 h n 1 c n 1 (h n 2 + h n 1 + c n h n 2 = 0. Example: n = 3, not-a-knot, with data (1,2, (2,3, (3,5. Three equations: c 1 2c 2 + c 3 = 0, c 1 + 4c 2 + c 3 = 3, c 1 2c 2 + c 3 = 0? but c 1 = c 2, so also = c 3 and therefore c 1 = c 2 = c 3 = 1/2; S 1 (x = (2 x 3 /6 + (x 1 3 /6 + 11(2 x/6 + 17(x 1/6, or S 2 (x = (3 x 3 /6 + (x 2 3 /6 + 17(3 x/6 + 29(x 2/6. Also S 1 (x = 2 + (x 1/2 + (x 1 2 /2 or = 3 + 3(x 2/2 + (x 2 2 /2 = S 2 (x. 10

11 11 Efficient Spline Evaluation Setup: solve linear system for c j s in O(n time For each evaluation point x, find interval x [x j, x j+1 ] in O(log(n time and evaluate S j (x in O(1 time. Alternate formula for S j (x (without computing b j s and d j s: S j (x = c j (x j+1 x 3 + c j+1 (x x j 3 + ( y j c jh j (xj+1 x+ ( y j+1 c j+1h j+1 (x xj. 3h j 3h j+1 h j 3 h j+1 3 Compare with poly. interpolation, with O(n 2 setup and O(n evaluation time. Error Theorem : if f C 4 [a, b], with max x [a,b] f (4 (x = M, and S(x is the unique clamped spline for f(x with a = x 1 < x 2 < x n = b, then f(x S(x 5M 384 max 1 j<n h4 j. Smoothness Theorem : if f C 2 [a, b], and S(x is the unique clamped spline for f(x with a = x 1 < x 2 < x n = b, and U C 2 [a, b], with U S, satisfying the same interpolation and deriative endpoint conditions, then b a (U (x 2 > b a (S (x 2.

Cubic Splines MATH 375. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Cubic Splines

Cubic Splines MATH 375. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Cubic Splines Cubic Splines MATH 375 J. Robert Buchanan Department of Mathematics Fall 2006 Introduction Given data {(x 0, f(x 0 )), (x 1, f(x 1 )),...,(x n, f(x n ))} which we wish to interpolate using a polynomial...

More information

1 Piecewise Cubic Interpolation

1 Piecewise Cubic Interpolation Piecewise Cubic Interpolation Typically the problem with piecewise linear interpolation is the interpolant is not differentiable as the interpolation points (it has a kinks at every interpolation point)

More information

3.1 Interpolation and the Lagrange Polynomial

3.1 Interpolation and the Lagrange Polynomial MATH 4073 Chapter 3 Interpolation and Polynomial Approximation Fall 2003 1 Consider a sample x x 0 x 1 x n y y 0 y 1 y n. Can we get a function out of discrete data above that gives a reasonable estimate

More information

Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation

Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation See your notes. 1. Lagrange Interpolation (8.2) 1 2. Newton Interpolation (8.3) different form of the same polynomial as Lagrange

More information

Cubic Spline. s(x) = s j (x) = a j + b j (x x j ) + c j (x x j ) 2 + d j (x x j ) 3, j = 0,... n 1 (1)

Cubic Spline. s(x) = s j (x) = a j + b j (x x j ) + c j (x x j ) 2 + d j (x x j ) 3, j = 0,... n 1 (1) Cubic Spline Suppose we are given a set of interpolating points (x i, y i ) for i = 0, 1, 2, n We seek to construct a piecewise cubic function s(x) that has the for x [[x j, x j+1 ] we have: s(x) = s j

More information

Piecewise Polynomial Interpolation

Piecewise Polynomial Interpolation Piecewise Polynomial Interpolation 1 Piecewise linear interpolation Suppose we have data point (x k,y k ), k =0, 1,...N. A piecewise linear polynomial that interpolates these points is given by p(x) =p

More information

Data Analysis-I. Interpolation. Soon-Hyung Yook. December 4, Soon-Hyung Yook Data Analysis-I December 4, / 1

Data Analysis-I. Interpolation. Soon-Hyung Yook. December 4, Soon-Hyung Yook Data Analysis-I December 4, / 1 Data Analysis-I Interpolation Soon-Hyung Yook December 4, 2015 Soon-Hyung Yook Data Analysis-I December 4, 2015 1 / 1 Table of Contents Soon-Hyung Yook Data Analysis-I December 4, 2015 2 / 1 Introduction

More information

CHAPTER 4. Interpolation

CHAPTER 4. Interpolation CHAPTER 4 Interpolation 4.1. Introduction We will cover sections 4.1 through 4.12 in the book. Read section 4.1 in the book on your own. The basic problem of one-dimensional interpolation is this: Given

More information

Empirical Models Interpolation Polynomial Models

Empirical Models Interpolation Polynomial Models Mathematical Modeling Lia Vas Empirical Models Interpolation Polynomial Models Lagrange Polynomial. Recall that two points (x 1, y 1 ) and (x 2, y 2 ) determine a unique line y = ax + b passing them (obtained

More information

9.4 Cubic spline interpolation

9.4 Cubic spline interpolation 94 ubic spline interpolation Instead of going to higher and higher order, there is another way of creating a smooth function that interpolates data-points A cubic spline is a piecewise continuous curve

More information

Interpolation and extrapolation

Interpolation and extrapolation Interpolation and extrapolation Alexander Khanov PHYS6260: Experimental Methods is HEP Oklahoma State University October 30, 207 Interpolation/extrapolation vs fitting Formulation of the problem: there

More information

1 Review of Interpolation using Cubic Splines

1 Review of Interpolation using Cubic Splines cs412: introduction to numerical analysis 10/10/06 Lecture 12: Instructor: Professor Amos Ron Cubic Hermite Spline Interpolation Scribes: Yunpeng Li, Mark Cowlishaw 1 Review of Interpolation using Cubic

More information

In practice one often meets a situation where the function of interest, f(x), is only represented by a discrete set of tabulated points,

In practice one often meets a situation where the function of interest, f(x), is only represented by a discrete set of tabulated points, 1 Interpolation 11 Introduction In practice one often meets a situation where the function of interest, f(x), is only represented by a discrete set of tabulated points, {x i, y i = f(x i ) i = 1 n, obtained,

More information

Cubic Splines; Bézier Curves

Cubic Splines; Bézier Curves Cubic Splines; Bézier Curves 1 Cubic Splines piecewise approximation with cubic polynomials conditions on the coefficients of the splines 2 Bézier Curves computer-aided design and manufacturing MCS 471

More information

Numerical interpolation, extrapolation and fi tting of data

Numerical interpolation, extrapolation and fi tting of data Chapter 6 Numerical interpolation, extrapolation and fi tting of data 6.1 Introduction Numerical interpolation and extrapolation is perhaps one of the most used tools in numerical applications to physics.

More information

Engineering 7: Introduction to computer programming for scientists and engineers

Engineering 7: Introduction to computer programming for scientists and engineers Engineering 7: Introduction to computer programming for scientists and engineers Interpolation Recap Polynomial interpolation Spline interpolation Regression and Interpolation: learning functions from

More information

Chapter 4: Interpolation and Approximation. October 28, 2005

Chapter 4: Interpolation and Approximation. October 28, 2005 Chapter 4: Interpolation and Approximation October 28, 2005 Outline 1 2.4 Linear Interpolation 2 4.1 Lagrange Interpolation 3 4.2 Newton Interpolation and Divided Differences 4 4.3 Interpolation Error

More information

Interpolation Theory

Interpolation Theory Numerical Analysis Massoud Malek Interpolation Theory The concept of interpolation is to select a function P (x) from a given class of functions in such a way that the graph of y P (x) passes through the

More information

Fitting a Natural Spline to Samples of the Form (t, f(t))

Fitting a Natural Spline to Samples of the Form (t, f(t)) Fitting a Natural Spline to Samples of the Form (t, f(t)) David Eberly, Geometric Tools, Redmond WA 9852 https://wwwgeometrictoolscom/ This work is licensed under the Creative Commons Attribution 4 International

More information

Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University

Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University Lecture Note 3: Polynomial Interpolation Xiaoqun Zhang Shanghai Jiao Tong University Last updated: October 24, 2013 1.1 Introduction We first look at some examples. Lookup table for f(x) = 2 π x 0 e x2

More information

There is a unique function s(x) that has the required properties. It turns out to also satisfy

There is a unique function s(x) that has the required properties. It turns out to also satisfy Numerical Analysis Grinshpan Natural Cubic Spline Let,, n be given nodes (strictly increasing) and let y,, y n be given values (arbitrary) Our goal is to produce a function s() with the following properties:

More information

Maria Cameron Theoretical foundations. Let. be a partition of the interval [a, b].

Maria Cameron Theoretical foundations. Let. be a partition of the interval [a, b]. Maria Cameron 1 Interpolation by spline functions Spline functions yield smooth interpolation curves that are less likely to exhibit the large oscillations characteristic for high degree polynomials Splines

More information

Lecture 1 INF-MAT3350/ : Some Tridiagonal Matrix Problems

Lecture 1 INF-MAT3350/ : Some Tridiagonal Matrix Problems Lecture 1 INF-MAT3350/4350 2007: Some Tridiagonal Matrix Problems Tom Lyche University of Oslo Norway Lecture 1 INF-MAT3350/4350 2007: Some Tridiagonal Matrix Problems p.1/33 Plan for the day 1. Notation

More information

Scientific Computing

Scientific Computing 2301678 Scientific Computing Chapter 2 Interpolation and Approximation Paisan Nakmahachalasint Paisan.N@chula.ac.th Chapter 2 Interpolation and Approximation p. 1/66 Contents 1. Polynomial interpolation

More information

We consider the problem of finding a polynomial that interpolates a given set of values:

We consider the problem of finding a polynomial that interpolates a given set of values: Chapter 5 Interpolation 5. Polynomial Interpolation We consider the problem of finding a polynomial that interpolates a given set of values: x x 0 x... x n y y 0 y... y n where the x i are all distinct.

More information

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20 Exam 2 Average: 85.6 Median: 87.0 Maximum: 100.0 Minimum: 55.0 Standard Deviation: 10.42 Fall 2011 1 Today s class Multiple Variable Linear Regression Polynomial Interpolation Lagrange Interpolation Newton

More information

Cubic Splines. Antony Jameson. Department of Aeronautics and Astronautics, Stanford University, Stanford, California, 94305

Cubic Splines. Antony Jameson. Department of Aeronautics and Astronautics, Stanford University, Stanford, California, 94305 Cubic Splines Antony Jameson Department of Aeronautics and Astronautics, Stanford University, Stanford, California, 94305 1 References on splines 1. J. H. Ahlberg, E. N. Nilson, J. H. Walsh. Theory of

More information

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University Lecture Note 3: Interpolation and Polynomial Approximation Xiaoqun Zhang Shanghai Jiao Tong University Last updated: October 10, 2015 2 Contents 1.1 Introduction................................ 3 1.1.1

More information

Q 0 x if x 0 x x 1. S 1 x if x 1 x x 2. i 0,1,...,n 1, and L x L n 1 x if x n 1 x x n

Q 0 x if x 0 x x 1. S 1 x if x 1 x x 2. i 0,1,...,n 1, and L x L n 1 x if x n 1 x x n . - Piecewise Linear-Quadratic Interpolation Piecewise-polynomial Approximation: Problem: Givenn pairs of data points x i, y i, i,,...,n, find a piecewise-polynomial Sx S x if x x x Sx S x if x x x 2 :

More information

Lecture 1 INF-MAT : Chapter 2. Examples of Linear Systems

Lecture 1 INF-MAT : Chapter 2. Examples of Linear Systems Lecture 1 INF-MAT 4350 2010: Chapter 2. Examples of Linear Systems Tom Lyche Centre of Mathematics for Applications, Department of Informatics, University of Oslo August 26, 2010 Notation The set of natural

More information

Interpolation. Chapter Interpolation. 7.2 Existence, Uniqueness and conditioning

Interpolation. Chapter Interpolation. 7.2 Existence, Uniqueness and conditioning 76 Chapter 7 Interpolation 7.1 Interpolation Definition 7.1.1. Interpolation of a given function f defined on an interval [a,b] by a polynomial p: Given a set of specified points {(t i,y i } n with {t

More information

Computing the Hausdorff Distance between Two B-Spline Curves. Zachi Shtain

Computing the Hausdorff Distance between Two B-Spline Curves. Zachi Shtain Computing the Hausdorff Distance between Two B-Spline Curves Zachi Shtain Based on the work of: Chen et al. 2010 Definition Given two curves C 1, C 2, their Hausdorff distance is defined as: H Where:,

More information

Curve Fitting and Interpolation

Curve Fitting and Interpolation Chapter 5 Curve Fitting and Interpolation 5.1 Basic Concepts Consider a set of (x, y) data pairs (points) collected during an experiment, Curve fitting: is a procedure to develop or evaluate mathematical

More information

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam Jim Lambers MAT 460/560 Fall Semester 2009-10 Practice Final Exam 1. Let f(x) = sin 2x + cos 2x. (a) Write down the 2nd Taylor polynomial P 2 (x) of f(x) centered around x 0 = 0. (b) Write down the corresponding

More information

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University Interpolation Sanzheng Qiao Department of Computing and Software McMaster University January, 2014 Outline 1 Introduction 2 Polynomial Interpolation 3 Piecewise Polynomial Interpolation 4 Natural Cubic

More information

Polynomials. p n (x) = a n x n + a n 1 x n 1 + a 1 x + a 0, where

Polynomials. p n (x) = a n x n + a n 1 x n 1 + a 1 x + a 0, where Polynomials Polynomials Evaluation of polynomials involve only arithmetic operations, which can be done on today s digital computers. We consider polynomials with real coefficients and real variable. p

More information

Outline. 1 Interpolation. 2 Polynomial Interpolation. 3 Piecewise Polynomial Interpolation

Outline. 1 Interpolation. 2 Polynomial Interpolation. 3 Piecewise Polynomial Interpolation Outline Interpolation 1 Interpolation 2 3 Michael T. Heath Scientific Computing 2 / 56 Interpolation Motivation Choosing Interpolant Existence and Uniqueness Basic interpolation problem: for given data

More information

Chapter 3 Interpolation and Polynomial Approximation

Chapter 3 Interpolation and Polynomial Approximation Chapter 3 Interpolation and Polynomial Approximation Per-Olof Persson persson@berkeley.edu Department of Mathematics University of California, Berkeley Math 128A Numerical Analysis Polynomial Interpolation

More information

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University

Intro Polynomial Piecewise Cubic Spline Software Summary. Interpolation. Sanzheng Qiao. Department of Computing and Software McMaster University Interpolation Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Introduction 2 Polynomial Interpolation 3 Piecewise Polynomial Interpolation 4 Natural Cubic Spline

More information

Q1. Discuss, compare and contrast various curve fitting and interpolation methods

Q1. Discuss, compare and contrast various curve fitting and interpolation methods Q1. Discuss, compare and contrast various curve fitting and interpolation methods McMaster University 1 Curve Fitting Problem statement: Given a set of (n + 1) point-pairs {x i,y i }, i = 0,1,... n, find

More information

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b) Numerical Methods - PROBLEMS. The Taylor series, about the origin, for log( + x) is x x2 2 + x3 3 x4 4 + Find an upper bound on the magnitude of the truncation error on the interval x.5 when log( + x)

More information

Curves. Hakan Bilen University of Edinburgh. Computer Graphics Fall Some slides are courtesy of Steve Marschner and Taku Komura

Curves. Hakan Bilen University of Edinburgh. Computer Graphics Fall Some slides are courtesy of Steve Marschner and Taku Komura Curves Hakan Bilen University of Edinburgh Computer Graphics Fall 2017 Some slides are courtesy of Steve Marschner and Taku Komura How to create a virtual world? To compose scenes We need to define objects

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 7 Interpolation Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign Copyright c 2002. Reproduction permitted

More information

19.4 Spline Interpolation

19.4 Spline Interpolation c9-b.qxd 9/6/5 6:4 PM Page 8 8 CHAP. 9 Numerics in General 9.4 Spline Interpolation Given data (function values, points in the xy-plane) (x, ƒ ), (x, ƒ ),, (x n, ƒ n ) can be interpolated by a polynomial

More information

Automatic Control Motion planning

Automatic Control Motion planning Automatic Control Motion planning (luca.bascetta@polimi.it) Politecnico di Milano Dipartimento di Elettronica, Informazione e Bioingegneria Motivations 2 Electric motors are used in many different applications,

More information

Global polynomial interpolants suffer from the Runge Phenomenon if the data sites (nodes) are not chosen correctly.

Global polynomial interpolants suffer from the Runge Phenomenon if the data sites (nodes) are not chosen correctly. Piecewise polynomial interpolation Global polynomial interpolants suffer from the Runge Phenomenon if the data sites (nodes) are not chosen correctly. In many applications, one does not have the freedom

More information

n 1 f n 1 c 1 n+1 = c 1 n $ c 1 n 1. After taking logs, this becomes

n 1 f n 1 c 1 n+1 = c 1 n $ c 1 n 1. After taking logs, this becomes Root finding: 1 a The points {x n+1, }, {x n, f n }, {x n 1, f n 1 } should be co-linear Say they lie on the line x + y = This gives the relations x n+1 + = x n +f n = x n 1 +f n 1 = Eliminating α and

More information

Additional exercises with Numerieke Analyse

Additional exercises with Numerieke Analyse Additional exercises with Numerieke Analyse March 10, 017 1. (a) Given different points x 0, x 1, x [a, b] and scalars y 0, y 1, y, z 1, show that there exists at most one polynomial p P 3 with p(x i )

More information

Spring 2012 Introduction to numerical analysis Class notes. Laurent Demanet

Spring 2012 Introduction to numerical analysis Class notes. Laurent Demanet 18.330 Spring 2012 Introduction to numerical analysis Class notes Laurent Demanet Draft April 25, 2014 2 Preface Good additional references are Burden and Faires, Introduction to numerical analysis Suli

More information

Evaluate and Graph Polynomial Functions

Evaluate and Graph Polynomial Functions Evaluate and Graph Polynomial Functions Section 2.2 How do you identify and evaluate polynomial functions? What is synthetic substitution? How do you graph polynomial functions? Polynomial Function f(x)

More information

Math 578: Assignment 2

Math 578: Assignment 2 Math 578: Assignment 2 13. Determine whether the natural cubic spline that interpolates the table is or is not the x 0 1 2 3 y 1 1 0 10 function 1 + x x 3 x [0, 1] f(x) = 1 2(x 1) 3(x 1) 2 + 4(x 1) 3 x

More information

Piecewise Polynomial Interpolation

Piecewise Polynomial Interpolation Piecewise Polynomial Interpolation 1 Piecewise linear interpolation Suppose we have data point (x k,y k ), k =0, 1,...N. A piecewise linear polynomial that interpolates these points is given by p(x) =p

More information

Introductory Numerical Analysis

Introductory Numerical Analysis Introductory Numerical Analysis Lecture Notes December 16, 017 Contents 1 Introduction to 1 11 Floating Point Numbers 1 1 Computational Errors 13 Algorithm 3 14 Calculus Review 3 Root Finding 5 1 Bisection

More information

CONTROL POLYGONS FOR CUBIC CURVES

CONTROL POLYGONS FOR CUBIC CURVES On-Line Geometric Modeling Notes CONTROL POLYGONS FOR CUBIC CURVES Kenneth I. Joy Visualization and Graphics Research Group Department of Computer Science University of California, Davis Overview B-Spline

More information

Lectures 9-10: Polynomial and piecewise polynomial interpolation

Lectures 9-10: Polynomial and piecewise polynomial interpolation Lectures 9-1: Polynomial and piecewise polynomial interpolation Let f be a function, which is only known at the nodes x 1, x,, x n, ie, all we know about the function f are its values y j = f(x j ), j

More information

Applied Math 205. Full office hour schedule:

Applied Math 205. Full office hour schedule: Applied Math 205 Full office hour schedule: Rui: Monday 3pm 4:30pm in the IACS lounge Martin: Monday 4:30pm 6pm in the IACS lounge Chris: Tuesday 1pm 3pm in Pierce Hall, Room 305 Nao: Tuesday 3pm 4:30pm

More information

Chapter 1 Numerical approximation of data : interpolation, least squares method

Chapter 1 Numerical approximation of data : interpolation, least squares method Chapter 1 Numerical approximation of data : interpolation, least squares method I. Motivation 1 Approximation of functions Evaluation of a function Which functions (f : R R) can be effectively evaluated

More information

Preliminary Examination in Numerical Analysis

Preliminary Examination in Numerical Analysis Department of Applied Mathematics Preliminary Examination in Numerical Analysis August 7, 06, 0 am pm. Submit solutions to four (and no more) of the following six problems. Show all your work, and justify

More information

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation Lecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80

More information

Lecture 10 Polynomial interpolation

Lecture 10 Polynomial interpolation Lecture 10 Polynomial interpolation Weinan E 1,2 and Tiejun Li 2 1 Department of Mathematics, Princeton University, weinan@princeton.edu 2 School of Mathematical Sciences, Peking University, tieli@pku.edu.cn

More information

Numerical techniques to solve equations

Numerical techniques to solve equations Programming for Applications in Geomatics, Physical Geography and Ecosystem Science (NGEN13) Numerical techniques to solve equations vaughan.phillips@nateko.lu.se Vaughan Phillips Associate Professor,

More information

GENG2140, S2, 2012 Week 7: Curve fitting

GENG2140, S2, 2012 Week 7: Curve fitting GENG2140, S2, 2012 Week 7: Curve fitting Curve fitting is the process of constructing a curve, or mathematical function, f(x) that has the best fit to a series of data points Involves fitting lines and

More information

CS412: Introduction to Numerical Methods

CS412: Introduction to Numerical Methods CS412: Introduction to Numerical Methods MIDTERM #1 2:30PM - 3:45PM, Tuesday, 03/10/2015 Instructions: This exam is a closed book and closed notes exam, i.e., you are not allowed to consult any textbook,

More information

Numerical Analysis Lecture Notes

Numerical Analysis Lecture Notes Numerical Analysis Lecture Notes Peter J Olver 3 Approximation and Interpolation We will now apply our minimization results to the interpolation and least squares fitting of data and functions 3 Least

More information

Outline. 1 Numerical Integration. 2 Numerical Differentiation. 3 Richardson Extrapolation

Outline. 1 Numerical Integration. 2 Numerical Differentiation. 3 Richardson Extrapolation Outline Numerical Integration Numerical Differentiation Numerical Integration Numerical Differentiation 3 Michael T. Heath Scientific Computing / 6 Main Ideas Quadrature based on polynomial interpolation:

More information

Interpolation. Escuela de Ingeniería Informática de Oviedo. (Dpto. de Matemáticas-UniOvi) Numerical Computation Interpolation 1 / 34

Interpolation. Escuela de Ingeniería Informática de Oviedo. (Dpto. de Matemáticas-UniOvi) Numerical Computation Interpolation 1 / 34 Interpolation Escuela de Ingeniería Informática de Oviedo (Dpto. de Matemáticas-UniOvi) Numerical Computation Interpolation 1 / 34 Outline 1 Introduction 2 Lagrange interpolation 3 Piecewise polynomial

More information

Fixed point iteration and root finding

Fixed point iteration and root finding Fixed point iteration and root finding The sign function is defined as x > 0 sign(x) = 0 x = 0 x < 0. It can be evaluated via an iteration which is useful for some problems. One such iteration is given

More information

Spring 2012 Introduction to numerical analysis Class notes. Laurent Demanet

Spring 2012 Introduction to numerical analysis Class notes. Laurent Demanet 18.330 Spring 2012 Introduction to numerical analysis Class notes Laurent Demanet Draft February 28, 2012 2 Preface Good additional references are Burden and Faires, Introduction to numerical analysis

More information

Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. What for x = 1.2?

Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. What for x = 1.2? Applied Numerical Analysis Interpolation Lecturer: Emad Fatemizadeh Interpolation Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. 0 1 4 1-3 3 9 What for x = 1.? Interpolation

More information

Curve Fitting. 1 Interpolation. 2 Composite Fitting. 1.1 Fitting f(x) 1.2 Hermite interpolation. 2.1 Parabolic and Cubic Splines

Curve Fitting. 1 Interpolation. 2 Composite Fitting. 1.1 Fitting f(x) 1.2 Hermite interpolation. 2.1 Parabolic and Cubic Splines Curve Fitting Why do we want to curve fit? In general, we fit data points to produce a smooth representation of the system whose response generated the data points We do this for a variety of reasons 1

More information

Introduction to Computer Graphics. Modeling (1) April 13, 2017 Kenshi Takayama

Introduction to Computer Graphics. Modeling (1) April 13, 2017 Kenshi Takayama Introduction to Computer Graphics Modeling (1) April 13, 2017 Kenshi Takayama Parametric curves X & Y coordinates defined by parameter t ( time) Example: Cycloid x t = t sin t y t = 1 cos t Tangent (aka.

More information

Applied Numerical Analysis Quiz #2

Applied Numerical Analysis Quiz #2 Applied Numerical Analysis Quiz #2 Modules 3 and 4 Name: Student number: DO NOT OPEN UNTIL ASKED Instructions: Make sure you have a machine-readable answer form. Write your name and student number in the

More information

Threshold Autoregressions and NonLinear Autoregressions

Threshold Autoregressions and NonLinear Autoregressions Threshold Autoregressions and NonLinear Autoregressions Original Presentation: Central Bank of Chile October 29-31, 2013 Bruce Hansen (University of Wisconsin) Threshold Regression 1 / 47 Threshold Models

More information

Barycentric rational interpolation with no poles and high rates of approximation

Barycentric rational interpolation with no poles and high rates of approximation Barycentric rational interpolation with no poles and high rates of approximation Michael S. Floater Kai Hormann Abstract It is well known that rational interpolation sometimes gives better approximations

More information

Polynomial Interpolation

Polynomial Interpolation Capter 4 Polynomial Interpolation In tis capter, we consider te important problem of approximatinga function fx, wose values at a set of distinct points x, x, x,, x n are known, by a polynomial P x suc

More information

MTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018)

MTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018) MTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018) COURSEWORK 3 SOLUTIONS Exercise ( ) 1. (a) Write A = (a ij ) n n and B = (b ij ) n n. Since A and B are diagonal, we have a ij = 0 and

More information

MATH ASSIGNMENT 07 SOLUTIONS. 8.1 Following is census data showing the population of the US between 1900 and 2000:

MATH ASSIGNMENT 07 SOLUTIONS. 8.1 Following is census data showing the population of the US between 1900 and 2000: MATH4414.01 ASSIGNMENT 07 SOLUTIONS 8.1 Following is census data showing the population of the US between 1900 and 2000: Years after 1900 Population in millions 0 76.0 20 105.7 40 131.7 60 179.3 80 226.5

More information

MA2501 Numerical Methods Spring 2015

MA2501 Numerical Methods Spring 2015 Norwegian University of Science and Technology Department of Mathematics MA5 Numerical Methods Spring 5 Solutions to exercise set 9 Find approximate values of the following integrals using the adaptive

More information

Numerical Integration

Numerical Integration Numerical Integration Sanzheng Qiao Department of Computing and Software McMaster University February, 2014 Outline 1 Introduction 2 Rectangle Rule 3 Trapezoid Rule 4 Error Estimates 5 Simpson s Rule 6

More information

Sample Exam 1 KEY NAME: 1. CS 557 Sample Exam 1 KEY. These are some sample problems taken from exams in previous years. roughly ten questions.

Sample Exam 1 KEY NAME: 1. CS 557 Sample Exam 1 KEY. These are some sample problems taken from exams in previous years. roughly ten questions. Sample Exam 1 KEY NAME: 1 CS 557 Sample Exam 1 KEY These are some sample problems taken from exams in previous years. roughly ten questions. Your exam will have 1. (0 points) Circle T or T T Any curve

More information

INTERPOLATION. and y i = cos x i, i = 0, 1, 2 This gives us the three points. Now find a quadratic polynomial. p(x) = a 0 + a 1 x + a 2 x 2.

INTERPOLATION. and y i = cos x i, i = 0, 1, 2 This gives us the three points. Now find a quadratic polynomial. p(x) = a 0 + a 1 x + a 2 x 2. INTERPOLATION Interpolation is a process of finding a formula (often a polynomial) whose graph will pass through a given set of points (x, y). As an example, consider defining and x 0 = 0, x 1 = π/4, x

More information

1 Trajectory Generation

1 Trajectory Generation CS 685 notes, J. Košecká 1 Trajectory Generation The material for these notes has been adopted from: John J. Craig: Robotics: Mechanics and Control. This example assumes that we have a starting position

More information

Math 660-Lecture 15: Finite element spaces (I)

Math 660-Lecture 15: Finite element spaces (I) Math 660-Lecture 15: Finite element spaces (I) (Chapter 3, 4.2, 4.3) Before we introduce the concrete spaces, let s first of all introduce the following important lemma. Theorem 1. Let V h consists of

More information

Finite element function approximation

Finite element function approximation THE UNIVERSITY OF WESTERN ONTARIO LONDON ONTARIO Paul Klein Office: SSC 4028 Phone: 661-2111 ext. 85227 Email: paul.klein@uwo.ca URL: www.ssc.uwo.ca/economics/faculty/klein/ Economics 613/614 Advanced

More information

Numerical Analysis. A Comprehensive Introduction. H. R. Schwarz University of Zürich Switzerland. with a contribution by

Numerical Analysis. A Comprehensive Introduction. H. R. Schwarz University of Zürich Switzerland. with a contribution by Numerical Analysis A Comprehensive Introduction H. R. Schwarz University of Zürich Switzerland with a contribution by J. Waldvogel Swiss Federal Institute of Technology, Zürich JOHN WILEY & SONS Chichester

More information

MA 323 Geometric Modelling Course Notes: Day 20 Curvature and G 2 Bezier splines

MA 323 Geometric Modelling Course Notes: Day 20 Curvature and G 2 Bezier splines MA 323 Geometric Modelling Course Notes: Day 20 Curvature and G 2 Bezier splines David L. Finn Yesterday, we introduced the notion of curvature and how it plays a role formally in the description of curves,

More information

Lagrange Interpolation and Neville s Algorithm. Ron Goldman Department of Computer Science Rice University

Lagrange Interpolation and Neville s Algorithm. Ron Goldman Department of Computer Science Rice University Lagrange Interpolation and Neville s Algorithm Ron Goldman Department of Computer Science Rice University Tension between Mathematics and Engineering 1. How do Mathematicians actually represent curves

More information

The Closed Form Reproducing Polynomial Particle Shape Functions for Meshfree Particle Methods

The Closed Form Reproducing Polynomial Particle Shape Functions for Meshfree Particle Methods The Closed Form Reproducing Polynomial Particle Shape Functions for Meshfree Particle Methods by Hae-Soo Oh Department of Mathematics, University of North Carolina at Charlotte, Charlotte, NC 28223 June

More information

5 Numerical Integration & Dierentiation

5 Numerical Integration & Dierentiation 5 Numerical Integration & Dierentiation Department of Mathematics & Statistics ASU Outline of Chapter 5 1 The Trapezoidal and Simpson Rules 2 Error Formulas 3 Gaussian Numerical Integration 4 Numerical

More information

4.1 Areas and Distances. The Area Problem: GOAL: Find the area of the region S that lies under the curve y = f(x) from a to b.

4.1 Areas and Distances. The Area Problem: GOAL: Find the area of the region S that lies under the curve y = f(x) from a to b. 4.1 Areas and Distances The Area Problem: GOAL: Find the area of the region S that lies under the curve y = f(x) from a to b. Easier Problems: Find the area of a rectangle with length l and width w. Find

More information

Spline Methods Draft. Tom Lyche and Knut Mørken

Spline Methods Draft. Tom Lyche and Knut Mørken Spline Methods Draft Tom Lyche and Knut Mørken 25th April 2003 2 Contents 1 Splines and B-splines an Introduction 3 1.1 Convex combinations and convex hulls..................... 3 1.1.1 Stable computations...........................

More information

COS 424: Interacting with Data

COS 424: Interacting with Data COS 424: Interacting with Data Lecturer: Rob Schapire Lecture #14 Scribe: Zia Khan April 3, 2007 Recall from previous lecture that in regression we are trying to predict a real value given our data. Specically,

More information

Integration, differentiation, and root finding. Phys 420/580 Lecture 7

Integration, differentiation, and root finding. Phys 420/580 Lecture 7 Integration, differentiation, and root finding Phys 420/580 Lecture 7 Numerical integration Compute an approximation to the definite integral I = b Find area under the curve in the interval Trapezoid Rule:

More information

Math Numerical Analysis Mid-Term Test Solutions

Math Numerical Analysis Mid-Term Test Solutions Math 400 - Numerical Analysis Mid-Term Test Solutions. Short Answers (a) A sufficient and necessary condition for the bisection method to find a root of f(x) on the interval [a,b] is f(a)f(b) < 0 or f(a)

More information

CHAPTER 3 Further properties of splines and B-splines

CHAPTER 3 Further properties of splines and B-splines CHAPTER 3 Further properties of splines and B-splines In Chapter 2 we established some of the most elementary properties of B-splines. In this chapter our focus is on the question What kind of functions

More information

Numerical integration - I. M. Peressi - UniTS - Laurea Magistrale in Physics Laboratory of Computational Physics - Unit V

Numerical integration - I. M. Peressi - UniTS - Laurea Magistrale in Physics Laboratory of Computational Physics - Unit V Numerical integration - I M. Peressi - UniTS - Laurea Magistrale in Physics Laboratory of Computational Physics - Unit V deterministic methods in 1D equispaced points (trapezoidal, Simpson...), others...

More information

Draft. Chapter 2 Approximation and Interpolation. MATH 561 Numerical Analysis. Songting Luo. Department of Mathematics Iowa State University

Draft. Chapter 2 Approximation and Interpolation. MATH 561 Numerical Analysis. Songting Luo. Department of Mathematics Iowa State University Chapter 2 Approximation and Interpolation Songting Luo Department of Mathematics Iowa State University MATH 561 Numerical Analysis Songting Luo ( Department of Mathematics Iowa State University[0.5in]

More information

Identify polynomial functions

Identify polynomial functions EXAMPLE 1 Identify polynomial functions Decide whether the function is a polynomial function. If so, write it in standard form and state its degree, type, and leading coefficient. a. h (x) = x 4 1 x 2

More information

Self-Influencing Interpolation in Groundwater Flow

Self-Influencing Interpolation in Groundwater Flow Self-Influencing Interpolation in Groundwater Flow Carolyn Atwood Whitman College Walla Walla, WA Robert Hildebrand University of Puget Sound Tacoma, WA Andrew Homan Ohio Northern University Ada, OH July

More information

An Efficient Algorithm Based on Quadratic Spline Collocation and Finite Difference Methods for Parabolic Partial Differential Equations.

An Efficient Algorithm Based on Quadratic Spline Collocation and Finite Difference Methods for Parabolic Partial Differential Equations. An Efficient Algorithm Based on Quadratic Spline Collocation and Finite Difference Methods for Parabolic Partial Differential Equations by Tong Chen A thesis submitted in conformity with the requirements

More information