Chap. 11 Numerical Differentiation and Integration

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

Computational Physics Numerical Integration Dr. Guy Tel-Zur Tulips by Anna Cervova, publicdomainpictures.net.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Computational Methods in Physics PHYS 3437
CSE Differentiation Roger Crawfis. May 19, 2015OSU/CIS 5412 Numerical Differentiation The mathematical definition: Can also be thought of as the.
Numerical Integration of Functions
Part 5 Chapter 19 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
NUMERICAL DIFFERENTIATION AND INTEGRATION
Numerical Computation
High Accuracy Differentiation Formulas
Chapter 7 Numerical Differentiation and Integration
2. Numerical differentiation. Approximate a derivative of a given function. Approximate a derivative of a function defined by discrete data at the discrete.
Lecture 18 - Numerical Differentiation
Numerical Integration
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
Newton-Cotes Integration Formula
Chapter 19 Numerical Differentiation §Estimate the derivatives (slope, curvature, etc.) of a function by using the function values at only a set of discrete.
Lecture 3: Integration. Integration of discrete functions
MANE 4240 & CIVL 4240 Introduction to Finite Elements Numerical Integration in 1D Prof. Suvranu De.
Curve-Fitting Polynomial Interpolation
Chapter 7 Differentiation and Integration
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 21 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
CISE301_Topic7KFUPM1 SE301: Numerical Methods Topic 7 Numerical Integration Lecture KFUPM Read Chapter 21, Section 1 Read Chapter 22, Sections 2-3.
CISE301_Topic71 SE301: Numerical Methods Topic 7 Numerical Integration Lecture KFUPM (Term 101) Section 04 Read Chapter 21, Section 1 Read Chapter.
Quadrature Greg Beckham. Quadrature Numerical Integration Goal is to obtain the integral with as few computations of the integrand as possible.
Numerical Integration Formulas
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Numerical Differentiation and Integration Part 6 Calculus.
Numerical Differentiation
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 21 Newton-Cotes Integration Formula.
Chapter 4, Integration of Functions. Open and Closed Formulas x 1 =a x 2 x 3 x 4 x 5 =b Closed formula uses end points, e.g., Open formulas - use interior.
Integrals 5.
Chapter 4 Numerical Differentiation and Integration 1/16 Given x 0, approximate f ’(x 0 ). h xfhxf xf h )()( lim)('    x0x0 x1x1 h x1x1 x0x0.
1 NUMERICAL INTEGRATION Motivation: Most such integrals cannot be evaluated explicitly. Many others it is often faster to integrate them numerically rather.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
3. Numerical integration (Numerical quadrature) .
Lecture 19 - Numerical Integration CVEN 302 July 22, 2002.
1 Chapter 7 NUMERICAL INTEGRATION. 2 PRELIMINARIES We use numerical integration when the function f(x) may not be integrable in closed form or even in.
Numerical Differential & Integration. Introduction If a function f(x) is defined as an expression, its derivative or integral is determined using analytical.
Simpson Rule For Integration.
Lecture 22 - Exam 2 Review CVEN 302 July 29, 2002.
EE3561_Unit 7Al-Dhaifallah EE 3561 : Computational Methods Unit 7 Numerical Integration Dr. Mujahed AlDhaifallah ( Term 342)
5.1.  When we use the midpoint rule or trapezoid rule we can actually calculate the maximum error in the calculation to get an idea how much we are off.
Engineering Analysis – Computational Fluid Dynamics –
Numerical Integration
The purpose of Chapter 5 is to develop the basic principles of numerical integration Usefule Words integrate, integral 积分(的), integration 积分(法), quadrature.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 5 Integration and Differentiation.
Sec 21: Generalizations of the Euler Method Consider a differential equation n = 10 estimate x = 0.5 n = 10 estimate x =50 Initial Value Problem Euler.
NUMERICAL DIFFERENTIATION or DIFFERENCE APPROXIMATION Used to evaluate derivatives of a function using the functional values at grid points. They are.
SE301_Topic 6Al-Amer20051 SE301:Numerical Methods Topic 6 Numerical Integration Dr. Samir Al-Amer Term 053.
Quadrature – Concepts (numerical integration) Don Allen.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation.
NUMERICAL DIFFERENTIATION Forward Difference Formula
High Accuracy Differentiation Formulas
Chapter 7 Numerical Differentiation and Integration
Numerical Analysis Lecture 42.
Numerical Integration Formulas
NUMERICAL DIFFERENTIATION AND INTEGRATION
Numerical Analysis Lecture 27.
Numerical Differentiation
CSE Differentiation Roger Crawfis.
Chapter 23.
4.3 Elements of Numerical Integration
Numerical differentiation
POLYNOMIAL INTERPOLATION
Numerical Integration:
Numerical Analysis Lecture 26.
Summation Formulas Constant Series.
SKTN 2393 Numerical Methods for Nuclear Engineers
Numerical Integration
Presentation transcript:

Chap. 11 Numerical Differentiation and Integration Computer Theory and Formal Methods LAB HWANG Dae-Yon (dyhwang@formal.korea.ac.kr) SIM Jae-Hwan (jhsim@formal.korea.ac.kr) YANG Jin-Seok (jsyang@formal.korea.ac.kr) May. 18, 2005

Contents 11.1 DIFFERENTIATION 11.2 BASIC NUMERICAL INTEGRATION 11.1.1 First Derivatives 11.1.2 Higher Derivatives 11.1.3 Richardson Extrapolation 11.2 BASIC NUMERICAL INTEGRATION 11.2.1 Trapezoid Rule 11.2.2 Simpson Rule 11.2.3 Midpoint Rule 11.2.4 Other Newton-Cotes Open Formulas

11.1 DIFFERENTIATION 11.1.1 First Derivatives Forward difference formula Backward difference formula Central difference formula

Example 11.1 Forward, Backward and Central Differences Data Points (x0, y0) = (1,2) (x1, y1) = (2,4) (x2, y2) = (3,8) (x3, y3) = (4,16) (x4, y4) = (5,32) Forward Backward Central

Three-point difference formula Three-point forward difference formula Three-point backward difference formula

Discussion Taylor polynomial Forward : h = xi+1 – xi Backward : h = xi-1 – xi

Discussion (cont’) Central : h = xi+1 – xi = xi – xi-1

General Three-Point Formula Based on Lagrange interpolation polynomial (x1 , y1) , (x2 , y2) , (x3 , y3)

General Three-Point Formula(2)

General Three-Point Formula(3) If h = xi+1 – xi = xi – xi-1

General Three-Point Formula(4) If h = xi+1 – xi = xi – xi-1

with truncation error O(h2) 11.1.2 Higher Derivative Formula for higher derivative can be founded by Differentiating the interpolating polynomial repeatedly. Using Taylor expansions. For example, Three equally spaced abscissas xi-1,xi, xi+1 Formula for the second derivative is with truncation error O(h2)

11.1.2 Higher Derivative - Derivation of Second-Derivative Formula If we assume that fourth derivative is continuous on [x-h, x+h], we can write the error term as for some point From the Taylor polynomial where and . adding gives or with truncation error O(h4)

11.1.2 Higher Derivative - Derivation of Second-Derivative Formula Table 11.1 Centered difference formulas, all O(h2) Example 11.3 Second Derivative Estimate the second derivative at x2 = 3, using point (x1, y1) = (2, 4), (x2, y2) = (3, 8), and (x3, y3) = (4, 6); for this example, h=1

11.1.2 Higher Derivative - Partial Derivatives Partial derivative of a function of two variables General point as (xi, yj ) The value of the function u(x, y) at that point as ui, j The spacing in the x and y directions is the same, h Using subscripts to indicate partial differentiation -1 1 i-1 i i+1 j 1 -2 i-1 i i+1 j

11.1.2 Higher Derivative - Partial Derivatives For the mixed second partial derivative and higher derivatives, the schematic form is especially convenient. The Laplacian operator The bi-harmonic operator -1 1 -4 i-1 i i+1 j-1 j j+1 -8 20 2

11.1.3 Richardson Extrapolation Method of improving the accuracy of a low order approximation formula A(h) whose error can be expressed as To apply Richardson extrapolation, we form approximations to A separately using the step size h and h/2 To continue the extrapolation process, consider Where B(h) is simply the extrapolated approximation to A, using step sizes h/2 and h/4, this would correspond to B(h/2). we get which has error O(h6)

11.1.3 Richardson Extrapolation The central difference formula can be written as We can also find f’(x) using one-half the previous value of h Since the coefficient of the h2 term does not change , the two estimates can be combined to give

11.1.3 Richardson Extrapolation - Example 11.4 Improved Estimate of the Derivative From Example 11.1 h=2 The approximation to f’(x2) is based on D(h)=7.5 and D(h/2) The data in the example are points on the curve f(x)=2x. The actual value of f’(x) is (ln2)2x, which gives

11.1.3 Richardson Extrapolation - Discussion Forms a linear combination of approximation A(h) and A(h/2) Dominant error term, which depends on h2, cancels (11.2) or (11.3) Subtracting eq. (11.2) from eq. (11.3) gives or O(h2) O(h4)

11.1.3 Richardson Extrapolation - Discussion To continue the extrapolation, we write where B(h) is simply the extrapolated approximation to A, using step size h, h/2. using step size h/2 and h/4, this would corresponding to B(h/2). Therefore, Define the second level extrapolated approximation to A as

Contents Trapezoid Rule Simpson Rule Midpoint Rule Example 11.5 Discussion about Trapezoid Rule Simpson Rule Example 11.6 Example 11.7 Discussion about Simpson Rule Midpoint Rule Example 11.8 Other Newton-Cotes Open Formulas

Overview (1/2) Numerical integration rules are very important. Functions may not have exact formulas for their antiderivatives (indefinite integrals). An exact formula for the antiderivative dose exist, it may be difficult to find. A numerical integration rule has the form

Overview (2/2) Two basic types of Newton-Cotes formulas. “Closed” formulas : the endpoints values are used. Trapezoid Rule Simpson Rule “Open” formulas : the endpoints are not used. Midpoint Rule Each of these formulas can be derived by approximating the function to be integrated by its Lagrange interpolating polynomial.

Trapezoid Rule This rule approximates the curve by the straight line that passes through the points (a,f(a)) and (b, f(b)).

Trapezoid Rule – Example 11.5 Integral of Using the Trapezoid Rule

Trapezoid Rule – Discussion (1/2) It derived from the Lagrange form of linear interpolation of f(x) using the endpoints of the interval of integration.

Trapezoid Rule – Discussion (2/2)

Simpson Rule Approximating the function to be integrated by a quadratic polynomial leads to the basic Simpon Rule: The approximate integral is given by

Simpson Rule – Example 11.6

Simpson Rule – Example 11.7

Simpson Rule – Discussion (1/2) Simpson’s rule is found by integrating the Lagrange interpolating polynomial for f(x).

Simpson Rule – Discussion (2/2)

Midpoint Rule If we use only function evaluations at points within the interval, the simplest formula is the midpoint rule. This formula uses only one function evaluation (so n = 1),at the midpoint of the interval, xm=(a+b)/2. Interpolating the function by the constant value f(xm) :

Midpoint Rule – Example 11.8

Other Newton-Cotes Open Formulas (1/2) Using two function evaluations Trapezoid Rule

Other Newton-Cotes Open Formulas (2/2) Using three function evaluations Simpson Rule