Document 15040893

advertisement
Matakuliah : METODE NUMERIK I
Tahun
: 2008
Pengintegralan Numerik (lanjutan)
Pertemuan 10
Integrasi
IIntegrasi
b
 f ( x )dx
a
Proses mencari luas di
bawah suatu curva.
I 
y
f(x)
b

f ( x )dx
a
Where:
f(x) is the integrand
a= lower limit of integration
b= upper limit of integration
Bina Nusantara
a
b
x
Aturan Kuadrat Gauss
Previously, the Trapezoidal Rule was developed by the method
of undetermined coefficients. The result of that development is
summarized below.
b
 f ( x )dx  c1 f ( a )  c2 f ( b )
a

Bina Nusantara
ba
ba
f(a)
f (b)
2
2
Aturan Kuadrat Gauss
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 )  a0  a1 x  a2 x 2  a3 x 3 .
Hence
2
3
 f ( x )dx   a0  a1 x  a2 x  a3 x dx
b
b
a
a
b

x
x
x 
 a0 x  a1
 a2
 a3 
2
3
4 a

2
3
4
 b2  a2 
 b3  a3 
 b4  a4 
  a 2 
  a3 

 a0 b  a   a1 
 2 
 3 
 4 
Bina Nusantara
Aturan Kuadrat Gauss
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
a
Equating Equations the two previous two expressions yield
 b2  a2 
 b3  a3 
 b4  a4 
  a 2 
  a3 

a0 b  a   a1 
 2 
 3 
 4 

 
 c x   a c x
 c1 a0  a1 x1  a2 x1  a3 x1  c2 a0  a1 x2  a2 x2  a3 x2
2
 a0 c1  c2   a1 c1 x1
Bina Nusantara
3
2 2
2
1 1
2
2


3

 c2 x2  a3 c1 x1  c2 x2
2
3
3


Aturan Kuadrat Gauss
Since the constants a0, a1, a2, a3 are arbitrary
b  a  c1  c2
b3  a 3
2
2
 c1 x1  c2 x2
3
Bina Nusantara
b2  a2
 c1 x1  c 2 x 2
2
b4  a4
3
3
 c1 x1  c 2 x 2
4
Aturan Kuadrat Gauss
The previous four simultaneous nonlinear Equations have
only one acceptable solution,
 b  a  1  b  a
x1  
   
3
2
 2 
ba
c1 
2
Bina Nusantara
 b  a  1  b  a
x2  
  
2
 2  3 
ba
c2 
2
Aturan Kuadrat Gauss
Hence Two-Point Gaussian Quadrature Rule
b
 f ( x )dx 
a
b  a b  a 1  b  a b  a b  a 1  b  a
c1 f  x1   c2 f  x2 
f
f


  
 
2  2  3 2  2  2  3 2 
Bina Nusantara
Aturan Kuadrat Gauss dengan n titik
b
 f ( x )dx  c1 f ( x1 )  c2 f ( x2 )  c3 f ( x3 )
a
Dinamakan kuadrat Gauss dengan 3 titik
The coefficients c1, c2, and c3, and the functional arguments x1, x2, and x3
are calculated by assuming the formula gives exact expressions for
integrating a fifth order polynomial
2
3
4
5
 a0  a1 x  a2 x  a3 x  a4 x  a5 x dx
b
a
General n-point rules would approximate the integral
b
 f ( x )dx  c1 f ( x1 )  c2 f ( x2 )  . . . . . . .  cn f ( xn )
a
Bina Nusantara
Arguments and Weighing Factors for n-point Gauss
Quadrature Formulas
Table 1: Weighting factors c and function
arguments x used in Gauss Quadrature
Formulas.
In handbooks, coefficients and
arguments given for n-point
Points
Gauss Quadrature Rule are
given for integrals
1
n
1
i 1
 g ( x )dx   ci g ( xi )
