ChE306: Heat and Mass Transfer - PowerPoint PPT Presentation

1 / 59
About This Presentation
Title:

ChE306: Heat and Mass Transfer

Description:

truncate (3.36) (3.32) Differentiation by Backward FD ... Truncate all but first term (3.53) Differentiation by Forward FD ... truncate (3.82) (3.78) ... – PowerPoint PPT presentation

Number of Views:94
Avg rating:3.0/5.0
Slides: 60
Provided by: ChemicalEn2
Category:

less

Transcript and Presenter's Notes

Title: ChE306: Heat and Mass Transfer


1
Chapter 4
Numerical Differentiation and Integration
2
Numerical Differentiation
  • Two major reasons for considering numerically
    approximations of the differentiation process
  • Approximation of derivatives in ordinary
    differential equations and partial differential
    equations. This is done in order to reduce the
    differential equation to a form that can be
    solved more easily than the original differential
    equation.
  • Forming the derivative of a function f (x) which
    is known only as empirical data (xi, yi) i
    1, . . . , m. The data generally is known only
    approximately, so that yi f (xi), i 1, . . .
    , m.

3
Numerical Differentiation
  • Two methods are used for numerically
    approximations of the differentiation process
  • Taylors theorem as approximation of the
    derivative.
  • Differentiation of interpolation approximation of
    the function.

4
Differentiation by Backward FD
  • First-order derivative in terms of ? with O(h)
  • Develop relationship between BFD and ?
  • Apply to y at i
  • Truncate all but first term

5
Differentiation by Backward FD
  • Truncation error
  • i.e., truncation error of higher-order terms
    O(hn) is smaller as the step size h decreases

6
Differentiation by Backward FD
  • Second-order derivative in terms of ? with O(h)
  • Apply to y at i, truncating all but first term

7
Differentiation by Backward FD
  • First-order derivative in terms of ? with O(h2)

(3.32)
Combine both equations
(3.36)
truncate
8
Differentiation by Backward FD
  • Second-order derivative in terms of ? with O(h2)

(3.36)
combine
(3.37)
truncate
9
Differentiation by Backward FD
  • Error of order h

10
Differentiation by Backward FD
  • Error of order h2

11
Differentiation by Forward FD
  • First-order derivative in terms of ? with O(h)
  • Develop relationship between FFD and ?
  • Apply to y at i
  • Truncate all but first term

(3.53)
12
Differentiation by Forward FD
  • Second-order derivative in terms of ? with O(h)
  • Apply to y at i, truncating all but first term

(3.57)
13
Differentiation by Forward FD
  • First-order derivative in terms of ? with O(h2)

(3.53)
combine
(3.57)
truncate
14
Differentiation by Forward FD
  • Second-order derivative in terms of ? with O(h2)

(3.57)
combine
(3.58)
truncate
15
Differentiation by Forward FD
  • Error of order h

16
Differentiation by Forward FD
  • Error of order h2

17
Differentiation by Central FD
  • First-order derivative in terms of ? with O(h2)
  • Apply to y at i, truncating all but first term

(3.78)
18
Differentiation by Central FD
  • Second-order derivative in terms of ? with O(h2)
  • Apply to y at i, truncating all but first term

(3.81)
19
Differentiation by Central FD
  • First-order derivative in terms of ? with O(h4)

(3.78)
combine
(3.82)
truncate
20
Differentiation by Central FD
  • Second-order derivative in terms of ? with O(h4)

(3.81)
combine
(3.83)
truncate
21
Differentiation by Central FD
  • Error of order h2

22
Differentiation by Central FD
  • Error of order h4

23
Example 4.1
  • Mass transfer flux from an open vessel
  • Flux
  • unsteady-stateconcentration
  • where ? isdetermined by

Step 1 determine ? Step 2 evaluate X Step 3
calculate N (requires evaluation of derivative)
24
Example 4.1 Input data
  • Mass transfer flux from an open vessel
  • time eps3600
  • axial positions vector 0.1, 0.2, 0.3
  • diffusion coefficient vapor in air 2.2e-5 m2/s
  • temperature 25C
  • pressure 101325 Pa
  • vapor pressure at temp 3161 Pa
  • File containing equation for ? 'Ex_4_1_phi'
  • File containing concentration profile
    'Ex4_1_profile'

