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

Size: px
Start display at page:

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

Transcription

1 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 are used eg, in applications in graphics, numerical methods (eg, for BVP), signal processing The simplest splines are the cubic splines We will restrict ourselves to their considerations 11 Theoretical foundations Let be a partition of the interval [a, b] := {a = x 0 < x 1 < < x n = b} Definition 1 A cubic spline S on is a real function S : [a, b] R with the properties: (1) S C 2 [a, b], (2) S coincides on every subinterval [x j, x j+1 ], j = 0, 1,, n 1 with a polynomial of degree at most 3 Thus a cubic spline consists of cubic polynomials glued in such a manner that their values together with the values of their first two derivatives coincide at the interior nodes x j, j = 1, 2,, n 1 Suppose a function f is given at the nodes x j, j = 0, 1,, n, ie, f(x j ) = f j, j = 0, 1,, n 1 We denote the vector {f 0,, f n } by F We will denote a spline function that interpolates f at these points by S (F ; ) Note that S (F, ) is not uniquely defined by the sequence F Indeed, we have 4n coefficients of the cubic polynomials and n (n 1) = 4n 2 conditions to satisfy Hence we a free to assign two additional conditions that would allow us to determine S (F ; ) uniquely The typical conditions are: (1) zero second derivatives at the ends: S (F ; a) = S (F ; b) = 0, (2) periodicity: S (F ; a) = S (F ; b), S (F ; a) = S (F ; b), (3) assigned first derivatives at the ends: S (F ; a) = f 0, S (F ; b) = f n A prerequisite for the second condition is that f 0 = f n There is a theorem proven eg, in [1] that the spline function is unique for each of these cases 1

2 2 12 Setting up a system of equations for a cubic spline Throughout this section we will stick with a fixed partition := {a = x 0 < x 1 < < x n = b} and fixed vector of f s values F = {f 0,, f n } We will use the following notations for the intervals between the nodes and their lengths: I j := [x j, x j+1 ], j = 0, 1,, n 1, and +1 := x j+1 x j The second derivatives of the spline functions at the nodes are called moments and denoted M j := S (F, x j ), J = 0, 1,, n We will show that the spline function S (F ; x) is completely characterized by its moments, and the moments are found by solving a system of linear equations The second derivative of a spline function coincides with a linear function on each subinterval, and these linear functions can be described in terms of the moments M j : (1) S (F ; x) = M j x j+1 x +1 Integrating Eq (1) we obtain: + M j+1 x x j +1 x I j [x j, x j+1 ] (2) S (F ; x) = M j (x j+1 x) M j+1 (x x j ) A j, (3) S (F ; x) = M j (x j+1 x) M j+1 (x x j ) A j (x x j ) + B j, for x I j, j = 0, 1,, n, where A j and B j are constants of integration From S (F ; x j ) = f j and S (F ; x j+1 ) = f j+1 we obtain the following equations for A j and B j : M j h 2 j B j = f j, Hence M j+1 h 2 j A j +1 + B j = f j+1 (4) (5) B j = f j M j h 2 j+1 6, A j = f j+1 f j (M j+1 M j ) This yields the following representation of the spline function in terms of its moments: (6) S (F ; x) = α j + β j (x x j ) + γ j (x x j ) 2 + δ j (x x j ) 3 for x I j,

