Sunteți pe pagina 1din 24

CHAPTER-22

Integration of Equations

Numerical Methods for Chemical Engineers


CHE F242
1
Integration Approach
• Functions to be integrated numerically will
typically be of two forms: a table of values or a
function.
• The form of the data has an important influence
on the approaches that can be used to evaluate
the integral.
• For tabulated information, you are limited by the
number of points that are given. In contrast, if the
function is available, you can generate as many
values of f(x) as are required to attain acceptable
accuracy.
Numerical Integration of Equations
• Three techniques that are expressly designed to analyze cases
where the function is given.
– The first is based on Richardson’s extrapolation, which is a
method for combining two numerical integral estimates to
obtain a third, more accurate value. The computational
algorithm for implementing Richardson’s extrapolation in a
highly efficient manner is called Romberg integration. This
technique is recursive and can be used to generate an integral
estimate within a pre-specified error tolerance.
– The second method, adaptive integration, is based on dividing
the integration interval into successively more refined
subintervals in a recursive fashion. Thus, more refined spacing is
employed where the function varies rapidly and coarser spacing
used where the function varies slowly in order to attain a
desired global accuracy with the least computational effort.
– The third method is called Gauss quadrature. Gauss-quadrature
formulas employ x values that are positioned between a and b in
such a manner that a much more accurate integral estimate
results.
Romberg Integration
• Richardson’s Extrapolation: These methods use two estimates
of an integral to compute third, more accurate approximation.

• The estimate and error associated with a multiple-application


trapezoidal rule can be represented as
I = I(h)+E(h)
where I = the exact value of the integral, I(h) = the approximation from
an n-segment application of the trapezoidal rule with step size h =
(b − a)/n, and E(h) the truncation error.

• For two separate estimates using step sizes of h1 and h2 and have
exact values for the error,
I(h1) + E(h1) = I(h2) + E(h2)
• Richardson’s Extrapolation:
Error for multiple application trapezoidal rule E(h)≈-(b-a) h2 f” /12.
It is assumed that f” is constant regardless of step size, So the ratio of the
two errors will be

Using substitution and rearrangement, E(h2)can be solved for

which can be substituted into I = I(h2)+E(h2) to yield a new estimate of


the integral:

error of estimate o(h4)


Problem

Single and multiple applications of the trapezoidal rule


yielded the following results:

Use the Richardson’s Extrapolation formula to compute


improved estimate of the integral.
Solution:
These two improved estimates can be combined to yield an even
better value with O(h6).
If the original trapezoidal estimate are based on successive halving
of the step size, the eqn. used for O(h6) accuracy is

Where Im and I1 are the more and less accurate estimates,


respectively.

Two O(h6) results can be combined to compute an integral that is


O(h8) using
Problem: Higher Order Error
Correction of Integral Estimates

Using the Richardson’s Extrapolation formula to compute


improved estimate of the integral, we get two integral estimates of
O(h4). Utilize the following equation to combine these estimates to
compute an integral with O(h6).

Solution: Equation

Here Im = 1.623467; I1 = 1.367467


Romberg Integration Algorithm
• The coefficients in each of the extrapolation equations add up
to 1, which represent the weighing factor.
• As accuracy increases, relatively greater weight is placed on
superior integral estimated.
• The general formulation can be expressed as:

+ O(h2k)

where Ij+1,k−1 and Ij,k−1 = the more and less accurate integrals,
respectively, and Ij, k = the improved integral.
• The index k signifies the level of the integration, where k = 1
correspond to the original trapezoidal rule estimates, k = 2
corresponds to O(h4), k = 3 to O(h6), and so forth.
• The index j is used to distinguish between the more ( j + 1) and
the less ( j) accurate estimates.
• Stopping Criterion
– An estimate of percent relative error:

When εa is below a pre-specified error criterion εs,


the computation is terminated
• Romberg integration is more efficient than the
trapezoidal rule and Simpson’s rules
• For same order of accuracy Trapezoidal rule and
Simpson’s rule require large no. of segments, which
gives rise to round-off errors.
Error Estimation for Richardson’s
Extrapolation Formula
• An approximation for desired quantity ‘A’, an approximation
with step ‘h’ can be present as:
• or

• By halving the step to h/2:

• Solving the two equations:


Graphical Depiction of the Sequence of
Integral Estimates Generated Using
Romberg Integration
Segment Trapezoidal Rule 1st Iteration 2nd Iteration 3rd
Iteration
2 4 6 8
1 O(h ) O(h ) O(h ) O(h )

2 I1,1 I1,2 I1,3 I1,4


4 I2,1 I2,2 I2,3
8 I3,1 I3,2
I4,1
Ij,k , here k signify the level of Integration (iteration), j show the more
accurate (j+1) and less (j) accurate integral.
Graphical Depiction of the Sequence of
Integral Estimates Generated Using
Romberg Integration
Segment Trapezoidal Rule 1st Iteration 2nd Iteration 3rd
Iteration
2 4
1 O(h ) O(h ) O(h6) O(h8)
0.172800 1.367467
2
1.068800
Segment Trapezoidal Rule 1st Iteration 2nd Iteration 3rd
Iteration
O(h2) O(h4) O(h6) O(h8)
1
0.172800 1.367467 1.640533
2
1.068800 1.623467
4
Graphical Depiction of the Sequence of
Integral Estimates Generated Using
Romberg Integration
Segment Trapezoidal Rule 1st Iteration 2nd Iteration 3rd
Iteration
2 4
1 O(h ) O(h ) O(h6) O(h8)
0.172800 1.367467 1.640533 1.640533
2
4 1.068800 1.623467 1.640533

8 1.484800 1.639467
1.600800
Gauss Quadrature
• Gauss quadrature (also referred as Gauss-Legendre
quadrature) evaluates the area under a straight line joining in
any two points of curve (* unlike trapezoidal rule that must
pass through the end points)
• The approach can be extended to ‘n’ base points
• By positioning these points wisely, the positive and negative
errors are balanced and an improved integral estimate results.
Gauss Quadrature
• The technique is described by

where the c’s = constants and xi’s are the appropriate base
points, that can be evaluate by ‘method of undetermined
coefficients’
• The given function f(x) with limits [a,b] is modified
to f(z) with limits [-1,1] as:
Method of Undetermined Coefficients
• Integrating the two equation (from equalities)
Method of Undetermined Coefficients
• The method of undetermined coefficients
offers an approach that has utility in
deriving Gauss quadrature integration
technique.
• To illustrate the approach Trapezoidal rule
is expressed as:

• Trapezoidal rule should give exact results


when the function being integrated is a
constant(y=1) or straight line (y=x)

The two
equalities
should hold :
Two-point Gauss-Legendre Formula

• There are total four unknowns to


evaluate
• The four conditions are obtained by
assuming that above equation fits the
integral of a constant(y=c), a linear
function(y=x), a parabolic (y=x2) and a
cubic (y=x3) function.
• The four equations to be solved are
Two-point Gauss-Legendre Formula
• Four simultaneous equations are solved for

• , ,,

• To yield the two point Gauss-Legendre formula

• Thus, we arrive at the interesting result that the simple


addition of the function values at x = 1/√3 and −1/√3 yields an
integral estimate that is third-order accurate.
Illustration

Solution: The function needs to modify in order to bring limits [-1 ,1]

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