0% found this document useful (0 votes)
53 views36 pages

CE324 Module 9 10 Numerical Integration

Uploaded by

Abellez
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)
53 views36 pages

CE324 Module 9 10 Numerical Integration

Uploaded by

Abellez
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/ 36

CPE324:

NUMERICAL
SOLUTIONS TO CE
PROBLEMS
NUMERICAL
INTEGRATION

PREPARED BY: Engr. David Uriel Jayson B. Bas


NUMERICAL
INTEGRATION

9.1 Trapezoidal Method

9.2 Simpson’s Rule


OBJECTIVES/
INTENDED LEARNING OUTCOMES

• Understand the concept of Numerical integration


methods such as Trapezoidal, and Simpsons.

• Compute for the approximation of Integrals using


Trapezoidal, and Simpsons.
NUMERICAL
INTEGRATION
– the process of measuring b

f ( x )dx
the area under a function y
a

f(x)

plotted on a graph.

b
I f ( x )dx
a
Where:
f(x) = the integrand
a b x
a = lower limit of
integration
b = upper limit of
NUMERICAL
INTEGRATION
-Simpler functions use integration to find area under the
curve of the graph.

-More complex functions require only estimating the


value by splitting the area under the graph separately
with use of many variable known as Numerical
Methods for
Quadrature. Solving Numerical Integration
• Trapezoidal Method
• Simpsons Rule
• Gauss Quadrature.
TRAPEZOIDAL RULE

– considered to be 𝑦2 𝑦 𝑛−2
the simplest 𝑦1 𝑦𝑛
method of
𝑦0 𝑦 𝑛−1
numerical
integration.

– In this method,
the value of is
approximated by
adding the areas
of series of
TRAPEZOIDAL RULE

– Single Segment, for – Multiple Segment,


for

[ ] ( )[ 𝑓 ( 𝑎) +2 ∑ 𝑦 + 𝑓 (𝑏)]
𝑏 𝑏 𝑛− 1
𝑓 ( 𝑎) + 𝑓 (𝑏) h
∫ 𝑓 (𝑥 )𝑑𝑥 ≈(𝑏 − 𝑎) ∫ 𝑓 (𝑥 )𝑑𝑥 ≈ 2 𝑖
𝑎 2 𝑎 𝑖=1
where,
TRAPEZOIDAL RULE

Basis of Trapezoidal Rule


– based on the Newton-Cotes Formula that states if one can
approximate the integrand as an nth order polynomial…

b
I f ( x )dx where f ( x )  fn( x )
a
,

n 1 n
and f n ( x ) a0  a1 x  ...  an  1 x  an x
TRAPEZOIDAL RULE

Basis of Trapezoidal Rule


– Then the integral of that function is approximated by the
integral of that bnth orderb polynomial.
f ( x ) f n ( x )
a a
– Trapezoidal Rule assumes n=1, that is, the area under the

[ ]
linear polynomial,
𝑏
𝑓 (𝑎)+ 𝑓 (𝑏)
∫ 𝑓 (𝑥)𝑑𝑥 ≈(𝑏− 𝑎) 2
𝑎
TRAPEZOIDAL RULE

Derivation of Trapezoidal Rule

By definition, the integral can be approximated as:


𝑏 𝑛 b1 b2
𝐼=∫ 𝑓 (𝑥)𝑑𝑥 ≈ ∑ 𝐴𝑖
𝑎 𝑖=1

From plane geometry, h


the area of a single
h = altitude
trapezoid is equal to: b1, b2 = measurement of
1
𝐴= h ( 𝑏1 +𝑏 2 ) bases
2
TRAPEZOIDAL RULE

From plane geometry, the area of a single trapezoid is equal to:

1 𝑦 𝑛−2
𝐴= h ( 𝑏1 +𝑏 2 ) 𝑦2
2 𝑦1 𝑦𝑛

Area of each individual 𝑦0 𝑦 𝑛−1


trapezoid in the figure
1
𝐴 1= h ( 𝑦 0 + 𝑦 1 )
2
1
𝐴 2= h ( 𝑦1+ 𝑦2)
2

1
𝐴 𝑛= h ( 𝑦 𝑛 −1 + 𝑦 𝑛 )
2
TRAPEZOIDAL RULE

Taking the sum of the areas:


𝑏 𝑛
1 1 1 1
∫ 𝑓 ( 𝑥 ) 𝑑𝑥 ≈ ∑ 𝐴𝑖 = h ( 𝑦 0 + 𝑦 1 ) + h ( 𝑦 1 +𝑦 2 ) +…+ h ( 𝑦 𝑛−2 + 𝑦 𝑛−1 ) + h ( 𝑦 𝑛−1 +𝑦 𝑛 )
2 2 2 2
𝑎 𝑖=1
𝑏 𝑛
1
∫ 𝑓 ( 𝑥 ) 𝑑𝑥 ≈ ∑ 𝐴𝑖 = h [ 𝑦 0 +2 𝑦 1 +2 𝑦 2+…+2 𝑦 𝑛−1 + 𝑦 𝑛 ]
2
𝑎 𝑖=1
𝑏 𝑛
1
∫ 𝑓 ( 𝑥 ) 𝑑𝑥 ≈ ∑ 𝐴𝑖 = h [ 𝑦 0 +2 ( 𝑦 1 +𝑦 2+…+ 𝑦 𝑛−1 ) + 𝑦 𝑛 ]
2
𝑎 𝑖=1

