Piecewise Polynomial Interpolation

Size: px
Start display at page:

Download "Piecewise Polynomial Interpolation"

Transcription

1 Piecewise Polynomial Interpolation 1

2 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 k (x), x 2 [x k,x k+1 ] where the polynomials p k (x) can be written as p k (x) =a 1 (x x k )+a 0, k =1, 2,...N 1 At this point, we could easily compute the coe cients a =[a 1,a 0 ], but let s go through a more general procedure that we can use for higher order piecewise polynomials. 2

3 Piecewise linear interpolation We can write this as a function of a local variable t which measures the distance along the interval. t = x x k x k+1 x k x = h k t + x k where h k = x k+1 x k. Then, for 0 apple t apple 1, we have p k (x) =ep k (t) =ea 1 t + ea 0 t =1 (x k+1,y k+1 ) t =0 Constraints to impose ep k (0) = y k (x k,y k ) 0 <t<1 ep k (1) = y k+1 3

4 Piecewise linear interpolation This leads to a linear system apple apple ea1 ea 0 = apple yk y k+1 which we write as Aea = p. To solve for the coe we use the matrix co-factor C to get A 1 A 1 = CT det(a) = 1 det(a) apple cients, We have det(a) = 1, and so ea = C T p 4

5 Piecewise linear interpolation To see what ep k (t) looks like, we let q(t) =[t, 1] and write ep k (t) = ea T q(t) = p T Cq(t) apple T = yk y k apple t 1 The advantage of this form is that we can clearly see how the polynomial ep k (t) depends on our data y k and y k+1 : ep k (t) =(1 t)y k + ty k+1 5

6 Piecewise linear interpolation To build a spline in Matlab, we need to have the coefficients a 0 and a 1 of our original polynomial. p k (x) =a 1 (x x k )+a 0 We can recover these coe cients by substituting t = (x x k )/h k into ep k (t) =ea 1 t + ea 0 to get p k (x) =ea 1 x h k xk + ea 0 = a 1 (x x k )+a 0 where a 1 = ea 1 /h k and ea 0 = a 0. 6

7 Piecewise linear interpolation We can also write a =[a 1,a 0 ]using a = p T apple 1 1 CS = y k y k " yk+1 y # k = h k y k apple 1/hk These are exactly the coefficients that Matlab needs to build a spline using mkpp. function pp_linear = build_linear_spline(xdata,ydata) N = length(xdata)-1; h = diff(xdata); %(x1-x0, x2-x1, x3-x2,...) C = [1-1; -1 0]; for k = 1:N, p = [ydata(k); ydata(k+1)]; S = diag([1./h(k) 1]); coeffs(k,:) = -p'*c*s; end pp_linear = mkpp(xdata,coeffs); end 7

8 Piecewise linear interpolation (x 4,y 4 ) (x 0,y 0 ) (x 2,y 2 ) (x 5,y 5 ) 8

9 Piecewise linear interpolation Piecewise linear interpolation has these properties Continuous at nodes (x k,y k ). Derivatives are not continuous (the function is not smooth!) Can we come design a method that matches derivatives at the nodes as well? 9

10 Hermite interpolation We can impose smoothness at the nodes to get a nicer looking curve. Suppose we match the function values and derivatives. p(x k+1 )=y k+1 p 0 (x k+1 )=d k+1 This approach assumes that we have derivatives dk at each of the nodes xk. p(x k )=y k Four conditions allow us to find the four coefficients of a cubic polynomial p 0 (x k )=d k p k (x) =a 3 (x x k ) 3 + a 2 (x x k ) 2 + a 1 (x x k )+a 0 10

11 Hermite interpolation As before, define t = x x k x k+1 x k,! x = h k t + x k where h k = x k+1 x k. Then, for 0 apple t apple 1, we have p k (x) ep k (t) =ea 3 t 3 + ea 2 t 2 + ea 1 t + ea 0 and our four conditions become ep k (0) = y k ep k (1) = y k+1 ep 0 k (0) = d kh k ep 0 k (1) = d k+1h k 11

