Interpolation and Splines

Similar documents
Interpolation by Spline Functions

CS 450 Numerical Analysis. Chapter 7: Interpolation

Polynomials tend to oscillate (wiggle) a lot, even when our true function does not.

Important Properties of B-spline Basis Functions

Mar. 20 Math 2335 sec 001 Spring 2014

APPM/MATH Problem Set 4 Solutions

Natasha S. Sharma, PhD

February 2017 (1/20) 2 Piecewise Polynomial Interpolation 2.2 (Natural) Cubic Splines. MA378/531 Numerical Analysis II ( NA2 )

Natural Quartic Spline

Curve and Surface Basics

Interpolation. TANA09 Lecture 7. Error analysis for linear interpolation. Linear Interpolation. Suppose we have a table x x 1 x 2...

PS Geometric Modeling Homework Assignment Sheet I (Due 20-Oct-2017)

99 International Journal of Engineering, Science and Mathematics

Convergence of C 2 Deficient Quartic Spline Interpolation

Linear Interpolating Splines

Parameterization of triangular meshes

Scientific Computing: Interpolation

Computational Physics PHYS 420

Numerical Integration

8 Piecewise Polynomial Interpolation

Lecture 8. Divided Differences,Least-Squares Approximations. Ceng375 Numerical Computations at December 9, 2010

specified or may be difficult to handle, we often have a tabulated data

Parameterization. Michael S. Floater. November 10, 2011

Calculus I Review Handout 1.3 Introduction to Calculus - Limits. by Kevin M. Chevalier

Journal of mathematics and computer science 13 (2014),

A Modified Spline Interpolation Method for Function Reconstruction from Its Zero-Crossings

Curve fitting using linear models

Spline Methods Draft. Tom Lyche and Knut Mørken

Block-based Thiele-like blending rational interpolation

Spline Methods Draft. Tom Lyche and Knut Mørken

Deficient Quartic Spline Interpolation

Spline Methods Draft. Tom Lyche and Knut Mørken. Department of Informatics Centre of Mathematics for Applications University of Oslo

Solve Non-Linear Parabolic Partial Differential Equation by Spline Collocation Method

A C 2 Four-Point Subdivision Scheme with Fourth Order Accuracy and its Extensions

MA 323 Geometric Modelling Course Notes: Day 10 Higher Order Polynomial Curves

February 23 Math 2335 sec 51 Spring 2016

Local Approximation by Splines with Displacement of Nodes

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

4 Visualization and. Approximation

Cardinality of Sets. Washington University Math Circle 10/30/2016

SYSTEMS OF NONLINEAR EQUATIONS

4.2 and 4.6 filled in notes.notebook. December 08, Integration. Copyright Cengage Learning. All rights reserved.

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

Computation of interpolatory splines via triadic subdivision

Bernstein-Bezier Splines on the Unit Sphere. Victoria Baramidze. Department of Mathematics. Western Illinois University

THE STUDY OF NEW APPROACHES IN CUBIC SPLINE INTERPOLATION FOR AUTO MOBILE DATA

Adaptive osculatory rational interpolation for image processing

Four equations are necessary to evaluate these coefficients. Eqn

A Transformation Based on the Cubic Parabola y = x 3

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Lecture 2.2 Cubic Splines

Lecture 9: Introduction to Spline Curves

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

A C 2 Four-Point Subdivision Scheme with Fourth Order Accuracy and its Extensions

Piecewise polynomial interpolation

Table for Third-Degree Spline Interpolation Using Equi-Spaced Knots. By W. D. Hoskins

Bézier Splines. B-Splines. B-Splines. CS 475 / CS 675 Computer Graphics. Lecture 14 : Modelling Curves 3 B-Splines. n i t i 1 t n i. J n,i.

Video 11.1 Vijay Kumar. Property of University of Pennsylvania, Vijay Kumar

Research Article A Family of Even-Point Ternary Approximating Schemes

Lecture 9. Curve fitting. Interpolation. Lecture in Numerical Methods from 28. April 2015 UVT. Lecture 9. Numerical. Interpolation his o

Handout 4 - Interpolation Examples

Interpolation - 2D mapping Tutorial 1: triangulation

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

Math 226A Homework 4 Due Monday, December 11th

Curves and Surfaces Computer Graphics I Lecture 9

Interpolation & Polynomial Approximation. Cubic Spline Interpolation II

