(a).
Graphically
f(x) =
5 -5 6 -2
x^ berapa 3 2 1
5.00
x f(x) 4.00
0 -2.00 3.00
0.2 -0.96 2.00
0.4 -0.08 1.00
0.6 0.88 0.00
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.8 2.16 -1.00
1 4.00 -2.00
-3.00
Interpolasi
x= 0.417 Pakai Rumus
x= 0.417 Pakai Forecast
(b). Bisection
f(x) =
5 -5 6 -2
x^ berapa 3 2 1
iterasi Xu Xl xr f(Xl) f(Xr) f(Xl)*(Xr) Stopping Criterion (%)
1 1 0 0.5 -2 0.375 -0.75
2 0.5 0 0.25 -2 -0.734 1.469 -100%
3 0.5 0.25 0.375 -0.734 -0.189 0.139 33%
4 0.5 0.375 0.438 -0.189 0.087 -0.016 14%
5 0.438 0.375 0.406 -0.189 -0.052 0.010 -8% Error < 10%
x = 0.406
(b). False Position
f(x) =
5 -5 6 -2
x^ berapa 3 2 1
iterasi Xu Xl xr f(Xu) f(Xl) f(Xr) f(Xl)*(Xr)
1 1 0 0.333 4 -2 -0.37 0.74
2 1 0.33 0.390 4 -0.37 -0.12 0.05
3 1 0.39 0.408 4.00 -0.12 -0.04 0.01
Error < 10% x= 0.408
Stopping Criterion (%)
14%
5% Error < 10%
(a) Graphically
f(x) =
x f(x)
0 -5.00 Chart Title
0.1 -3.35 8.00
0.2 -1.91
0.3 -0.69 6.00
0.4 0.34
4.00
0.5 1.18
0.6 1.84 2.00
0.7 2.34
0.8 2.70 0.00
0 0.5 1 1.5 2 2.5 3 3.5 4
0.9 2.91
-2.00
1 3.00
1.1 2.98 -4.00
1.2 2.85
1.3 2.63 -6.00
1.4 2.34
1.5 1.98
1.6 1.56 Akar akar persamaannya
1.7 1.10 x1 = 0.367
1.8 0.62 x2 = 1.922
1.9 0.11 x3 = 3.561
2 -0.40
2.1 -0.91
2.2 -1.39
2.3 -1.85
2.4 -2.26
2.5 -2.63
2.6 -2.92
2.7 -3.14
2.8 -3.26
2.9 -3.29
3 -3.20
3.1 -2.99
3.2 -2.63
3.3 -2.13
3.4 -1.46
3.5 -0.62
3.6 0.40
3.7 1.62
3.8 3.06
3.9 4.71
4 6.60
(b) Fixed point iteration method
f(x) =
x0 = 3
tle x (i+1) = 5 - 2x^3 + 11.7x^2
17.7
iterasi x x(i+1) Error
0 3 3.18
1 3.18 3.33 4.59%
2 3.33 3.44 3.15%
2.5 3 3.5 4 4.5 3 3.44 3.51 1.82%
(c) Newton - Raphson Method (d) Secant Method
f(x) = f(x) =
f'(x) =
x0 = 3 x-1 = 3
iterasi x f(x) f'(x) X(i+1) Error iterasi x(i-1)
0 3 -3.2 1.5 5.13 0 3
1 5.13 48.09 55.69 4.27 -20.2% 1 4
2 4.27 12.96 27.17 3.79 -12.6% 2 3.33
3 3.79 2.95 15.26 3.60 -5.4% 3 3.48
4 3.60 0.40 11.22 3.56 -1.0% 4 3.59
5 3.56 0.01 10.52 3.56 0.0% 5 3.56
x0 = 4
x f(xi-1) f(x) X(i+1) Error
4 -3.2 6.6 3.33
3.33 6.6 -1.97 3.48 4.4%
3.48 -1.968853 -0.795915 3.59 2.9%
3.59 -0.795915 0.247869 3.56 -0.7%
3.56 0.247869 -0.019082 3.56 0.1%
3.56 -0.019082 -0.000401 3.56 0.0%
8x1 + 4x2 - x3 = 11
-2x1 + 5x2 + x3 = 4
2x1 - x2 + 6x3 = 7
(a) Eliminasi Gauss
[A] [X] = [C]
- 8 x1 4 x2 -1 x3 = 11
- -2 x1 5 x2 1 x3 = 4
- 2 x1 -1 x2 6 x3 = 7
8 4 -1 x1 11
[A] = -2 5 1 [X] = x2 [C] = 4
2 -1 6 x3 7
1. Mencari Matriks [L] dan [U]
u11 u12 u13
[U] = 0 u22 u23 [L] =
0 0 u33
a11 a12 a13 huruf kecil L21 =
[U] = 0 a22 a23 huruf kecil L31 =
0 0 a33 huruf kecil L32 =
8 4 -1 kalikan baris pertama dengan -2/8 [L] =
-2 5 1 baris kedua kurangi hasil baris pertama
2 -1 6 yang sudah dikali -2/8
8 4 -1 kalikan baris pertama dengan 1/8
0 6 0.75 baris ketiga kurangi hasil baris pertama
2 -1 6 yang sudah dikali 1/8
8 4 -1 kalikan baris kedua dengan -2/6
0 6 0.75 baris ketiga kurangi hasil baris kedua
0 -2.0 6.25 yang sudah dikali -2/6
8 4 -1
0 6 0.75
0 0 6.5
2. Pembuktian
[A] = [L][U] U L
8 4 -1 1 0 0 8 4 -1
-2 5 1 = -0.25 1 0 0 6.0 0.8
2 -1 6 0.25 -0.333 1 0 0 6.50
8 4 -1 8 4 -1
-2 5 1 = -2 5 1
2 -1 6 2 -1 6
(b) Dekomposisi LU
[A] [X] = [C]
- 8 x1 4 x2 -1 x3 = 11
- -2 x1 5 x2 1 x3 = 4
- 2 x1 -1 x2 6 x3 = 7
8 4 -1 x1
[A] = -2 5 1 [X] = x2 [C] =
2 -1 6 x3
1. Mencari Matriks [L] dan [U]
1 0 0 1 0 0 u11 u12
l21 1 0 [L] = l21 1 0 [U] = 0 u22
l31 l32 1 l31 l32 1 0 0
a21/a11 = -0.25 [A] = [L] [U]
a31/a11 = 0.25 u11 = 8 u12 = 4
a'32/a'22 = -0.33 l21 = -0.25 u22 = 6
l31 = 0.25 l32 = -0.333
1 0 0
-0.25 1 0
0.25 -0.33 1
2. Mencari Matriks D
[L] {D} = {C}
1 0 0 d1 c1
-0.25 1 0 d2 = c2
0.25 -0.333 1 d3 c3
d1 = 11
d2 = 6.75
d3 = 6.5
3. Mencari Akar Persamaan [X]
[U][X] = [D]
8 4 -1 x1 11.00
0 6 0.75 x2 = 6.75
0 0 6.5 x3 6.50
x1 = 1
x2 = 1
x3 = 1
11
4
7
u13
u23
u33
u13 = -1
u23 = 0.75
u33 = 6.50
(a) Metode Analitis (b)
dy/dt = 3yt2-2.5y i
dy/dt = y(3t2-2.5) 0
1/y dy = (3t2-2.5)dt 1
ln y + c = t3-2.5t + c 2
y = e^(t3-2.5t + c) 3
y(0) = e^((0)3-2.5(0) + c) 4
1= e^c
c = 0
y = e^(t3-2.5t)
t y
0 1
0.5 0.325
1 0.223
1.5 0.687
2 20.086
0 1
0.5 -1.125 0.325
1 -1.5 0.223
1.5 -0.375 0.687
2 3 20.086
t y analit y euler y heun y RK
0 1
0.5 0.325
1 0.223
1.5 0.687
2 20.086
dx 0.5 dx 0.5
Metode Euler, h-0.5 (c) Metode Heun tanpa iterasi, h=0.5
t_i f(x,y) / y' y_i (euler) i xi yi
0 -2.500 1 0 0 1.000
0.5 0.438 -0.25 1 0.5 0.484
1 -0.016 -0.031 2 1 0.280
1.5 -0.166 -0.039 3 1.5 0.687
2 -1.160 -0.122 4 2 6.515
eun tanpa iterasi, h=0.5
f(xi,yi) = k1 xi+h yi + k1 h f(xi+h , yi+k1h) =k2 yi+1
-2.500 0.500 -0.250 0.438 0.484
-0.848 1.000 0.061 0.030 0.280
0.140 1.500 0.350 1.488 0.687
2.920 2.000 2.147 20.394 6.515
61.895 2.500 37.463 608.770 174.181
25
25
20
15
10
y
5
0
0 0.5
-5
dx 0.5
(d) Metode Fourth-Order Runge-Kutta, h = 0.5
i xi yi f(xi,yi) = k1 xi+1/2h yi+1/2k1h f(xi+1/2h, yi+1/2k1h) = k2 yi+1/2k2h
0 0 1.000 -2.500 0.250 0.375 -0.867 0.783
1 0.5 0.332 -0.580 0.750 0.186 -0.152 0.294
2 1 0.227 0.113 1.250 0.255 0.559 0.367
3 1.5 0.686 2.914 1.750 1.414 9.457 3.050
4 2 14.520 137.943 2.250 49.006 621.763 169.961
Result on the same graph
Result on the same graph
Analytically
Euler's method with h = 0.5
Heun's method without iteration h
4th Order RK Methods h = 0.5
0 0.5 1 1.5 2 2.5
t
k3 xi+h yi+k3h k4 yi+1
-1.811 0.500 0.094 -0.165 0.332
-0.239 1.000 0.212 0.106 0.227
0.802 1.500 0.628 2.669 0.686
20.396 2.000 10.884 103.395 14.520
2156.380 2.500 1092.710 17756.539 1968.751
ytically
r's method with h = 0.5
n's method without iteration h = 0.5
Order RK Methods h = 0.5 ganti nama grafik di " "