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

Size: px
Start display at page:

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

Transcription

1 TANA9 Lecture 7 Interpolation Suppose we have a table x x x... x n+ Interpolation Introduction. Polynomials. Error estimates. Runge s phenomena. Application - Equation solving. Spline functions and interpolation. End point conditions. Error estimate. f(x) f f... f n+ How to estimate f(x) för x x x n+? Definition A polynomial p(x) interpolates a function f(x) at x, x,..., x n+, if p(x i ) = f(x i ), i =,,..., n+. Questions Degree of the polynomial? How to compute the polynomial? Error estimate? 4 december 8 Sida / 3 4 december 8 Sida / 3 Linear Interpolation Error analysis for linear interpolation f(x) f f p (x) Lemma Let the function values f and f have errors f i ε. If linear interpolation is used we have the error estimate R XF ε. x x Theorem The linear polynomial p (x) that interpolates two points (x, f ) and (x, f ) is given by p (x) = f + x x x x (f f ). Theorem Let p (x) be the linear polynomial that interpolates f(x) at x and x. Then R T = f(x) p (x)= f (ξ) (x x )(x x ), x <ξ<x. or R T Ch, where h=x x. 4 december 8 Sida 3 / 3 4 december 8 Sida 4 / 3

2 Polynomial interpolation Theorem For n+ points (x i, f i ) there is a unique polynomial p n (x), of degree n, that interpolates the given points, i.e. p n (x i ) = f i, i=,,..., n+. Newton s interpolation formula Find a polynomial p n (x) that interpolates the table x x x... x n+ f(x) f f... f n+ The ansatz Theorem Let p n (x) be the polynomial, of degree n, that interpolates f(x) in the points x, x,..., x n+. Then f(x) p n (x) = f(n+) (ξ(x)) (x x ) (x x n+ ). (n+)! The function f(x) has to have continuous derivatives. How to organize the computations? 4 december 8 Sida 5 / 3 p n (x)=c +c (x x )+c (x x )(x x )+...+c n (x x ) (x x n ), leads to simple calculations. The interpolation conditions give p n (x ) = c = f, and p n (x ) = c + c (x x ) = f,= c = (f c )/(x x ). Every new condition p n (x i ) = f i gives one new c i. 4 december 8 Sida 6 / 3 Error estimate Remark In practice f (ξ) is unknown. Instead use an additional point (x n+, f n+ ) and compute a new interpolating polynomial p n+ (x). Approximate f (n+) (ξ(x)) p (n+) n+ (ξ(x)) = n!c n+. Lemma Let p n (x) be a polynomial interpolating f(x) at n+ points. We can estimate the error f(x) p n (x) = R T p n+ (x) p n (x). Example Let f(x) = e x/ cos(x/7)+(x.) /, and suppose we have a table x..5.7 f(x) Make use of the table to estimate f(x), for x =.35, by linear interpolation and estimate the error. Question How to do this using Matlab? What if we want to use quadratic interpolation? Remark If Newtons formula is used it is simple to carry out the calculations. 4 december 8 Sida 7 / 3 4 december 8 Sida 8 / 3

3 Find polynomials p (x) and p (x) by >> x=[.5.7];, y=[ ]; >> p = polyfit( x(:), y(:), ); >> p = polyfit( x(:3), y(:3), ); Quadratic interpolation require 3 points for p (x) and one more for estimating R T. Comnpute the polynomials on a dense grid and plot by >> xx=-.:.:.8; y=polyval(p,xx); plot(xx,y)..5.8 x Left p (x), p (x) and f(x). Right Error f(x) p (x) and R T p (x) p (x). Here R T.38. Left p (x), p 3 (x) and f(x). Right Error f(x) p (x) and R T p 3 (x) p (x). Here R T. 4. What if we increse the degree of the polynomial? 4 december 8 Sida 9 / 3 4 december 8 Sida / 3 Runge s phenomena Application - Equation solving.5 Problem Find the root x to the equation f(x) =. In an iterative method we have a sequence x, x, x,...,x n and want the next iterate x n+. How to compute?.5 Method Find a quadratic polynomial p(x) interpolating the table x x n x n x n f(x) f n f n f n Polynomials of degree n = 4, 6, and that interpolates f(x) = /(+x ). The maximnum error grows as the degree increses. In practice only low degree polynomials are used. Compute the two roots x i, i =, of p(x). Pick x n+ as the root with the smallest function value f(x i ). 4 december 8 Sida / 3 4 december 8 Sida / 3

4 In Matlab x=[ ];fvals=f(x); while abs(fvals(end))>^-5 p=polyfit(x(end-:end),fvals(end-:end),); r=roots(p);fr=f(r); if abs(fr())<abs(fr()) x=[x,r()];fvals=[fvals,fr()]; else x=[x,r()];fvals=[fvals,fr()]; end fprintf(, %6.4f %8.e\n, x(end),fvals(end)) end Remark A quadratic polynomial has two roots. Two function evaluations in each step. Very fast convergence but a step can fail. 4 december 8 Sida 3 / 3 Example Solve f(x) = cos(x/)+ e x/5 x/ 4x =. k x k f(x k ) Remark Looks like quadratic convergence! How to avoid two function evaluations? 4 december 8 Sida 4 / 3 Method Let y i = f(x i ) and x i = f (y i ). Find a polynomial quadratic polynomial p(y) interpolating Pick x n+ = p(). In Matlab y f n f n f n f (y) x n x n x n x=[ ];fvals=f(x); while abs(fvals(end))>^-5 p=polyfit(fvals(end-:end),x(end-:end),); x=[x,polyval(p,)];fvals=[fvals,f(x(end))]; fprintf(, %6.4f %8.e\n, x(end),fvals(end)) end Example Solve f(x) = cos(x/)+ e x/5 x/ 4x = using Inverse quadratic interpolation k x k f(x k ) Remark One function evaluation in each step. The interpolation step doesn t always work. This is the main method forfzero. 4 december 8 Sida 5 / 3 Remark Still very fast convergence! 4 december 8 Sida 6 / 3