3 3 where (7) α j = f j, (8) (9) (10) γ j = M j 2, β j = S (F ; x j ) = M j +1 2 δ j = S (F, x+ j ) = M j+1 M j A j = f j+1 f j (M j+1 + 2M j ), Now we need to calculate the moments M j The continuity of S (F ; x) at the interior nodes yields n 1 equations for the moments M j Using Eqs (3) and (5) we obtain Therefore, for j = 1, 2,, n 1 we have S (F ; x) = M j (x j+1 x) M j+1 (x x j ) f j+1 f j (M j+1 M j ) S (F ; x j ) = f j f j 1 Since S (F ; x+ j ) = S (F ; x j ), we have (11) + 3 M j + 6 M j 1, S (F ; x + j ) = f j+1 f j M j +1 6 M j+1 6 M j M j M j+1 = f j+1 f j +1 f j f j 1 for j = 1, 2,, n 1 these are n 1 equations for n + 1 unknown moments The remaining two equations can be gained from the boundary conditions In the first case, S (F ; a) = S (F ; b) = 0 we set M 0 = M n = 0 In the periodic case we set M 0 = M n and h n 6 M n 1 + h n + h 1 M n + h M 1 = f 1 f n f n f n 1 h 1 h n Exercise Obtain additional two conditions for the case of assigned first derivatives at the end points: (12) (13) h 1 3 M 0 + h 1 6 M 1 = f 1 f 0 f h 0, 1 h n 6 M n 1 + h n 3 M n = f n f n f n 1 h n Eqs (11), (12) and (13) can be written in the common format µ j M j 1 + 2M j + λ j M j+1 = d j, j = 1, 2,, n 1,

4 4 where (14) (15) (16) λ j := , µ j := 1 λ j =, + +1 { 6 fj+1 f j d j := f } j f j 1 In the case M 0 = M n = 0 we set λ 0 = 0, d 0 = 0, µ n = 0, d n = 0 In result, we arrive at the following system of equations (17) 2 λ 0 0 µ 1 2 λ 1 µ 2 2 λ n 1 0 µ n 2 M 0 M 1 M n = d 0 d 1 d n Exercise Write out the system of equations for the momenta for the periodic case and for the case of assigned first derivatives at the endpoints Theorem 1 The matrix in Eq (17) is nonsingular for any partition of [a, b] Proof We will denote the Matrix in Eq (17) by A If follows from the definitions of λ j and µ j that µ j + λ j = 1, µ j 0, λ j 0 Therefore, the matrix A is strictly diagonal dominant Therefore, for any vector z max j z j max Az j j (Check this!) Hence Az = 0 if and only if z = 0

5 13 A fast solver for tridiagonal matrices The matrix in Eq (17) is tridiagonal There is a fast solver for such kind of systems that involves O(n) flops q 0 = λ 0 2 ; u 0 = d 0 2 ; λ n = 0; for k = 1 : n p k = µ k q k 1 + 2; q k = λ k p k ; u k = d k µ k u k 1 p k ; end for M n = u n ; for k = n 1 : 0 end for M k = q k M k+1 + u k ; 5 14 Convergence properties of cubic spline functions Definition 2 The fineness of the given partition is := max j As we know, the interpol ating polynomials do not necessarily converge to f no matter how smooth f is as the fineness of the partition tends to zero The spline interpolants do converge to f nicely under mild conditions First we will introduce some notations We will denote by F the vector of the second derivatives of f at the nodes The vector of moments M satisfies Eq (17) We will write The residual r is defined as AM = d r := d AF = A(M F ) Theorem 2 Suppose the first derivatives of f are assigned If f C 4 [a, b] and f (4) (x) L for x [a, b], then M F r 3 4 L 2

6 6 Proof By definition of the residual we have r j = d j µ j f (x j 1 ) 2f (x j ) λ j f (x j+1 ) { 6 fj+1 f j = f } j f j f (x j 1 ) 2f (x j ) +1 f (x j+1 ) Using Taylor s expansion around x j we obtain r j = (f f + h2 j+1 6 f + h3 j+1 24 f (τ 1 ) f + 2 f h2 j 6 f + h3 j 24 f (τ 2 )) [ f f + h2 j f (τ 3 ) [ ] 2f +1 f + +1 f + h2 j f (τ 4 ) [ ] 1 h 3 j+1 = f (τ 1 ) + h3 j 4 f (τ 2 ) h3 j 2 f (τ 3 ) +1 2 f (τ 4 ) Here all omitted arguments are x j and τ j [x j 1, x j+1 ] Therefore, for j = 1, 2,, n 1 r j 3 4 Lh3 j+1 + h3 j +1 + = 3 4 L(h2 j +1 + h 2 j+1) 3 4 L 2 The first and the last intervals are handled in a similar manner For them we have Since r = A(M F ) and A 1 we get r L 2 and r n 3 4 L 2 M F r 3 4 L 2 Theorem 3 Suppose f C 4 [a, b] and f (4) (x) L for x [a, b] Let be a partition of the interval [a, b] and K be a constant such that +1 K, j = 0, 1,, n 1 If S is the spline function which interpolates the values of f at the nodes of the partition and satisfies S (a) = f (a) and S (b) = f (b), ]