as shown in Table 1.
Bina Nusantara
Weighting
Factors
Function
Arguments
2
c1 = 1.000000000
c2 = 1.000000000
x1 = -0.577350269
x2 = 0.577350269
3
c1 = 0.555555556
c2 = 0.888888889
c3 = 0.555555556
x1 = -0.774596669
x2 = 0.000000000
x3 = 0.774596669
4
c1 = 0.347854845
c2 = 0.652145155
c3 = 0.652145155
c4 = 0.347854845
x1 = -0.861136312
x2 = -0.339981044
x3 = 0.861136312
x4 = 0.339981044
Arguments and Weighing Factors for n-point Gauss Quadrature Formulas
Table 1 (cont.) : Weighting factors c and function arguments x used in
Gauss Quadrature Formulas.
Points
Bina Nusantara
Weighting
Factors
Function
Arguments
5
c1 = 0.236926885
c2 = 0.478628670
c3 = 0.568888889
c4 = 0.478628670
c5 = 0.236926885
x1 = -0.906179846
x2 = -0.538469310
x3 = 0.000000000
x4 = 0.538469310
x5 = 0.906179846
6
c1 = 0.171324492
c2 = 0.360761573
c3 = 0.467913935
c4 = 0.467913935
c5 = 0.360761573
c6 = 0.171324492
x1 = -0.932469514
x2 = -0.661209386
x3 = -0.171324492
x4 = 0.171324492
x5 = 0.661209386
x6 = 0.932469514
Arguments and Weighing Factors for n-point Gauss Quadrature
Formulas
So if the table is given for
1
 g ( x )dx
integrals, how does one solve
1
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
a , b
Let
x  mt  c
Bina Nusantara
If
x  a,
then
t  1
If
x  b,
then
t 1
Such that:
ba
m
2
Arguments and Weighing Factors for n-point Gauss Quadrature
Formulas
Then
ba
c
2
ba ba
x
t
2
2
Hence
ba
dx 
dt
2
Substituting our values of x, and dx into the integral gives us
b  ab  a
b  a
f
(
x
)
dx

f
x

dx


 
2  2
a
1  2
b
Bina Nusantara
1
Contoh 1
For an integral
Rule.
b
 f ( x )dx ,
derive the one-point Gaussian Quadrature
a
Solution
The one-point Gaussian Quadrature Rule is
b
 f ( x )dx  c1 f  x1 
a
Bina Nusantara
Solution
Assuming the formula gives exact values for integrals
1
 1dx ,
1
 xdx ,
and
1
1
b
 1dx  b  a  c1
a
Since
c1  b  a ,
b2  a2
( b  a )x1 
2
Bina Nusantara
b2  a2
 c1 x1
 xdx 
2
a
b
the other equation becomes
ba
x1 
2
Solution (cont.)
Therefore, one-point Gauss Quadrature Rule can be expressed as
b  a

 f ( x )dx  ( b  a ) f 
 2 
a
b
Bina Nusantara
Contoh 2
Use two-point Gauss Quadrature Rule to approximate the distance
a)
covered by a rocket from t=8 to t=30 as given by
140000




x    2000 ln 

9
.
8
t
dt

140000  2100t 

8
30
Find the true error,
b)
E t for part (a).
Also, find the absolute relative true error,  a for part (a).
Bina Nusantara
Solution
First, change the limits of integration from [8,30] to [-1,1]
by previous relations as follows
30  8 1  30  8
30  8 
f
(
t
)
dt

f
x

dx

 
2 1  2
2 
8
30
1
 11  f 11x  19 dx
1
Bina Nusantara
Solution (cont)
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
Bina Nusantara
Solution (cont.)
Now we can use the Gauss Quadrature formula
1
11  f 11x  19 dx  11c1 f 11x1  19   11c 2 f 11x 2  19 
1
 11 f 11( 0.5773503 )  19  11 f 11( 0.5773503 )  19
 11 f ( 12.64915 )  11 f ( 25.35085 )
 11( 296.8317 )  11( 708.4811 )
 11058.44 m
Bina Nusantara
Solution (cont)
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
Bina Nusantara
Solution (cont)
b) The true error,
Et
, is
Et  True Value  Approximate Value
 11061.34 11058.44
c)
The absolute relative true error,
t 
t
, is (Exact value = 11061.34m)
11061.34  11058.44
 100%
