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

Chapter 5 - Numerical Integration

This document discusses numerical integration methods including trapezoidal rule and Simpson's rule. It provides examples of using each method to calculate the integral of a function from 1 to 2 and compares the results to the true value. For trapezoidal rule, dividing the interval into 4 parts results in an error between 0.001302 and 0.0101126. For Simpson's rule, the error is between 0.0000215 and 0.00052, demonstrating its higher accuracy compared to trapezoidal rule. Both methods produce results within the calculated error bounds, validating the numerical integration approaches.

Uploaded by

aben777
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views

Chapter 5 - Numerical Integration

This document discusses numerical integration methods including trapezoidal rule and Simpson's rule. It provides examples of using each method to calculate the integral of a function from 1 to 2 and compares the results to the true value. For trapezoidal rule, dividing the interval into 4 parts results in an error between 0.001302 and 0.0101126. For Simpson's rule, the error is between 0.0000215 and 0.00052, demonstrating its higher accuracy compared to trapezoidal rule. Both methods produce results within the calculated error bounds, validating the numerical integration approaches.

Uploaded by

aben777
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

CHAPTER 5 NUMERICAL INTEGRATION

Prepared by:
Engr. Romano A. Gabrillo
MEngg - MfgE
INTRODUCTION
Engineers and scientist are frequently faced
with the problem of differentiating or integrating
functions which are defined in a tabular or
graphical form rather than as explicit functions.

Sometimes there are certain explicit functions
which are difficult to integrate in terms of
elementary functions. One simple example is:
v = dx/dt
where v=velocity; x=distance; t=time
METHODS FOR SOLVING NUMERICAL
INTEGRATION
One can resort to number integration if:
1. F(x) is not known as a closed form but specified
only at discrete points.
2. F(x) is expressed analytically but cannot be
integrated in a closed form. In this chapter the
following methods for numerical integration will
be discussed:
1. Trapezoidal Rule
2. Simpsons Rule

TRAPEZOIDAL RULE
This is based on linear interpolation formula
of Newtons forward difference using First
order Newtons forward difference
y = y
0
+ y
0
T + Error
= y
0
+ y
0
T + f

() h
2
T(T-1)
2
Integrating both sides: (See Figure 1)
} }
)
`

+ A + = =
1
0
1
0
2
' '
0 0
) 1 (
2
) (
x
x
dT T T h
f
T y y h ydx I

FIGURE 1
Substituting for y
0
as (y
1
+ y
0
) in the
above equation we get:



) 6 / 1 (
2
) (
2
2
2
3
3
2
) (
2
' ' 2
1
0
2
0
0
1
0
2 ' ' 2
0
0
+
(

A
+ =
(

|
.
|

\
|
+
A
+ =

f h T y
y h I
T T h f T y
T y h
Error Local y y
h
I
f h y y
y h I
+ + =


+ =
] [
2
12
) (
2
1 0
' ' 2
0 1
0

HENCE, IF WE INTEGREATE A FUNCTION BY
TRAPEZOIDAL RULE WE GET:
Upper and lower bound for the error can be
found out by substituting upper and lower
bound values for f

().
| ) ( |
12
| |
] [
2
' '
2
1 0
f
h
error local the and
y y
h
I
=
+ =
COMPOSITE INTEGRATION FORMULA
(TRAPEZOIDAL)
One way to reduce the error associated with a
low order integration formula is to subdivide the
interval of integration a, b into smaller intervals
and to use the trapezoidal rule separately on
each sub interval.

Repeated application of lower order formula is
preferred to the single application of higher
order formula, partly because of the simplicity of
the low order formulae and partly because of
computational difficulties.
TO GET I BY TRAPEZOIDAL RULE FROM X
0
X
N
,
WE GET I FOR EACH SUBINTERVAL SUCH AS
(x
0
x
1
), (x
1
x
2
)and add them.
( ) ( )
( ) ( )
( ) ( )
( ) { }] ........ 2 [ 2 /
:
); ( 12 / ] [ 2 /
); ( 12 / ] [ 2 /
); ( 12 / ] [ 2 /
1
2 1 0
1
' ' 3
1
2 1
' ' 3
2 1
1 0
' ' 3
1 0
0
1
2 1
1 0

+ + + = =
< < + =
< < + =
< < + =

n n x x T
n n n n x x
x x
x x
y y y y y h I I
Adding
X X f h y y h I
X X f h y y h I
X X f h y y h I
n
n n



GLOBAL ERROR
) ( ) (
12
' '
0
2
f x x
h
n
=
The global error accumulated in n steps in
going from x
0
to x
n
is known as global Error
nh
3

SIMPSONS RULE
Simpsons Rule is based on quadratic
interpolation function between three points.
The quadratic interpolation function may be
written as:
In the equation above after
2
y
0
we have
written two terms because the fourth
term vanishes on integration.
) 3 )( 2 )( 1 (
24
) 2 )( 1 (
6
) 1 (
2
0
4
0
3
0
2
0 0

A
+
A
+
A
+ A + = T T T T
y
T T T
y
T T
y
y y y
(

+
A
+
A
+ A + =
)
`