7 7 then there exist constants c k 2 independent of the partition, such that for x [a, b] (18) (19) (20) (21) f(x) S (x) c 0 L 4, f (x) S (x) c 1 L 3, f (x) S (x) c 2 L 2, f (x) S (x) c 3 LK Proof First we prove Eq (21) For x [x j 1, x j ], S (x) f (x) = M j M j 1 f (x) = M j f (x j ) M j 1 f (x j 1 ) + f (x j ) f (x) [f (x j 1 ) f (x)] f (x) Using the previous theorem and the Taylor expansion at x we get S (x) f (x) 3 2 L (x j x)f + (x j x) 2 f (η 1 ) 2 (x j 1 x)f (x j 1 x) f (η 2 ) f 3 2 L 2 + L 2 2 2LK 2 = 2L 2 Here η 1, η 2 [x j 1, x j ] To prove Eq (20) we observe that for every x (a, b) there is a closes node x j = x j (x) Assume without loss of generality that x x j (x) so that x [x j 1, x j ] and x j (x) x /2 /2 Then f (x) S (x) = f (x j ) S (x j ) + x x j (x) (f (t) S (t))dt 3 4 L L L 2, x (a, b) Next we prove Eq (19) In addition to the boundary points ξ 0 := a and ξ n+1 := b there exist by Rolle s theorem n points ξ j (x j 1, x j ) such that f (ξ j ) = S (ξ j ) for any x (a, b) there exists a closest one ξ j = ξ j (x), and x ξ j (x) <

8 8 Therefore, x f (x) S (x) = (f (t) S (t))dt ξ(x) Finally we prove Eq (18) We have f(x) S (x) = x 7 4 L 2 = 7 4 L 3 x j (x) (f (t) S (t))dt L 3 = 7 8 L 4, x [a, b] 15 Spline interpolation in Matlab The Matlab command interp1 is capable of finding the cubic spline The default mode is the linear interpolation, while adding spline in the argument results in finding the cubic spline Figure 1 is generated by the following sequence of commands >> t=linspace(0,5,1000); >> p=linspace(0,5,20); >> flin=interp1(p,sin(p^2),t); >> fspl=interp1(p,sin(p^2),t, spline ); >> fig=figure; >> hold on; >> grid; >> plot(t,sin(t^2), LineWidth,1) >> plot(t,flin, LineWidth,1, color, k ) >> plot(t,fspl, LineWidth,1, color, r ) >> plot(p,sin(p^2), b, MarkerSize,20) >> axis tight >> set(gca, DataAspectRatio,[1 1 1]) References [1] J Stoer and R Bulirsch, Introduction to Numerical Analysis, Third Edition, Springer, 2002

9 Figure 1 Linear interpolation and cubic spline interpolation 9

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

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

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

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

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

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

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations Numerical Solutions to Partial Differential Equations Zhiping Li LMAM and School of Mathematical Sciences Peking University Discretization of Boundary Conditions Discretization of Boundary Conditions On

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

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

Convergence Rates on Root Finding

Convergence Rates on Root Finding Convergence Rates on Root Finding Com S 477/577 Oct 5, 004 A sequence x i R converges to ξ if for each ǫ > 0, there exists an integer Nǫ) such that x l ξ > ǫ for all l Nǫ). The Cauchy convergence criterion

More information

Numerical Methods of Approximation

Numerical Methods of Approximation Contents 31 Numerical Methods of Approximation 31.1 Polynomial Approximations 2 31.2 Numerical Integration 28 31.3 Numerical Differentiation 58 31.4 Nonlinear Equations 67 Learning outcomes In this Workbook

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

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

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

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

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

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

