BSM510 Numerical Analysis

Similar documents
Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20

Curve Fitting and Interpolation

Introduction Linear system Nonlinear equation Interpolation

Numerical Analysis: Interpolation Part 1

Lectures 9-10: Polynomial and piecewise polynomial interpolation

CS 323: Numerical Analysis and Computing

Lecture 10 Polynomial interpolation

Polynomial Interpolation Part II

CS 323: Numerical Analysis and Computing

Numerical Marine Hydrodynamics

Curve Fitting. Objectives

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University

Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University

Q1. Discuss, compare and contrast various curve fitting and interpolation methods

Two hours. To be provided by Examinations Office: Mathematical Formula Tables. THE UNIVERSITY OF MANCHESTER. 29 May :45 11:45

TABLE OF CONTENTS INTRODUCTION, APPROXIMATION & ERRORS 1. Chapter Introduction to numerical methods 1 Multiple-choice test 7 Problem set 9

Chap. 19: Numerical Differentiation

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.

Lecture 07: Interpolation

(0, 0), (1, ), (2, ), (3, ), (4, ), (5, ), (6, ).

CHAPTER Order points and then develop a divided difference table:

Numerical Methods. King Saud University

A first order divided difference

Interpolation and Approximation

Review I: Interpolation

NUMERICAL METHODS. x n+1 = 2x n x 2 n. In particular: which of them gives faster convergence, and why? [Work to four decimal places.

MATH ASSIGNMENT 07 SOLUTIONS. 8.1 Following is census data showing the population of the US between 1900 and 2000:

Chapter 5: Numerical Integration and Differentiation

SECTION 7: CURVE FITTING. MAE 4020/5020 Numerical Methods with MATLAB

Polynomial Interpolation

Numerical Analysis Solution of Algebraic Equation (non-linear equation) 1- Trial and Error. 2- Fixed point

MA3457/CS4033: Numerical Methods for Calculus and Differential Equations

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

Function approximation

Numerical Mathematics & Computing, 7 Ed. 4.1 Interpolation

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)

Newton's forward interpolation formula

Lecture 1: Interpolation and approximation

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Math Numerical Analysis Mid-Term Test Solutions

MA2501 Numerical Methods Spring 2015

Scientific Computing

Nonlinearity Root-finding Bisection Fixed Point Iteration Newton s Method Secant Method Conclusion. Nonlinear Systems

Preliminary Examination in Numerical Analysis

SYSTEMS OF NONLINEAR EQUATIONS

Advanced Math Quiz Review Name: Dec Use Synthetic Division to divide the first polynomial by the second polynomial.

446 CHAP. 8 NUMERICAL OPTIMIZATION. Newton's Search for a Minimum of f(x,y) Newton s Method

UNIT-II INTERPOLATION & APPROXIMATION

Cubic Splines MATH 375. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Cubic Splines

INTERPOLATION Background Polynomial Approximation Problem:

CS412: Introduction to Numerical Methods

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat.

BSM510 Numerical Analysis

MTH603 FAQ + Short Questions Answers.

Computational Methods. Solving Equations

1 Lecture 8: Interpolating polynomials.

Numerical Methods for Differential Equations Mathematical and Computational Tools

Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. What for x = 1.2?

Interpolation and the Lagrange Polynomial

Interpolation (Shape Functions)

STOP, a i+ 1 is the desired root. )f(a i) > 0. Else If f(a i+ 1. Set a i+1 = a i+ 1 and b i+1 = b Else Set a i+1 = a i and b i+1 = a i+ 1

Outline. 1 Interpolation. 2 Polynomial Interpolation. 3 Piecewise Polynomial Interpolation

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Trashketball Chap 2 Review.notebook. February 10, Trashketball. f(x)=3(x+1) 2 2

Lösning: Tenta Numerical Analysis för D, L. FMN011,

Outline. Math Numerical Analysis. Intermediate Value Theorem. Lecture Notes Zeros and Roots. Joseph M. Mahaffy,

Math Numerical Analysis

Topics Covered in Math 115

Nonlinearity Root-finding Bisection Fixed Point Iteration Newton s Method Secant Method Conclusion. Nonlinear Systems

1 Motivation for Newton interpolation

Numerical Methods and Computation Prof. S.R.K. Iyengar Department of Mathematics Indian Institute of Technology Delhi

Physics 331 Introduction to Numerical Techniques in Physics

CSE 250a. Assignment Noisy-OR model. Out: Tue Oct 26 Due: Tue Nov 2

CS 450 Numerical Analysis. Chapter 5: Nonlinear Equations

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

The Intermediate Value Theorem If a function f (x) is continuous in the closed interval [ a,b] then [ ]

Outline. Scientific Computing: An Introductory Survey. Nonlinear Equations. Nonlinear Equations. Examples: Nonlinear Equations

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /8:00-9:30

Scientific Computing: An Introductory Survey

Assignment 6, Math 575A

1) The line has a slope of ) The line passes through (2, 11) and. 6) r(x) = x + 4. From memory match each equation with its graph.