A
+
A
+ A + =

A
+
A
+ A + =
} }
) (
90
) 0 (
6
) 3 / 2 (
2
2 2
) 3 )( 2 )( 1 (
24
)...... 1 (
2
) 3 )( 2 )( 1 (
24
)..... 1 (
2
4
4
0
3
0
2
0 0
2
0
0
4
0
2
0 0
0
4
0
2
0 0
2
0
f
h y y
y y h
dT T T T T
y
T T
y
y y h ydx
T T T T
y
T T
y
y y y
x
x
SUBSTITUTING FOR
| |
(

+ + =
+ + =
+ = A A
2 1 0
2 1 0
0 1 2 0
2
0 1 0
6
1
6
4
6
1
2 /
4 3 /
2
y y y L I
L as h f or ng Substituti
y y y h I
get we y y y y and y y as y
COMPOSITE INTEGRATION FORMULA
The interval x
n
x
0
must be divided into even
number of intervals so as to apply Simpsons
Rule
| | ( )
| | ( )
| | ( )
| |
) ( ) (
180
:
........) ( 2 ) .... ( 4 ) 3 / (
:
;
90
4 ) 3 / (
... ... ... ... ...
;
90
4 ) 3 / (
;
90
4 ) 3 / (
0
4
6 4 2 1 3 1 0
2
5
1 2
4 2
5
1 3 2
2 0
5
2 1 0
0
2
4 2
2 0




IV
n
n n x x S
n n
IV
n n n x x
IV
x x
IV
x x
f x x
h
Error Global
y y y y y y y y h I I
Adding
x x f
h
y y y h I
x x f
h
y y y h I
x x f
h
y y y h I
n
n n
=
+ + + + + + + = =
s s + + + =
s s + + + =
s s + + + =

EXAMPLE NO. 1
Integrate using a) trapezoidal rule b)
Simpsons rule and also compute error bounds


Using trapezoidal rule where h is divided by 4
parts.




dx x
}
2
1
/ 1
| | Value True x dx x x f = = = =
}
6931471 . 0 log / 1 ) (
2
1
2
1
| |
6970238 . 0
) 5714285 . 0 6667 . 0 8 . 0 ( 2 5 . 0 1
2
25 . 0
=
+ + + + =
T
I
TABLE 1
x f(x) T
1 1 0
1.25 0.8 1
1.5 0.66667 2
1.75 0.5714265 3
2.0 0.5 4
Actual error
= |true value numerically computed value|
= 0.003876
BY USING TRAPEZOIDAL RULE
Global Error = h
2
/12 (x
n
x
0
) f

()
f(x)= 2/x
3

f() max = 2/1
3
=2
f() min = 2/2
3
= 0.25
Error Upper Bound
= 0.25
2
(2-1)(2) = 0.010426
12
Error Lower Bound
= 0.25
2
(2-1)(0.25) = 0.001302
12

0.001302<0.003876<0.0101126

Therefore the answer is acceptable!
BY SIMPSONS RULE
I
S
= 0.25[1+0.5+4(0.8+0.5714285)+2(0.6667)]
3
= 0.6932595

By using Simpsons Rule the Global Error
= h
4
(x
n
x
0
) f
IV
()
180
f
IV
(x) = 24/x
5

x=1; f
IV
() max = 24/1
5
= 24
x=2; f
IV
() max = 24/2
5
= 0.75
UPPER BOUND FOR THE ERROR
= (0.25)
4
x (2-1) x 24 = 0.00052

180



LOWER BOUND FOR THE ERROR
= (0.25)
4
x (2-1) x 0.75 = 0.0000215

180



BUT ACTUAL ERROR BY SIMPSONS RULE
= 0.6931471 0.6932595 = 0.000107

0.0000215 < 0.000107 < 0.00052

lower bound error < actual error < upper bound
error

Therefore the final answer is acceptable
END OF CHAPTER 5
End of Module
Laboratory Experiments starts next week up to
end of June
Project submission is also at the end of June
Final Exam
June 7, 2013 (Friday Afternoon) (To be confirmed)
Coverage
Chapter 4-5
Thanks for listening!

You might also like