Justify all your answers and write down all important steps. Unsupported answers will be disregarded.

Curve Representation ME761A Instructor in Charge Prof. J. Ramkumar Department of Mechanical Engineering, IIT Kanpur

Lacunary Interpolation Using Quartic B-Spline

Piecewise Polynomial Interpolation, cont d

Approximation of a Fuzzy Function by Using Radial Basis Functions Interpolation

Graphing Techniques. Domain (, ) Range (, ) Squaring Function f(x) = x 2 Domain (, ) Range [, ) f( x) = x 2

CHAPTER 6 Parametric Spline Curves

CS 475 / CS Computer Graphics. Modelling Curves 3 - B-Splines

Remark. Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 331

Connected Minimal Acceleration Trigonometric Curves

An introduction to interpolation and splines

Need for Parametric Equations

Normals of subdivision surfaces and their control polyhedra

Constructing Cubic Splines on the Sphere

08 - Designing Approximating Curves

AM205: lecture 2. 1 These have been shifted to MD 323 for the rest of the semester.

Algebraic Graph Theory- Adjacency Matrix and Spectrum

Math 3316, Fall 2016 Due Nov. 3, 2016

Section 5.5 Piecewise Interpolation

Smooth rounded corner. Smooth rounded corner. Smooth rounded corner

Module 2: Single Step Methods Lecture 4: The Euler Method. The Lecture Contains: The Euler Method. Euler's Method (Analytical Interpretations)

Algorithms and Data Structures

Intensity Transformations and Spatial Filtering

New Basis Functions and Their Applications to PDEs

Maximizing an interpolating quadratic

MODELS OF CUBIC THEORIES

MATH 1A MIDTERM 1 (8 AM VERSION) SOLUTION. (Last edited October 18, 2013 at 5:06pm.) lim

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

Curves and Surfaces Computer Graphics I Lecture 10

Polynomial Approximation and Interpolation Chapter 4

Spline Curves. Spline Curves. Prof. Dr. Hans Hagen Algorithmic Geometry WS 2013/2014 1

Knot Insertion and Reparametrization of Interval B-spline Curves

Limits and Derivatives (Review of Math 249 or 251)

Splines. Patrick Breheny. November 20. Introduction Regression splines (parametric) Smoothing splines (nonparametric)

Transcription:

Interpolation and Splines Anna Gryboś October 23, 27 1 Problem setting Many of physical phenomenona are described by the functions that we don t know exactly. Often we can calculate or measure the values of those functions or their derivatives for the given arguments. For example, we can measure position, velocity and acceleration of a moving object at the specified time points, hence we can gain a discrete information about the function f, i.e. for a given sequence of n distinct points x,..., x n called nodes of interpolation we obtain the sequence of values f(x i ) = y i, i =,..., n. From physical properties of the phenomenon, we may know approximately the behaviour of the function f, i.e. if it is polynomial, expotential, periodic, ect. Problem of interpolation consist of finding for the function f an approximation p within the fixed class of functions, in the way that they obtain the same values at the nodes, i.e. f(x i ) = p(x i ), i =,..., n (1) There are many ways to solve this problem, here we focus on a few of them: polynomial interpolation (Section 2) trigonometric interpolation (see Fast Fourier Transforms, Cooley-Tukey method) splines (Section 4) Let s note yet that for those classes of interpolating functions, storing the full information about the function (for example the coefficients of interpolating polynomial) does not require too much computer memory. Additionally, we can easily perform the operations on those functions like addition, multiplication, differentiation or integration. The latter property is important in particular for the applications (quadratures). 1