Curve Fitting. Objectives

Curve Fitting. Objectives Curve Fitting Objectives Understanding the difference between regression and interpolation. Knowing how to fit curve of discrete with least-squares regression. Knowing how to compute and understand the

More information

Lecture 8: Optimization

Lecture 8: Optimization Lecture 8: Optimization This lecture describes methods for the optimization of a real-valued function f(x) on a bounded real interval [a, b]. We will describe methods for determining the maximum of f(x)

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

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

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

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

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

Chapter 5 - Integration

Chapter 5 - Integration Chapter 5 - Integration 5.1 Approximating the Area under a Curve 5.2 Definite Integrals 5.3 Fundamental Theorem of Calculus 5.4 Working with Integrals 5.5 Substitution Rule for Integrals 1 Q. Is the area

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

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

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

Numerical Programming I (for CSE)

Numerical Programming I (for CSE) Technische Universität München WT 1/13 Fakultät für Mathematik Prof. Dr. M. Mehl B. Gatzhammer January 1, 13 Numerical Programming I (for CSE) Tutorial 1: Iterative Methods 1) Relaxation Methods a) Let

More information

Numerical Analysis: Approximation of Functions

Numerical Analysis: Approximation of Functions Numerical Analysis: Approximation of Functions Mirko Navara http://cmp.felk.cvut.cz/ navara/ Center for Machine Perception, Department of Cybernetics, FEE, CTU Karlovo náměstí, building G, office 104a

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

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

Finite difference method for elliptic problems: I

Finite difference method for elliptic problems: I Finite difference method for elliptic problems: I Praveen. C praveen@math.tifrbng.res.in Tata Institute of Fundamental Research Center for Applicable Mathematics Bangalore 560065 http://math.tifrbng.res.in/~praveen

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

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

M.A. Botchev. September 5, 2014

M.A. Botchev. September 5, 2014 Rome-Moscow school of Matrix Methods and Applied Linear Algebra 2014 A short introduction to Krylov subspaces for linear systems, matrix functions and inexact Newton methods. Plan and exercises. M.A. Botchev

More information

Homework and Computer Problems for Math*2130 (W17).

Homework and Computer Problems for Math*2130 (W17). Homework and Computer Problems for Math*2130 (W17). MARCUS R. GARVIE 1 December 21, 2016 1 Department of Mathematics & Statistics, University of Guelph NOTES: These questions are a bare minimum. You should

More information

Finite Element Method for Ordinary Differential Equations

Finite Element Method for Ordinary Differential Equations 52 Chapter 4 Finite Element Method for Ordinary Differential Equations In this chapter we consider some simple examples of the finite element method for the approximate solution of ordinary differential

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

University of Houston, Department of Mathematics Numerical Analysis, Fall 2005

