Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

University of Palestine

Gaza Strip

Civil Engineering College


Numerical analysis
CIVL 3309
Formerly CVL 3308

Dr. Suhail Lubbad


Numerical Integration
Integration
What is it about?
The inverse process to differentiation

Bring together parts into a whole

Unite many finite amounts into a total amount


'' SUMMATION''
Mathematical Representation

I = ∫ b
f . x/dx=F . x/∣a =F .b/−F. a/
a
I≡ :Integral of the function f(x)≡ integrand. The function independent variable is x ,
Such integral is taken between the limits a and b
The total value or summation of f . x/dx over the interval [ a b ]

∫ ≡ a stylized capital s that stands for summation


A graphical manifestation
of the concept
Functions to be differentiated or integrated

1. A simple continuous function.


a polynomial, an exponential, or a trigonometric function.

2. A complicated continuous function that is difficult or impossible


to differentiate or integrate directly.

3. 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.
When the function is difficult to integrate
or discrete data is encountered,

approximate methods must be employed.

Numerical integration
Pre-computer Era
1
equal-area graphical integration
2
Numerical integration or quadrature methods
to obtain integrals.

Are easier to implement than the grid approach,


Are similar in spirits to the strip method.

The function heights are multiplied by strip widths and


summed over.

Good choices of weighting factors bring the resulting estimate


to a higher accuracy than that from the simple strip method.
Paraphrasing
Numerical
Integration
Newton-Cotes Integration Formulas

are based on replacing a complicated function or tabulated data with an


approximating function that is easy to integrate

b b

I = ∫ ∫
f .x / dx≈ f n .x/dx
a a

where fn(x) = a polynomial of the form


fn(x)=a0 +a1x+···+an−1xn−1 +anxn
n is the order of the polynomial.
THE TRAPEZOIDAL RULE
Is the first of
The Newton-Cotes forms where
f(x) is replaced by a line segment f1(x)
THE TRAPEZOIDAL RULE
Mathematical expression

b b
I = ∫ f .x/ dx≈ ∫ f 1 .x/ dx
a a

The equation of the line passing through f(a) and f(b) is?
f . b/ − f .a/
f 1 .x /=f .a/,
b−a
.x − a/ HOW?

and the integrand will be evaluated as:


b
f .a/,f .b/
I=∫ [f .x/=f .a/,
1
f .b/ − f .a/
]
.x − a/ dx = .b − a/
a
b−a 2
Error of the Trapezoidal Rule

TRUNCATION ERROR ETr equiiv Ea


in book it is written as Et , Don't confuse it with true error

1 3
Et = − f ′ ′ . 0 /.b − a/
12
where 0 lies between a and b, usually the average value of f ' ' is used.

If interested
Box 21.2 Derivation and Error Estimate of the Trapezoidal Rule
Average value of a function can be computed by

b
∫ f .x/ dx
a
Average (Mean) of f .x/ =
b−a
EXAMPLE 21.1

Use the trapezoidal Rule to numerically integrate

2 3 4 5
f .x/=0.2,25x − 200x ,675x − 900x ,400x

from a = 0 to b = 0.8. The exact value of the integral can be determined


analytically to be 1.640533.
I = 0.1728

Et =1.640533−0.1728=1.467733

Ea = 2.56

Thus
Composite/Multiple Application Trapezoidal Rule

To improve accuracy of the trapezoidal rule


divide the integration interval from a to b into a number of segments and apply
the method to each segment

As depicted in next figure


For n,1 equally spaced base points . x 0, x 1, x 2, . . . , xn / .
b−a
Consequently, n segments of equal width=h=
n
x1 x2 xn

I = ∫ f . x / dx , ∫ f . x / dx , ⋯ , ∫ f .x / dx
x0 x1 xn−1
n−1

f0.x/ , 2 ∑ fi .x/ , fn.x/

[ ]
n−1

=
h
f0.x/ , 2 ∑ f i.x/ , fn.x/ =.+
b−a /
i=1
2 i=1 width +
2n
average height

3
. b−a /
Error analysis is then: Ea = − 2 f ' ' .0/
-
12n
n

∑ f ' ' . 0i /
i=1
f ' ' .0 / =
where -
n
Computer Algorithms for the Trapezoidal Rule
Question 21.1

Analytically and
by trapezoid rule

You might also like