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

Size: px
Start display at page:

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

Transcription

1 INTERPOLATION Background Polynomial Approximation Problem: given f(x) C[a, b], find P n (x) = a 0 + a 1 x + a 2 x a n x n with P n (x) close to f(x) for x [a, b]. Motivations: f(x) might be difficult to compute, but P n (x) is easy to compute, integrate, differentiate,... Weierstrass Approximation Theorem: if f C[a, b], ɛ > 0, there exists a polynomial P (x) with f(x) P (x) < ɛ x [a, b]. Problem: how to find a good P (x)? Possible solution: Taylor polynomials? P n (x) = f(x 0 ) + (x x 0 )f (x 0 ) + + (x x 0 ) n f (n) (x 0 )/n!. But Taylor P n (x) is often bad unless x is close to x 0 ; Taylor poly. needs f (i) s. Another possible solution: the interpolating polynomial. Given points x 0, x 1,..., x n, and function values f(x 0 ), f(x 1 ),..., f(x n ), an interpolating polynomial P (x) for f(x) satisifies P (x i ) = f(x i ), i = 0, 1,..., n. Issues: how to find, represent, compute P (x); errors?

2 Lagrange Interpolating Polynomial LAGRANGE INTERPOLATION Linear Interpolation: given x 0, f(x 0 ), x 1, f(x 1 ), the point-slope form for interpolating P 1 (x) is P 1 (x) = f(x 0 ) + (x x 0 ) f(x 1) f(x 0 ) x 1 x 0 ; then Lagrange form for interpolating P 1 (x) is 2 P 1 (x) = x x 1 x 0 x 1 f(x 0 ) + x x 0 x 1 x 0 f(x 1 ). Quadratic Interpolation: given (x 0, f(x 0 )), (x 1, f(x 1 )), (x 2, f(x 2 )), a point-slope form for interpolating P 2 (x) (see 3.3) is P 2 (x) = f(x 0 ) + (x x 0 ) f(x 1) f(x 0 ) x 1 x 0 +???; the Lagrange form for interpolating P 2 (x) is P 2 (x) = (x x 1)(x x 2 ) (x 0 x 1 )(x 0 x 2 ) f(x 0) + (x x 0)(x x 2 ) (x 1 x 0 )(x 1 x 2 ) f(x 1) + (x x 0)(x x 1 ) (x 2 x 0 )(x 2 x 1 ) f(x 2). Note: can easily check P 2 (x 0 ) = f(x 0 ), P 2 (x 1 ) = f(x 1 ), P 2 (x 2 ) = f(x 2 ).

3 LAGRANGE INTERPOLATION CONT. Example: f(x) = cos(πx), for x [0, 2] 3 Maxiumum error for x [0, 2]: 2(for P 1 (x)),.61(p 2 (x)),.089(p 4 (x)). 1.5 cos(π x) and Lagrange degree 1, 2, 4 approximations

4 LAGRANGE INTERPOLATION CONT. 4 General Lagrange Interpolation Lagrange Basis functions: given n + 1 distinct x i s L n,k (x) = (x x 0) (x x k 1 )(x x k+1 ) (x x n ) n (x k x 0 ) (x k x k 1 )(x k x k+1 ) (x k x n ) = Notice: L n,k (x j ) = 0, if j k, L n,k (x k ) = 1, and degree of L n,k is n. i=0, k (x x i ) (x k x i ). Lagrange Interpolating Polynomial: given a data set D = {(x i, f(x i ))} n i=0, with distinct x i s, the Lagrange interpolating polynomial for D is n P (x) = f(x 0 )L n,0 (x) + f(x 1 )L n,1 (x) + + f(x n )L n,n (x) = f(x k )L n,k (x). For efficient evaluation, you can use n n f(x i ) P (x) = (x x i ) w i (x x i ), with w i = i=0 With precomputed w i s (O(n 2 )), P (x) needs O(n) flops. i=0 n j=0, i k=0 (x i x j ).

