introduction and analysis of error pertemuan 1 matakuliah: s0262-analisis numerik tahun: 2010

21

Upload: noah-jared-mathews

Post on 26-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010
Page 2: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

Introduction and Analysis of Error

Pertemuan 1

Matakuliah : S0262-Analisis NumerikTahun : 2010

Page 3: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

Material Outline

• Introduction to Numerical Methods• Approximation and Errors• Propagation of Errors

Page 4: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 DR. Paston Sidauruk 4

Numerical Analysis: Methods for providing numerical answer when analytic

procedures are either computationally difficult or nonexistent.

Numerical Analysis: Always involving complicated arithmetic computations Need the help of computing machines (computers)

Numerical Analysis Numerical Methods

Page 5: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 DR. Paston Sidauruk 5

Why Numerical methods are important: In real life many problems can not be solved

analytically. Numerical Analysis is a universal procedure (It can be

applied to many different engineering fields such as CE, ME, EE, and IT)

The fast growing development of computing machines (computers)

Page 6: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 6

INTRODUCTIONIt is a fact that many mathematical or engineering

problems or or physics phenomena can not be solved analytically (exact solution) For this type of problems or phenomena, numerical analysis can give the solution.

Numerical Work in general will cover the following steps:

Modeling : formulating a given work (problem) into mathematical equations.

Choosing appropriate Numerical methods. Developing a program Executing the program Analyzing the results

Note: Numerical Methods is always involving serious arithmetical calculation Need the help of computer.

Page 7: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 7

Some Concerns About Numerical Analysis:– Numerical Value: is an approximation of true

value that never known, hence we have to concern about the errors that may occur.

Page 8: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 8

ERRORSIn numerical solution, the results we get is the

best approximation to true value. Hence the numerical solution is always associated to certain degree of errors. For this purpose, a true value of any parameter can be written as :

a ã - Et In which :

a = true value (exact) ã = approximation (derived from measurements,

calculations etc) Et = total error

Numerical Errors: arise from the use of approximations to represent exact mathematical operations and quantities.

Page 9: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 9

RELATIVE ERRORSIt is sometimes desired to normalize the error with the

true value such as to account the magnitudes of the quantities being evaluated, such error called relative error.

Relative error t=true error/true value Relative error of approximation:a= approximation error/approximation

In the approximation of using iteration ( current approximation is based on the previous approximation), then the relative error of approximation is given below:

a= (current approximation – previous approximation)/ current approximationIn numerical computations or iteration process, it is sometimes to pre specify the tolerance (s) such that the following eq is satisfied, | a|< tolerance (s) =(0,5 x 102-n) %n= significant figure

Page 10: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 10

Errors sources1. Experimental errors (errors arise from

experiments, measurements etc)2. Round off errors (errors because of

rounding)3. Truncation errors (errors arise from a

process of simplification an algorithms, computations, steps in algorithms)

4. Programming errors

Page 11: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 11

Example:A MacLaurin series of ex is given below:

If the 1st term is considered as 1st estimate, the first 2 terms as the second estimate of ex, how many do you have to include in the series such that the relative errors | a|< s. In which a pre specified tolerance conforming to 3 significant figures. Find the true error and approximation errors.

Note: e0,5= 1.648721271 Solution: s =(0,5 x 102-3)%= 0,05 %

..........!3!2

132

xx

xex

Page 12: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 12

• Example (Cont.):

e0,5= 1,648721271Solution: s =(0,5 x 102-3)%= 0,05 %

Therefore, the minimum of the first 6 terms have to be used to estimate ex such that the error of approximation is less than the pre-specified tolerance.

2nd column: Series value for x= 0.5, 3rd column= (2nd column)/1.648721271.

Ith tern Result t (%) a (%)

1. 1 39,3

2 1,5 9,02 33,3

3 1,625 1,44 7,69

4 1,645833333 0,175 1,27