( )[ ]
𝑏 𝑛− 1
Let +…+. Thus, the formula for h
∫ 𝑓 ( 𝑥 ) 𝑑𝑥 ≈ 2 𝑦 0 +2 ∑ 𝑦 𝑖 + 𝑦 𝑛
Trapezoidal rule is: 𝑎 𝑖=1

,
TRAPEZOIDAL RULE

EXAMPLE 1:
Determine the value of

a. Using the analytical method.


b. Using the trapezoidal rule ().
c. True Error
d. Percentage Relative True Error
TRAPEZOIDAL RULE

EXAMPLE 1:
a. Analytical Calculation
From rules of Thus:
integration:
TRAPEZOIDAL RULE

EXAMPLE 1:
b. Trapezoidal Method
Solve for the value of h: 1 1

4 16

Solve for the values of to : 7 49


= =1
10 100
= =16
= =49
= =100
TRAPEZOIDAL RULE

EXAMPLE 1:
b. Trapezoidal Method

Solve for the approx. value: Solve for the summation:


TRAPEZOIDAL RULE

EXAMPLE 1:
b. Trapezoidal Method

Solve for the approx. value:


TRAPEZOIDAL RULE

EXAMPLE 1:
c. True Error

Solve for the true error:


TRAPEZOIDAL RULE

EXAMPLE 1:
d. Percentage Relative True Error
Solve for the percentage relative true error:
TRAPEZOIDAL RULE

EXAMPLE 2:
Determine the value of

a. Using the analytical method.


b. Using the trapezoidal rule (n=10).
c. True Error
d. Percentage Relative True Error
TRAPEZOIDAL RULE

EXAMPLE 2:
a. Analytical Calculation
From rules of integration:

Thus:
TRAPEZOIDAL RULE

EXAMPLE 2: 1 8
b. Trapezoidal Method 1.5 26.375
2 65.5
Solve for the value of h:
2.5 131.825
3 232
3.5 372.7321

=
Solve for the values of to : 4 560.75

=
4.5 802.7917
5 1105.6
5.5 1475.9205
6 1920.5
TRAPEZOIDAL RULE

EXAMPLE 2:

( )[ ]
𝑏 𝑛− 1
b. Trapezoidal Method h
∫ 𝑓 ( 𝑥
Solve for the approx. value:
) 𝑑𝑥 ≈
2
𝑦 0 +2 ∑ 𝑦 𝑖 + 𝑦 𝑛
𝑎 𝑖=1
Solve for the summation:
+…+
TRAPEZOIDAL RULE

EXAMPLE 2:
b. Trapezoidal Method

Solve for the approx. value:


TRAPEZOIDAL RULE

EXAMPLE 2:
c. True Error

Solve for the true error:


TRAPEZOIDAL RULE

EXAMPLE 2:
d. Percentage Relative True Error
Solve for the percentage relative true error:
SIMPSONS’S RULE

– Simpson’s Rule is one of the closed forms of the Newton-


Cotes formulas.

– The closed forms are those where the data points at the
beginning and end of the limits of integration are known.

Two Simpson’s Rules


1. 1/3 Rule
2. 3/8 Rule
SIMPSONS’S RULE

Simpson’s 1/3 Rule


 Depth (h), interval (n) and
bases (f(xn)) similar to
trapezoidal rule

 Assume the areas separated


to be Parabola instead of
trapezoid

 For number of
segments/interval is even,
employ
SIMPSONS’S RULE

Simpson’s 1/3 Rule


Simpson’s 1/3 rule approximation formula uses a single
parabola requiring 3 data points, i.e. a minimum of 2
segments should be applied with the step size computed
as:

Hence, the simplified Simpson’s 1/3 rule formula,


SIMPSONS’S RULE

Simpson’s 1/3 Rule


Final equation derived from the figure:

fxo = your starting point


fx1 = the first interval after that point (multiplier of 4)
fx2 = the second interval (alternating multiplier of 2)
fx3 = the third interval (alternating multiplier of 4)
fxn-1= odd number of segment before finishing point (multiplier of 4)
fxn = your finishing point
SIMPSONS’S RULE

Simpson’s 3/8 Rule


 Interval (n) and bases (f(xn)) similar to
trapezoidal rule
 Assume the areas separated to be
Parabola instead of trapezoid

 For number of segments/interval is


odd, employ for remaining three (3)
segments.

 Depth is )
SIMPSONS’S RULE

Simpson’s 3/8 Rule


Simpson’s 3/8 rule transforms the complicated function into
a third order polynomial to further improve the
approximation by fitting four of the discrete points. The
technique requires a minimum of 3 segments, hence the
formula can be simplified as

Hence, the simplified Simpson’s 3/8 rule formula,


SIMPSONS’S RULE

Simpson’s 3/8 Rule


Final equation derived from the figure:

fxo = your starting point (endpoint of 1/3 rule if solution is in conjunction with
both rule)
fx1 = the first interval after that point
fx2 = the second interval
fx3 = the odd end interval
SIMPSONS’S RULE

EXAMPLE 1:
Use Simpson’s Rule with 6 intervals to estimate the definite
integral of

Solution:
6 intervals = even, then use 1/3 rule only

Then: x0 = 1 (start) ; x1 = 2 ; x2 = 3 ; x3 = 4 ; x4 = 5; x5
= 6 ; x6 = 7 (end point)
SIMPSONS’S RULE

EXAMPLE 1:
Solution:
=

= 49.594832
THANKS!
Do you have any
questions?

You might also like