5 LAGRANGE INTERPOLATION CONT. Theorem: given {f(x i )} n i=0, with distinct x i s, there is a unique polynomial P (x) of degree n which satisfies P (x i ) = f(x i ) for i = 0, 1,..., n. 5 How to find power form for P (x)? Find a i s so that Solve the linear system determined by P n (x) = a 0 + a 1 x + a 2 x a n x n. P n (x i ) = a 0 + a 1 x i + a 2 x 2 i + + a n x n i = f(x i ), for i = 0, 1,..., n, to find the a i s. In system form V a = f, with Vandermonde matrix 1 x 0 x x n 0 a 0 V = 1 x 1 x x n , a = a 1. 1 x n x 2 n... x n n a n, f = Problems: O(n 3 ) cost to find a i s?; V is often illconditioned; a i s are usually not explicitly needed. f(x 0 ) f(x 1 ). f(x n ),

6 NEWTON INTERPOLATION 6 Newton Divided Difference Background Motivation: to provide Taylor -like general formula where terms are added successively as degree increases: P n (x) = a 0 + a 1 (x x 0 ) + a 2 (x x 0 )(x x 1 ) + + a n (x x 0 ) (x x n 1 ). Iterative construction of P n : Notice P n (x 0 ) = f(x 0 ) = a 0 ; P n (x 1 ) = f(x 1 ) = f(x 0 ) + a 1 (x 1 x 0 ), so a 1 = f(x 1) f(x 0 ) x 1 x 0. Then P n (x 2 ) = f(x 2 ) = f(x 0 ) + a 1 (x 2 x 0 ) + a 2 (x 2 x 0 )(x 2 x 1 ), so f(x 2 ) f(x 1 ) x a 2 = 2 x 1 f(x 1) f(x 0 ) x 1 x 0. x 2 x 0 For general case, use divided differences for all a k s.

7 DIVIDED DIFFERENCE INTERPOLATION CONT. 7 Divided Differences Notation: the k th divided difference for {(x j, f(x j ))} i+k j=i is a number denoted by f[x i, x i+1,..., x i+k ]. Divided Difference Formula: using f[x i ] f(x i ) f[x i, x i+1,..., x i+k ] = f[x i+1, x i+2,..., x i+k ] f[x i, x i+1,..., x i+k 1 ] x i+k x i. Divided Difference Table is computed row at a time x 0 f[x 0 ] x 1 f[x 1 ] f[x 0, x 1 ].... x n f[x n ] f[x n 1, x n ] f[x n 2, x n 1, x n ]... f[x 0, x 1,..., x n ] Example: find the divided difference table for the given data x f(x)

8 DIVIDED DIFFERENCE INTERPOLATION CONT. Simple Matlab algorithm for divided difference table, computed by rows n = 4; d = zeros(1,n+1); x = [0:n]/n; f = cos(pi*x); % Data for i = 1 : n+1, t = d(1); d(1) = f(i); for j = 1 : i-1, dm = t; t = d(j+1); d(j+1) = (d(j)-dm)/(x(i)-x(i-j)); end, disp([x(i) d(1:i)]) end % d contains DD coefficients %x s f s DD s e-15 Newton Interpolation Formula: define n P n (x) = f[x 0 ] + f[x 0, x 1,..., x k ](x x 0 ) (x x k 1 ) k=1 Example: using diagonal from computed DD table: P 4 (x) = 8

9 9 DIVIDED DIFFERENCE INTERPOLATION CONT. Computation with DD polynomial: setup cost is O(n 2 ), but nested evaluation costs only O(n) for P (x). Nested evaluation algorithm for P(x) a) set P = f[x 0, x 1,..., x n ], b) for k = n 1 : 1 : 0, set P = f[x 0, x 1,..., x k ] + (x x k )P. Example: find f(0.45)(.15643) given previous data. P 4 (x) = P 4 (.45) = Algorithm steps: k = 4; P = 0; k = 3; P = (.3)0 = ; k = 2; P = (.05) = ; k = 1; P = (.2)( ) = ; k = 0; P = 1 + (.45)( ) =.1547.

