Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 / Error in Numerical Method

Similar presentations


Presentation on theme: "Chapter 1 / Error in Numerical Method"— Presentation transcript:

1 Chapter 1 / Error in Numerical Method
What is The Error ? How it is happened ?

2 Error = True Value – Approximate Value
Definition The Error in a computed quantity is defined as: Error = True Value – Approximate Value Example: - True Value : phi = - Appr. Value : 22/7 = - Error =

3 Kind of Error The Absolute Error is measure the magnitude of the error
The Relatife Error is a measure of the error in relation to the size of the true value

4 Example True value : 10 m Appr. Value : 9 m True value : 1000 m

5 Source of Error Truncation Error Round-off Error
Caused by approximation used in the mathematical formula of the scheme Round-off Error Caused by the limited number of digits that represent numbers in a computer and The ways numbers are stored and additions and substractions are performed in a computer

6 Background of The Truncation Error
Numerical solutions are mostly approximations for exact solution Most numerical methods are based on approximating function by polynomials How accurately the polynomial is approximating the true function ? Comparing the polynomial to the exact solution it becames possible to evaluate the error, called truncation error

7 Taylor Series The most important polynomials used to derived numerical schemes and analyze truncation errors With an infinite power series, it is exactly represents a function within a certain radius about a given point

8 Taylor’s Theorem (See Introduction to Real Analysis by Bartle and Sherbert for proves)

9 Applications For practice we denote
Find the Taylor expansion of sin(x) about answer:

10 How about the Taylor expansion of Tan(x) at
? The Taylor expansion of a function about is called the Maclaurin series. Thus, Maclaurin series for sin(x) is, It is impossible in practical applications to include an infinite number of terms. Therefore, the Taylor series has to be truncated after a certain order term

11 If the Taylor series is truncated after the N th order term, it is expressed as
Since cannot be found exactly, the error term is often approximated by

12 Example 1: Find the Taylor expansion of about which use the first two, three, four and five and evaluate for x= 0.5, respectively. Answer:

13

14 Example 2: Find the Taylor expansion of about which use the first two, three, four and five and evaluate for x= 0.5, respectively. Answer:

15

16 Summary from example 1 and 2:
Order of Trunc. Er. Ratio 3.4 6.66 e-04 13.13 e-0.5 26.03

17 Numbers on Computers Computers do not use the decimal system in computations and memory but use the binary system It caused by computer memory consists of a huge number of electronic and magnetic recording devices, of which each element has only “on” and “off” statuses

18 Example: In a single precision, 4 bytes, or equivalently 32 bits, are used to store one real number. If a decimal number is given by input, it first converted to the closest binary in the normalized format: where a is always 1 and b’s are binary digit that are 0 or 1; z is an exponent which is also expressed in binary.

19 Numbers Store in Computer’s Memory for Single Precision (IBM 370)
where s is as sign (+ or -), e is an exponent, and m is a mantissa including the a and b’s. Example:

20 Causes Round-off Error
The summation of these two numbers becomes Because the mantissa has 24 bits, therefore, the result of this calculation is stored in memory as Thus, whenever is added to 1.5, the result gains as an error which called round-off error

21 The effects of round-off error can be minimized by changing the computational algorithm although it must be devised case by case. Some useful strategies include: Double precision Grouping Taylor expansions Changing definition of variables Rewriting the equation to avoid substraction

22 Chapter 1 / Error in Numerical Method
Double Precision (IBM 370) In a double precision, 8 bytes, or equivalently 64 bits, are used to store one real number. In this format 1 bit is used for sign, 7 bits are used for exponent, and 56 bits are used for mantissa. Grouping when the small numbers are computed, e.g. addition, substraction, etc., grouping them helps to reduce round-off errors. For example, to add to unity ten thousand times one can grouped into 100 groups and each group consists of 100 small values.

23 Chapter 1 / Error in Numerical Method
Taylor Expansions as approaches 0, accuracy of a numerical evaluation for becomes very poor because round-off errors. By using Taylor expansion, we can rewrite the equation so that the accuracy for is improved as

24 Chapter 1 / Error in Numerical Method
Rewriting the equation to avoid substraction consider the equation of for an increasing of values x, the calculation of the equation above has a loss-of-significance error. To avoid this error one can reformulate it to get


Download ppt "Chapter 1 / Error in Numerical Method"

Similar presentations


Ads by Google