Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chap. 11 Numerical Differentiation and Integration

Similar presentations


Presentation on theme: "Chap. 11 Numerical Differentiation and Integration"— Presentation transcript:

1 Chap. 11 Numerical Differentiation and Integration
Computer Theory and Formal Methods LAB HWANG Dae-Yon SIM Jae-Hwan YANG Jin-Seok May. 18, 2005

2 Contents 11.1 DIFFERENTIATION 11.2 BASIC NUMERICAL INTEGRATION
First Derivatives Higher Derivatives Richardson Extrapolation 11.2 BASIC NUMERICAL INTEGRATION Trapezoid Rule Simpson Rule Midpoint Rule Other Newton-Cotes Open Formulas

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

4 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

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

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

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

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

9 General Three-Point Formula(2)

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

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

12 with truncation error O(h2)
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)

13 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)

14 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

15 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

16 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

17 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)

18 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

19 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

20 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)

21 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

22 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

23 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

24 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.

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

26 Trapezoid Rule – Example 11.5
Integral of Using the Trapezoid Rule

27 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.

28 Trapezoid Rule – Discussion (2/2)

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

30 Simpson Rule – Example 11.6

31 Simpson Rule – Example 11.7

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

33 Simpson Rule – Discussion (2/2)

34 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) :

35 Midpoint Rule – Example 11.8

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

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


Download ppt "Chap. 11 Numerical Differentiation and Integration"

Similar presentations


Ads by Google