10 DIVIDED DIFFERENCE INTERPOLATION CONT. Another Example: given the DD table below, what is f(x)? % x f(x) 1st 2nd 3rd 4th 5th 6th Another Example: how many degree d polynomials through n points? d = 3, with points (1,-1), (3,2), (4,5)? d = 4?

11 DIVIDED DIFFERENCE INTERPOLATION CONT. 11 Application Example: efficient function representation. Find a good interpolation approximation for sin(x). a) pick fundamental domain [0, π/2]; for other x s use sin(x) = sin(π x), x [π/2, π]; sin(x) = sin(2π x), x [π, 2π]; sin(x + 2kπ) = sin(x), x > 2π; with sin(x) = sin( x). b) given ɛ, find smallest d so that P d (x) sin(x) < ɛ. E.g. with evenly spaced x i s d = 3, has P 3 (x) sin(x).0024, d = 4, has P 4 (x) sin(x).00022, d = 5, has P 5 (x) sin(x) , d = 6, has P 6 (x) sin(x) , d = 7, has P 7 (x) sin(x) A single precision interpolating polynomial for sin(x) needs only 8 DD coefficients.

12 DIVIDED DIFFERENCE INTERPOLATION CONT x 10 8 P 7 (x) sin(x) n = 7; x = pi*[0:n]/(2*n); f = sin(x); xt = pi*[0:128]/256; [fv,d] = divdif(x,f,xt); disp(max(abs(fv-sin(xt)))) plot( xt, fv-sin(xt), x, zeros(1,n+1) ); grid on disp(d) % DD diagonal entries

13 DD table computation and interp. poly value function function [ f, d, fp ] = divdif( xs, fs, x, ip ) if nargin < 4, ip = 0; end % Computes DD table for data xs, fs, and % evaluates interp. poly at points in x, % returning poly values in f, derivatives in fp, % and DD table diagonal entries in d. % n = length(xs); dd = zeros(1,n); for i = 1 : n, db = dd(1); dd(1) = fs(i); if ip>0, fprintf( %8.1f%11.2f,xs(i),fs(i)),end % compute and display row i of DD table for j = 1 : i-1, da = db; db = dd(j+1); dd(j+1) = ( dd(j) - da )/( xs(i) - xs(i-j) ); if ip>0, fprintf( %10.4f,dd(j+1)), end end, d(i) = dd(i); if ip>0, fprintf( \n ), end end, f = d(n); fp = 0; % nested poly and derivative values at x points for i = n-1 : -1 : 1, fp = f + (x-xs(i)).*fp; f = d(i) + (x-xs(i)).*f; end % end divdif 13

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

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

Interpolation. TANA09 Lecture 7. Error analysis for linear interpolation. Linear Interpolation. Suppose we have a table x x 1 x 2... 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.

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

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

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

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

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

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

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

Practice Reading for Loops

Practice Reading for Loops ME 350 Lab Exercise 3 Fall 07 for loops, fprintf, if constructs Practice Reading for Loops For each of the following code snippets, fill out the table to the right with the values displayed when the code

More information

2.9 Linear Approximations and Differentials

2.9 Linear Approximations and Differentials 2.9 Linear Approximations and Differentials 2.9.1 Linear Approximation Consider the following graph, Recall that this is the tangent line at x = a. We had the following definition, f (a) = lim x a f(x)

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

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

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

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

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

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

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

Chapter 3. Numerical Differentiation, Interpolation, and Integration. Instructor: Dr. Ming Ye

Chapter 3. Numerical Differentiation, Interpolation, and Integration. Instructor: Dr. Ming Ye Chapter 3 Numerical Differentiation, Interpolation, and Integration Instructor: Dr. Ming Ye Measuring Flow in Natural Channels Mean-Section Method (1) Divide the stream into a number of rectangular elements

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

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

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

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

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

