Anda di halaman 1dari 19

a) Hitung nilai 3 polinomial Lagrange derajat 2 (L 2,0, L2,1

dan L2,2) pada x = 1.7; x0 = 0.0, x1 = 1.0 dan x2 = 2.0. quadratic, n = 2


x0 = 1.40
x1 =
x2 = 1.20

k= 1.00
x
1 0.80
1.2 0.60
Ln,k(x)...
1.4
1.6 0.40
1.8
0.20
2
2.2 0.00
2.4
-0.20
2.6
2.8 -0.40
3
-0.60
2.7
1 1.2 1.
2.7
2.7
b) Hitung nilai interpolasi Polinomial Lagrange derajat 2
pada titik x = 1.7 dengan data nilai fungsi di titik 0, 1
dan 2 sbb:
No.
0
1
2

Lagrange Interpolation, n = 2
f(x) = 1/x
take three points
x0 =
x1 =
x2 =
k=
x
10
12
14
16
18
20
22
24
26
28
30
27
10
20
30
1.40 1
2
1.20
3
1.00 0 1 2
L2,0(x) L2,1(x) L2,2(x)
0.80 1.00 0.00 0.00
0.60 0.72 0.36 -0.08 L2,0(x)
Ln,k(x)...
0.48 0.64 -0.12 L2,1(x)
0.40 0.28 0.84 -0.12 L2,2(x)
0.12 0.96 -0.08
0.20 Row 20
0.00 1.00 0.00
0.00 -0.08 0.96 0.12
-0.12 0.84 0.28
-0.20
-0.12 0.64 0.48
-0.40 -0.08 0.36 0.72
0.00 0.00 1.00
-0.60
-0.105 0.510 0.595
1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3

3.50 x

3.00

x y
2.50
10 1.54
20 3.25
2.00
30 2.33

ange Interpolation, n = 2 1.50


the function to be approximated
1.00
10 1.54
20 3.25 0.50
30 2.33
0 1 0.00
2 0 1 2
L2,0(x) L2,1(x) L2,2(x) f(x10
0
)L2,0(x)12 14f(x1)L16
2,1
(x) 18 f(x
202)L2,2(x)
22 24 26 28
1.00 0.00 0.00 1.54 0.00 0.00
0.72 0.36 -0.08 1.11 1.17 -0.19
0.48 0.64 -0.12 0.74 2.08 -0.28
0.28 0.84 -0.12 0.43 2.73 -0.28
0.12 0.96 -0.08 0.18 3.12 -0.19
0.00 1.00 0.00 0.00 3.25 0.00
-0.08 0.96 0.12 -0.12 3.12 0.28
-0.12 0.84 0.28 -0.18 2.73 0.65
-0.12 0.64 0.48 -0.18 2.08 1.12
-0.08 0.36 0.72 -0.12 1.17 1.68
0.00 0.00 1.00 0.00 0.00 2.33
-0.11 0.51 0.60 -0.162 1.658 1.386
3

Pn(x)
2.882
Column J

22 24 26 Pn(x)
28 30
1.54
2.09
2.54
2.88
3.12
3.25
3.28
3.20
3.01
2.72
2.33
2.882
1.54
3.25
2.33
a) Hitung dan bandingkan pendekatan nilai turunan f (x) 0.8x1.5 0.2 cos
fungsi di bawah ini pada titik x = 0.31 dengan skema f '(x) 1.2 x0.5 sin 5x
diferensi mundur, diferensi maju dan diferensi tengah.
Gunakan h atau x = 0.01
h=
location
x-h =
x=
x+h =

bacward dif
central dif
forward dif

analitic sol

b) Gunakan polinomial interpolasi Lagrange derajat 2


untuk mendekati nilai turunan fungsi tersebut seperti
pada soal butir 2.a. Buatlah titik-titik bantu yang
diperlukan dengan jarak 0.01 dari titik yang
bersangkutan
xi, i=0,1,2
x0
x1
x2

a =
b =
c =
d =
x
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
x) 0.8x1.5 0.2 cos 5x
x) 1.2 x0.5 sin 5x

0.01
x f(x)
0.30 0.1456009
0.31 0.1422395
0.32 0.1389756

f'(x) num error


-0.336133 -1.351%
-0.331264 -0.1169%
-0.326396 -1.585%
f'(x) anal
-0.331652041 yg grey untuk cek saja

f(x) Ni'(x) at x1 f(x) Ni'(x)


0.30 0.1456009 -50 -7.280042707
0.31 0.1422395 0 0
0.32 0.1389756 50 6.948778216 +
f'(x) num = -0.33126449
0.8 error = -0.1169%
1.5
0.2
5
f(x)
0.200 0.900
0.201 0.800
0.180 0.700
0.146 0.600
0.119 0.500
0.123 0.400
0.174 0.300
0.281
0.200
0.442
0.100
0.641
0.000
0.857
0 0.2 0.4
f(x)