11061.34
 0.0262%
Bina Nusantara
 2.9000 m
Integral Romberg
Romberg Integration is an extrapolation formula of
the Trapezoidal Rule for integration. It provides a better
approximation of the integral by reducing the True Error.
Bina Nusantara
Integral Romberg
Romberg integration is same as Richardson’s
extrapolation formula as given previously. However,
Romberg used a recursive algorithm for the
extrapolation. Recall
TV  I 2 n
I 2n  I n

3
This can alternately be written as
I 2n R  I 2n
Bina Nusantara
I 2n  I n

3
 I 2n
I 2n  I n
 21
4 1
Integral Romberg
Determine another integral value with further halving
the step size (doubling the number of segments),
I 4 n R  I 4n
I 4n  I 2n

3
It follows from the two previous expressions
that the true value TV can be written as
TV   I 4 n  R 
I 4n R  I 2n R
15
 I 4 n R   I 2 n R
 I 4n 
431  1
Bina Nusantara
Integral Romberg
A general expression for Romberg integration can be
written as
I k 1, j 1  I k 1, j
I k , j  I k 1, j 1 
,k  2
k 1
4 1
The index k represents the order of extrapolation.
k=1 represents the values obtained from the regular
Trapezoidal rule, k=2 represents values obtained using the
true estimate as O(h2). The index j represents the more and
less accurate estimate of the integral.
Bina Nusantara
Contoh 2
A company advertises that every roll of toilet paper has at
least 250 sheets. The probability that there are 250 or more
sheets in the toilet paper is given by

P( y  250)   0.3515 e
0.3881( y 252.2 )2
250
dy
Approximating the above integral as
270
P( y  250)   0.3515 e
250
0.3881( y 252.2 )2
dy
Use Romberg’s rule to find the probability. Use the 1, 2, 4, and
8-segment Trapezoidal rule results as given.
Bina Nusantara
Solution
From Table 1, the needed values from original
Trapezoidal rule are
I 1,1  0.53721
I 1, 2  0.26861
I 1,3  0.21814
I 1, 4  0.95767
where the above four values correspond to using 1, 2,
4 and 8 segment Trapezoidal rule, respectively.
Bina Nusantara
Penyelesaian (lanjutan)
To get the first order extrapolation values,
I 2 ,1  I1,2 
I 1,3  I 1, 2
Bina Nusantara
I 2,3  I 1, 4 
3
0.21814  0.26861
 0.21814 
3
 0.20132
3
0.26861  0.53721
 0.26861 
3
Similarly,
I 2, 2  I 1,3 
I1,2  I1,1
 0.95767 
 0.17908
I 1, 4  I 1,3
3
0.95767  0.21814
3
 1.2042
Penyelesaian (lanjutan)
For the second order extrapolation values,
I 3,1  I 2, 2 
I 2, 2  I 2,1
15
0.20132  0.17908
 0.20132 
15
Similarly,
I 3, 2  I 2 , 3 
 1.2042 
Bina Nusantara
I 2,3  I 2, 2
15
1.2042  0.20132
15
 1.2711
 0.20280
Penyelesaian (lanjutan)
For the third order extrapolation values,
I 4,1  I 3, 2 
I 3, 2  I 3,1
63
1.2711  0.20280
 1.2711 
63
 1.2881
Table 3 shows these increased correct values in a tree
graph.
Bina Nusantara
Solution (cont.)
Table 3: Improved estimates of the integral value using Romberg Integration
1st Order
1-segment
2nd Order
3rd Order
0.53721
0.17908
2-segment
0.20280
0.26861
1.2881
0.20132
4-segment
1.2711
0.21814
1.2042
8-segment
Bina Nusantara
0.95767
Soal Latihan
1
dx
Hitunglah 
2
1 x
0
Menggunakan
a. Aturan Trapezoidal pada segmen (n) = 2, 4,
6,dan 8
b. Kuadratur Gauss untuk 2 dan 4 titik
c. Integral Romberg (gunakan hasil a)
Bina Nusantara
Download