University of Houston, Department of Mathematics Numerical Analysis, Fall 2005 4 Interpolation 4.1 Polynomial interpolation Problem: LetP n (I), n ln, I := [a,b] lr, be the linear space of polynomials of degree n on I, P n (I) := { p n : I lr p n (x) = n i=0 a i x i, a i lr, 0 i

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

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

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

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

Interpolation Atkinson Chapter 3, Stoer & Bulirsch Chapter 2, Dahlquist & Bjork Chapter 4 Topics marked with are not on the exam

Interpolation Atkinson Chapter 3, Stoer & Bulirsch Chapter 2, Dahlquist & Bjork Chapter 4 Topics marked with are not on the exam Interpolation Atkinson Chapter 3, Stoer & Bulirsch Chapter 2, Dahlquist & Bjork Chapter 4 Topics marked with are not on the exam 1 Polynomial interpolation, introduction Let {x i } n 0 be distinct real

More information

NEW ITERATIVE METHODS BASED ON SPLINE FUNCTIONS FOR SOLVING NONLINEAR EQUATIONS

NEW ITERATIVE METHODS BASED ON SPLINE FUNCTIONS FOR SOLVING NONLINEAR EQUATIONS Bulletin of Mathematical Analysis and Applications ISSN: 181-191, URL: http://www.bmathaa.org Volume 3 Issue 4(011, Pages 31-37. NEW ITERATIVE METHODS BASED ON SPLINE FUNCTIONS FOR SOLVING NONLINEAR EQUATIONS

More information

YURI LEVIN, MIKHAIL NEDIAK, AND ADI BEN-ISRAEL

YURI LEVIN, MIKHAIL NEDIAK, AND ADI BEN-ISRAEL Journal of Comput. & Applied Mathematics 139(2001), 197 213 DIRECT APPROACH TO CALCULUS OF VARIATIONS VIA NEWTON-RAPHSON METHOD YURI LEVIN, MIKHAIL NEDIAK, AND ADI BEN-ISRAEL Abstract. Consider m functions

More information

Introduction to Numerical Analysis

Introduction to Numerical Analysis J. Stoer R. Bulirsch Introduction to Numerical Analysis Second Edition Translated by R. Bartels, W. Gautschi, and C. Witzgall With 35 Illustrations Springer Contents Preface to the Second Edition Preface

More information

Polynomial Interpolation

Polynomial Interpolation Polynomial Interpolation (Com S 477/577 Notes) Yan-Bin Jia Sep 1, 017 1 Interpolation Problem In practice, often we can measure a physical process or quantity (e.g., temperature) at a number of points

More information

Chapter 3: Root Finding. September 26, 2005

Chapter 3: Root Finding. September 26, 2005 Chapter 3: Root Finding September 26, 2005 Outline 1 Root Finding 2 3.1 The Bisection Method 3 3.2 Newton s Method: Derivation and Examples 4 3.3 How To Stop Newton s Method 5 3.4 Application: Division

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

MATH 552 Spectral Methods Spring Homework Set 5 - SOLUTIONS

MATH 552 Spectral Methods Spring Homework Set 5 - SOLUTIONS MATH 55 Spectral Methods Spring 9 Homework Set 5 - SOLUTIONS. Suppose you are given an n n linear system Ax = f where the matrix A is tridiagonal b c a b c. A =.........,. a n b n c n a n b n with x =

More information

Numerical integration and differentiation. Unit IV. Numerical Integration and Differentiation. Plan of attack. Numerical integration.

Numerical integration and differentiation. Unit IV. Numerical Integration and Differentiation. Plan of attack. Numerical integration. Unit IV Numerical Integration and Differentiation Numerical integration and differentiation quadrature classical formulas for equally spaced nodes improper integrals Gaussian quadrature and orthogonal

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

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

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

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

3 Interpolation of Functions

3 Interpolation of Functions 3 Interpolation of Functions 3(a) Polynomial Interpolation Read Ch 3 (Section 35 optional) Applications: approximation theory, numerical integration & differentiation, integration of ODE s & PDE s 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

Finite Difference Methods for Boundary Value Problems

Finite Difference Methods for Boundary Value Problems Finite Difference Methods for Boundary Value Problems October 2, 2013 () Finite Differences October 2, 2013 1 / 52 Goals Learn steps to approximate BVPs using the Finite Difference Method Start with two-point

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

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations Numerical Solutions to Partial Differential Equations Zhiping Li LMAM and School of Mathematical Sciences Peking University The Implicit Schemes for the Model Problem The Crank-Nicolson scheme and θ-scheme

More information

Notation Nodes are data points at which functional values are available or at which you wish to compute functional values At the nodes fx i

Notation Nodes are data points at which functional values are available or at which you wish to compute functional values At the nodes fx i LECTURE 6 NUMERICAL DIFFERENTIATION To find discrete approximations to differentiation (since computers can only deal with functional values at discrete points) Uses of numerical differentiation To represent

More information

Finite Difference Methods (FDMs) 1

Finite Difference Methods (FDMs) 1 Finite Difference Methods (FDMs) 1 1 st - order Approxima9on Recall Taylor series expansion: Forward difference: Backward difference: Central difference: 2 nd - order Approxima9on Forward difference: Backward

More information

FINITE DIFFERENCES. Lecture 1: (a) Operators (b) Forward Differences and their calculations. (c) Backward Differences and their calculations.

FINITE DIFFERENCES. Lecture 1: (a) Operators (b) Forward Differences and their calculations. (c) Backward Differences and their calculations. FINITE DIFFERENCES Lecture 1: (a) Operators (b) Forward Differences and their calculations. (c) Backward Differences and their calculations. 1. Introduction When a function is known explicitly, it is easy

More information

5. Hand in the entire exam booklet and your computer score sheet.

5. Hand in the entire exam booklet and your computer score sheet. WINTER 2016 MATH*2130 Final Exam Last name: (PRINT) First name: Student #: Instructor: M. R. Garvie 19 April, 2016 INSTRUCTIONS: 1. This is a closed book examination, but a calculator is allowed. The test

More information

Block-tridiagonal matrices

Block-tridiagonal matrices Block-tridiagonal matrices. p.1/31 Block-tridiagonal matrices - where do these arise? - as a result of a particular mesh-point ordering - as a part of a factorization procedure, for example when we compute

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

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

x 2 x n r n J(x + t(x x ))(x x )dt. For warming-up we start with methods for solving a single equation of one variable.

x 2 x n r n J(x + t(x x ))(x x )dt. For warming-up we start with methods for solving a single equation of one variable. Maria Cameron 1. Fixed point methods for solving nonlinear equations We address the problem of solving an equation of the form (1) r(x) = 0, where F (x) : R n R n is a vector-function. Eq. (1) can be written

More information

University of British Columbia Math 307, Final

University of British Columbia Math 307, Final 1 University of British Columbia Math 307, Final April 23, 2012 3.30-6.00pm Name: Student Number: Signature: Instructor: Instructions: 1. No notes, books or calculators are allowed. A MATLAB/Octave formula

More information

Numerical Methods with MATLAB

Numerical Methods with MATLAB Numerical Methods with MATLAB A Resource for Scientists and Engineers G. J. BÖRSE Lehigh University PWS Publishing Company I(T)P AN!NTERNATIONAL THOMSON PUBLISHING COMPANY Boston Albany Bonn Cincinnati

More information

Theory, Solution Techniques and Applications of Singular Boundary Value Problems

Theory, Solution Techniques and Applications of Singular Boundary Value Problems Theory, Solution Techniques and Applications of Singular Boundary Value Problems W. Auzinger O. Koch E. Weinmüller Vienna University of Technology, Austria Problem Class z (t) = M(t) z(t) + f(t, z(t)),

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

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

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

3.4 Introduction to power series

3.4 Introduction to power series 3.4 Introduction to power series Definition 3.4.. A polynomial in the variable x is an expression of the form n a i x i = a 0 + a x + a 2 x 2 + + a n x n + a n x n i=0 or a n x n + a n x n + + a 2 x 2

More information

Applied Linear Algebra in Geoscience Using MATLAB

Applied Linear Algebra in Geoscience Using MATLAB Applied Linear Algebra in Geoscience Using MATLAB Contents Getting Started Creating Arrays Mathematical Operations with Arrays Using Script Files and Managing Data Two-Dimensional Plots Programming in

More information

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form Qualifying exam for numerical analysis (Spring 2017) Show your work for full credit. If you are unable to solve some part, attempt the subsequent parts. 1. Consider the following finite difference: f (0)

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

INTRODUCTION TO COMPUTER METHODS FOR O.D.E.

INTRODUCTION TO COMPUTER METHODS FOR O.D.E. INTRODUCTION TO COMPUTER METHODS FOR O.D.E. 0. Introduction. The goal of this handout is to introduce some of the ideas behind the basic computer algorithms to approximate solutions to differential equations.

More information

arxiv: v1 [math.na] 1 May 2013

arxiv: v1 [math.na] 1 May 2013 arxiv:3050089v [mathna] May 03 Approximation Properties of a Gradient Recovery Operator Using a Biorthogonal System Bishnu P Lamichhane and Adam McNeilly May, 03 Abstract A gradient recovery operator based

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

Solution of Non Linear Singular Perturbation Equation. Using Hermite Collocation Method

Solution of Non Linear Singular Perturbation Equation. Using Hermite Collocation Method Applied Mathematical Sciences, Vol. 7, 03, no. 09, 5397-5408 HIKARI Ltd, www.m-hikari.com http://dx.doi.org/0.988/ams.03.37409 Solution of Non Linear Singular Perturbation Equation Using Hermite Collocation

More information

Section 5.8 Regression/Least Squares Approximation

Section 5.8 Regression/Least Squares Approximation Section 5.8 Regression/Least Squares Approximation Key terms Interpolation via linear systems Regression Over determine linear system Closest vector to a column space Linear regression; least squares line

More information

Hani Mehrpouyan, California State University, Bakersfield. Signals and Systems

Hani Mehrpouyan, California State University, Bakersfield. Signals and Systems Hani Mehrpouyan, Department of Electrical and Computer Engineering, Lecture 26 (LU Factorization) May 30 th, 2013 The material in these lectures is partly taken from the books: Elementary 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

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

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

Computational Physics

Computational Physics Interpolation, Extrapolation & Polynomial Approximation Lectures based on course notes by Pablo Laguna and Kostas Kokkotas revamped by Deirdre Shoemaker Spring 2014 Introduction In many cases, a function

More information

MA3457/CS4033: Numerical Methods for Calculus and Differential Equations

MA3457/CS4033: Numerical Methods for Calculus and Differential Equations MA3457/CS4033: Numerical Methods for Calculus and Differential Equations Course Materials P A R T II B 14 2014-2015 1 2. APPROXIMATION CLASS 9 Approximation Key Idea Function approximation is closely related

More information

x n+1 = x n f(x n) f (x n ), n 0.

x n+1 = x n f(x n) f (x n ), n 0. 1. Nonlinear Equations Given scalar equation, f(x) = 0, (a) Describe I) Newtons Method, II) Secant Method for approximating the solution. (b) State sufficient conditions for Newton and Secant to converge.

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