1 Sinus and its interpolant..8.6.4.2.2.4.6.8 1 1 2 3 4 6 7 Figure 1: Sinusoid function and its interpolating linear spline supported on six equidistant nodes (see Section 3.1). 2 Polynomial Interpolation 2.1 Vandermonde matrix Let s denote by P n the set of all real or complex polynomials P of degree not exceeding n: P (x) = a + a 1 x + a 2 x 2 +... + a n x n (2) To find the interpolating polynomial P we can substitute equation 1 into 2 and get a following system of linear equations in the coefficients a k. x n x n 1 x n 2... x 1 x n 1 x n 1 1 x1 n 2... x 1 1..... x n n x n 1 n xn n 2... x n 1 a n a n 1. a y y 1 =.. The square matrix on the left is commonly referred to as a Vandermonde matrix. Its determinant is nonzero, as we assumed that the nodes x,..., x n to be distinct, which proves the unisolvence theorem: there exists a unique interpolating polynomial P. y n 2.2 Lagrange Interpolation Theorem 1. For n+1 arbitrary nodes x,..., x n, x i x k, for i k and values y,..., y n there exists a unique polynomial P P n with P (x i ) = y i, i =, 1,..., n. We can construct the interpolating polynomial P explicitely with the help of Lagrange polynomials L i P n, i =, 1,..., n defined by: L i (x) = (x x ) (x x i 1 )(x x i+1 ) (x x n ) (x i x ) (x i x i 1 )(x i x i+1 ) (x i x n ) = ω(x) ω (x i )(x x i ) 2 (3)

with ω(x) = Π n i= (x x i). have the values L i (x k ) = δ ik. interpolation formula: At the nodes x,..., x n, the Lagrange polynomials defined that way Then the interpolating polynomial P can be expressed by Lagrange P (x) = 2.3 Error of approximation by interpolating polynomial n y i L i (x) (4) i= Let s consider a given function f(x) and its values in the nodes f(x i ) = y i, i =, 1,..., n. As we know, we can use the interpolating polynomial P supported on the nodes with the same values y i (see Equation 1) to approximate the function f(x). The error of approximation is estimated in the following theorem: Theorem 2. If the function f has an (n+1)st derivate, then for every argument x there exists a number ξ in the smallest interval I[x,..., x n, x] containing all nodes and x, satisfying: where ω(x) = Π n i= (x x i). f(x) P (x) = ω(x)f (n+1) (ξ) (n + 1)! When we denote by M n+1 = sup ξ I f (n+1) (ξ) then the error of approximation may be estimated by f(x) P (x) = M n+1 (n + 1)! ω(x) Example 1. Estimate the accuracy of calculating the value ln 1. with Lagrange interpolation formula, when the given values are: ln 1, ln 11, ln 12, ln 13. We have: f(x) = ln x, n = 3 and the nodes x = 1, x 3 = 13. As f (4) (x) = 6 x 4 hence M 4 = Following the Theorem 2, we obtain that ln(1.) P (1.) sup f (4) (x) = 6/1 4 x <1;13> 6 1 4.. 1. 2. 2.344 1 9 4! Remark 1. The degree of interpolating Lagrange polynomial P is strictly related to the amount of nodes x,..., x n, which makes the problems with high number of input data difficult to solve. Therefore, instead of interpolating the data by one polynomial, it is more applicable to divide the data into small groups, construct the interpolating polynomial P k in each group separately, then glue up the resulting interpolation polynomials P k into one function P. Such construction is realized by splines (see Section 3). Remark 2. Another problem with the polynomial interpolation with the polynomials of high degree is Runge s phenomenon. If the function f is interpolated at equidistant points x i in the interval [ 1, 1] with a polynomial P n (x) of degree n, the resulting interpolation oscillates near the ends of the 3

interval. It can even be proven that the interpolation error tends to infinity with increasing polynomial degree. The oscillation can be minimized by using Chebyshev nodes instead of equidistant nodes. In this case the maximum error is guaranteed to diminish with increasing polynomial order. The phenomenon demonstrates that high degree polynomials at equidistant nodes are generally unsuitable for interpolation. The problem can be avoided however by using splines again (see Section 3). 3 Splines In the one dimensional case, the splines are functions that are piecewiese polynomials associated with a partition of an interval [a, b] = {a = x < x 1 < < x n = b}. () The domain hence may be divided, as described above (Remark 1), into the smaller intervals, then on each subinterval an interpolating polynomial S i is constructed. The resulting spline function S is called a spline of order r or degree r 1 if, for each i =, 1,..., n 1, the restriction of S to the subinterval (x i, x i+1 ) agrees with a polynomial p i (x) of degree r 1. 3.1 Linear splines Linear spline interpolation is the simplest form of spline interpolation, the data points (x i, y i ) are graphically connected by straight lines (Fig.2). Algebraically, each S i for i =, 1,..., n is a linear function constructed as The spline must be continuous at each node, that is S i (x) = y i + y i+1 y i x i+1 x i (x x i ) (6) S i (x i ) = S i+1 (x i ), i = 1,... n 1 (7) This condition is satisfied as we can easily see: S i 1 (x i ) = y i 1 + y i y i 1 x i x i 1 (x i x i 1 ) = y i S i (x i ) = y i + y i+1 y i x i+1 x i (x i x i ) = y i This easy construction has however its disadvantages, the resulting linear spline S is usually not differentiable at the nodes x 1,..., x n 1. That s why the splines of higher order are used. 3.2 Cubic splines Definition 1. For a partition = {a = x < x 1 < < x n = b} of interval [a, b] a cubic spline is a real function S : [a, b] R with the properties: 4

