Metnum-Teori Integrasi Trapesium Simpson
Transcript of Metnum-Teori Integrasi Trapesium Simpson
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
1/38
1
POKOK BAHASANINTEGRASI NUMERIK
-Metode Trapesium
- Metode Simpson
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
2/38
Pengantar•
Pengintegralan numerik merupakan alat ataucara yang digunakan oleh ilmuwan untukmemperoleh awa!an hampiran "aprok#ima#i$dari pengintegralan yang tidak dapat
di#ele#aikan #ecara analitik%• Metode integra#i numerik di!edakan&
'% Metode Newton Cotes & dida#arkan padapenggantian (ung#i yang komplek# atau ta!el
data dengan (ung#i polinomial #ederhana yangmudah diintegralkan%
)% Metode Gauss & untuk mengintegralkan(ung#i "tidak ta!el data$
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
3/38
Dasar Pengintegralan Numerik
Penjumlahan berbobot dari nilai ungsi
x 0 x 1 x n x n-1 x
f ( x ) )(...)()(
)()(
1100
0
nn
i
n
i
i
b
a
x f c x f c x f c
x f cdx x f
+++=
≈∑∫ =
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
4/38
Melakukan pengintegralan pada !agian*!agian kecil+
#eperti #aat awal !elaar integral , penumlahan !agian*!agian%
Metode Numerik hanya menco!a untuk le!ih cepat danle!ih mendekati awa!an ek#ak%
Dasar PengintegralanNumerik
0
2
4
6
8
10
12
3 5 7 9 11 13 15
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
5/38
Formula Newton-Cotes
- Berdasarkan pada
Nilai hampiran f ( x ) dengan polinomial
Dasar PengintegralanNumerik
dx x f dx x f I b
a n
b
a ∫≅ )()(
n
n
1n
1n10n x a x a x aa x f )(
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
6/38
f n ( x ) !i#a (ung#i linear
f n ( x ) !i#a (ung#i kuadrat
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
7/38
f n ( x ) !i#a uga (ung#i ku!ik
atau polinomial yang le!ihtinggi
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
8/38
Polinomial dapat dida#arkan padadata
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
9/38
!ormula Newton"Cotes Aturan Trape#ium & -inier
Aturan Simp#on.# '/0 & Kuadrat Aturan Simp#on.# 0/1 & Ku!ik
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
10/38
Aturan #ra$esium
A$roksimasi garis lurus %linier&
x 0 x 1 x
f ( x )
L(x)
)()(
)()()()(
10
1100i
1
0i
i
b
a
x f x f 2
h
x f c x f c x f cdx x f
∑
=
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
11/38
Aturan Kom$osisi#ra$esium
x 0 x 1 x
f ( x )
x 2h h x 3h h x 4
)()()()()(
)()()()()()(
)()()()(
n1ni 10
n1n2110
x
x
x
x
x
x
b
a
x f x f 2 x 2f x f 2 x f
2
h
x f x f 2
h x f x f
2
h x f x f
2
h
dx x f dx x f dx x f dx x f
n
1n
2
1
1
0
∫
n
abh
=
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
12/38
function f = example1(x)
% a = 0, b = pi
f=x.^2.*sin(2*x);
Aturan Kom$osisi#ra$esium
dx x 2sin x 02
)(
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
13/38
» a=0; b=pi; dx=(b-a)100;
» x=a!dx!b; "=example1(x);
» #=t$ap(example1,a,b,1)
# =
-&.''0e-01
» #=t$ap(example1,a,b,2)
# =
-1.2&e-01» #=t$ap(example1,a,b,)
# =
-&.+'+
» #=t$ap(example1,a,b,+)
# =
-.'+
» #=t$ap(example1,a,b,1)# =
-.+'12
» #=t$ap(example1,a,b,&2)
# =
-.1+
» #=t$ap(example1,a,b,)
# =
-.&0+
» #=t$ap(example1,a,b,12+)
# =
-.&&+
» #=t$ap(example1,a,b,2)
# = -.&
» #=t$ap(example1,a,b,12)
# =
-.&'
» #=t$ap(example1,a,b,102)
# =
-.&+» =uad+(example1,a,b)
=
-.&+ MATLABfunction
Aturan Kom$osisi#ra$esium
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
14/38
n = 2
I = -1.4239 e-15
Exact = -4. 9348
dx x 2sin x 0
2 )(∫
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
15/38
n = 4
I = -3.8758
E!a = -4. 9348
dx x 2sin x 0
2 )(∫
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
16/38
n = 8
I = -4."785
E!a = -4. 9348
dx x 2sin x 0
2 )(∫
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
17/38
n = 1"
I = -4.8712
E!a = -4. 9348
dx x 2sin x 0
2 )(∫
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
18/38
•
Hitung integral dari
Aturan Kom$osisi#ra$esium
dx xe I 4
0
x 2
∫
#..)().().(
).().()(.$
#..)().(
)().()().(
)().()(.$
#..)()(
)()()($
#..)()()($
#..)()($
66 2 9553554 f 753 f 253 f 2
50 f 2250 f 20 f 2
h I 250h16 n
5010 76 57644 f 53 f 2
3 f 252 f 22 f 251 f 2
1 f 250 f 20 f 2
h I 50h8n
7139 7972884 f 3 f 2
2 f 21 f 20 f 2
h I 1h4n
75132 23121424 f 2 f 20 f 2
h I 2h2n
12357 66 23847 4 f 0 f 2
h I 4h1n
At K i i
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
19/38
» x=0!0.0!; "=example2(x);
» x1=0!!; "1=example2(x1);
» x2=0!2!; "2=example2(x2);» x&=0!1!; "&=example2(x&);
» x=0!0.!; "=example2(x);
» /=plot(x,",x1,"1,-*,x2,"2,$-s,x&,"&,c-o,x,",m-d);
» set(/,ineidt3,&,4a$5e$6i7e,12);
» xlabel(x); "label("); title(f(x) = x exp(2x));
» #=t$ap(example2,0,,1)# = 2.&++e800» #=t$ap(example2,0,,2)# = 1.212e800» #=t$ap(example2,0,,)
# = '.2+++e800&» #=t$ap(example2,0,,+)# = .'+e800&» #=t$ap(example2,0,,1)# = .&e800&
Aturan Kom$osisi#ra$esium
At K i i
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
20/38
Aturan Kom$osisi#ra$esium
dx xe I 4
0
x 2
∫
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
21/38
21
POKOK BAHASANINTEGRASI NUMERIK
-
Metode Trapesium- Metode Simpson
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
22/38
Aturan Sim$son
Menggunakan $olinomial order
lebih tinggi untuk menghubungkantitik"titik'
Sim$son ()* digunakan $olinomial
order + %$arabola& ,ang melalui *titik'
x 0 x 1 x
f ( x )
x 2h h
L( x )
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
23/38
Aturan Sim$son
Aturan Sim$son *)- . Bila terda$at +
titik tambahan dengan jarak ,angsama antara %a& sd %b&/ makakeem$at titik tsb dihubungkandengan $olinomial order tiga'
x 0 x 1 x
f(x)
x 2h h
L(x)
x 3h
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
24/38
Aturan Sim$son ()*
A$roksimasi dengan ungsi
$arabola
x 0 x 1 x
f ( x )
x 2h h
L( x )
)()()(
)()()()()(
210
221100i
2
0i
i
b
a
x f x f 4 x f 3
h
x f c x f c x f c x f cdx x f
∑
=
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
25/38
Ingatkah Interpola#i Polinomial-agrange2
• Secara umum order n&
3rder )&
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
26/38
Aturan Sim$son ()*.$olinomial lagrange order + ,ang melalui * titik
x 0
x 1
x
f ( x )
x 2
h h
L( x )
=
=
===
=
=
1 x x
0 x x
1 x x
h
dx d
h
x x
2
abh
2ba x b x a x let
x f x x x x
x x x x
x f x x x x
x x x x x f x x x x
x x x x x L
2
1
0
1
120
2
1202
10
1
2101
200
2010
21
ξ
ξ
ξ
ξ$$
$$
)())((
))((
)())((
))(()())((
))(()(
)()(
)()()()(
)(21
2
0
x f 2
1 x f 1 x f
2
1 L
=
ξ
ξξ
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
27/38
Aturan Sim$son ()*
)(
)(
)()()(
)(
)( 212
0 x f 2
1
x f 1 x f 2
1
L
=
ξ
ξξ
1
1
23
2
1
1
3
1
1
1
23
0
1
12
1
0
2
1
1
10
1
1
)23
(2
)(
)3
()()23
(2
)(
)1(2)()1)(
)1(2
)()()(
−
−−
−
−−
++
−+−=
++−+
−=≈
∫ ∫
∫ ∫ ∫
ξ ξ h x f
ξ ξ h x f
ξ ξ h x f
dξ ξ ξ
h
x f dξ ξ ( h x f
dξ ξ ξ h
x f dξ Lhdx x f b
a
ξ
)()()()( 210b
a
x f x f 4 x f 3
hdx x f
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
28/38
Aturan Kom$osisi Sim$son
x 0 x 2 x
f ( x )
x 4h h x n-2h x n
%...
h x 3 x 1 x n-1
n
abh
=
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
29/38
Hitung integral dari
• n = 2, h = 2
• n = 4, h = 1
Aturan Kom$osisiSim$son
dx xe I 4
0
x 2
∫
#..
)()()(
)()()()()(
708 9755670
e4e34e22e403
1
4 f 3 f 42 f 21 f 40 f 3h I
86 42
#..)(
)()()(
96 57 4118240e4e24032
4 f 2 f 40 f 3
h I
84
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
30/38
Aturan Sim$son *)-
A$roksimasi dengan ungsi kubik
x 0 x 1 x
f(x)
x 2h h
L(x)
x 3h
)()()()(
)()()()()()(
3210
33221100i
3
0i
i
b
a
x f x f 3 x f 3 x f 8
h3
x f c x f c x f c x f c x f cdx x f
∑
=
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
31/38
Ingatkah Interpola#i Polinomial-agrange2
• Secara umum order n&
3rder 0&
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
32/38
E&&o& 'eena*an
Aturan Sim$son *)-
x 0 x 1
f(x)
x 2h h
L(x)
x 3h
)())()((
))()(()(
))()((
))()((
)())()((
))()(()(
))()((
))()(()(
3
231303
2102
321202
310
1
312101
3200
302010
321
x f x x x x x x
x x x x x x x f
x x x x x x
x x x x x x
x f x x x x x x
x x x x x x x f
x x x x x x
x x x x x x x L
=
)()()()( 3210
b
a
b
a
x f x f 3 x f 3 x f 8
h3
3abh ; L(x)dx f(x)dx
=
∫
3
abh ; f
6480
ab f h
80
3 E 4
545
t
= )()(
)( )()(
ξ
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
33/38
Hitung integral dari
Aturan Sim$son ()*
Aturan Sim$son *)-
Aturan Sim$son *)-
dx xe4
0
x 2
∫
#..
..
.)(
)()()(
96 57 926 5216
4118240926 5216
4118240e4e240
3
2
4 f 2 f 40 f 3
hdx xe I
84
4
0
x 2
=
=
∫
71 !30926 !5216
209 !6819926 !5216
209 !6819832 !11923 )33933 !552( 3 )18922 !19( 308
)4"3( 3
)4( f )3
8( f 3 )
3
4( f 3 )0( f
8
h3dx xe I
4
0
x 2
=
=
∫
At K i i
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
34/38
function # = 6imp(f, a, b, n)
% inte$al of f usin composite 6impson $ule
% n must be e9en
3 = (b - a)n;
6 = fe9al(f,a);
fo$ i = 1 ! 2 ! n-1 x(i) = a 8 3*i;
6 = 6 8 *fe9al(f, x(i));
end
fo$ i = 2 ! 2 ! n-2 x(i) = a 8 3*i;
6 = 6 8 2*fe9al(f, x(i));
end
6 = 6 8 fe9al(f, b); # = 3*6&;
Aturan Kom$osisiSim$son
At Si
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
35/38
Aturan Sim$son
Aturan Kom$osisi
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
36/38
Aturan Kom$osisiSim$son
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
37/38
MA#0AB !un1tion+ t$ap7
» x=:0 1 1. 2.0 2. &.0 &.& &. &.+ &. .0
x =
-
8/18/2019 Metnum-Teori Integrasi Trapesium Simpson
38/38
Sumber.
http&//cepro(#%tamu%edu/hchen/c4en05)/chap'6%ppt