Upload
jeff-hardy
View
56
Download
1
Embed Size (px)
DESCRIPTION
a
Citation preview
1
http://numericalmethods.eng.usf.edu
NUMERICAL INTEGRATION:
NEWTON COTE’s FORMULAS
GROUP MEMBERSMuhammad Saad Qureshi
Athar Minallah Faizan ShahidArslan AhmedNajam Tariq
2
http://numericalmethods.eng.usf.edu
LIST OF TOPICS TO BE COVERED
Trapezoidal Rule & its Error Analysis Simpson’s 1/3 Rule & its Error AnalysisSimpson’s 3/8 Rule & its Error Analysis
EXAMPLES !
What is Numerical Integration
b
adx)x(fI
Integration:
3
The process of measuring the area under a function plotted on a graph.
Where: f(x) is the integranda= lower limit of integrationb= upper limit of integration
f(x)
a b
b
a
dx)x(f
y
x
Newton cote’s integration
formula
Trapezoidal Rule
SAAD QURESHI…
Basis of Trapezoidal Rule
b
a
dxxfI )( )x(f)x(f n
Trapezoidal Rule is based on the Newton-Cotes Formula that states if one can approximate the integrand as an nth order polynomial…
http://numericalmethods.eng.
usf.edu5
where
nn
nnn xaxa...xaa)x(f
1110and
Basis of Trapezoidal Rule
b
an
b
a)x(f)x(f
Then the integral of that function is approximated by the integral of that nth
order polynomial.
http://numericalmethods.eng.
usf.edu6
Trapezoidal Rule assumes n=1, that is, the area under the linear polynomial,
2)b(f)a(f)ab(
b
adx)x(f
Derivation of the Trapezoidal
Rule
7
Method Derived From
Geometry
8
The area under the curve is a trapezoid. The integral
trapezoidofAreadxxfb
a
)(
))((21 widthAvgheight
)ab()a(f)b(f 21
2)b(f)a(f)ab(
Figure 2: Geometric Representation
f(x)
a b
b
a
dx)x(f1
y
x
f1(x)
Example 1The vertical distance covered by a rocket from t=8 to t=30 seconds is given by:
9
30
8
892100140000
1400002000 dtt.t
lnx
a) Use single segment Trapezoidal rule to find the distance covered.
b) Find the true error, for part (a).c) Find the absolute relative true error, for part (a).
tEa
10
Solution
2
)()()( bfafabI
a)8a 30b
t.t
ln)t(f 892100140000
1400002000
)(.)(
ln)(f 88982100140000
14000020008
)(.)(
ln)(f 3089302100140000
140000200030
s/m.27177
s/m.67901
2
6790127177830 ..)(I
11
Solution (cont)
m11868
a)
b)The exact value of the above integral is
30
8
892100140000
1400002000 dtt.t
lnx m11061
12
Solution (cont)b) ValueeApproximatValueTrueEt
1186811061
m807
c) The absolute relative true error, , would be t
10011061
1186811061
t %.29597
13
Multiple Segment Trapezoidal Rule
f(x)
a b
y
x
4aba
42 aba
4
3 aba
Figure 4: Multiple (n=4) Segment Trapezoidal Rule
Divide into equal segments as shown in Figure 4. Then the width of each segment is:
n
abh
The integral I is:
b
adx)x(fI
14
Multiple Segment Trapezoidal Rule
b
h)n(a
h)n(a
h)n(a
ha
ha
ha
a
dx)x(fdx)x(f...dx)x(fdx)x(f1
1
2
2
The integral I can be broken into h integrals as:
b
adx)x(f
Applying Trapezoidal rule on each segment gives:
b
adx)x(f
)b(f)iha(f)a(f
nab n
i
1
12
2
15
Example 2The vertical distance covered by a rocket from to seconds is given by:
30
889
21001400001400002000 dtt.
tlnx
a) Use two-segment Trapezoidal rule to find the distance covered.
b) Find the true error, for part (a).c) Find the absolute relative true error, for part (a).
atE
16
Solutiona) The solution using 2-segment Trapezoidal rule is
)b(f)iha(f)a(f
nabI
n
i
1
12
2
2n 8a 30b
2830
n
abh 11
17
Solution (cont)
)(f)iha(f)(f
)(I
i3028
22830 12
1
)(f)(f)(f 3019284
22
6790175484227177422 .).(.
m11266
Then:
18
Solution (cont)
30
8
892100140000
1400002000 dtt.t
lnx m11061
b) The exact value of the above integral is
so the true error is
ValueeApproximatValueTrueEt
1126611061
Newton cote’s integration
formula
Error Analysis of Trapezoidal Rule
ATHAR MINALLAH…
20
The error of the composite trapezoidal rule is
the difference between the value of the integral and the numerical result
The error can be written as
There exixt a number ξ between a and b
http://numericalmethods.eng.usf.e
du
Error analysis of Trapezoidal rule
21
Example on Error Analysis
http://numericalmethods.eng.usf.e
du
Newton cote’s integration
formula
Simpson’s 1/3 Rule
FAIZAN SHAHID…
Simpson's rule also corresponds to the three-point Newton
Cote’s Quadrature Rule. The method is credited to the mathematician Thomas
Simpson (1710–1761) of Leicestershire, England. Kepler used similar formulas over 100 years prior. For this
reason the method is sometimes called Kepler's rule. Simpson’s 1/3rd rule is an extension of Trapezoidal rule and a
further improvement. Instead of approximating the curve by a straight line, we
approximate it by a quadratic or cubic function.
Introduction:
Simpson’s 1/3rd rule is an extension of Trapezoidal rule
where the integrand is approximated by a second order polynomial.
Hence we show below the basic mathematical background by showing that,
Where is a second order polynomial.
Mathematical Explanation:
b
a
b
a
dxxfdxxfI )()( 2
22102 xaxaa)x(f
mathematical explanation: (Simple Or Single Segment
Case)Choose
)),a(f,a( ,baf,ba
22))b(f,b(and
as the three points of the function to evaluate a0, a1 and a2. 2
2102 aaaaa)a(f)a(f 2
2102 2222
baabaaabafbaf
22102 babaa)b(f)b(f
Solving the previous equations for a0, a1 and a2 give
22
22
0 22
4
baba
)a(fb)a(abfbaabf)b(abf)b(faa
221 22
4332
4
baba
)b(bfbabf)a(bf)b(afbaaf)a(afa
222 22
22
baba
)b(fbaf)a(fa
mathematical explanation: (Simple Or Single Segment Case)
Then
b
adx)x(fI 2
b
adxxaxaa 2
210
b
a
xaxaxa
32
3
2
2
10
32
33
2
22
10abaaba)ab(a
Substituting values of a0, a1, a 2 give
)b(fbaf)a(fabdx)x(fb
a 24
62
Since for Simpson’s 1/3rd Rule, the interval [a, b] is broken into 2 segments, the segment width
2abh
)b(fbaf)a(fhdx)x(fb
a 24
32
Hence
Consider the definite integral in interval [1,2].
Solve for using Simpson's 1/3 rule for function by using simple or 2 segment case:
SOLUTION: We know that for two segment case, the Simpson’s 1/3 Rule is known as,
Where, it is given:
Example: (Simple Or two Segment
Case)
Now, we calculate as,
So, putting in the values,
Example: (Simple Or two Segment
Case)
Just like in multiple segment Trapezoidal Rule, one can subdivide the interval [a, b] into n segments and apply Simpson’s 1/3rd Rule repeatedly overevery two segments. Note that n needs to be even. Divide interval [a, b] intoequal segments, hence the segment width. Where,
mathematical explanation: (multiple Segment Case)
nabh
nx
x
b
adx)x(fdx)x(f
0
ax 0 bxn
Apply Simpson’s 1/3rd Rule over each interval,
...)x(f)x(f)x(f)xx(dx)x(fb
a
64 210
02
...)x(f)x(f)x(f)xx(
64 432
24
f(x)
. . .
x0 x2 xn
-2
xn
x
.....dx)x(fdx)x(fdx)x(fx
x
x
x
b
a
4
2
2
0
n
n
n
n
x
x
x
xdx)x(fdx)x(f....
2
2
4
mathematical explanation:
(multiple Segment Case)...)x(f)x(f)x(f)xx(... nnn
nn
64 234
42
64 12
2)x(f)x(f)x(f)xx( nnn
nn
Since hxx ii 22 n...,,,i 42
Then
...)x(f)x(f)x(fhdx)x(fb
a
6
42 210
...)x(f)x(f)x(fh
642 432
...)x(f)x(f)x(fh nnn
642 234
642 12 )x(f)x(f)x(fh nnn
mathematical explanation:
(multiple Segment Case)
b
adx)x(f ...)x(f...)x(f)x(f)x(fh
n 1310 43
)}]()(...)()(2... 242 nn xfxfxfxf
)()(2)(4)(3
2
2
1
10 n
n
evenii
i
n
oddii
i xfxfxfxfh
)()(2)(4)(3
2
2
1
10 n
n
evenii
i
n
oddii
i xfxfxfxfnab
Consider the definite integral in interval [1,2].
Solve for using Simpson's 1/3 rule for function by using 6 segments:
SOLUTION: We know that for multiple segment case, the Simpson’s 1/3 Rule is known as,
Where,
example: (multiple Segment Case)
)()(2)(4)(3
2
2
1
10 n
n
evenii
i
n
oddii
i xfxfxfxfh
We know that,
Calculating points and their function values,
example: (multiple Segment Case)
POINTS: FUNCTION VALUES:
Putting the values in the function,
example: (multiple Segment Case)
In the Trapezoid rule method, we start with
rectangular area-elements and replace their horizontal-line tops with slanted lines. The area-elements used to approximate, say, the area under the graph of a function and above a closed interval then become trapezoids. Simpson’s method replaces the slanted-line tops with parabolas.
Simpson’s rule approximations usually achieve a given level of accuracy faster. Simpson’s rule is indeed much better than the Trapezoid rule. As n → ∞ it generally converges much more rapidly to the value of the definite integral than does the Trapezoid rule.
The main dis-advantage of the Simpson’s rule is its conceptualization and derivation marginally more difficult.
Advantages & Dis-Advantages:
Newton cote’s integration
formula
Simpson’s 3/8 Rule
ARSLAN AHMED…
Formula
using matrixes using lagrange interpolation
Not to discuss here
Derivation
composite simpson 3/8 rule for multiple segments
http://numericalmethods.eng.
usf.edu40
Example 1 (Single Simpson rule)
Compute
30
8,8.9
2100000,140000,140ln2000
b
adxx
xI
by using a single segment Simpson 3/8 ruleSolution
In this example:3333.7
3830
3
abh
83
http://numericalmethods.eng.
usf.edu41
2667.17788.982100140000
140000ln20008 00
xfx
4629.3723333.158.93333.152100140000
140000ln2000
3333.153333.78
1
01
xf
hxx
http://numericalmethods.eng.
usf.edu42
8976.6086666.228.96666.222100140000
140000ln2000
6666.22)3333.7(282
2
02
xf
hxx
6740.901308.9302100140000
140000ln2000
30)3333.7(383
3
03
xf
hxx
http://numericalmethods.eng.
usf.edu43
Applying Eq. (12), one has:
3104.11063
6740.9018976.60834629.37232667.1773333.783
I
I
The “exact” answer can be computed as
34.11061exactI
http://numericalmethods.eng.
usf.edu44
Example 2 (Multiple segments Simpson rule)
Compute
30
8,8.9
2100000,140000,140ln2000
b
adxx
xI
using Simple multiple segments rule, with number (of ) segments = = 6 (which corresponds to 2
“big” segments).""h n
83
83
http://numericalmethods.eng.
usf.edu45
SolutionIn this example, one has (see Eq. 14):
6666.36
830
h
2667.177,8, 00 xfx
6666.11
6666.38;4104.270,6666.11, 0111
hxxwherexfx
3333.152;4629.372,3333.15, 0222 hxxwherexfx
193;7455.484,19, 0333 hxxwherexfx
http://numericalmethods.eng.
usf.edu46
6666.224;8976.608,6666.22, 0444 hxxwherexfx
3333.265;9870.746,3333.26, 0555 hxxwherexfx
306;6740.901,30, 0666 hxxwherexfx
http://numericalmethods.eng.
usf.edu47
Applying Eq. (17), one obtains:
6740.9012332667.1776666.3
83 33
,..6,3
51
,..5,2
42
,..4,1
n
ii
n
ii
n
ii xfxfxfI
6740.9017455.4842
9870.7464629.37238976.6084104.27032667.1773750.1I
4696.601,11I
http://numericalmethods.eng.
usf.edu48
ruleSimpson
hxxhxxhxx
hxxax
31
5714.201429.34844286.171429.33832857.141429.3282
1429.111429.3818
04
03
02
01
0
301429.3787
8571.261429.36867143.231429.3585
07
06
05
hxxhxxhxx
http://numericalmethods.eng.
usf.edu49
2667.17788.982100000,140
000,140ln200080
xf
Similarly: 6740.901
9978.7678260.6463909.5362749.4353241.342
5863.2561429.11
7
6
5
4
3
2
1
xfxfxfxfxfxfxf
http://numericalmethods.eng.
usf.edu50
For multiple segments segmentsfirstn 41 using Simpson rule, one obtains (See Eq. 19):
1197.4364
3909.5363241.34222749.4355863.25642667.1773
1429.3
243
1
1
22
,...2
31
,...3,101 1
11
I
I
xfxfxfxfhI n
n
ii
n
ii
31
http://numericalmethods.eng.
usf.edu51
For multiple segmentsusing Simpson 3/8 rule, one obtains (See Eq. 17):
segmentslastn 32
2748.6697
2749.435!3241.34235863.25632667.1771429.383
23383
2
2
03
,...6,3
21
,...2
12
,...3,102 1
222
I
skipI
xfxfxfxfxfhI n
n
ii
n
ii
n
ii
The mixed (combined) Simpson 1/3 and 3/8 rules give:
3946.061,112748.66971197.436421
IIII
http://numericalmethods.eng.
usf.edu52
Remarks:(a) Comparing the truncated error of Simpson 1/3 rule
fabEt
2880
5
With Simple 3/8 rule (See Eq. 13), the latter seems to offer slightly more accurate answer than the former. However, the cost associated with Simpson 3/8 rule (using 3rd order polynomial function) is significant
higher than the one associated with Simpson 1/3 rule (using 2nd order polynomial function).
(18)
http://numericalmethods.eng.
usf.edu53
(b) The number of multiple segments that can be used in the conjunction with Simpson 1/3 rule is 2,4,6,8,..
(any even numbers).
n
n
ii
n
ii
nnn
xfxfxfxfhI
xfxfxfxfxfxfxfxfxfhI
2
...6,4,2
1
,...3,102
124322101
243
4.....443
(19)
http://numericalmethods.eng.
usf.edu54
However, Simpson 3/8 rule can be used with the number of segments equal to 3,6,9,12,.. (can be
either certain odd or even numbers).
(c) If the user wishes to use, say 7 segments, then the mixed Simpson 1/3 rule (for the first 4 segments),
and Simpson 3/8 rule (for the last 3 segments).