0% found this document useful (0 votes)
4 views

Lecture 27

The document discusses numerical differentiation and integration methods used in chemical engineering, focusing on techniques like the Trapezoidal Rule and Simpson's Rules for approximating integrals. It includes examples and error estimates for various applications of these methods, emphasizing the importance of accuracy in numerical calculations. Additionally, it highlights the use of these methods in various engineering fields such as fluid mechanics and heat transfer.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture 27

The document discusses numerical differentiation and integration methods used in chemical engineering, focusing on techniques like the Trapezoidal Rule and Simpson's Rules for approximating integrals. It includes examples and error estimates for various applications of these methods, emphasizing the importance of accuracy in numerical calculations. Additionally, it highlights the use of these methods in various engineering fields such as fluid mechanics and heat transfer.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Numerical Differentiation and

Integration

Numerical Methods of Chemical Engineers


CHE F242

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Graphical Definition of Derivative

Difference Approximation ---🡪 as ∆x approaches 0 Derivative

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Integration
• Inverse of Differentiation

Obtain area (shaded) under


the curve between points,
from x = a to x =b

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Numerical Differentiation and
Integration in Engineering
• All over the place, Fluid mechanics, Mass Transfer, kinetics
Design Equation
for Plug flow
reactor
Heat Transfer Problems

Heat flux

The amount of heat transfer Q at


a finite time t is can be
expressed as

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Newton-Cotes Integration Formulas
• Based on the strategy of replacing a
complicated function or tabulated data
with an approximating function that is
easy to integrate:

Zero order approximation First-order Second-order

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Newton-Cotes Integration Formulas
• Based on the strategy of replacing a
complicated function or tabulated data
with an approximating function that is
easy to integrate:

(a) The approximation of (b) The approximation of (c) 3 straight line segments
an integral by the area an integral by the area are used to approximate
under a single straight line under a single parabola the integral
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Newton-Cotes Integration Formulas

(a) Closed Integral Formula (b) Open Integral Formula


The data points at the beginning The open forms have integration
and end of the limits of limits that extend beyond the
integration are known range of the data.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Trapezoidal Rule
• Use a first order polynomial in
approximating the function f(x) :

• The area under this first order


polynomial is an estimate of the
integral of f(x) between a and b:

Error:

Trapezoidal rule
where ξ lies somewhere in the
interval from a to b

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

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

= width x average height


Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem 1: Single Application of the Trapezoidal Rule
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem 1: Single Application of the Trapezoidal Rule
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8

Solution: f(a) = f(0) = 0.2 and f(b) = f(0.8) = 0.232

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

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Multiple-Application Trapezoidal Rule

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Multiple-Application Trapezoidal Rule
• The accuracy can be improved by dividing the
interval from a to b into a number of segments
and applying the method to each segment.

• The areas of individual segments are added to


yield the integral for the entire interval.

Using the trapezoidal rule, we get:

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Multiple-Application Trapezoidal Rule

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Multiple-Application Trapezoidal Rule

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Error Estimate for
The Multiple-Application Trapezoidal Rule
• Error estimate for one segment is given as:

• An error for multiple-application trapezoidal rule can be obtained by


summing the individual errors for each segment:

Thus, if the number of segments is doubled,


the truncation error will be quartered.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use the two-segment Trapezoidal Rule to estimate the integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the error.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use the two-segment Trapezoidal Rule to estimate the integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the error.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use the three-segment Trapezoidal Rule to estimate the integral of

f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5


Integrate f(x) from a=0 to b=0.8. Estimate the error.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use the three-segment Trapezoidal Rule to estimate the integral of

f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5


Integrate f(x) from a=0 to b=0.8. Estimate the error.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use the n-segment Trapezoidal Rule to estimate the integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the error.
n h I Et(%)
2 0.4 1.0688 34.9
3 0.2667 1.3704 16.5
4 0.2 1.4848 9.5
5 0.16 1.5399 6.1
6 0.1333 1.5703 4.3
7 0.1143 1.5887 3.2
8 0.1 1.6008 2.4
9 0.0889 1.6091 1.9
10 0.08 1.6150 1.6
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Limitations

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Simpson’s Rules
• More accurate estimate of an integral is obtained if
a high-order polynomial is used to connect the
points. These formulas are called Simpson’s rules.

Simpson’s 1/3 Rule: results when a 2nd order


Lagrange interpolating polynomial is used for f(x)
a=x0 x1 b=x2

Simpson’s 1/3 Rule

Error
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Simpson’s Rules Error

Error

a=x0 x1 b=x2

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use the Simpson’s 1/3rd Rule to estimate the integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the true and absolute
error. The exact integral is 1.640533.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use the Simpson’s 1/3rd Rule to estimate the integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the true and absolute
error. The exact integral is 1.640533.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use the Simpson’s 1/3rd Rule to estimate the integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the true and absolute
error. The exact integral is 1.640533.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Multiple-Application Simpson’s 1/3 Rule
• Just as the trapezoidal rule, Simpson’s rule can be improved by dividing the
integration interval into a number of segments of equal width.

• However, it is limited to cases where values are equispaced, there are an even
number of segments and odd number of data points.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Multiple-Application Simpson’s 1/3 Rule
• Just as the trapezoidal rule, Simpson’s rule can be improved by dividing the
integration interval into a number of segments of equal width.

• However, it is limited to cases where values are equispaced, there are an even
number of segments and odd number of data points.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use n=4, Multi-Application Simpson’s 1/3rd Rule to estimate the
integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the true and absolute
error. The exact integral is 1.640533.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use n=4, Multi-Application Simpson’s 1/3rd Rule to estimate the
integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the true and absolute
error. The exact integral is 1.640533.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use n=4, Multi-Application Simpson’s 1/3rd Rule to estimate the
integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the true and absolute
error. The exact integral is 1.640533.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Use n=4, Multi-Application Simpson’s 1/3rd Rule to estimate the
integral of
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8. Estimate the true and absolute
error. The exact integral is 1.640533.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Simpson’s 3/8 Rule
Simpson’s 1/3 and 3/8 rules can be
Fit a 3rd order Lagrange interpolating applied in combination to handle
polynomial to four points and integrate multiple applications with odd
number of intervals

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Simpson’s 3/8 Rule
Simpson’s 1/3 and 3/8 rules can be
Fit a 3rd order Lagrange interpolating applied in combination to handle
polynomial to four points and integrate multiple applications with odd
number of intervals

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

You might also like