f(x)

0.2 0.4 0.6 0.8 1 1.2


a) Dekati integral fungsi pada soal No 2 butir a) di antara
titik x = 0.0 dan titik x = 0.8 dengan metode trapesium
x
f(x) 0.8x 0.2 cos 5x
1.5 0
0.8

0.8


0.8
f (x)dx 0.32x2.5 0.04sin 5x
0.0
0.0

b)Hitung soal pada butir a) dengan metode Gauss


derajat 2.

x
0

0.4
f ( x ) 0 . 8 x 1 .5 0 . 2 c o s 5 x
0.8


0.8 0.0 z 0.8 0.0 0.8
1.5
1 1
f z dz 0.8 2


0.2 cos 5

1 1

f z 0.28284 0.8z 0.8 0.2 cos 2z 2 0.4


1.5

0.2828427125
0.5
0.45
0.4
f(x) integral x f(x)
0.2 0.25668187 0 0.2 0.037961464 0.35
0.441704678 0.2 0.179614636 0.029877104 0.3
0.4 0.119156403 0.02929643 0.25
0.6 0.173807902 0.061551258 0.2
0.8 0.441704678
0.15
0.8 0.1529065889 0.15868626
0.1
0 0-
analytic sol = 0.15290659 0.05
0
0 0.1 0.2 0.3

Gauss sampling points


f(x) z f(z) w Coef w f(z)
0.2 -1 0.08
-0.577350269 0.075324477 1 0.075324477
0.119156403 0 0.047662561
0.5773502692 0.080380215 1 0.080380215
0.441704678 1 0.176681871
0.15570469


0.8 0.0 z 0.8 0.0
1.5
.0 0.8 0.0
0.2 cos 5 dz
2 2

2z 2 0.4

2
0.5
45
0.4
35
0.3
25
0.2
15
0.1
05
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8

Gauss derajat 3
-0.774596669 0.555555556 0.080670917 0.04481718
0 0.888888889 0.047662561 0.04236672
0.774596669 0.555555556 0.117930909 0.06551717
+ 0.1527011
GunakanmetodeEulerdanRungeKuttaorde2untukmendekatisolusisoalberikutpada
t=0.8.Bandingkanhasilnya,tuliskomentarsaudara/Use the Euler and 2nd Orde Runge-
Kutta Method to approximate the solutions of the following initial value problems at t =
0.8, compare the results (give your comment)

y(0) = 1 1st Oder


h= 0.2
i t wi f(ti,wi) wi+1
0 0 1 0 1
1 0.2 1 0.62 1.124
2 0.4 1.124 1.0094747 1.3258949
3 0.6 1.3258949 1.0598136 1.5378577
4 0.8 1.5378577 0.902551 1.7183679

2nd Order
i t wi f(ti,wi) ti+h/2 h/2f(ti,wi)
0 0 1 0 0.1 0
1 0.2 1.062 0.5597281 0.3 0.0559728
2 0.4 1.2149628 0.8638505 0.5 0.0863851
3 0.6 1.399886 0.9173544 0.7 0.0917354
4 0.8 1.5758751 0.8206831 0.9 0.0820683
4.1t
y' ty , 0 t 0.8, y 0 1, h 0.2
y
solusisoalberikutpada
er and 2nd Orde Runge-
1.8
value problems at t =
1.6

1.4

1.2

0.8

0.6

0.4

0.2

fi++ wi+1 0
0.31 1.062 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
0.7648138 1.2149628
0.9246159 1.399886
0.8799458 1.5758751
0.7334999 1.7225751
1st Oder
2nd Order

0.6 0.7 0.8 0.9


Gunakanmetodebedahinggauntukmendekatisolusisoa
ini.Gunakakansubinterval10mpadarentangantaraSta+
0.0015
k= 0.0015
x =
2 h2
10
x h h2 k 0.0002 x, 0 x 50,
0 0 15 225 x2
1 10 23.947 573.441
2 20 30.432 926.099 2 h 2 0.0002 hi21 2hi2
3 30 35.843 1284.720 x;
4 40 40.628 1650.644
x 2
k x 2
0.0002 x
2
5 50 45.000 2025 1
h 2 k 1
h 2
h2

i
2 i 1 i 1
k

h
50

45

40

35

30

25

20

15
0 5 10 15 20 25 3
hinggauntukmendekatisolusisoalaliranairtanahtidaktertekanberikut
rval10mpadarentangantaraSta+0mdanSta+50m,sertanilaiksebesar

0002 x, 0 x 50, h(0) 15, h(50) 45

0002 hi21 2hi2 hi21 0.0002


x; xi ;
k x 2
k
0.0002 x
2
2
i 1 h 2
i 1 xi
k

10 15 20 25 30 35 40 45 50

Anda mungkin juga menyukai