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

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

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

Numerical Integration and Numerical Differentiation. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Bindel, Spring 2012 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 16. f(x) dx,

Chapter 5: Numerical Integration and Differentiation

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

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

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

Numerical Integration Formulas

Integration. Topic: Trapezoidal Rule. Major: General Engineering. Author: Autar Kaw, Charlie Barker.

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

Extrapolation in Numerical Integration. Romberg Integration

Section 6.6 Gaussian Quadrature

8.3 Numerical Quadrature, Continued

Simpson s 1/3 Rule Simpson s 1/3 rule assumes 3 equispaced data/interpolation/integration points

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.

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

Numerical Integra/on

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

Numerical Integra/on

Numerical Methods. King Saud University

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

Curve Fitting and Interpolation

BSM510 Numerical Analysis

General Linear Least-Squares and Nonlinear Regression

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation

Then, Lagrange s interpolation formula is. 2. What is the Lagrange s interpolation formula to find, if three sets of values. are given.

To find an approximate value of the integral, the idea is to replace, on each subinterval

Numerical Integration

Simpson s Rule. f(x)dx = h 3 [f(x 0) + 4f(x 1 ) + f(x 2 )] h2 90 f (4) (ɛ)

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

1.8. Integration using Tables and CAS

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

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

Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation

COURSE Numerical integration of functions

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Parallel Circuits. Chapter

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

GENG2140, S2, 2012 Week 7: Curve fitting

Engg. Math. II (Unit-IV) Numerical Analysis

MA6452 STATISTICS AND NUMERICAL METHODS UNIT IV NUMERICAL DIFFERENTIATION AND INTEGRATION

USHA RAMA COLLEGE OF ENGINEERING & TECHNOLOGY

MA2501 Numerical Methods Spring 2015

Week 10 TENTATIVE SCHEDULE NUMERICAL APPROXIMATION LECTURE # 10

Interpolating Accuracy without underlying f (x)

NUMERICAL INTEGRATION. By : Dewi Rachmatin

Numerical Integration Schemes for Unequal Data Spacing

APPM/MATH Problem Set 6 Solutions

Lectures 9-10: Polynomial and piecewise polynomial interpolation

Section 1.1 Algorithms. Key terms: Algorithm definition. Example from Trapezoidal Rule Outline of corresponding algorithm Absolute Error

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

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

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

LECTURE 14 NUMERICAL INTEGRATION. Find

Scientific Computing. Roots of Equations

COURSE Numerical integration of functions (continuation) 3.3. The Romberg s iterative generation method

A first order divided difference

Newton's forward interpolation formula

Romberg Integration and Gaussian Quadrature

Mathematics for Engineers. Numerical mathematics

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.

Scientific Computing: Numerical Integration

STATISTICS AND NUMERICAL METHODS

Scientific Computing

Interpolation. s(s 1)(s 2) Δ 3 f ! s(s 1) Δ 2 f 0 + 2! f(x s )=f 0 + sδf 0 +

5 Numerical Integration & Dierentiation

NUMERICAL ANALYSIS SYLLABUS MATHEMATICS PAPER IV (A)

Do not turn over until you are told to do so by the Invigilator.

Integration. Copyright Cengage Learning. All rights reserved.

Numerical interpolation, extrapolation and fi tting of data

BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES

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

Exact and Approximate Numbers:

Applied Numerical Analysis

CS412: Introduction to Numerical Methods

Numerical methods. Examples with solution

Polynomial Functions and Their Graphs

Romberg Rule of Integration

SKMM 3023 Applied Numerical Methods

Higher-Degree Polynomial Functions. Polynomials. Polynomials

Integration. Tuesday, December 3, 13

3. Numerical Quadrature. Where analytical abilities end...

LECTURE 16 GAUSS QUADRATURE In general for Newton-Cotes (equispaced interpolation points/ data points/ integration points/ nodes).

Identifying the Graphs of Polynomial Functions

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

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

Lecture 28 The Main Sources of Error

Math 107H Fall 2008 Course Log and Cumulative Homework List

Chapter 4 Mathematics of Cryptography

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

Calculus for the Life Sciences

MA1023-Methods of Mathematics-15S2 Tutorial 1

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

Numerical techniques to solve equations

Consider a function f we ll specify which assumptions we need to make about it in a minute. Let us reformulate the integral. 1 f(x) dx.

Applied Numerical Analysis Quiz #2

Chap. 19: Numerical Differentiation

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

Chapter 2 notes from powerpoints

Transcription:

Part 5 Chapter 17 Numerical Integration Formulas PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Chapter Objectives Recognizing that Newton-Cotes integration formulas are based on the strategy of replacing a complicated function or tabulated data with a polynomial that is easy to integrate. Knowing how to implement the following single application Newton-Cotes formulas: Trapezoidal rule Simpson s 1/3 rule Simpson s 3/8 rule Knowing how to implement the following composite Newton-Cotes formulas: Trapezoidal rule Simpson s 3/8 rule

Objectives (cont) Recognizing that even-segment-odd-point formulas like Simpson s 1/3 rule achieve higher than expected accuracy. Knowing how to use the trapezoidal rule to integrate unequally spaced data. Understanding the difference between open and closed integration formulas.

Integration Integration: I = ( ) f x dx a is the total value, or summation, of f(x) dx over the range from a to b: b

Newton-Cotes Formulas The Newton-Cotes formulas are the most common numerical integration schemes. Generally, they are based on replacing a complicated function or tabulated data with a polynomial that is easy to integrate: I = b ( ) f x dx f n x dx a ( ) where f n (x) is an n th order interpolating polynomial. b a