CS 257: Numerical Methods

Convergence rates of derivatives of a family of barycentric rational interpolants

Solutions 2. January 23, x x

Example 1 Which of these functions are polynomials in x? In the case(s) where f is a polynomial,

Interpolation. Chapter Interpolation. 7.2 Existence, Uniqueness and conditioning

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004

Midterm Review. Igor Yanovsky (Math 151A TA)

An Invitation to Mathematics Prof. Sankaran Vishwanath Institute of Mathematical Sciences, Chennai. Unit I Polynomials Lecture 1A Introduction

Interpolation. Escuela de Ingeniería Informática de Oviedo. (Dpto. de Matemáticas-UniOvi) Numerical Computation Interpolation 1 / 34

Jim Lambers MAT 772 Fall Semester Lecture 21 Notes

Integration, differentiation, and root finding. Phys 420/580 Lecture 7

Interpolation and Polynomial Approximation I

Polynomial functions right- and left-hand behavior (end behavior):

Section 5.3 The Newton Form of the Interpolating Polynomial

MAT 300 Midterm Exam Summer 2017

Stability lectures. Stability of Linear Systems. Stability of Linear Systems. Stability of Continuous Systems. EECE 571M/491M, Spring 2008 Lecture 5

Computational Physics

The University of Western Ontario Faculty of Engineering DEPARTMENT OF CHEMICAL AND BIOCHEMICAL ENGINEERING

Transcription:

BSM510 Numerical Analysis Polynomial Interpolation Prof. Manar Mohaisen Department of EEC Engineering

Review of Precedent Lecture Polynomial Regression Multiple Linear Regression Nonlinear Regression

Lecture Content Introduction to Interpolation Newton Interpolation Polynomial Lagrange Interpolation Polynomial Extrapolation and Oscillations 3

Introduction to Interpolation Interpolation Estimate intermediate values between precise data points Polynomial interpolation Using n data points, find an (n-1)th-order polynomial that passes by all the points Matlab format f() x = a + a x + a x + L + a xn 1 3 1 n f x = px + p x + + p x + p () n 1 n L 1 n 1 n 4

Introduction to Interpolation Determining Polynomial Coefficients Example nd order polynomial f() x = px + p x + p 1 3 x 300 400 500 f(x) 0.616 0.55 0.457 p(300) + p (300) + p = 0.616 1 3 p(400) + p (400) + p = 0.55 1 3 p(500) + p (500) + p = 0.457 1 3 90,000 300 1 p 0.616 160,000 400 1 p = 0.55 50,000 500 1 p 0.457 1 3 y 0.7 06 0.6 0.5 p 0.00000115 1 p 0.001715 = p 3 1.070000 0.4 300 350 400 450 500 x 5

Introduction to Interpolation Drawback of the precedent algorithm Vandermonde matrix 90,000000 300 1 A = 160,000 400 1 cond( A) = 3.893 106 50,000 500 1 Matrices of this type are very ill-conditioned! Look for alternative methods! % file: nd order polynomial interpolation format long x =[300 400 500]; y = [0.616 0.55 0.457]; p = polyfir(x, y, ); % find intermediate value >> d = polyval(p, 350) d = 0.56765 6

Newton Interpolation Polynomial Linear Interpolation f ( x) f( x ) f( x ) f( x ) f( x ) f( x ) = f () x = f( x ) + ( x x ) 1 1 1 1 x x x x 1 1 x x 1 1 1 1 Example (log() = 0.693147) Find log() using log(1) and log(6) Find log() using log(1) and log(4).5 1.71759 0 f () = 0 + ( 1) = 0.3583519 1 6 1 1.38694 0 f () = 0 + ( 1) = 0.460981 1 4 1 1.5 y 1 0.5 1 3 4 5 6 7 8 0 x 7

Newton Interpolation Polynomial Quadratic Interpolation f () x = b + b ( x x ) + b ( x x )( x x ) 1 1 3 1 Substitute with x = x 1 f ( x ) = b 1 1 Substitute x = x b = f( x ) f( x ) 1 x x 1 Finally, b 3 = f( x ) f( x ) f( x ) f( x ) 3 1 x x x x 3 1 x x 3 1 8