5 Lagrange Interpolation Lemma The unique polynomial of degree n that interpolates f(x) in the points x j, i =,,..., n is Definition Let x j, j =,..., n be distinct points. The Lagrange basis polynomial is l i (x) = Π j i x x j x i x j. p(x) = n f(x i )l i (x). i= Example Find the unique polynomial interpolating the table Remark We have l i (x i ) = and l i (x j ) = for i j. x i f i december 8 Sida 7 / 3 4 december 8 Sida 8 / Lemma Let p(x) be an interpolating polynomial of degree n. If the approximate function values f i are used then p(x) n l i (x) f i, i= wherel i (x) are the Lagrange basis polynomials Results The Lagrange basis polynomials of degree 3 and the interpolating polynomial. The error iso(h 4 ). Question How to generalize to D? Errors in the used function values? Example Let p(x) interpolate the table x i f i Estimate the maximum error due to f i being correctly rounded. 4 december 8 Sida 9 / 3 4 december 8 Sida / 3

6 Example We have m = 6 points (x i, y j ) and want to find the interpolating polynomial u I (x, y). Introduce basis functions l i such that l i (x j, y j ) = if i = j and zero otherwise. Then the interpolant is u I (x) = m u(x i, x i )l i (x). i= The error due to f i.5. Estimated using the Lagrange interpolation formula. Remark The error is exactly f i at the interpolation points x i. 4 december 8 Sida / 3 4 december 8 Sida / Two basis functions l (x, y) and l 3 (x, y). We use m = 6 interpolation points and basis functions, x, y, xy, x, y. The interpolant u I (x, y) and the error u I u, where u = 3+x y+cos(x)y was interpolated using m = 6 points. Remark Really simple and flexible method. The error terms are obtained by comparing with a Taylor series expansion. 4 december 8 Sida 3 / 3 4 december 8 Sida 4 / 3

7 Spline interpolation Linear splines Problem A function f(x) is known at certain nodes x, x,...,x n. How can we find an approximation s(x) f(x) on [x, x n ]? Solution Use linear interpolation on each subinterval [x i, x i+ ]. f f(x) f f 3 f 5 s(x) f 4 Definition A function s(x) is an interpolating linear spline with nodes x,..., x n is. s(x) is continuous on [x, x n ].. s(x) is a straight line on each subinterval [x i, x i+ ]. 3. s(x) interpolates f(x) at the nodes, i.e. s(x i ) = f(x i ). Theorem For an interpolating linear spline it holds that x x x 3 x 4 x 5 The theory for linear interpolation holds. f(x) s(x) M 8 h, where f (x) M och h = max x i+ x i. 4 december 8 Sida 5 / 3 4 december 8 Sida 6 / 3 Cubic splines Example Find the cubic spline s(x) interpolating the table f f f 3 f 5 s s f 4 s 3 s 4 x f(x).5 with end point conditions f () = and f () =. Solution Find polynomials s (x) och s (x). x x x 3 x 4 x 5 Definition A function s(x) is an interpolating cubic spline with nodes x,..., x n if. s(x), s (x), och s (x) are continuous on[x, x n ].. s(x) is a cubic polynomial on each [x i, x i+ ]. 3. s(x) interpolates f(x) at the nodes, i.e. s(x i ) = f(x i ). 4 december 8 Sida 7 / 3 f f 3 f s s x x x 3 The coefficients of s and s are found by solving a linear system of equations. 4 december 8 Sida 8 / 3