Newton-Cotes Examples The integrating function can be polynomials for any order - for example, (a) straight lines or (b) parabolas. The integral can be approximated in one step or in a series of steps to improve accuracy.

The Trapezoidal Rule The trapezoidal rule is the first of the Newton- Cotes closed integration formulas; it uses a straight-line approximation for the function: I = b f n ( x) dx a I = f (a)+ f ( b ) f ( a) b ( x a) dx a b a I = ( b a) f a ( )+ f b 2 ( )

Error of the Trapezoidal Rule An estimate for the local truncation error of a single application of the trapezoidal rule is: E t = 1 12 f ξ ( )( b a) 3 where ξ is somewhere between a and b. This formula indicates that the error is dependent upon the curvature of the actual function as well as the distance between the points. Error can thus be reduced by breaking the curve into parts.

Composite Trapezoidal Rule Assuming n+1 data points are evenly spaced, there will be n intervals over which to integrate. The total integral can be calculated by integrating each subinterval and then adding them together: x 1 x 2 I = f n ( x) dx = f x 0 ( ) dx + f x 0 ( ) dx + + f x 1 ( ) dx 1 I = ( x 1 x 0 ) f ( x 0)+ f( x 1 ) + ( x 2 x 1 ) f ( x 1)+ f( x 2 ) 2 2 I = h n 1 2 f ( x 0)+ 2 f( x i ) + f( ) i =1 + + ( 1 ) f 1 ( )+ f 2 ( )

MATLAB Program

Simpson s Rules One drawback of the trapezoidal rule is that the error is related to the second derivative of the function. More complicated approximation formulas can improve the accuracy for curves - these include using (a) 2nd and (b) 3rd order polynomials. The formulas that result from taking the integrals under these polynomials are called Simpson s rules.

Simpson s 1/3 Rule Simpson s 1/3 rule corresponds to using second-order polynomials. Using the Lagrange form for a quadratic fit of three points: f n ( ) ( x x 2 ) ( ) ( ) f x 0 ( x)= x x 1 x 0 x 1 x 0 x 2 ( )+ x x 0 x 1 x 0 Integration over the three points simplifies to: x 2 I = f n ( x) dx x 0 ( ) ( x x 2 ) ( ) ( ) f x 1 x 1 x 2 [ ( )] I = h 3 f ( x 0)+ 4 f ( x 1 )+ f x 2 ( ) ( x x 1 ) ( ) ( ) f ( x 2) ( )+ x x 0 x 2 x 0 x 2 x 1

Error of Simpson s 1/3 Rule An estimate for the local truncation error of a single application of Simpson s 1/3 rule is: E t = 1 2880 f 4 ( )( b a) 5 ( ) ξ where again ξ is somewhere between a and b. This formula indicates that the error is dependent upon the fourth-derivative of the actual function as well as the distance between the points. Note that the error is dependent on the fifth power of the step size (rather than the third for the trapezoidal rule). Error can thus be reduced by breaking the curve into parts.

Composite Simpson s 1/3 Rule Simpson s 1/3 rule can be used on a set of subintervals in much the same way the trapezoidal rule was, except there must be an odd number of points. Because of the heavy weighting of the internal points, the formula is a little more complicated than for the trapezoidal rule: x 2 x 4 I = f n ( x) dx = f n ( x) dx + f n ( x) dx + + f n ( x) dx x 0 x 0 x 2 I = h [ 3 f ( x 0)+ 4 f ( x 1 )+ f ( x 2 )]+ h [ 3 f ( x 2)+ 4 f ( x 3 )+ f ( x 4 )]+ + h 3 f ( 2)+ 4 f ( 1 )+ f I = h n 1 n 2 3 f ( x 0)+ 4 f ( x i ) + 2 f x i i=1 j=2 i, odd j, even ( ) ( ) + f 2 [ ( )]

Simpson s 3/8 Rule Simpson s 3/8 rule corresponds to using third-order polynomials to fit four points. Integration over the four points simplifies to: x 3 I = f n ( x) dx x 0 [ ( )] I = 3h 8 f ( x 0)+ 3 f ( x 1 )+ 3 f ( x 2 )+ f x 3 Simpson s 3/8 rule is generally used in concert with Simpson s 1/3 rule when the number of segments is odd.

Higher-Order Formulas Higher-order Newton-Cotes formulas may also be used - in general, the higher the order of the polynomial used, the higher the derivative of the function in the error estimate and the higher the power of the step size. As in Simpson s 1/3 and 3/8 rule, the evensegment-odd-point formulas have truncation errors that are the same order as formulas adding one more point. For this reason, the even-segmentodd-point formulas are usually the methods of preference.

Integration with Unequal Segments Previous formulas were simplified based on equispaced data points - though this is not always the case. The trapezoidal rule may be used with data containing unequal segments: x 1 x 2 I = f n ( x) dx = f x 0 ( ) dx + f x 0 ( ) dx + + f x 1 ( ) dx 1 I = ( x 1 x 0 ) f ( x 0)+ f ( x 1 ) + ( x 2 x 1 ) f ( x 1)+ f ( x 2 ) 2 2 + + ( 1 ) f 1 ( ) ( )+ f 2

Integration Code for Unequal Segments

MATLAB Functions MATLAB has built-in functions to evaluate integrals based on the trapezoidal rule z = trapz(y) z = trapz(x, y) produces the integral of y with respect to x. If x is omitted, the program assumes h=1. z = cumtrapz(y) z = cumtrapz(x, y) produces the cumulative integral of y with respect to x. If x is omitted, the program assumes h=1.

Multiple Integrals Multiple integrals can be determined numerically by first integrating in one dimension, then a second, and so on for all dimensions of the problem.