Newton Interpolation Polynomial Quadratic Interpolation Example x 1 4 5 f(x) 0 1.38694 1.79159 0 = b 1 b f( x ) f( x ) = 1 x x = 1 0.460981 b 3 f( x ) f( x ) f( x ) f( x ) 3 1 x x x x = 3 1 x x = 3 1 0.0518731 Then, f () 0.460981( 1) 0.0518731( 0518731( 1)( 4) x = x x x f () 0.5658444 = 9

Newton Interpolation Polynomial General Form of Newton s Interpolating Polynomials f ( x) = b + b ( x x ) + L+ b ( x x )( x x ) L( x x ) 1 1 n 1 n 1 With b = f( x ) 1 1 b = f[ x, x ] 1 f( x ) f( x ) fx [, x] = i j i j x x i j b = f[ x, x, x ] 3 1 b 3 = f[ x, x ] f[ x, x ] 3 1 x x 3 1 b = f[ x, x, L, x, x ] n n n 1 1 10

Newton Interpolation Polynomial Graphical depiction Finite divided difference Divided difference table x i f(x i ) First Second Third x 1 f(x 1 ) f[x,x 1 ] f[x 3,x,x 1 ] f[x 4, x 3,x,x 1 ] 1 1 1 3 1 4 3 1 x f(x ) f[x 3,x ] f[x 4, x 3,x ] x 3 f(x 3 ) f[x 4,x 3 ] x 4 f(x 4 ) 11

Newton Interpolation Polynomial Example Estimate log() with a third-order Newton s interpolating polynomial f ( x) = b + b ( x x ) + b ( x x )( x x ) + b ( x x )( x x )( x x ) 3 1 1 3 1 4 1 3 x i f(x i ) First Second Third 1 0 0.460981 0.051873110 05187311 0.0078655900786559 4 1.38694 0.0736 0.0041100 6 1.791759 0.18316 5 1.609438 f 3 () x = 0.460981 ( x 1) 0.05187311( 05187311( x 1)( x 4) + 0.00786559 ( x 1)( x 4)( x 6) f () = 0.687686 3 1

Lagrange Interpolation Polynomial Linear Lagrange Interpolation Polynomial x x x x f ( x ) = L f ( x ) + L f ( x ) = f ( x ) + f ( x ) 1 11 1 x x 1 x x 1 1 nd-order Lagrange Interpolation Polynomial ( x x )( x x ) ( x x )( x x ) ( x x )( x x ) f () x = f( x ) + f( x ) + f( x ) 3 1 3 1 ( x x )( x x ) 1 ( x x )( x x ) ( x x )( x x ) 3 1 1 3 1 3 1 3 (n-1)th-order Lagrange Interpolation Polynomial n n i i i x = 1 = 1 i x x f () x L()( x f x ), L() x n 1 = = x i j i j j 13

Lagrange Interpolation Polynomial Example Estimate f(15) Linear Interpolation x i 0 0 40 f(x i ) 3.85 0.8 0.1 x x x x 15 0 15 0 fx ( ) = x x fx ( ) + x x fx ( ) = 3.85+ 0.800 = 1.565 0 0 0 0 1 1 1 1 nd-order interpolation ( x x )( x x ) ( x x )( x x ) ( x x )( x x ) f () x = 3 f( x ) + 1 3 f( x ) + 1 f( x ) ( x x )( x x ) 1 ( x x )( x x ) ( x x )( x x ) 3 1 1 3 1 3 1 3 (15 0)(15 40) (15 0)(15 40) (15 0)(15 0) = 3.85 + 0.8 + 0.1 = 1.331 6875 (0 0)(0 40) (0 0)(0 40) (0 0)(40 0) 14

Inverse Interpolation Given f(x), we need to find x f(x) 0.149 0.1667 0. 0.5 0.3333 0.5 1 x 7 6 5 4 3 1 Solution 1: switch the values of x and f(x) The values of the new x is not guaranteed to be evenly spaced This leads to oscillations in the obtained function Solution : maintain x and f(x) Obtain the polynomial as a function of x Solve the root of the equation Example: f ( x ) = 0.041667 0.375 x + 1.08333 Find x such that f(x) = 0.3 0.3 = 0.041667 0.375x + 1.08333 x = 5.704158, 3.9584 15

Extrapolation and Oscillation Extrapolation Estimating a value of f(x) that lies outside the range of known points x i 16

Dangers of Extrapolation Example 190 1930 1940 1950 1960 1970 1980 1990 000 106.46 13.08 13.11 15.77 180.67 05.05 7.33 49.4646 81.4 Interpolate the first 8 points using 7-th order polynomial Find f(x) at 000 using the interpolation function Result: f(000) = 175.0800 17

Oscillations Interpolation The more is the better? (higher order polynomial is better than lower order polynomials?) Not usually true: higher order polynomials are ill-conditioned (sensitive) Example: Runge s function f() x = 1 1 + 5x x 18

Lecture Summary Introduction to Interpolation Newton Interpolation Polynomial Lagrange Interpolation Polynomial Extrapolation and Oscillations 19