25
Example 4.2
  • Numerical differentiation (1st to 4th-order
    derivatives) of a series of numerical data.
  • deriv.m is applied in this example to calculate
    first- to fourth-order derivatives of a matrix of
    data. Central finite difference is used to
    calculate the derivatives.

26
Numerical Integration
27
Numerical Integration
28
Numerical Integration
29
Numerical Integration
  • We also want to choose the approximates
    of a form we can integrate directly and easily.
    Examples are polynomials, trig functions,
    piecewise polynomials, and others. If we use
    polynomial approximations, then how do we choose
    them. At this point, we have two choices
  • Taylor polynomials approximating f (x)
  • 2. Interpolatory polynomials approximating f (x)

30
Newton-Cotes Integration
  • Accomplished by replacing function yf(x) with a
    polynomial, such as the Gregory-Newton forward
    interpolation formula.
  • First three Newton-Cotes Integration formulas
    are Trapezoid, Simpson's 1/3, and Simpson's 3/8
    rules

31
Trapezoid Rule
32
Trapezoid Rule
33
Trapezoid Rule
34
Trapezoid Rule
35
Trapezoid Rule
36
Trapezoid Rule
37
Trapezoid Rule
38
Trapezoid Rule
39
Trapezoid Rule
40
Trapezoid Rule
41
Trapezoid Rule
42
Trapezoid Rule
  • Use one segment with h and fit polynomial through
    (xo,yo) and (x1,y1).
  • Retain first 2 terms of Gregory-Newton

43
Simpson's 1/3 Rule
  • Fit polynomial through two segments of h (i.e.,
    through points (xo,yo), (x1,y1), (x2,y2)).
  • Retain first 3 terms of Gregory-Newton

44
Simpson's 3/8 Rule
  • Fit polynomial through three segments of h.
  • Retain first 4 terms of Gregory-Newton

45
Summary of Newton-Cotes Integration Formula
46
Example 4.3
  • Numerical integration using Trapezoidal and
    Simpsons 1/3 Rules.
  • trapz.m and Simpson.m are used for nunmerical
    integration.

47
Gauss Quadrature
  • Applied to unequally-spaced data
  • Lagrange polynomial used to approximate function.
    Orthogonal polynomials applied to locate the
    loci of base points.

areaabove areabelow
48
Gauss Quadrature
  • Transform interval a,b to -1,1

49
Gauss Quadrature
  • Equivalent to Trapezoid to this point
  • Gauss Quadrature eliminates error term by
    expanding error in terms of 2nd degree Legendre
    polynomial.
  • Values of z0 and z1 chosen as root of 2nd degree
    Legendre polynomial, z0,1 ??1/3½which causes
    the R term to vanish.

50
Higher-Point Gauss-Legendre
  • Replace yf(x) with Lagrange polynomial

Identical to Newton-Cotes, except that Lagrange
polynomial used in place of Gregory-Newton
interpolation
where
51
Higher-Point Gauss-Legendre
  • substitute
  • convert interval

where
polynomials of degree n and n1, respectively
52
Higher-Point Gauss-Legendre
  • Differs from Newton-Cotes in that error term
    eliminated by expanding polynomials in the error
    term with Legendre orthogonal polynomials zi
    chosen as roots of (n1)th degree Legendre
    polynomial. Accuracy increased from n to 2n1.

0
error in Gauss-Legendre(Seinfeld Lapidus)
53
Spline Integration
  • Sum terms of integrated cubic splines across all
    intervals.

54
Multiple Integrals
  • inner integration first, e.g., Trapezoid Rule
  • m ? number of divisions
  • k ? integration step in y-direction
  • x ? constant

55
Multiple Integrals
  • Plug result into double integral
  • Apply Trapezoid rule to each integral
  • n ? number of divisions
  • h ? integration step in x-direction
  • y ? constant

56
Multiple Integrals
  • Combine

57
Example 4.4
  • Use Gauss-Legendre Quadrature to solve the
    temperature profile in a vertical falling film.

T profile
yltlt? near wall
vz profile
58
Example 4.4
  • Combine
  • Boundary conditions for short contact time

where
59
Example 4.4
  • Analytical Solution
  • Must integrate using Gauss-Legendre

where
and
Write a Comment
User Comments (0)
About PowerShow.com