Scientific Computing I

Scientific Computing I Scientific Computing I Module 8: An Introduction to Finite Element Methods Tobias Neckel Winter 2013/2014 Module 8: An Introduction to Finite Element Methods, Winter 2013/2014 1 Part I: Introduction to

More information

Lehrstuhl Informatik V. Lehrstuhl Informatik V. 1. solve weak form of PDE to reduce regularity properties. Lehrstuhl Informatik V

Lehrstuhl Informatik V. Lehrstuhl Informatik V. 1. solve weak form of PDE to reduce regularity properties. Lehrstuhl Informatik V Part I: Introduction to Finite Element Methods Scientific Computing I Module 8: An Introduction to Finite Element Methods Tobias Necel Winter 4/5 The Model Problem FEM Main Ingredients Wea Forms and Wea

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

Hierarchical Matrices. Jon Cockayne April 18, 2017

Hierarchical Matrices. Jon Cockayne April 18, 2017 Hierarchical Matrices Jon Cockayne April 18, 2017 1 Sources Introduction to Hierarchical Matrices with Applications [Börm et al., 2003] 2 Sources Introduction to Hierarchical Matrices with Applications

More information

Elliptic curves and modularity

Elliptic curves and modularity Elliptic curves and modularity For background and (most) proofs, we refer to [1]. 1 Weierstrass models Let K be any field. For any a 1, a 2, a 3, a 4, a 6 K consider the plane projective curve C given

More information

EIGENVALUE PROBLEMS. EIGENVALUE PROBLEMS p. 1/4

EIGENVALUE PROBLEMS. EIGENVALUE PROBLEMS p. 1/4 EIGENVALUE PROBLEMS EIGENVALUE PROBLEMS p. 1/4 EIGENVALUE PROBLEMS p. 2/4 Eigenvalues and eigenvectors Let A C n n. Suppose Ax = λx, x 0, then x is a (right) eigenvector of A, corresponding to the eigenvalue

More information