8 The resulting spline is { s (x)=.+.(x )+.75(x ) s(x)=.5(x ) 3, x, s (x)=.5+.75(x ).(x ) +.75(x ) 3, x, 3 End point conditions Theorem A cubic spline s(x), interpolating f(x) at nodes x,..., x n, is uniqely determined if we provide two end point conditions..5.5 s (x) s (x) Prove by comparing the number of unknowns with the number of conditions..5 We have the options Two continuous derivatives and correct slopes at the end points. Natural conditions s (x )=s (x n )=. Correct conditions s (x )=f (x ) and s (x n )=f (x n ). Periodic conditions s (x )=s (x n ). 4 december 8 Sida 9 / 3 4 december 8 Sida 3 / 3 Error estimate Theorem If correct end point conditions are used then s(x) f(x) Mh4, where h = max x i+ x i and M = max f (4) (x). In Matlab csape computes an interpolating cubic spline. >> pp = csape( x, y, complete, [ d, d ] ); where d and d are numerical values for the derivatives f (x ) and f (x n ). Compute the values of the spline usingppval Exempel Approximate f(x) = /(+x ), on [ 5, 5], with a cubic spline and correct end point conditions. How does the error depend on the number of nodes? The error behave as Ch 4. N h /4 /8 /6 Felet december 8 Sida 3 / Plot the function f(x) = /(+x ) and the cubic splines s(x), for N = 5, 9, and 7 nodes. 4 december 8 Sida 3 / 3

Natasha S. Sharma, PhD

Natasha S. Sharma, PhD Revisiting the function evaluation problem Most functions cannot be evaluated exactly: 2 x, e x, ln x, trigonometric functions since by using a computer we are limited to the use of elementary arithmetic

More information

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

Lecture 8. Divided Differences,Least-Squares Approximations. Ceng375 Numerical Computations at December 9, 2010 Lecture 8, Ceng375 Numerical Computations at December 9, 2010 Computer Engineering Department Çankaya University 8.1 Contents 1 2 3 8.2 : These provide a more efficient way to construct an interpolating

More information

Handout 4 - Interpolation Examples

Handout 4 - Interpolation Examples Handout 4 - Interpolation Examples Middle East Technical University Example 1: Obtaining the n th Degree Newton s Interpolating Polynomial Passing through (n+1) Data Points Obtain the 4 th degree Newton

More information

APPM/MATH Problem Set 4 Solutions

APPM/MATH Problem Set 4 Solutions APPM/MATH 465 Problem Set 4 Solutions This assignment is due by 4pm on Wednesday, October 16th. You may either turn it in to me in class on Monday or in the box outside my office door (ECOT 35). Minimal

More information

an interpolating polynomial P (x) for f(x) Issues: how to find, represent, compute P (x); errors?

an interpolating polynomial P (x) for f(x) Issues: how to find, represent, compute P (x); errors? INTERPOLATION Background Polynomial Approximation Problem: given f(x) C[a, b], find P n (x) = a 0 + a 1 x + a 2 x 2 + + a n x n with P n (x) close to f(x) for x [a, b]. Motivations: f(x) might be difficult

More information

Interpolation and Splines

Interpolation and Splines 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

More information

ME 261: Numerical Analysis Lecture-12: Numerical Interpolation

ME 261: Numerical Analysis Lecture-12: Numerical Interpolation 1 ME 261: Numerical Analysis Lecture-12: Numerical Interpolation Md. Tanver Hossain Department of Mechanical Engineering, BUET http://tantusher.buet.ac.bd 2 Inverse Interpolation Problem : Given a table

More information

8 Piecewise Polynomial Interpolation

8 Piecewise Polynomial Interpolation Applied Math Notes by R. J. LeVeque 8 Piecewise Polynomial Interpolation 8. Pitfalls of high order interpolation Suppose we know the value of a function at several points on an interval and we wish to

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

Mar. 20 Math 2335 sec 001 Spring 2014

Mar. 20 Math 2335 sec 001 Spring 2014 Mar. 20 Math 2335 sec 001 Spring 2014 Chebyshev Polynomials Definition: For an integer n 0 define the function ( ) T n (x) = cos n cos 1 (x), 1 x 1. It can be shown that T n is a polynomial of degree n.

More information

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

Polynomials tend to oscillate (wiggle) a lot, even when our true function does not. AMSC/CMSC 460 Computational Methods, Fall 2007 UNIT 2: Spline Approximations Dianne P O Leary c 2001, 2002, 2007 Piecewise polynomial interpolation Piecewise polynomial interpolation Read: Chapter 3 Skip:

More information

Section 5.5 Piecewise Interpolation

Section 5.5 Piecewise Interpolation Section 5.5 Piecewise Interpolation Key terms Runge phenomena polynomial wiggle problem Piecewise polynomial interpolation We have considered polynomial interpolation to sets of distinct data like {( )

More information

February 23 Math 2335 sec 51 Spring 2016

February 23 Math 2335 sec 51 Spring 2016 February 23 Math 2335 sec 51 Spring 2016 Section 4.1: Polynomial Interpolation Interpolation is the process of finding a curve or evaluating a function whose curve passes through a known set of points.

More information

f( x ), or a solution to the equation f( x) 0. You are already familiar with ways of solving

f( x ), or a solution to the equation f( x) 0. You are already familiar with ways of solving The Bisection Method and Newton s Method. If f( x ) a function, then a number r for which f( r) 0 is called a zero or a root of the function f( x ), or a solution to the equation f( x) 0. You are already

More information

Today s class. Roots of equation Finish up incremental search Open methods. Numerical Methods, Fall 2011 Lecture 5. Prof. Jinbo Bi CSE, UConn

Today s class. Roots of equation Finish up incremental search Open methods. Numerical Methods, Fall 2011 Lecture 5. Prof. Jinbo Bi CSE, UConn Today s class Roots of equation Finish up incremental search Open methods 1 False Position Method Although the interval [a,b] where the root becomes iteratively closer with the false position method, unlike

More information

Introduction to Matlab

Introduction to Matlab Technische Universität München WT 21/11 Institut für Informatik Prof Dr H-J Bungartz Dipl-Tech Math S Schraufstetter Benjamin Peherstorfer, MSc October 22nd, 21 Introduction to Matlab Engineering Informatics

More information

Engineering Analysis ENG 3420 Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00

Engineering Analysis ENG 3420 Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00 Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00 1 Lecture 24 Attention: The last homework HW5 and the last project are due on Tuesday November

More information

CS 450 Numerical Analysis. Chapter 7: Interpolation

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

More information

LECTURE 0: Introduction and Background

LECTURE 0: Introduction and Background 1 LECTURE 0: Introduction and Background September 10, 2012 1 Computational science The role of computational science has become increasingly significant during the last few decades. It has become the

More information

we wish to minimize this function; to make life easier, we may minimize

we wish to minimize this function; to make life easier, we may minimize Optimization and Lagrange Multipliers We studied single variable optimization problems in Calculus 1; given a function f(x), we found the extremes of f relative to some constraint. Our ability to find

More information

Homework #6 Brief Solutions 2012

Homework #6 Brief Solutions 2012 Homework #6 Brief Solutions %page 95 problem 4 data=[-,;-,;,;4,] data = - - 4 xk=data(:,);yk=data(:,);s=csfit(xk,yk,-,) %Using the program to find the coefficients S =.456 -.456 -.. -.5.9 -.5484. -.58.87.

More information

Polynomial Approximation and Interpolation Chapter 4

Polynomial Approximation and Interpolation Chapter 4 4.4 LAGRANGE POLYNOMIALS The direct fit polynomial presented in Section 4.3, while quite straightforward in principle, has several disadvantages. It requires a considerable amount of effort to solve the

More information

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

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines EECS 556 Image Processing W 09 Interpolation Interpolation techniques B splines What is image processing? Image processing is the application of 2D signal processing methods to images Image representation

More information

The Parks McClellan algorithm: a scalable approach for designing FIR filters

The Parks McClellan algorithm: a scalable approach for designing FIR filters 1 / 33 The Parks McClellan algorithm: a scalable approach for designing FIR filters Silviu Filip under the supervision of N. Brisebarre and G. Hanrot (AriC, LIP, ENS Lyon) PEQUAN Seminar, February 26,

More information

CS321 Introduction To Numerical Methods

CS321 Introduction To Numerical Methods CS3 Introduction To Numerical Methods Fuhua (Frank) Cheng Department of Computer Science University of Kentucky Lexington KY 456-46 - - Table of Contents Errors and Number Representations 3 Error Types

More information

lecture 10: B-Splines

lecture 10: B-Splines 9 lecture : -Splines -Splines: a basis for splines Throughout our discussion of standard polynomial interpolation, we viewed P n as a linear space of dimension n +, and then expressed the unique interpolating

More information

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

Lecture 9. Curve fitting. Interpolation. Lecture in Numerical Methods from 28. April 2015 UVT. Lecture 9. Numerical. Interpolation his o Curve fitting. Lecture in Methods from 28. April 2015 to ity Interpolation FIGURE A S Splines Piecewise relat UVT Agenda of today s lecture 1 Interpolation Idea 2 3 4 5 6 Splines Piecewise Interpolation

More information

Constrained and Unconstrained Optimization

Constrained and Unconstrained Optimization Constrained and Unconstrained Optimization Carlos Hurtado Department of Economics University of Illinois at Urbana-Champaign hrtdmrt2@illinois.edu Oct 10th, 2017 C. Hurtado (UIUC - Economics) Numerical

More information

Linear Interpolating Splines

Linear Interpolating Splines Jim Lambers MAT 772 Fall Semester 2010-11 Lecture 17 Notes Tese notes correspond to Sections 112, 11, and 114 in te text Linear Interpolating Splines We ave seen tat ig-degree polynomial interpolation

More information

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

Justify all your answers and write down all important steps. Unsupported answers will be disregarded. Numerical Analysis FMN011 2017/05/30 The exam lasts 5 hours and has 15 questions. A minimum of 35 points out of the total 70 are required to get a passing grade. These points will be added to those you

More information

MATH 51: MATLAB HOMEWORK 3

MATH 51: MATLAB HOMEWORK 3 MATH 5: MATLAB HOMEWORK Experimental data generally suffers from imprecision, though frequently one can predict how data should behave by graphing results collected from experiments. For instance, suppose

More information

3.2 - Interpolation and Lagrange Polynomials

3.2 - Interpolation and Lagrange Polynomials 3. - Interpolation and Lagrange Polynomials. Polynomial Interpolation: Problem: Givenn pairs of data points x i, y i,wherey i fx i, i 0,,...,n for some function fx, we want to find a polynomial P x of

More information

Assignment 2. with (a) (10 pts) naive Gauss elimination, (b) (10 pts) Gauss with partial pivoting

Assignment 2. with (a) (10 pts) naive Gauss elimination, (b) (10 pts) Gauss with partial pivoting Assignment (Be sure to observe the rules about handing in homework). Solve: with (a) ( pts) naive Gauss elimination, (b) ( pts) Gauss with partial pivoting *You need to show all of the steps manually.

More information

LECTURE NOTES - SPLINE INTERPOLATION. 1. Introduction. Problems can arise when a single high-degree polynomial is fit to a large number

LECTURE NOTES - SPLINE INTERPOLATION. 1. Introduction. Problems can arise when a single high-degree polynomial is fit to a large number LECTURE NOTES - SPLINE INTERPOLATION DR MAZHAR IQBAL 1 Introduction Problems can arise when a single high-degree polynomial is fit to a large number of points High-degree polynomials would obviously pass

More information

Numerical Integration

Numerical Integration Numerical Integration Numerical Integration is the process of computing the value of a definite integral, when the values of the integrand function, are given at some tabular points. As in the case of

More information

Math 225 Scientific Computing II Outline of Lectures

Math 225 Scientific Computing II Outline of Lectures Math 225 Scientific Computing II Outline of Lectures Spring Semester 2003 I. Interpolating polynomials Lagrange formulation of interpolating polynomial Uniqueness of interpolating polynomial of degree

More information

Piecewise Cubic Curve Fitting Algorithm

Piecewise Cubic Curve Fitting Algorithm mathematics of computation volume 49, number 179 july 1987, pages 203-213 Piecewise Cubic Curve Fitting Algorithm By Zheng Yan Abstract. We give a piecewise cubic curve fitting algorithm which preserves

More information

A Random Variable Shape Parameter Strategy for Radial Basis Function Approximation Methods

A Random Variable Shape Parameter Strategy for Radial Basis Function Approximation Methods A Random Variable Shape Parameter Strategy for Radial Basis Function Approximation Methods Scott A. Sarra, Derek Sturgill Marshall University, Department of Mathematics, One John Marshall Drive, Huntington

More information

Final Exam Review Algebra Semester 1

Final Exam Review Algebra Semester 1 Final Exam Review Algebra 015-016 Semester 1 Name: Module 1 Find the inverse of each function. 1. f x 10 4x. g x 15x 10 Use compositions to check if the two functions are inverses. 3. s x 7 x and t(x)

More information

Linear and quadratic Taylor polynomials for functions of several variables.

Linear and quadratic Taylor polynomials for functions of several variables. ams/econ 11b supplementary notes ucsc Linear quadratic Taylor polynomials for functions of several variables. c 016, Yonatan Katznelson Finding the extreme (minimum or maximum) values of a function, is

More information

Math 226A Homework 4 Due Monday, December 11th

Math 226A Homework 4 Due Monday, December 11th Math 226A Homework 4 Due Monday, December 11th 1. (a) Show that the polynomial 2 n (T n+1 (x) T n 1 (x)), is the unique monic polynomial of degree n + 1 with roots at the Chebyshev points x k = cos ( )

More information

Math Numerical Analysis

Math Numerical Analysis ... Math 541 - Numerical Analysis Interpolation and Polynomial Approximation Piecewise Polynomial Approximation; Joseph M. Mahaffy, jmahaffy@mail.sdsu.edu Department of Mathematics and Statistics Dynamical

More information

Maximizing an interpolating quadratic

Maximizing an interpolating quadratic Week 11: Monday, Apr 9 Maximizing an interpolating quadratic Suppose that a function f is evaluated on a reasonably fine, uniform mesh {x i } n i=0 with spacing h = x i+1 x i. How can we find any local

More information

This expression is known as the Newton form of the interpolating polynomial. How do we go about finding the coefficients c i?

This expression is known as the Newton form of the interpolating polynomial. How do we go about finding the coefficients c i? Chapter 1 Polynomial Interpolation When you are wrestling for possession of a sword, the man with the handle always wins. Neal Stephenson, Snow Crash The goal of interpolation is to fit a function exactly

More information

1. How many white tiles will be in Design 5 of the pattern? Explain your reasoning.

1. How many white tiles will be in Design 5 of the pattern? Explain your reasoning. Algebra 2 Semester 1 Review Answer the question for each pattern. 1. How many white tiles will be in Design 5 of the pattern Explain your reasoning. 2. What is another way to represent the expression 3.

More information

Math Homework 3

Math Homework 3 Math 0 - Homework 3 Due: Friday Feb. in class. Write on your paper the lab section you have registered for.. Staple the sheets together.. Solve exercise 8. of the textbook : Consider the following data:

More information

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

THE STUDY OF NEW APPROACHES IN CUBIC SPLINE INTERPOLATION FOR AUTO MOBILE DATA Journal of Science and Arts Year 17, No. 3(4), pp. 41-46, 217 ORIGINAL PAPER THE STUDY OF NEW APPROACHES IN CUBIC SPLINE INTERPOLATION FOR AUTO MOBILE DATA NAJMUDDIN AHMAD 1, KHAN FARAH DEEBA 1 Manuscript

More information

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

February 2017 (1/20) 2 Piecewise Polynomial Interpolation 2.2 (Natural) Cubic Splines. MA378/531 Numerical Analysis II ( NA2 ) f f f f f (/2).9.8.7.6.5.4.3.2. S Knots.7.6.5.4.3.2. 5 5.2.8.6.4.2 S Knots.2 5 5.9.8.7.6.5.4.3.2..9.8.7.6.5.4.3.2. S Knots 5 5 S Knots 5 5 5 5.35.3.25.2.5..5 5 5.6.5.4.3.2. 5 5 4 x 3 3.5 3 2.5 2.5.5 5

More information

Interpolation. Chapter Information from Data

Interpolation. Chapter Information from Data Chapter 5 Interpolation 5. Information from Data The topic of this chapter is interpolation, which relates to passing a curve through a set of data points. To put this in context, extracting information

More information

Reals 1. Floating-point numbers and their properties. Pitfalls of numeric computation. Horner's method. Bisection. Newton's method.

Reals 1. Floating-point numbers and their properties. Pitfalls of numeric computation. Horner's method. Bisection. Newton's method. Reals 1 13 Reals Floating-point numbers and their properties. Pitfalls of numeric computation. Horner's method. Bisection. Newton's method. 13.1 Floating-point numbers Real numbers, those declared to be

More information

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /4:30-6:00

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /4:30-6:00 ECE 4 Numerical Methods for Computer Engineers ECE 4 Numerical Methods for Computer Engineers MIDTERM EXAMINATION --7/4:-6: The eamination is out of marks. Instructions: No aides. Write your name and student

More information

x n x n stepnumber k order r error constant C r+1 1/2 5/12 3/8 251/720 abs. stab. interval (α,0) /11-3/10

x n x n stepnumber k order r error constant C r+1 1/2 5/12 3/8 251/720 abs. stab. interval (α,0) /11-3/10 MATH 573 LECTURE NOTES 77 13.8. Predictor-corrector methods. We consider the Adams methods, obtained from the formula xn+1 xn+1 y(x n+1 y(x n ) = y (x)dx = f(x,y(x))dx x n x n by replacing f by an interpolating

More information

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

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 Parametric Curves and Surfaces 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 Describing curves in space that objects move

More information

1. Practice the use of the C ++ repetition constructs of for, while, and do-while. 2. Use computer-generated random numbers.

1. Practice the use of the C ++ repetition constructs of for, while, and do-while. 2. Use computer-generated random numbers. 1 Purpose This lab illustrates the use of looping structures by introducing a class of programming problems called numerical algorithms. 1. Practice the use of the C ++ repetition constructs of for, while,

More information

Today is the last day to register for CU Succeed account AND claim your account. Tuesday is the last day to register for my class

Today is the last day to register for CU Succeed account AND claim your account. Tuesday is the last day to register for my class Today is the last day to register for CU Succeed account AND claim your account. Tuesday is the last day to register for my class Back board says your name if you are on my roster. I need parent financial

More information

Introduction to numerical algorithms

Introduction to numerical algorithms Introduction to numerical algorithms Given an algebraic equation or formula, we may want to approximate the value, and while in calculus, we deal with equations or formulas that are well defined at each

More information

3.1 INTRODUCTION TO THE FAMILY OF QUADRATIC FUNCTIONS

3.1 INTRODUCTION TO THE FAMILY OF QUADRATIC FUNCTIONS 3.1 INTRODUCTION TO THE FAMILY OF QUADRATIC FUNCTIONS Finding the Zeros of a Quadratic Function Examples 1 and and more Find the zeros of f(x) = x x 6. Solution by Factoring f(x) = x x 6 = (x 3)(x + )

More information

Consider functions such that then satisfies these properties: So is represented by the cubic polynomials on on and on.

Consider functions such that then satisfies these properties: So is represented by the cubic polynomials on on and on. 1 of 9 3/1/2006 2:28 PM ne previo Next: Trigonometric Interpolation Up: Spline Interpolation Previous: Piecewise Linear Case Cubic Splines A piece-wise technique which is very popular. Recall the philosophy

More information

Today. Golden section, discussion of error Newton s method. Newton s method, steepest descent, conjugate gradient

Today. Golden section, discussion of error Newton s method. Newton s method, steepest descent, conjugate gradient Optimization Last time Root finding: definition, motivation Algorithms: Bisection, false position, secant, Newton-Raphson Convergence & tradeoffs Example applications of Newton s method Root finding in

More information

Introduction to Programming for Engineers Spring Final Examination. May 10, Questions, 170 minutes

Introduction to Programming for Engineers Spring Final Examination. May 10, Questions, 170 minutes Final Examination May 10, 2011 75 Questions, 170 minutes Notes: 1. Before you begin, please check that your exam has 28 pages (including this one). 2. Write your name and student ID number clearly on your

More information

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

A Modified Spline Interpolation Method for Function Reconstruction from Its Zero-Crossings Scientific Papers, University of Latvia, 2010. Vol. 756 Computer Science and Information Technologies 207 220 P. A Modified Spline Interpolation Method for Function Reconstruction from Its Zero-Crossings

More information

Fitting to a set of data. Lecture on fitting

Fitting to a set of data. Lecture on fitting Fitting to a set of data Lecture on fitting Linear regression Linear regression Residual is the amount difference between a real data point and a modeled data point Fitting a polynomial to data Could use

More information

Central issues in modelling

Central issues in modelling Central issues in modelling Construct families of curves, surfaces and volumes that can represent common objects usefully; are easy to interact with; interaction includes: manual modelling; fitting to

More information

Computer Simulations

Computer Simulations Computer Simulations A practical approach to simulation Semra Gündüç gunduc@ankara.edu.tr Ankara University Faculty of Engineering, Department of Computer Engineering 2014-2015 Spring Term Ankara University

More information

Lecture VIII. Global Approximation Methods: I

Lecture VIII. Global Approximation Methods: I Lecture VIII Global Approximation Methods: I Gianluca Violante New York University Quantitative Macroeconomics G. Violante, Global Methods p. 1 /29 Global function approximation Global methods: function

More information

Open and Closed Sets

Open and Closed Sets Open and Closed Sets Definition: A subset S of a metric space (X, d) is open if it contains an open ball about each of its points i.e., if x S : ɛ > 0 : B(x, ɛ) S. (1) Theorem: (O1) and X are open sets.

More information

Computational Physics PHYS 420

Computational Physics PHYS 420 Computational Physics PHYS 420 Dr Richard H. Cyburt Assistant Professor of Physics My office: 402c in the Science Building My phone: (304) 384-6006 My email: rcyburt@concord.edu My webpage: www.concord.edu/rcyburt

More information

Midterm Exam with solutions

Midterm Exam with solutions Midterm Exam with solutions CS227-Introduction to Scientific Computation November 8, 2011 1. The following is a transcript of a MATLAB session. >> x=1/62.5 x = 0.016000000000000 >> y=(1+x)-1 y = 0.016000000000000

More information

Cubic Splines By Dave Slomer

Cubic Splines By Dave Slomer Cubic Splines By Dave Slomer [Note: Before starting any example or exercise below, press g on the home screen to Clear a-z.] Curve fitting, the process of finding a function that passes through (or near)

More information

The Bisection Method versus Newton s Method in Maple (Classic Version for Windows)

The Bisection Method versus Newton s Method in Maple (Classic Version for Windows) The Bisection Method versus (Classic Version for Windows) Author: Barbara Forrest Contact: baforres@uwaterloo.ca Copyrighted/NOT FOR RESALE version 1.1 Contents 1 Objectives for this Lab i 2 Approximate

More information

5.5 Newton s Approximation Method

5.5 Newton s Approximation Method 498CHAPTER 5. USING DERIVATIVES TO ANALYZE FUNCTIONS; FURTHER APPLICATIONS 4 3 y = x 4 3 f(x) = x cosx y = cosx 3 3 x = cosx x cosx = 0 Figure 5.: Figure showing the existence of a solution of x = cos

More information

UNIVERSITY OF CALIFORNIA COLLEGE OF ENGINEERING

UNIVERSITY OF CALIFORNIA COLLEGE OF ENGINEERING UNIVERSITY OF CALIFORNIA COLLEGE OF ENGINEERING E7: INTRODUCTION TO COMPUTER PROGRAMMING FOR SCIENTISTS AND ENGINEERS Professor Raja Sengupta Spring 2010 Second Midterm Exam April 14, 2010 [30 points ~

More information

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes CSCI 420 Computer Graphics Lecture 8 Splines Jernej Barbic University of Southern California Hermite Splines Bezier Splines Catmull-Rom Splines Other Cubic Splines [Angel Ch 12.4-12.12] Roller coaster

More information

Review for test 2. Graphs of functions (vertical shifts, horizontal shifts, compression, stretching): Given the graph of y=f(x), and c >0

Review for test 2. Graphs of functions (vertical shifts, horizontal shifts, compression, stretching): Given the graph of y=f(x), and c >0 Review for test 2 Graphs of functions (vertical shifts, horizontal shifts, compression, stretching): Given the graph of y=f(x), and c >0 a) The graph of y=f(x-c) is obtained by b) The graph of y=f(x+c)

More information

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

Bernstein-Bezier Splines on the Unit Sphere. Victoria Baramidze. Department of Mathematics. Western Illinois University Bernstein-Bezier Splines on the Unit Sphere Victoria Baramidze Department of Mathematics Western Illinois University ABSTRACT I will introduce scattered data fitting problems on the sphere and discuss

More information

Evaluating the polynomial at a point

Evaluating the polynomial at a point Evaluating the polynomial at a point Recall that we have a data structure for each piecewise polynomial (linear, quadratic, cubic and cubic Hermite). We have a routine that sets evenly spaced interpolation

More information

Generating Functions

Generating Functions 6.04/8.06J Mathematics for Computer Science Srini Devadas and Eric Lehman April 7, 005 Lecture Notes Generating Functions Generating functions are one of the most surprising, useful, and clever inventions

More information

1.00 Lecture 19. Packaging Functions in Objects

1.00 Lecture 19. Packaging Functions in Objects 1.00 Lecture 19 Numerical Methods: Root Finding Packaging Functions in Objects Consider writing method that finds root of function or evaluates a function, e.g., f(x)= 0 on some interval [a, b], or find

More information

Interpolation - 2D mapping Tutorial 1: triangulation

Interpolation - 2D mapping Tutorial 1: triangulation Tutorial 1: triangulation Measurements (Zk) at irregular points (xk, yk) Ex: CTD stations, mooring, etc... The known Data How to compute some values on the regular spaced grid points (+)? The unknown data

More information

Homework #6 Brief Solutions 2011

Homework #6 Brief Solutions 2011 Homework #6 Brief Solutions %page 95 problem 4 data=[-,;-,;,;4,] data = - - 4 xk=data(:,);yk=data(:,);s=csfit(xk,yk,-,) %Using the program to find the coefficients S =.456 -.456 -.. -.5.9 -.5484. -.58.87.

More information

Generalised Mean Averaging Interpolation by Discrete Cubic Splines

Generalised Mean Averaging Interpolation by Discrete Cubic Splines Publ. RIMS, Kyoto Univ. 30 (1994), 89-95 Generalised Mean Averaging Interpolation by Discrete Cubic Splines By Manjulata SHRIVASTAVA* Abstract The aim of this work is to introduce for a discrete function,

More information

Piecewise Polynomial Interpolation, cont d

Piecewise Polynomial Interpolation, cont d Jim Lambers MAT 460/560 Fall Semester 2009-0 Lecture 2 Notes Tese notes correspond to Section 4 in te text Piecewise Polynomial Interpolation, cont d Constructing Cubic Splines, cont d Having determined

More information

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

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 13: Slide 2 Splines The word spline comes from the ship building trade

More information

A Cumulative Averaging Method for Piecewise Polynomial Approximation to Discrete Data

A Cumulative Averaging Method for Piecewise Polynomial Approximation to Discrete Data Applied Mathematical Sciences, Vol. 1, 16, no. 7, 331-343 HIKARI Ltd, www.m-hiari.com http://dx.doi.org/1.1988/ams.16.5177 A Cumulative Averaging Method for Piecewise Polynomial Approximation to Discrete

More information

Approximating Square Roots

Approximating Square Roots Math 560 Fall 04 Approximating Square Roots Dallas Foster University of Utah u0809485 December 04 The history of approximating square roots is one of the oldest examples of numerical approximations found.

More information

Natural Numbers and Integers. Big Ideas in Numerical Methods. Overflow. Real Numbers 29/07/2011. Taking some ideas from NM course a little further

Natural Numbers and Integers. Big Ideas in Numerical Methods. Overflow. Real Numbers 29/07/2011. Taking some ideas from NM course a little further Natural Numbers and Integers Big Ideas in Numerical Methods MEI Conference 2011 Natural numbers can be in the range [0, 2 32 1]. These are known in computing as unsigned int. Numbers in the range [ (2

More information

1.00 Lecture 19. Numerical Methods: Root Finding

1.00 Lecture 19. Numerical Methods: Root Finding 1.00 Lecture 19 Numerical Methods: Root Finding short int Remember Java Data Types Type byte long float double char boolean Size (bits) 8 16 32 64 32 64 16 1-128 to 127-32,768 to 32,767-2,147,483,648 to

More information

Piecewise polynomial interpolation

Piecewise polynomial interpolation Chapter 2 Piecewise polynomial interpolation In ection.6., and in Lab, we learned that it is not a good idea to interpolate unctions by a highorder polynomials at equally spaced points. However, it transpires

More information

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

Graphing Techniques. Domain (, ) Range (, ) Squaring Function f(x) = x 2 Domain (, ) Range [, ) f( x) = x 2 Graphing Techniques In this chapter, we will take our knowledge of graphs of basic functions and expand our ability to graph polynomial and rational functions using common sense, zeros, y-intercepts, stretching

More information

Introduction to optimization methods and line search

Introduction to optimization methods and line search Introduction to optimization methods and line search Jussi Hakanen Post-doctoral researcher jussi.hakanen@jyu.fi How to find optimal solutions? Trial and error widely used in practice, not efficient and

More information

IB HL Mathematical Exploration

IB HL Mathematical Exploration IB HL Mathematical Exploration Modelling the surface area of a ceramic pot Personal code: glt101 Table of Contents Introduction... 1 Rationale... 1 Aim... 1-2 Exploring the formula for surface area...

More information

Math 5320, 3/28/18 Worksheet 26: Ruler and compass constructions. 1. Use your ruler and compass to construct a line perpendicular to the line below:

Math 5320, 3/28/18 Worksheet 26: Ruler and compass constructions. 1. Use your ruler and compass to construct a line perpendicular to the line below: Math 5320, 3/28/18 Worksheet 26: Ruler and compass constructions Name: 1. Use your ruler and compass to construct a line perpendicular to the line below: 2. Suppose the following two points are spaced

More information

Module 4 : Solving Linear Algebraic Equations Section 11 Appendix C: Steepest Descent / Gradient Search Method

Module 4 : Solving Linear Algebraic Equations Section 11 Appendix C: Steepest Descent / Gradient Search Method Module 4 : Solving Linear Algebraic Equations Section 11 Appendix C: Steepest Descent / Gradient Search Method 11 Appendix C: Steepest Descent / Gradient Search Method In the module on Problem Discretization

More information

CCNY Math Review Chapter 2: Functions

CCNY Math Review Chapter 2: Functions CCN Math Review Chapter : Functions Section.1: Functions.1.1: How functions are used.1.: Methods for defining functions.1.3: The graph of a function.1.: Domain and range.1.5: Relations, functions, and

More information

WK # Given: f(x) = ax2 + bx + c

WK # Given: f(x) = ax2 + bx + c Alg2H Chapter 5 Review 1. Given: f(x) = ax2 + bx + c Date or y = ax2 + bx + c Related Formulas: y-intercept: ( 0, ) Equation of Axis of Symmetry: x = Vertex: (x,y) = (, ) Discriminant = x-intercepts: When

More information

MEI Desmos Tasks for AS Pure

MEI Desmos Tasks for AS Pure Task 1: Coordinate Geometry Intersection of a line and a curve 1. Add a quadratic curve, e.g. y = x² 4x + 1 2. Add a line, e.g. y = x 3 3. Select the points of intersection of the line and the curve. What

More information

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

PS Geometric Modeling Homework Assignment Sheet I (Due 20-Oct-2017) Homework Assignment Sheet I (Due 20-Oct-2017) Assignment 1 Let n N and A be a finite set of cardinality n = A. By definition, a permutation of A is a bijective function from A to A. Prove that there exist

More information

Partial Derivatives (Online)

Partial Derivatives (Online) 7in x 10in Felder c04_online.tex V3 - January 21, 2015 9:44 A.M. Page 1 CHAPTER 4 Partial Derivatives (Online) 4.7 Tangent Plane Approximations and Power Series It is often helpful to use a linear approximation

More information

Remember Java Data Types

Remember Java Data Types 1.00 Lecture 19 October 24, 2005 Numerical Methods: Root Finding Remember Java Data Types Size Type (bits) Range byte 8-128 to 127 short 16-32,768 to 32,767 int 32-2,147,483,648 to 2,147,483,647 long 64-9,223,372,036,854,775,808L

More information

= f (a, b) + (hf x + kf y ) (a,b) +

= f (a, b) + (hf x + kf y ) (a,b) + Chapter 14 Multiple Integrals 1 Double Integrals, Iterated Integrals, Cross-sections 2 Double Integrals over more general regions, Definition, Evaluation of Double Integrals, Properties of Double Integrals

More information