Vous êtes sur la page 1sur 19

Matakuliah : METODE NUMERIK I

Tahun : 2008

Integrasi
Pertemuan 7
INTEGRASI NUMERIK
Pengertian:
Secara matematika merupakan anti derivative
dI ( x)
 g ( x)  I ( x)   g ( x)dx
dx
Secara praktis integral suatu fungsi pada batas tertentu dapat diartikan
sebagai luas daerah dibawah kurva dengan batas yang ditentukan dan
sumbu x
y
g(x)
x2

I ( x)   g ( x)dx
x1 x1 x2 x
Bina Nusantara
Numerical Integration
• Often g(x) cannot be integrated analytically to give a closed form
expression for I(x), e.g. solution to y’ =(1+xy).
• Motivates need to find approximate solutions for I(x).
• In the differential limit, an integral is equivalent to a summation
operation:
x2 x2

 g ( x)dx  lim  g ( x)x


x1
x 0
x1

• Approximate methods for determining integrals are mostly based


on idea of area between integrand and axis.
• Area determined by the summation of the areas of “strips” of
finite width x.
• Particular method depends on how “strips” are determined.
Bina Nusantara
Numerical Integration by Rectangular Method

• g(x) is approximated by a constant value over the finite distance x.

g(x)

x1 x2 x

•xAreas
2 of rectangles summed to give approximation of integral.
 g ( x)dx  x( g ( x )  g ( x
x1
1 1  x)    g ( x 2  x))
x2  x1
x 
n
Bina Nusantara
Integration as a Weighted Sum of Sample Function Evaluations

Think of integration as the weighted sum of function evaluations at


axnumber
2 of discrete sample points, c.f. interpolation.

 g ( x)dx  w g ( x )  w g ( x
x1
1 1 2 1  x)    wn g ( x2  x)

e.g. rectangular method: w1  w2   wn  x

Weights for rectangular method sum to give integration interval:


nx  x2  x1
Bina Nusantara
Contoh
1
(0  1)

x2
Hitung e dxuntuk n=8, maka x   0,125
0
8
( 0 ,125) 2 ( 0 , 25) 2
I ( f )  0,125(e  e
0
e  ...  e ( 0,875) )  1,36232

Latihan:
Menggunakan Metode Rectangular hitung hasil integral di atas
untuk n=10

Bina Nusantara
Trapeziodal Method

• Trapezoidal method – top of each strip varies linearly to give


trapezoids: g(x)
Ok for
Area of trapezoid =
smooth
g ( x1 )  g ( x1  x)
x. functions and
2
small intervals

x1 x2 x

• Weighted sum of function evaluations at sample points.


x2
x
x g ( x)dx  2 g ( x1 )  xg ( x1  x)   Weights sum
1 to
x
Bina Nusantara
 xg ( x2  x)  g ( x2 )give x2-x1.
Formula Trapezoida Komposit dan Error
n 1
h
Rumus Komposit
T ( f )  ( )[ f ( x1 )  f ( x2 )  2 f ( x j )]
2 j 1

1 2
Error RT ( f )  ( )h ( x2  x1 ) f ' ' (  )
12
Dimana: x1≤  ≤ x 2

Bina Nusantara
Contoh:
1 (0  1)
e
x2
Hitung dx Untuk n=8 h
8
 0,125
0

n 1
h
T ( f )  ( )[ f ( x1 )  f ( x2 )  2 f ( x j )]
2 j 1

( 0,125 ) 2 ( 0, 25 ) 2 ( 0, 375 ) 2 ( 0,875 ) 2


I( f )  0,125
2
[e  e  2(e
0 1
e e  ...  e )]
I(f)= 1,469712

Bina Nusantara
Metode Simpson
• Simpson’s method – top of each pair of strips varies quadratically :
g(x)
x Exact for
Evaluate in centre
polynomials up to
also – 3 points to get
order 3
polynomial

x
• Weighted sum of function evaluations at sample points.
 x 3 
x2  g ( x )  4 g ( x  )  2 g ( x   x )  4 g ( x  x ) 
x  1 1
2
1 1
2 
x g ( x ) dx 
6  x 
1
    2 g ( x 2  x )  4 g ( x 2  )  g ( x 2 ) 
 2 
Bina Nusantara
Weights sum to give x2-x1.
Rumus Simpson’s Komposit
Integral dari
b
I ( f )   f ( x)dx  s ( f )
a

m 1 m
h
S ( f )  ( )[ f (a)  f (b)  2 f ( xxj )  4 f ( x2 j 1 )]
3 j 1 j 1

Error: Rs(f)=-(h4/180)(b-a)f(4)()

Dimana n = 2m, h=(b-a)/n, a≤ ≤b

Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara

Vous aimerez peut-être aussi