ERROR DALAM NUMERIK
Pertemuan Ke-2 Metode Numerik
Tujuan Untuk memahami pengertian Error Untuk lebih memahami notasi dan teknik
dalam matakuliah ini
Approksimasi dan Signifikansi 4 significant figures 1.845 0.01845 0.0001845
43,500 ? confidence 4.35 x 104
3 significant figures 4.350 x 104 4 significant figures 4.3500 x 104 5 significant figures
Akurasi dan Presisi Akurasi : seberapa dekat nilai yang dikomputasi atau nilai yang diukur dengan nilai sebenarnya.
Presisi : seberapa dekat nilai yang dikomputasi atau diukur secara individual dengan nilai komputasi atau nilai ukur lainnya. Jumlah nilai yang significant Distribusi dalam nilai komputasi atau nilai ukur
Akurasi dan Presisi
Meningkatnya Presisi
Meningkatnya akurasi
Defenisi Error Error Numerik : Penggunaan aproksimasi yang melambangkan operasi matematik exact dan
jumlah true value = approximation + error error, et=true value - approximation
subscript t represents the true error
Defenisi Error. true error et 100 true value
True relative percent error
Contoh Suatu pengukuran memiliki nilai sesungguhnya 7.91712 m. Jika kamu melaporkan nilai tersebut sebagai 7.92 m, maka jawablah pertanyaan di bawah ini: 1. Berapa angka significant yang kamu pake ? 2. Apakah itu true error? 3. Apakah itu relative error?
Error definitions cont. May not know the true answer apriori approximate error ea 100 approximation
Defenisi Error Relative Error approximate error ea 100 approximation
• Diperlukan iterative method untuk mencapai relative error yang convergence.
Defenisi Error Relative Error approximate error ea 100 approximation
• Diperlukan iterative method untuk mencapai relative error yang convergence. approximate error ea 100 approximation present approx. previous approx. 100 present approx.
Defenisi Error Tidak ditentukan dengan tanda, tapi toleransi Hasil adalah koreksi n angka signifikan
Error definitions cont. Tidak ditentukan dengan tanda, tapi toleransi Hasil adalah koreksi n angka signifikan
ea es
e s 0.5 10
2 n
%
Example Consider a series expansion to estimate trigonometric functions
x3 x5 x7 sin x x ..... x 3! 5! 7! Estimate sinp/ 2 to three significant figures
Defenisi Error Round off error - originate from the fact that
computers retain only a fixed number of significant figures Truncation errors - errors that result from using an approximation in place of an exact mathematical procedure
Defenisi Error Round off error - originate from the fact that
computers retain only a fixed number of significant figures Truncation errors - errors that result from using an approximation in place of an exact mathematical procedure
To gain insight consider the mathematical formulation that is used widely in numerical methods - TAYLOR SERIES
DERET TAYLOR Alat untuk memprediksi nilai fungsi pada
suatu titik nilai fungsi tersebut dan juga fungsi derivatifnya pada titik lainnya. Zero order approximation
DERET TAYLOR Alat untuk memprediksi nilai fungsi pada suatu titik nilai fungsi tersebut dan juga fungsi derivatifnya pada titik lainnya. Zero order approximation
f xi 1 f xi This is good if the function is a constant.
EKSPANSI DERET TAYLOR First order approximation
{
f xi 1 f xi f ' xi xi 1 xi
slope multiplied by distance
EKSPANSI DERET TAYLOR First order approximation
f xi 1 f xi f ' xi xi 1 xi slope multiplied by distance Still a straight line but capable of predicting an increase or decrease - LINEAR
EKSPANSI DERET TAYLOR Second order approximation - captures some of the curvature
EKSPANSI DERET TAYLOR Second order approximation - captures some of the curvature
f ' ' xi 2 f xi 1 f xi f ' xi xi 1 xi xi 1 xi 2!
EKSPANSI DERET TAYLOR f ' ' xi 2 f ' ' ' xi 3 f xi 1 f xi f ' xi h h h 2! 3! f n xi n ...... h Rn n! where h step size xi 1 xi
EKSPANSI DERET TAYLOR f xi 1 f xi f ' xi h f n xi n ...... h Rn n!
f ' ' xi 2 f ' ' ' xi 3 h h 2! 3!
where h step size xi 1 xi f n 1 n 1 Rn h xi xi 1 n 1!
CONTOH Use zero through fourth order Taylor series expansion to approximate f(1) given f(0) = 1.2 (i.e. h = 1) f x 01 . x 4 015 . x 3 0.5x 2 0.25x 1.2 1.4
1
f(x)
Note: f(1) = 0.2
1.2
0.8 0.6 0.4 0.2 0 0
0.2
0.4
0.6 x
0.8
1
Solution n=0 f(1) = 1.2 et = abs [(0.2 - 1.2)/0.2] x 100 = 500%
n=1
f '(x) = -0.4x3 - 0.45x2 -x -0.25 f '(0) = -0.25 f(1) = 1.2 - 0.25h = 0.95 et =375%
Solution n=2 f "=-1.2 x2 - 0.9x -1 f "(0) = -1 f(1) = 0.45
et = 125%
n=3 f "'=-2.4x - 0.9
f "'(0)=-0.9 f(1) = 0.3 et =50%
Solution n=4 f ""(0) = -2.4 f(1) = 0.2 EXACT Why does the fourth term give us an exact solution? The 5th derivative is zero In general, nth order polynomial, we get an exact solution with an nth order Taylor series
Solution 1.4 1.2
f(x)
1 0.8
True Solution Zero Order
0.6
1st Order
0.4
2nd Order
0.2
3rd Order
0 0
0.2
0.4
0.6 x
0.8
1
1.2
Exam Question How many significant figures are in the following numbers? A. 3.215 B. 0.00083 C. 2.41 x 10-3 D. 23,000,000 E. 2.3 x 107
Taylor Series Problem Use zero- through fourth-order Taylor series expansions to predict f(4) for f(x) = ln x using a base point at x = 2. Compute the percent relative error et for each approximation. 1.6 1.4 1.2
y
1 0.8 0.6 0.4 0.2 0 0
1
2
3 x
4
5
f x i 1 f x i f ' x i h . . . . . .
f
n
xi
f ' ' xi 2!
h 2
f ' ' ' xi 3!
h3
h n Rn
n! where h step size xi 1 xi
1. Determine the step size h = 4 - 2 = 2 2. Determine the analytical solution f(4) = ln(4) = 1.3863 3. Determine the derivatives for f(2)