Sunteți pe pagina 1din 29

Numerical Differentiation and Integration

Introduction Newton-Cotes Integration Formulas Integration of Equations Numerical Differentiation

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Introduction
Calculus is the mathematics of change. Because engineers must continuously deal with systems and processes that change, calculus is an essential tool of engineering. Standing in the heart of calculus are the mathematical concepts of differentiation and integration:
y f ( xi x) f ( xi ) x x f ( xi x) f ( xi ) dy x lim 0 dx x I f ( x)dx
a
Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Numerical Differentiation and Integration

Newton-Cotes Integration Formulas

Integration of Equations

Numerical Differentiation

Trapezoidal rule Simpsons rules

Gauss Quadrature

High-accuracy formulas Richardson extrapolation Unequal-spaced data

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Graphical definition of a derivative

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Graphical representation of the integral

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Noncomputer Methods for Differentiation and Integration


The function to be differentiated or integrated will typically be in one of the following three forms:
A simple continuous function such as polynomial, an exponential, or a trigonometric function.

A complicated continuous function that is difficult or impossible to differentiate or integrate directly.


A tabulated function where values of x and f(x) are given at a number of discrete points, as is often the case with experimental or field data.

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Newton-Cotes Integration Formulas


The Newton-Cotes formulas are the most common numerical integration schemes. They are based on the strategy of replacing a complicated function or tabulated data with an approximating function that is easy to integrate:
I f ( x)dx f n ( x)dx
a a b b

f n ( x) a0 a1 x an 1 x n 1 an x n

n is order of polynomial.
Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Figure 21.1

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Figure 21.2 integral can be approximated using a series of polynomials applied piecewise to the function or data over segments of constant length.

3 straight line segments are used

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

The Trapezoidal Rule


The Trapezoidal rule is the first of the NewtonCotes closed integration formulas, corresponding to the case where the polynomial is first order:

I f ( x)dx f1 ( x)dx
a a

The area under this first order polynomial is an estimate of the integral of f(x) between the limits of a and b: >>>equation 21.3
Derivation of Trapezoidal Rule >> Box 21.1
Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

I width x average height

Try out Example 21.1 Try out Problem 21.10 for first 2 data
Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

The Multiple Application Trapezoidal Rule One way to improve the accuracy of the trapezoidal rule is to divide the integration interval from a to b into n number of segments and apply the method to each segment. The areas of individual segments can then be added to yield the integral for the entire interval.
h I ba n
x1

a x0
x2

b xn
xn

f ( x)dx f ( x)dx f ( x)dx


x1 xn1

x0

General form: >>>equation 21.10


Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

General format for multiple-application integrals

Try out Example 21.2 Try out Problem 21.10 a


Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Simpsons Rules
More accurate estimate of an integral is obtained if a high-order polynomial is used to connect the points. The formulas that result from taking the integrals under such polynomials are called Simpsons rules. Simpsons 1/3 Rule Results when a second-order Lagrange interpolating polynomial is used. >>>equation 21.15
Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Simpsons 1/3 rule (parabola)

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

The Multiple-Application Simpsons 1/3 Rule

Just as the trapezoidal rule, Simpsons rule can be improved by dividing the integration interval into a number of segments of equal width. Yields accurate results and considered superior to trapezoidal rule for most applications. Can be employed only if the number of segments is even >>>equation 21.18

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Simpsons 3/8 Rule

Results when a third-order Lagrange interpolating polynomial is used. >>>equation 21.20 >>>n? data points?
Estimate five segments??

Use trapezoidal rule (large truncation error)


Alternative : apply Simpsons 1/3 rule to the first 2 segments & Simpsons 3/8 rule to the last three. Try out Problem 21.10 & Problem 21.11

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Simpsons 3/8 rule (cubic)

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Integration of Equations
Functions to be integrated numerically are in two forms:
A table of values. We are limited by the number of points that are given. A function. We can generate as many values of f(x) as needed to attain acceptable accuracy.

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Gauss Quadrature
Gauss quadrature implements a strategy of positioning any two points on a curve to define a straight line that would balance the positive and negative errors. Hence the area evaluated under this straight line provides an improved estimate of the integral.

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Two-point formula
General form >>>equation 22.12 Yield to >>>equation 22.17 Equation 22.23 & 22.24 can be substituted for x & dx in the equation to be integrated

Substitution transform the integration interval


Try out Problem 22.8
Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Figure 22.7

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Higher-point formula
General form >>>equation 22.25 >>>refer Table 22.1
Try out Problem 22.8

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Numerical Differentiation
Notion of numerical differentiation has been introduced in Chapter 1. In this chapter more accurate formulas that retain more terms will be developed.

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

High Accuracy Differentiation Formulas


High-accuracy divided-difference formulas can be generated by including additional terms from the Taylor series expansion. >>>Figure 23.1 to 23.3
Try out Problem 23.3

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Richardson Extrapolation
There are two ways to improve derivative estimates when employing finite divided differences:
Decrease the step size, or Use a higher-order formula that employs more points.

A third approach, based on Richardson extrapolation, uses two derivative estimates to compute a third, more accurate approximation. >>>equation 23.8
Try out Problem 23.4
Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Derivatives of Unequally Spaced Data


Data from experiments or field studies are often collected at unequal intervals. One way to handle such data is to fit a second-order Lagrange interpolating polynomial. >>>equation 23.9
Try out Problem 23.26

Copyright 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

S-ar putea să vă placă și