12 Hermite interpolation This leads to the following linear system for the coe cients ea n : We write the above system as Aea = p. To invert A, weusethe co-factor matrix C to get A 1 = CT det(a) See Strang s Introduction to Linear Algebra for more information on the co-factor formula for the matrix inverse. 12

13 Hermite interpolation We can then write ep k (t) as ep k (t) =ea T q(t) = p T Cq(t) where q(t) =[t 3,t 2,t,1] T and we have used the fact that det(a) = 1. Computing C, we get t 3 ep k (t) = T y k y k+1 d k h k d k+1 h k t t which leads to a formula that clearly shows how the polynomial depends on our data y k, y k+1, d k and d k+1 : ep k (t) = 1 t 2 (3 2t) y k + t 2 (3 2t) y k+1 + t(t 1) 2 h k d k + t 2 (t 1) h k d k+1 13

14 Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) ep k (t) = 1 t 2 (3 2t) y k + t 2 (3 2t) y k+1 + t(t 1) 2 h k d k + t 2 (t 1) h k d k+1 x k )/h k, we can recover our original poly- If we substitute t =(x nomial in x : p k (x) =a 3 (x x k ) 3 + a 2 (x x k ) 2 + a 1 (x x k )+a 0 where a n = ea n /h n k. We can write these coe a = p T CS cients as These are exactly the coefficients that Matlab needs to build a spline using mkpp. where S = diag(h 3 k,h 2 k,h 1 k, 1), p =[y k,y k+1,d k h k,d k+1 h k ], and C is the co-factor matrix of our original coe cient matrix A. 14

15 The derivatives? Where do we get the derivatives d k from? If we know f(x), we can set d k = f 0 (x k ). We can approximate derivatives using data (x k,y k ). d k = G ( k 1, k), k = y k+1 y k h k where, for example, we could take G(a, b) = a+b 2, G(a, b) = a, G(a, b) = b or some other reasonable function. Matlab s PCHIP chooses derivatives to avoid introducing new extrema in the spline. We can impose additional smoothness conditions and solve implicitly for the derivatives. 15

16 Derivatives? Given data points (x 0,y 0 ),...,(x N,y N ), impose continuity in the second derivative at the interior nodes, p 00 k(x k+1 )=p 00 k+1(x k+1 ), k =1, 2,...N 1. This leads to a tridiagonal system for the derivatives at internal nodes ( knots ) d 1,d 2,d 3,...,d N 1. To get equations for the end point derivatives, we will need to to impose additional conditions at the endpoints. 16

17 Piecewise linear interpolation The entries in the tridiagonal system can be found by considering the polynomials as functions of t : p 00 k 1(x) = 1 h 2 k 1 p 00 k 1(t), x = h k 1 t + x k 1 Transforming the equations equating second derivatives at knots, we obtain 1 h 2 k 1 p 00 k 1(1) = 1 h 2 k p 00 k(0), k =1, 2, 3,...N 1 Using p 00 k (t) = pt Cq 00 (t), we get 6 h 2 k 1 6 y k 1 h 2 y k + 2 d k k 1 h k 1 h k 1 d k = 6 h 2 k 6 y k h 2 y k d k + 4 d k+1 k h k h k or 1 h k 1 d k h k h k d k + 1 h k d k+1 = 3 h 2 k 1 (y k y k 1 )+ 3 h 2 k (y k+1 y k ) for k =1, 2, 3,...,N derivatives d k. 1. This leads to a tridiagonal system for the unknown 17

18 Piecewise linear interpolation We can combine all equations into an (N system A 0 d = b, or u 0 u 0 + u 1 u 1 u 1 u 1 + u 2 u 2 u 2 u 2 + u 3 u ) (N + 1) augmented tridiagonal u N 2 u N 2 + u N 1 u N 1 where the matrix A 0 A 0 = u 0 A u N d 0 d 1. d N 1 d N 3 2 = b 1.. b N and u i = 1, k =0, 1, 2,...,N 1 h i b i =3u 2 i 1(y i y i 1 )+3u 2 i (y i+1 y i ), k =1, 2, 3,...,N 1. We can write this as a square tridiagonal system Ad = b d 0 u 0 d N u N where u 0 and u N are the first and last columns of A 0 above, and d =(d 1,d 2,...,d N 1 ) 18

19 Piecewise linear interpolation We solve for the unknown derivatives d 0,d 1,d 2,...,d N in three steps. 1. Solve d H = A 1 b. 2. Solve for vectors d 0 and d N. Ad 0 = u 0 Ad N = u N 3. Solve F(d 0,d N )= apple a11 a 12 a 21 a 22 apple d0 d N + apple F0 F N =0 for scalars d 0, d N so that so that endpoint conditions (to be determined) are satisfied. Coe cients for the above system depend on choice of endpoint conditions. All unknown derivatives are then given by d = d 0, d H d 0 d 0 d N d N, d N 19

20 End conditions? There are several additional conditions we can impose to solve for the endpoint derivatives. Clamp derivative values d 0 and d N to fixed values, Fit a cubic through first (last) four points and set d 0 (d N ) to the derivative of this polynomial at x 0 (x N ). Impose continuity of the third derivative at x 1 (x N 1 ). This is the not-aknot condition, since we now have a single cubic polynomial over [x 0,x 2 ] and [x N 2,x N ], e ectively eliminating the second (and second to last) node (or knot ). For a periodic spline, match first and second derivatives between x 0 and x N. Impose the natural endpoint conditions, i.e. second derivative equal to 0. Each of these can be represented as a 2 2 system of the form F(d 0,d N )= apple a11 a 12 a 21 a 22 apple d0 d N + apple F0 F N =0 After determining coe cients, we can then solve for d 0 and d N. 20

21 Cubic spline 21

22 Periodic spline 22

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

SPLINE INTERPOLATION

SPLINE INTERPOLATION 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

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

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

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

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

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

Numerical Methods I: Polynomial Interpolation

Numerical Methods I: Polynomial Interpolation 1/31 Numerical Methods I: Polynomial Interpolation Georg Stadler Courant Institute, NYU stadler@cims.nyu.edu November 16, 2017 lassical polynomial interpolation Given f i := f(t i ), i =0,...,n, we would

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

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

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

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

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

Numerical Methods I: Interpolation (cont ed)

Numerical Methods I: Interpolation (cont ed) 1/20 Numerical Methods I: Interpolation (cont ed) Georg Stadler Courant Institute, NYU stadler@cims.nyu.edu November 30, 2017 Interpolation Things you should know 2/20 I Lagrange vs. Hermite interpolation

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Vector Spaces and SubSpaces

Vector Spaces and SubSpaces Vector Spaces and SubSpaces Linear Algebra MATH 2076 Linear Algebra Vector Spaces & SubSpaces Chapter 4, Section 1b 1 / 10 What is a Vector Space? A vector space is a bunch of objects that we call vectors

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

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

Interpolation. 1. Judd, K. Numerical Methods in Economics, Cambridge: MIT Press. Chapter

Interpolation. 1. Judd, K. Numerical Methods in Economics, Cambridge: MIT Press. Chapter Key References: Interpolation 1. Judd, K. Numerical Methods in Economics, Cambridge: MIT Press. Chapter 6. 2. Press, W. et. al. Numerical Recipes in C, Cambridge: Cambridge University Press. Chapter 3

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

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

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

Solving Integral Equations by Petrov-Galerkin Method and Using Hermite-type 3 1 Elements

Solving Integral Equations by Petrov-Galerkin Method and Using Hermite-type 3 1 Elements 5 1 July 24, Antalya, Turkey Dynamical Systems and Applications, Proceedings, pp. 436 442 Solving Integral Equations by Petrov-Galerkin Method and Using Hermite-type 3 1 Elements M. Karami Department of

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

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

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

SYSTEMS OF NONLINEAR EQUATIONS

SYSTEMS OF NONLINEAR EQUATIONS SYSTEMS OF NONLINEAR EQUATIONS Widely used in the mathematical modeling of real world phenomena. We introduce some numerical methods for their solution. For better intuition, we examine systems of two

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

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

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

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

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

Keyframing. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University

Keyframing. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University Keyframing CS 448D: Character Animation Prof. Vladlen Koltun Stanford University Keyframing in traditional animation Master animator draws key frames Apprentice fills in the in-between frames Keyframing

More information

Applied Numerical Analysis Homework #3

Applied Numerical Analysis Homework #3 Applied Numerical Analysis Homework #3 Interpolation: Splines, Multiple dimensions, Radial Bases, Least-Squares Splines Question Consider a cubic spline interpolation of a set of data points, and derivatives

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

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

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

Math 314/ Exam 2 Blue Exam Solutions December 4, 2008 Instructor: Dr. S. Cooper. Name:

Math 314/ Exam 2 Blue Exam Solutions December 4, 2008 Instructor: Dr. S. Cooper. Name: Math 34/84 - Exam Blue Exam Solutions December 4, 8 Instructor: Dr. S. Cooper Name: Read each question carefully. Be sure to show all of your work and not just your final conclusion. You may not use your

More information

CHAPTER 2 POLYNOMIALS KEY POINTS

CHAPTER 2 POLYNOMIALS KEY POINTS CHAPTER POLYNOMIALS KEY POINTS 1. Polynomials of degrees 1, and 3 are called linear, quadratic and cubic polynomials respectively.. A quadratic polynomial in x with real coefficient is of the form a x

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

How fast can we add (or subtract) two numbers n and m?

How fast can we add (or subtract) two numbers n and m? Addition and Subtraction How fast do we add (or subtract) two numbers n and m? How fast can we add (or subtract) two numbers n and m? Definition. Let A(d) denote the maximal number of steps required to

More information

1 Roots of polynomials

1 Roots of polynomials CS348a: Computer Graphics Handout #18 Geometric Modeling Original Handout #13 Stanford University Tuesday, 9 November 1993 Original Lecture #5: 14th October 1993 Topics: Polynomials Scribe: Mark P Kust

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

LINEAR SYSTEMS AND MATRICES

LINEAR SYSTEMS AND MATRICES CHAPTER 3 LINEAR SYSTEMS AND MATRICES SECTION 3. INTRODUCTION TO LINEAR SYSTEMS This initial section takes account of the fact that some students remember only hazily the method of elimination for and

More information

Linear Algebra Practice Problems

Linear Algebra Practice Problems Math 7, Professor Ramras Linear Algebra Practice Problems () Consider the following system of linear equations in the variables x, y, and z, in which the constants a and b are real numbers. x y + z = a

More information

G-SPLINE INTERPOLATION FOR APPROXIMATING THE SOLUTION OF FRACTIONAL DIFFERENTIAL EQUATIONS USING LINEAR MULTI- STEP METHODS

G-SPLINE INTERPOLATION FOR APPROXIMATING THE SOLUTION OF FRACTIONAL DIFFERENTIAL EQUATIONS USING LINEAR MULTI- STEP METHODS Journal of Al-Nahrain University Vol.0(), December, 00, pp.8- Science G-SPLINE INTERPOLATION FOR APPROXIMATING THE SOLUTION OF FRACTIONAL DIFFERENTIAL EQUATIONS USING LINEAR MULTI- STEP METHODS Osama H.

More information

Maximum and Minimum Values section 4.1

Maximum and Minimum Values section 4.1 Maximum and Minimum Values section 4.1 Definition. Consider a function f on its domain D. (i) We say that f has absolute maximum at a point x 0 D if for all x D we have f(x) f(x 0 ). (ii) We say that f

More information

Linear Algebra, part 2 Eigenvalues, eigenvectors and least squares solutions

Linear Algebra, part 2 Eigenvalues, eigenvectors and least squares solutions Linear Algebra, part 2 Eigenvalues, eigenvectors and least squares solutions Anna-Karin Tornberg Mathematical Models, Analysis and Simulation Fall semester, 2013 Main problem of linear algebra 2: Given

More information

MTH MTH Lecture 6. Yevgeniy Kovchegov Oregon State University

MTH MTH Lecture 6. Yevgeniy Kovchegov Oregon State University MTH 306 0 MTH 306 - Lecture 6 Yevgeniy Kovchegov Oregon State University MTH 306 1 Topics Lines and planes. Systems of linear equations. Systematic elimination of unknowns. Coe cient matrix. Augmented

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

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

Linear Systems and Matrices

Linear Systems and Matrices Department of Mathematics The Chinese University of Hong Kong 1 System of m linear equations in n unknowns (linear system) a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2.......

More information

Section 1.1 System of Linear Equations. Dr. Abdulla Eid. College of Science. MATHS 211: Linear Algebra

Section 1.1 System of Linear Equations. Dr. Abdulla Eid. College of Science. MATHS 211: Linear Algebra Section 1.1 System of Linear Equations College of Science MATHS 211: Linear Algebra (University of Bahrain) Linear System 1 / 33 Goals:. 1 Define system of linear equations and their solutions. 2 To represent

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

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

Numerical Integration (Quadrature) Another application for our interpolation tools!

Numerical Integration (Quadrature) Another application for our interpolation tools! Numerical Integration (Quadrature) Another application for our interpolation tools! Integration: Area under a curve Curve = data or function Integrating data Finite number of data points spacing specified

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

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

Coordinate Systems. Recall that a basis for a vector space, V, is a set of vectors in V that is linearly independent and spans V.

Coordinate Systems. Recall that a basis for a vector space, V, is a set of vectors in V that is linearly independent and spans V. These notes closely follow the presentation of the material given in David C. Lay s textbook Linear Algebra and its Applications (rd edition). These notes are intended primarily for in-class presentation

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

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

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

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

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

Math 365 Homework 5 Due April 6, 2018 Grady Wright

Math 365 Homework 5 Due April 6, 2018 Grady Wright Math 365 Homework 5 Due April 6, 018 Grady Wright 1. (Polynomial interpolation, 10pts) Consider the following three samples of some function f(x): x f(x) -1/ -1 1 1 1/ (a) Determine the unique second degree

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

Finite Elements. Colin Cotter. January 18, Colin Cotter FEM

Finite Elements. Colin Cotter. January 18, Colin Cotter FEM Finite Elements January 18, 2019 The finite element Given a triangulation T of a domain Ω, finite element spaces are defined according to 1. the form the functions take (usually polynomial) when restricted

More information

Solutions to Final Exam 2011 (Total: 100 pts)

Solutions to Final Exam 2011 (Total: 100 pts) Page of 5 Introduction to Linear Algebra November 7, Solutions to Final Exam (Total: pts). Let T : R 3 R 3 be a linear transformation defined by: (5 pts) T (x, x, x 3 ) = (x + 3x + x 3, x x x 3, x + 3x

More information

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel LECTURE NOTES on ELEMENTARY NUMERICAL METHODS Eusebius Doedel TABLE OF CONTENTS Vector and Matrix Norms 1 Banach Lemma 20 The Numerical Solution of Linear Systems 25 Gauss Elimination 25 Operation Count

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

Numerical solution of nonlinear sine-gordon equation with local RBF-based finite difference collocation method

Numerical solution of nonlinear sine-gordon equation with local RBF-based finite difference collocation method Numerical solution of nonlinear sine-gordon equation with local RBF-based finite difference collocation method Y. Azari Keywords: Local RBF-based finite difference (LRBF-FD), Global RBF collocation, sine-gordon

More information

MATH 304 Linear Algebra Lecture 10: Linear independence. Wronskian.

MATH 304 Linear Algebra Lecture 10: Linear independence. Wronskian. MATH 304 Linear Algebra Lecture 10: Linear independence. Wronskian. Spanning set Let S be a subset of a vector space V. Definition. The span of the set S is the smallest subspace W V that contains S. If

More information

Chapter 1: Systems of Linear Equations and Matrices

Chapter 1: Systems of Linear Equations and Matrices : Systems of Linear Equations and Matrices Multiple Choice Questions. Which of the following equations is linear? (A) x + 3x 3 + 4x 4 3 = 5 (B) 3x x + x 3 = 5 (C) 5x + 5 x x 3 = x + cos (x ) + 4x 3 = 7.

More information

Polynomial approximation and Splines

Polynomial approximation and Splines Polnomial approimation and Splines 1. Weierstrass approimation theorem The basic question we ll look at toda is how to approimate a complicated function f() with a simpler function P () f() P () for eample,

More information

Bernstein polynomials of degree N are defined by

Bernstein polynomials of degree N are defined by SEC. 5.5 BÉZIER CURVES 309 5.5 Bézier Curves Pierre Bézier at Renault and Paul de Casteljau at Citroën independently developed the Bézier curve for CAD/CAM operations, in the 1970s. These parametrically

More information

Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS

Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS 5.1 Introduction When a physical system depends on more than one variable a general

More information

Edexcel GCE Further Pure Mathematics (FP1) Required Knowledge Information Sheet. Daniel Hammocks

Edexcel GCE Further Pure Mathematics (FP1) Required Knowledge Information Sheet. Daniel Hammocks Edexcel GCE Further Pure Mathematics (FP1) Required Knowledge Information Sheet FP1 Formulae Given in Mathematical Formulae and Statistical Tables Booklet Summations o =1 2 = 1 + 12 + 1 6 o =1 3 = 1 64

More information

Eigenvalues and Eigenvectors: An Introduction

Eigenvalues and Eigenvectors: An Introduction Eigenvalues and Eigenvectors: An Introduction The eigenvalue problem is a problem of considerable theoretical interest and wide-ranging application. For example, this problem is crucial in solving systems

More information

Direct Learning: Linear Classification. Donglin Zeng, Department of Biostatistics, University of North Carolina

Direct Learning: Linear Classification. Donglin Zeng, Department of Biostatistics, University of North Carolina Direct Learning: Linear Classification Logistic regression models for classification problem We consider two class problem: Y {0, 1}. The Bayes rule for the classification is I(P(Y = 1 X = x) > 1/2) so

More information

Department of Applied Mathematics Preliminary Examination in Numerical Analysis August, 2013

Department of Applied Mathematics Preliminary Examination in Numerical Analysis August, 2013 Department of Applied Mathematics Preliminary Examination in Numerical Analysis August, 013 August 8, 013 Solutions: 1 Root Finding (a) Let the root be x = α We subtract α from both sides of x n+1 = x

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

Chapter I. Linear Equations

Chapter I. Linear Equations Chapter I Linear Equations I.. Solving Linear Equations Prerequisites and Learning Goals From your work in previous courses, you should be able to Write a system of linear equations using matrix notation.

More information

Mid-term Exam #2 MATH 205, Fall 2014

Mid-term Exam #2 MATH 205, Fall 2014 Mid-term Exam # MATH 05, Fall 04 Name: Instructions: Please answer as many of the following questions as possible Show all of your work and give complete explanations when requested Write your final answer

More information

Remark By definition, an eigenvector must be a nonzero vector, but eigenvalue could be zero.

Remark By definition, an eigenvector must be a nonzero vector, but eigenvalue could be zero. Sec 6 Eigenvalues and Eigenvectors Definition An eigenvector of an n n matrix A is a nonzero vector x such that A x λ x for some scalar λ A scalar λ is called an eigenvalue of A if there is a nontrivial

More information

Section 0.2 & 0.3 Worksheet. Types of Functions

Section 0.2 & 0.3 Worksheet. Types of Functions MATH 1142 NAME Section 0.2 & 0.3 Worksheet Types of Functions Now that we have discussed what functions are and some of their characteristics, we will explore different types of functions. Section 0.2

More information

and let s calculate the image of some vectors under the transformation T.

and let s calculate the image of some vectors under the transformation T. Chapter 5 Eigenvalues and Eigenvectors 5. Eigenvalues and Eigenvectors Let T : R n R n be a linear transformation. Then T can be represented by a matrix (the standard matrix), and we can write T ( v) =

More information