Getting Started with Matlab

Getting Started with Matlab Chapter Getting Started with Matlab The computational examples and exercises in this book have been computed using Matlab, which is an interactive system designed specifically for scientific computation

More information

Answers to practice questions for Midterm 1

Answers to practice questions for Midterm 1 Answers to practice questions for Midterm Paul Hacking /5/9 (a The RREF (reduced row echelon form of the augmented matrix is So the system of linear equations has exactly one solution given by x =, y =,

More information

CS388C: Combinatorics and Graph Theory

CS388C: Combinatorics and Graph Theory CS388C: Combinatorics and Graph Theory David Zuckerman Review Sheet 2003 TA: Ned Dimitrov updated: September 19, 2007 These are some of the concepts we assume in the class. If you have never learned them

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

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

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

Chapter 3. Interpolation. 3.1 Introduction

Chapter 3. Interpolation. 3.1 Introduction Chapter 3 Interpolation 3 Introduction One of the fundamental problems in Numerical Methods is the problem of interpolation, that is given a set of data points ( k, k ) for k =,, n, how do we find a function

More information

CS130 : Computer Graphics Curves. Tamar Shinar Computer Science & Engineering UC Riverside

CS130 : Computer Graphics Curves. Tamar Shinar Computer Science & Engineering UC Riverside CS130 : Computer Graphics Curves Tamar Shinar Computer Science & Engineering UC Riverside Design considerations local control of shape design each segment independently smoothness and continuity ability

More information

Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives

Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives. Directional Derivatives Recall that if z = f(x, y), then the partial derivatives f x and f y are defined as and represent the rates of change of z in the x- and y-directions, that is, in the directions of the unit vectors i and

More information

Numerical Analysis Fall. Numerical Differentiation

Numerical Analysis Fall. Numerical Differentiation Numerical Analysis 5 Fall Numerical Differentiation Differentiation The mathematical definition of a derivative begins with a difference approimation: and as is allowed to approach zero, the difference

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

We can conclude that if f is differentiable in an interval containing a, then. f(x) L(x) = f(a) + f (a)(x a).

We can conclude that if f is differentiable in an interval containing a, then. f(x) L(x) = f(a) + f (a)(x a). = sin( x) = 8 Lecture :Linear Approximations and Differentials Consider a point on a smooth curve y = f(x), say P = (a, f(a)), If we draw a tangent line to the curve at the point P, we can see from the

More information

Introduction to MATLAB

Introduction to MATLAB 58:110 Computer-Aided Engineering Spring 2005 Introduction to MATLAB Department of Mechanical and industrial engineering January 2005 Topics Introduction Running MATLAB and MATLAB Environment Getting help

More information

Math 3316, Fall 2016 Due Nov. 3, 2016

Math 3316, Fall 2016 Due Nov. 3, 2016 Math 3316, Fall 2016 Due Nov. 3, 2016 Project 3 Polynomial Interpolation The first two sections of this project will be checked in lab the week of Oct. 24-26 this completion grade will count for 10% of

More information

Know it. Control points. B Spline surfaces. Implicit surfaces

Know it. Control points. B Spline surfaces. Implicit surfaces Know it 15 B Spline Cur 14 13 12 11 Parametric curves Catmull clark subdivision Parametric surfaces Interpolating curves 10 9 8 7 6 5 4 3 2 Control points B Spline surfaces Implicit surfaces Bezier surfaces

More information

2 Second Derivatives. As we have seen, a function f (x, y) of two variables has four different partial derivatives: f xx. f yx. f x y.

2 Second Derivatives. As we have seen, a function f (x, y) of two variables has four different partial derivatives: f xx. f yx. f x y. 2 Second Derivatives As we have seen, a function f (x, y) of two variables has four different partial derivatives: (x, y), (x, y), f yx (x, y), (x, y) It is convenient to gather all four of these into

More information

Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras. Lecture - 24

Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras. Lecture - 24 Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras Lecture - 24 So in today s class, we will look at quadrilateral elements; and we will

More information

Approximate First and Second Derivatives

Approximate First and Second Derivatives MTH229 Project 6 Exercises Approximate First and Second Derivatives NAME: SECTION: INSTRUCTOR: Exercise 1: Let f(x) = sin(x 2 ). We wish to find the derivative of f when x = π/4. a. Make a function m-file

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

EE 216 Experiment 1. MATLAB Structure and Use

EE 216 Experiment 1. MATLAB Structure and Use EE216:Exp1-1 EE 216 Experiment 1 MATLAB Structure and Use This first laboratory experiment is an introduction to the use of MATLAB. The basic computer-user interfaces, data entry techniques, operations,

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

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

Curves and Surfaces for Computer-Aided Geometric Design

Curves and Surfaces for Computer-Aided Geometric Design Curves and Surfaces for Computer-Aided Geometric Design A Practical Guide Fourth Edition Gerald Farin Department of Computer Science Arizona State University Tempe, Arizona /ACADEMIC PRESS I San Diego

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

Workbook. MAT 397: Calculus III

Workbook. MAT 397: Calculus III Workbook MAT 397: Calculus III Instructor: Caleb McWhorter Name: Summer 2017 Contents Preface..................................................... 2 1 Spatial Geometry & Vectors 3 1.1 Basic n Euclidean

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

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

Interpolation by Spline Functions

Interpolation by Spline Functions Interpolation by Spline Functions Com S 477/577 Sep 0 007 High-degree polynomials tend to have large oscillations which are not the characteristics of the original data. To yield smooth interpolating curves

More information

Locally Weighted Least Squares Regression for Image Denoising, Reconstruction and Up-sampling

Locally Weighted Least Squares Regression for Image Denoising, Reconstruction and Up-sampling Locally Weighted Least Squares Regression for Image Denoising, Reconstruction and Up-sampling Moritz Baecher May 15, 29 1 Introduction Edge-preserving smoothing and super-resolution are classic and important

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

Jim Lambers MAT 169 Fall Semester Lecture 33 Notes

Jim Lambers MAT 169 Fall Semester Lecture 33 Notes Jim Lambers MAT 169 Fall Semester 2009-10 Lecture 33 Notes These notes correspond to Section 9.3 in the text. Polar Coordinates Throughout this course, we have denoted a point in the plane by an ordered

More information

Recent Developments in Model-based Derivative-free Optimization

Recent Developments in Model-based Derivative-free Optimization Recent Developments in Model-based Derivative-free Optimization Seppo Pulkkinen April 23, 2010 Introduction Problem definition The problem we are considering is a nonlinear optimization problem with constraints:

More information

Splines and Piecewise Interpolation. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Splines and Piecewise Interpolation. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan Splines and Piecewise Interpolation Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.tw Splines n 1 intervals and n data points 2 Splines (cont.) Go through

More information

14.6 Directional Derivatives and the Gradient Vector

14.6 Directional Derivatives and the Gradient Vector 14 Partial Derivatives 14.6 and the Gradient Vector Copyright Cengage Learning. All rights reserved. Copyright Cengage Learning. All rights reserved. and the Gradient Vector In this section we introduce

More information

Math 126 Final Examination Autumn CHECK that your exam contains 9 problems on 10 pages.

Math 126 Final Examination Autumn CHECK that your exam contains 9 problems on 10 pages. Math 126 Final Examination Autumn 2016 Your Name Your Signature Student ID # Quiz Section Professor s Name TA s Name CHECK that your exam contains 9 problems on 10 pages. This exam is closed book. You

More information

SHAPE Returns the number of elements in each direction in an integer vector.

SHAPE Returns the number of elements in each direction in an integer vector. Chapter 5: Arrays An advantage fortran has over other programming languages is the ease with which it handles arrays. Because arrays are so easy to handle, fortran is an ideal choice when writing code

More information

Lecture 23: Starting to put it all together #2... More 2-Point Boundary value problems

Lecture 23: Starting to put it all together #2... More 2-Point Boundary value problems Lecture 23: Starting to put it all together #2... More 2-Point Boundary value problems Outline 1) Our basic example again: -u'' + u = f(x); u(0)=α, u(l)=β 2) Solution of 2-point Boundary value problems

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

over The idea is to construct an algorithm to solve the IVP ODE (8.1)

over The idea is to construct an algorithm to solve the IVP ODE (8.1) Runge- Ku(a Methods Review of Heun s Method (Deriva:on from Integra:on) The idea is to construct an algorithm to solve the IVP ODE (8.1) over To obtain the solution point we can use the fundamental theorem

More information

interpolation, multivariate, Newton polynomial, divided difference, algorithm,

interpolation, multivariate, Newton polynomial, divided difference, algorithm, MULTIVARIATE POLYNOMIAL INTERPOLATION IN NEWTON FORMS RICHARD D. NEIDINGER Abstract. Techniques of univariate Newton interpolating polynomials are extended to multivariate data points by different generalizations

More information

Application 7.6A The Runge-Kutta Method for 2-Dimensional Systems

Application 7.6A The Runge-Kutta Method for 2-Dimensional Systems Application 7.6A The Runge-Kutta Method for -Dimensional Systems Figure 7.6. in the text lists TI-85 and BASIC versions of the program RKDIM that implements the Runge-Kutta iteration k (,, ) = f tn xn

More information

Scientific Computing: Interpolation

Scientific Computing: Interpolation Scientific Computing: Interpolation Aleksandar Donev Courant Institute, NYU donev@courant.nyu.edu Course MATH-GA.243 or CSCI-GA.22, Fall 25 October 22nd, 25 A. Donev (Courant Institute) Lecture VIII /22/25

More information

Animation Lecture 10 Slide Fall 2003

Animation Lecture 10 Slide Fall 2003 Animation Lecture 10 Slide 1 6.837 Fall 2003 Conventional Animation Draw each frame of the animation great control tedious Reduce burden with cel animation layer keyframe inbetween cel panoramas (Disney

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

Practice Reading if Constructs

Practice Reading if Constructs ME 350 Lab Exercise 4 Fall 2017 if constructs, while loops Practice Reading if Constructs What is the output of the following command sequences? Some of the sequences may print messages that are not correct

More information

EE 301 Lab 1 Introduction to MATLAB

EE 301 Lab 1 Introduction to MATLAB EE 301 Lab 1 Introduction to MATLAB 1 Introduction In this lab you will be introduced to MATLAB and its features and functions that are pertinent to EE 301. This lab is written with the assumption that

More information

Answers to Worksheet 5, Math 272

Answers to Worksheet 5, Math 272 Answers to Worksheet 5, Math 7 1. Calculate the directional derivative of the function f(, y, z) = cos y sin z at the point a = (1, π/, 5π/6) in the direction u = (3, 0, 1). The gradient of f at a is (

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

60 2 Convex sets. {x a T x b} {x ã T x b}

60 2 Convex sets. {x a T x b} {x ã T x b} 60 2 Convex sets Exercises Definition of convexity 21 Let C R n be a convex set, with x 1,, x k C, and let θ 1,, θ k R satisfy θ i 0, θ 1 + + θ k = 1 Show that θ 1x 1 + + θ k x k C (The definition of convexity

More information

Finding, Starting and Using Matlab

Finding, Starting and Using Matlab Variables and Arrays Finding, Starting and Using Matlab CSC March 6 &, 9 Array: A collection of data values organized into rows and columns, and known by a single name. arr(,) Row Row Row Row 4 Col Col

More information

Iterative Algorithms I: Elementary Iterative Methods and the Conjugate Gradient Algorithms

Iterative Algorithms I: Elementary Iterative Methods and the Conjugate Gradient Algorithms Iterative Algorithms I: Elementary Iterative Methods and the Conjugate Gradient Algorithms By:- Nitin Kamra Indian Institute of Technology, Delhi Advisor:- Prof. Ulrich Reude 1. Introduction to Linear

More information

4 Visualization and. Approximation

4 Visualization and. Approximation 4 Visualization and Approximation b A slope field for the differential equation y tan(x + y) tan(x) tan(y). It is not always possible to write down an explicit formula for the solution to a differential

More information

LIMITS, CONTINUITY AND GRAPH THEORY

LIMITS, CONTINUITY AND GRAPH THEORY LIMITS, CONTINUITY AND GRAPH THEORY SOME OF THE STANDARD LIMITS: 1. ; 2. =1= = = =m ; c) = m 2 /2 ; = ; = where x is in radian measure. 3. =e ; 4. ; 5. =1 ; = 6. 7. 8. LHospital s Rule: If f(x) and g(x)

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

Introduction to Geogebra

Introduction to Geogebra Aims Introduction to Geogebra Using Geogebra in the A-Level/Higher GCSE Classroom To provide examples of the effective use of Geogebra in the teaching and learning of mathematics at A-Level/Higher GCSE.

More information

Nested Arrays: A Novel Approach to Array Processing with Enhanced Degrees of Freedom

Nested Arrays: A Novel Approach to Array Processing with Enhanced Degrees of Freedom Nested Arrays: A Novel Approach to Array Processing with Enhanced Degrees of Freedom Xiangfeng Wang OSPAC May 7, 2013 Reference Reference Pal Piya, and P. P. Vaidyanathan. Nested arrays: a novel approach

More information

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

AM205: lecture 2. 1 These have been shifted to MD 323 for the rest of the semester. AM205: lecture 2 Luna and Gary will hold a Python tutorial on Wednesday in 60 Oxford Street, Room 330 Assignment 1 will be posted this week Chris will hold office hours on Thursday (1:30pm 3:30pm, Pierce

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Enrique Muñoz Ballester Dipartimento di Informatica via Bramante 65, 26013 Crema (CR), Italy enrique.munoz@unimi.it Contact Email: enrique.munoz@unimi.it Office: Room BT-43 Industrial,

More information

Design considerations

Design considerations Curves Design considerations local control of shape design each segment independently smoothness and continuity ability to evaluate derivatives stability small change in input leads to small change in

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

Friday, 11 January 13. Interpolation

Friday, 11 January 13. Interpolation Interpolation Interpolation Interpolation is not a branch of mathematic but a collection of techniques useful for solving computer graphics problems Basically an interpolant is a way of changing one number

More information

Written test, 25 problems / 90 minutes

Written test, 25 problems / 90 minutes Sponsored by: UGA Math Department and UGA Math Club Written test, 5 problems / 90 minutes November 8, 04 Instructions. At the top of the left of side of your scan-tron answer sheet, fill in your last name,

More information

1 >> Lecture 3 2 >> 3 >> -- Functions 4 >> Zheng-Liang Lu 169 / 221

1 >> Lecture 3 2 >> 3 >> -- Functions 4 >> Zheng-Liang Lu 169 / 221 1 >> Lecture 3 2 >> 3 >> -- Functions 4 >> Zheng-Liang Lu 169 / 221 Functions Recall that an algorithm is a feasible solution to the specific problem. 1 A function is a piece of computer code that accepts

More information

Assignment 2, MACM 204, Fall Question 1. Question 2. Question 3. Michael Monagan.

Assignment 2, MACM 204, Fall Question 1. Question 2. Question 3. Michael Monagan. Assignment 2, MACM 204, Fall 2016 Michael Monagan. Due Thursday October 6th at 2:30pm. Late penalty: -20% for up to 24 hours late. 0 after that. Please attempt each question in a seperate worksheet. Print

More information

Methods and Applications of Multiobjective Optimization. Introduction. Terminology (1) Terminology(2) Multiobjective or Multicriteria optimization

Methods and Applications of Multiobjective Optimization. Introduction. Terminology (1) Terminology(2) Multiobjective or Multicriteria optimization Methods and Applications of Multiobjective Optimization A review of The Normal Boundary Intersection Approach of Indraneel Das and John E. Dennis and some variations or extensions by Trond Steihaug Department

More information

Interpolation & Polynomial Approximation. Cubic Spline Interpolation II

Interpolation & Polynomial Approximation. Cubic Spline Interpolation II Interpolation & Polynomial Approximation Cubic Spline Interpolation II Numerical Analysis (9th Edition) R L Burden & J D Faires Beamer Presentation Slides prepared by John Carroll Dublin City University

More information

Computational Methods. Constrained Optimization

Computational Methods. Constrained Optimization Computational Methods Constrained Optimization Manfred Huber 2010 1 Constrained Optimization Unconstrained Optimization finds a minimum of a function under the assumption that the parameters can take on

More information

CS227-Scientific Computing. Lecture 3-MATLAB Programming

CS227-Scientific Computing. Lecture 3-MATLAB Programming CS227-Scientific Computing Lecture 3-MATLAB Programming Contents of this lecture Relational operators The MATLAB while Function M-files vs script M-files The MATLAB for Logical Operators The MATLAB if

More information

1.1 ABOUT MATLAB and MATLAB GUI (Graphical User Interface)

1.1 ABOUT MATLAB and MATLAB GUI (Graphical User Interface) Chapter 1 Introduction The Taylor Series is one of the most important tools in numerical analysis. It constitutes the foundation of numerical methods and will be used in most of the chapters of this text.

More information

Institut for Matematik & Datalogi November 15, 2010 Syddansk Universitet. DM528: Combinatorics, Probability and Randomized Algorithms Ugeseddel 3

Institut for Matematik & Datalogi November 15, 2010 Syddansk Universitet. DM528: Combinatorics, Probability and Randomized Algorithms Ugeseddel 3 Institut for Matematik & Datalogi November 15, 2010 Syddansk Universitet JBJ DM528: Combinatorics, Probability and Randomized Algorithms Ugeseddel 3 Stuff covered in Week 46: Rosen 6.1-6.2. The parts of

More information

Computational Mathematics/Information Technology. Worksheet 2 Iteration and Excel

Computational Mathematics/Information Technology. Worksheet 2 Iteration and Excel Computational Mathematics/Information Technology Worksheet 2 Iteration and Excel This sheet uses Excel and the method of iteration to solve the problem f(x) = 0. It introduces user functions and self referencing

More information

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

specified or may be difficult to handle, we often have a tabulated data Interpolation Introduction In many practical situations, for a function which either may not be explicitly specified or may be difficult to handle, we often have a tabulated data where and for In such

More information

THS Step By Step Calculus Chapter 3

THS Step By Step Calculus Chapter 3 Name: Class Period: Throughout this packet there will be blanks you are expected to fill in prior to coming to class. This packet follows your Larson Textbook. Do NOT throw away! Keep in 3 ring-binder

More information

PRESCOTT UNIFIED SCHOOL DISTRICT District Instructional Guide Revised 6/3/15

PRESCOTT UNIFIED SCHOOL DISTRICT District Instructional Guide Revised 6/3/15 PRESCOTT UNIFIED SCHOOL DISTRICT District Instructional Guide Revised 6/3/15 Grade Level: PHS Subject: Precalculus Quarter/Semester: 1/1 Core Text: Precalculus with 1 st week Chapter P - Prerequisites

More information

Computational Mathematics: Models, Methods and Analysis. Zhilin Li

Computational Mathematics: Models, Methods and Analysis. Zhilin Li Computational Mathematics: Models, Methods and Analysis Zhilin Li Chapter 1 Introduction Why is this course important (motivations)? What is the role of this class in the problem solving process using

More information

Matrices and Systems of Linear Equations

Matrices and Systems of Linear Equations Chapter The variable x has now been eliminated from the first and third equations. Next, we eliminate x3 from the first and second equations and leave x3, with coefficient, in the third equation: System:

More information