Professional Documents
Culture Documents
http://numericalmethods.eng.usf.edu
What is Integration?
f(x)
y
Integration
TWO-POINT GAUSSIAN
QUADRATURE RULE
http://numericalmethods.eng.usf.edu
Basis of the Gaussian Quadrature Rule
5
The four unknowns x1, x2, c1 and c2 are found by assuming that
the formula gives exact results for integrating a general third
order polynomial, f ( x ) a a x a x 2 a x 3 .
0 1 2 3
Hence
a a
b
x 2
x x 3 4
a0 x a1 a 2 a3
2 3 4 a
b2 a2 b3 a3 b4 a4
a0 b a a1 a 2 a3
2 3 4
Basis of the Gaussian
Quadrature Rule
6
It follows that
b
f ( x )dx c1 a0 a1 x1 a2 x1 a3 x1 c2 a0 a1 x2 a2 x2 a3 x2
2 3 2 3
b2 a2 b3 a3 b4 a4
a0 b a a1 a 2 a3
2 3 4
2
c1 a0 a1 x1 a2 x1 a3 x1 c2 a0 a1 x2 a2 x2 a3 x2
3 2 3
a0 c1 c2 a1 c1 x1 c x a c x
c2 x2 a3 c1 x1 c2 x2
2 2 3 3
2 2 2 1 1
http://numericalmethods.eng.usf.edu
Basis of Gauss Quadrature
7
b a 1 b a b a 1 b a
x1 x2
2 3 2 2 3 2
ba ba
c1 c2
2 2
http://numericalmethods.eng.usf.edu
Basis of Gauss Quadrature
8
http://numericalmethods.eng.usf.edu
9
http://numericalmethods.eng.usf.edu
Higher Point Gaussian Quadrature Formulas
10
f ( x)dx c f ( x ) c
a
1 1 2 f ( x2 ) c3 f ( x3 )
a0 a1 x a2 x a3 x a4 x a5 x dx
b
2 3 4 5
http://numericalmethods.eng.usf.edu
Arguments and Weighing Factors for n-point Gauss
Quadrature Formulas
12
http://numericalmethods.eng.usf.edu
Arguments and Weighing Factors for n-point Gauss
Quadrature13 Formulas
1
So if the table is given for g ( x )dx integrals, how does one solve
1
a , b
b
f ( x )dx ? The answer lies in that any integral with limits of
a
can be converted into an integral with limits 1, 1 Let
x mt c
If x a, then t 1
Such that:
If x b, then t 1
ba
m
2
http://numericalmethods.eng.usf.edu
Arguments and Weighing Factors for n-point Gauss
Quadrature Formulas
14
ba baba
b 1
a
f ( x )dx 1 2
f t
2 2
dt
http://numericalmethods.eng.usf.edu
Example 1
15
b
For an integral f ( x )dx , derive the one-point Gaussian Quadrature
a
Rule.
Solution
The one-point Gaussian Quadrature Rule is
b
f ( x )dx c1 f x1
a
http://numericalmethods.eng.usf.edu
Solution
The two unknowns x1, and c1 are found by assuming that the
formula gives exact results for integrating a general first order
polynomial,
f ( x ) a0 a1 x.
b b
f ( x)dx a
a a
0 a1 x dx
b
x2
a 0 x a1
2 a
b2 a 2
a0 b a a1
2
16 http://numericalmethods.eng.usf.edu
Solution
It follows that
b
f ( x)dx c a
a
1 0 a1 x1
b2 a 2
a0 b a a1 c1 a0 a1 x1 a0 (c1 ) a1 (c1 x1 )
2
17 http://numericalmethods.eng.usf.edu
Basis of the Gaussian Quadrature Rule
b a c1
b2 a 2
c1 x1
2
giving
c1 b a
ba
x1
2
18 http://numericalmethods.eng.usf.edu
Solution
ba
b
f ( x)dx c1 f x1 (b a ) f
a 2
19 http://numericalmethods.eng.usf.edu
Example 2
20
30
140000
x 2000 ln 9.8t dt
8 140000 2100t
c) Also, find the absolute relative true error, a for part (a).
http://numericalmethods.eng.usf.edu
Solution
21
30
30 8 1 30 8 30 8
f ( t )dt
f x dx
8 2 1 2 2
1
11 f 11x 19 dx
1
http://numericalmethods.eng.usf.edu
Solution (cont)
22
Next, get weighting factors and function argument values from Table 1
for the two point rule,
c1 1.000000000
x1 0.577350269
c2 1.000000000
x2 0.577350269
http://numericalmethods.eng.usf.edu
Solution (cont.)
23
1
11 f 11x 19 dx 11c1 f 11x1 19 11c 2 f 11x 2 19
1
http://numericalmethods.eng.usf.edu
Solution (cont)
24
since
140000
f ( 12.64915 ) 2000 ln 9.8( 12.64915 )
140000 2100( 12.64915 )
296.8317
140000
f ( 25.35085 ) 2000 ln 9.8( 25.35085 )
140000 2100( 25.35085 )
708.4811
http://numericalmethods.eng.usf.edu
Solution (cont)
25
11061.34 11058.44
t 100%
11061.34
0.0262%
http://numericalmethods.eng.usf.edu
Derivation of the Trapezoidal Rule
Method Derived From Geometry
27
f ( x )dx
1
f(x)
curve is a trapezoid.
The integral
b
f ( x)dx Area of
a
trapezoid
f1(x)
1
( Sum of parallel sides )( height )
2
1
f ( b ) f ( a )( b a )
2
f ( a ) f ( b )
( b a ) a b x
2
Figure 2: Geometric Representation
http://numericalmethods.eng.usf.edu
Algoritma Metode Integrasi Trapezoida
Definisikan y=f(x)
Tentukan batas bawah (a) dan batas atas integrasi (b)
Tentukan jumlah pembagi n
Hitung h=(b-a)/n
Hitung
h n 1
L f 0 2 f i f n
2 i 1
Example
30
140000
x 2000 ln 9.8t dt
8 140000 2100t
30
140000
x 2000 ln 9.8t dt
8 140000 2100t
f ( a ) f ( b )
a) I ( b a )
2
a 8 b 30
140000
f ( t ) 2000 ln 9.8t
140000 2100t
140000
f ( 8 ) 2000 ln 9.8( 8 ) 177.27 m / s
140000 2100( 8 )
140000
f ( 30 ) 2000 ln 9.8( 30 ) 901.67 m / s
140000 2100( 30 )
http://numericalmethods.eng.usf.edu
Solution (cont)
32
177.27 901.67
a) I ( 30 8 )
2
11868 m
30
140000
x 2000 ln 9.8t dt 11061 m
8 140000 2100t
http://numericalmethods.eng.usf.edu
Solution (cont)
33
11061 11868
t 100 7.2959%
11061
http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
34
In Example 1, the true error using single segment trapezoidal rule was
large. We can divide the interval [8,30] into [8,19] and [19,30] intervals
and apply Trapezoidal rule over each segment.
140000
f ( t ) 2000 ln 9.8t
140000 2100t
30 19 30
f ( 8 ) f ( 19 ) f ( 19 ) f ( 30 )
( 19 8 ) ( 30 19 )
2 2
http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
35
With
f ( 8 ) 177.27 m / s
f ( 30 ) 901.67 m / s
f ( 19 ) 484.75 m / s
Hence:
8
f (t )dt (19 8)
2 ( 30 19) 2
11266 m
http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
36
http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
37
y
f(x)
Divide into equal segments
as shown in Figure 4. Then
the width of each segment is:
ba
h
n
The integral I is:
b
I f ( x )dx
a a
ba ba ba b x
a a2 a3
4 4 4
http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
38
b
ba n 1
f ( x )dx f ( a ) 2 f ( a ih ) f ( b )
a 2n i 1
http://numericalmethods.eng.usf.edu
Example 2
39
http://numericalmethods.eng.usf.edu
Solution
40
ba n 1
I f ( a ) 2 f ( a ih ) f ( b )
2n i 1
n2 a 8 b 30
ba 30 8
h 11
n 2
http://numericalmethods.eng.usf.edu
Solution (cont)
41
Then:
30 8 2 1
I f ( 8 ) 2 f ( a ih ) f ( 30 )
2( 2 ) i 1
22
f ( 8 ) 2 f ( 19 ) f ( 30 )
4
22
177.27 2( 484.75 ) 901.67
4
11266 m
http://numericalmethods.eng.usf.edu
Solution (cont)
42
30
140000
x 2000 ln 9.8t dt 11061 m
8 140000 2100t
11061 11266
http://numericalmethods.eng.usf.edu
Solution (cont)
43
True Error
t 100
True Value
11061 11266
100
11061
1.8534%
http://numericalmethods.eng.usf.edu
Solution (cont)
44
http://numericalmethods.eng.usf.edu