3. 3 2. 2 1. 1... 1 1. 2 2. 3 3. Figure 2: Three data points (, 1), (1, 3), (3, 2) may be interpolated by the lines (linear splines) supported on intervals [, 1] and [1, 3] or by one parabol (cubic spline - see section 3.2). 1. S C 2 [a, b] 2. S coincides on every subinterval [x i, x i+1 ], i =, 1,... n 1 with a polynomial of degree three. 3. S satisfies the interpolation property S(x i ) = f(x i ), i = 1,... n 1 (see Equation 1). Thus the definition of cubic spline gives us the conditions for its construction. If S (x), x [x, x 1 ) S 1 (x), x [x 1, x 2 ) S(x) = S n 1 (x), x [x n 1, x n ] represents the spline function interpolating the function f, we require: the interpolating property S(x i ) = f(x i ) for i =,... n the splines to join up at nodes, S i 1 (x i ) = S i (x i ) for i = 1,... n 1 twice continuous differentiable, S i 1 (x i) = S i (x i), S i 1 (x i) = S i (x i) for i = 1,... n 1 However, an interpolating spline function S is not uniquely determined. We need to determine 4n conditions (since for one polynomial of degree three, there are four conditions on choosing the curve), while the definition gives 4n 2 conditions, there are still two degrees of freedom left. The following requirement may be considered resulting in the natural cubic spline. S (a) = S (b) =

4 B-splines B-spline are special piecewiese polynomial functions with following properties: they are nonnegative and vanish everywhere except on a few contiguous intervals [x i, x i+1 ]. Moreover, the function space S,k consisting of all splines of order k associated with the partition has a basis consisting of B-splines. Definition 2. Let χ A denote the characteristic function of a given set A. Then the nth-order B-spline B n (x) is defined inductively as follows: B n = B n 1 B 1 = B 1 (x) = χ [ 1 2, 1 2 ] 1 2 1 2 B n 1 (x t)dt signals spectra 1.2 B splines up to order 1 1 1 4 2 2 4 6 6 4 2 2 4 6.8 1.6 1 4 2 2 4 6 6 4 2 2 4 6 1.4 4 2 2 4 6 6 4 2 2 4 6 1.2 1 1 4 2 2 4 6 6 4 2 2 4 6.2 2 4 6 8 1 12 14 normalized so that they form a BUPU Figure 3: First four B-splines and their spectra on the left and B-splines up to order 1 on the right Theorem 3. Given n N, B-splines B n have the following properties: 1. If n 2, then B n C n 2 (R). 2. supp B n = [ n 2, n 2 ]. 3. B n (x) > for n 2 < x < n 2. 4. j B n(x j) = 1 for all x R.. B n(x)dx = 1. By the definition of the B-splines all the functions B n have support on a symmetric interval around zero. The translated spline N n (x) := T n 2 B n(x) = B n (x n 2 ) has support on the interval [, n]. The splines N n are called cardinal B-splines. Alternatively they can be defined inductively as the B-splines, starting with the function N 1 = χ [,1]. 6

4 6 8 1 12 14 B splines of first order B splines of second order.8.7.6..4.3.2.1.1 2 4 6 8 1 12 14 cubic B splines.7 B splines of fourth order.6..4.3.2.1 4 6 8 1 12 14.1 2 4 6 8 1 12 14 Figure 4: Normalized B-splines form a bounded uniform partition of unity (BUPU). The B-splines of first order in the upper left figure, B-splines of second order in upper right, cubic B-splines in lower left and finally B-splines of fourth order in lower right. Bibliography 1. Charles K. Chui, Multivariate splines, American Mathematical Society, 1988. 2. J. Stoer ; R. Bulirsch, Introduction to numerical analysis, Springer, 1993. 3. Wikipedia 7