5 1,648437500 0,0172 0,158

6 1,648697917 0,00142 0,0158

Page 13: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 13

FINITE NUMBERS: can be written in two ways

1. fixed- point system ( is written according to the

specified number of decimal place) Example: 62.358; 0.013; and 1.000

(3 decimal place)2. floating- point system is written

according to certain significant figures

Example:0.6238 * 103; 1.7130 * 10-13; 2000 * 104

Page 14: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 14

Significant Figures

The concept of significant figures designate the reliability of a numerical value.

All digits that can be used with confidence. Example: 4 digit significant figures 1.360 ; 1360 ; 0.001360All zeros that are needed only to locate the

decimal point are not counted as significant figures:

Example: all of the following numbers are in 4 significant figures 0.01845; 0.0001845; 0.001845

Also:4.53 * 104 (3 significant figures)4.530 * 104 (4 significant figures)4.5300 * 104 (5 significant figures)

Page 15: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 15

Rounding a number to certain significant figures

1. Those digits that are not significant will be omitted. The last digit that is saved will rounded up if the first digit in the omitted digits >5 and if the 1st in the omitted digits =5 and the last digit in the saved digits is odd number.

2. The final results of summation or subtraction will be rounded to the most significant figures of all the numbers (quantities) that are being operated.

3. The final results of multiplication or division will be rounded such that the number of significant figures will be equivalent with the least number of significant figures of all the numbers (quantities) that are being operated.

Page 16: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 16

Rounding a number to certain significant figures

• Examples:– Rounding

5.6723 5.67 (3 significant figures)10.406 10.41 (4 significant figures)7.3500 7.4 (2 significant figures)88.21650 88.216 (5 significant figures)1.25001 1.2 (2 significant figures)

– Summation/Subtraction Evaluate: 2.2 – 1.768

2.2-1.768= 0.432 0.44.68 x 10-7+8.3x10-4-228x10-6= ….? ……. (6.0x10-4)

– Multiplication/Division0.0642x 4,8= 0.30816 0.31945/0.3185= 2967.0329672970

Page 17: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 17

Error Propagation The purpose is to study how errors in numbers

propagates through mathematical functions

• Function of single Variable

xxxx

x

x

xfxfxfxf

xxfxf

xfy

~~ oferror of estimate ~ value true

ion valueapproximat ~)~()()~( oferror of estimate )~(

~)~(')~(

)(

Page 18: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 18

Error Propagation• Function of single VariableExample: Given a value of

Answer:

3)(function in theerror

resulting theestimate ,01.0~error an with 5.2~

xxf

xx

8125.15)5.2(4375.15

1875.0625.15)5.2(

1875.0)01.0()5.2(3~)~(')~(

3)(')(2

23

f

f

xxfxf

xxfxxf

Page 19: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 19

Error Propagation• Function of more than one variable

nn

n

n

nn

n

xxxxxx

xxx

xxxfxf

xx

fx

x

fx

x

fxf

xxxfy

~,,~,~ oferror of estimate ~,,~,~ion valuesapproximat ~,,~,~

)~,,~,~( oferror of estimate )~(

~~~)~(

),,,(

2121

21

21

22

11

21

Page 20: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 20

Error Propagation• Function of more than one variableExample/Exercises:

006.0~6.0~01.0~5.1~1.0~30~2~50~

given thaty in error resulting theestimate

8

),,,(4

ttzz

yyxx

zt

xytzyxfy

Page 21: Introduction and Analysis of Error Pertemuan 1 Matakuliah: S0262-Analisis Numerik Tahun: 2010

19 Apr 2023 21

Error PropagationEstimated Error for common mathematical

operations

Operation Estimated Error

Addition

Subtraction

Multiplication

Division 2~

~~~~

y

xyyx

y

x~

~

)~~( yx xyyx ~~~~

)~~( yx

)~~( yx yx ~~

yx ~~