0% found this document useful (0 votes)
4 views

Lecture2

This lecture discusses errors in numerical methods, focusing on round-off and truncation errors, and the importance of significant digits. It explains the concepts of accuracy versus precision, error definitions, and how computers represent numbers. Additionally, it covers the use of Taylor series for approximations and estimating truncation errors.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture2

This lecture discusses errors in numerical methods, focusing on round-off and truncation errors, and the importance of significant digits. It explains the concepts of accuracy versus precision, error definitions, and how computers represent numbers. Additionally, it covers the use of Taylor series for approximations and estimating truncation errors.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Lecture 2

Errors
Round-Off Errors Truncation Errors
Significant Digits Taylor series
Accuracy vs Precision Taylor series approximation of a polynomial
Error Definitions Using Taylor series to estimate truncation errors
Computer representation of a number
Approximations and Round-Off Errors

❑ Numerical methods are based on approximation, which introduces


error.

❑ Error cannot always be calculated due to the lack of an exact solution.

❑ How confident we are in our numerical results?

❑ How much error is present in our calculation and how much tolerable
it is?
SIGNIFICANT FIGURES
Significant digits of a number are those that can be used with confidence.

Correspond to the number of certain digits plus one estimated digit.

❑ Leading zeros are excluded


e.g. 0.00001845 and 0.001845 both have 4 significant figures

❑ Zeros appearing between non-zero digits are significant

❑ All non-zero digits are significant

❑ Use scientific notation


e.g. 4.53 × 104, 4.530 × 104 , have 3 and four significant digits
respectively.

e.g. Speedometer yields readings of 3 significant digits (48.5)


Odometer yields readings of seven digits (87,324.45)
Accuracy vs Precision

Accuracy: How closely a computed or measured value agrees with true value

Precision: How closely individual calculated value agrees with each other

Analogy with target practice


(Bullet holes on each target )

(a) Inaccurate and imprecise


(b) accurate and imprecise
(c) inaccurate and precise
(d) accurate and precise
Type of Errors

Round-Off Errors Truncation Errors

Computers represent only finite


number of digits Related to numerical method
Error: Definition

True Error (𝑬𝒕 ) = True Value- Approximation

True error takes no account of the order of magnitude of the value under examination.

True Error
True Percent Relative Error = True Value × 𝟏𝟎𝟎

Bridge Rivet
Actual Value = 10 ,
000 cm.
A V
.
.
=
10 .
cm

Measured 9999 cm.


M V gam
.

=
. = .

Et = 1 cm.
Et =
f cm.
Relative Error :
-

Rivet
=.

Bridge.

x100

= 10 %
= 0 :
01 %
❑ In real world applications, we usually do not know the true value

approximate error
𝜖𝑎 = × 100
approximation

❑ Iterative solution approach

current approximation −previous approximation


𝜖𝑎 = × 100
current aprroximation

❑Typically, absolute value is used. Computations are repeated until stopping criterion
is satisfied.

|𝜖𝑎 | < 𝜖𝑠

where 𝜖𝑠 is pre-specified % tolerance based on the knowledge of your solution


Computer Representation of Numbers
Integer Representation

(a) decimal (base 10) (b) binary (base 2)


In (b), the binary number 10101101 is equivalent to the decimal number 173.

The representation of the


decimal integer −173 on a
16-bit computer using the
signed magnitude method.

(0 for positive and a 1 for negative)


Floating point representation for fractional quantities
exponent or characteristic
mantissa 𝑚. 𝑏 𝑒 Base of the number system

There is a limited range of numbers that may be stored.


• Overflow error: Number produced is greater than maximum that can be stored
• Underflow error: Number produced is lower than minimum that can be stored

• Chopping vs rounding off errors


• Store 3.14159265358 on base-10 system with 7 significant digits.
• Chopping: =3.141592 (t=0.00000065)
• Rounding off: =3.141593 (t=0.00000035)
Truncation Error
where 𝜉 varies from a to x.
Intution :

#find f(xi+ 1) if f(xi) is known

We
approximate f(xi 1) by f(xi)
+ .
itself

f(xi + 1) f(xi) : Zeroth Order Approximation


If f is a linear function fleit)-

f(xi 1) +
=
f(xi) + #
(slope) h flexe
---- Y of

in
:

f'(di) h
f(xi + 1) = f(xi) + f(xi)h with di + 1

= f(xi) + f(xi)(xi + 1
-

xi)
Order Approximation:
Second

f'(i)n
f(xi 1)
+ = f(xi) +
+
Similarly ,

f(i)h
f(xi)
.
f(xi + 1) = + +. ..
.

where h =i + -xi

Truncation error for nth order


approximation is

Rn
=A3)
ht ,
for some between

x;2 ki + 1
&

Also, obtain truncation error for each.


1,
fa(0)
Solution
n = 2 3, 4
: ,
,

f'(0) =
-
0 .

25 , +"(0) = -1 ,
f"(0) = 3)( -
0 -

15)
fir(0) = 4! ) -
0 -

7)

Orderapproximation
-eroth
2-1 2 1
Er 0 =
-

=
.
.

lett =
1
2nd

!
order
1st order approx :
approx :

f(1) ~ f(0) + f(0) . h f(1) = f(0) + fld)h + + "(0)h


Z
1 2 .
-
0 .
25h =
0 .
95 =
0 . 45

Truncation Error= True Error


(E + 1 =
10 .

2 -
0 .

45) = 0 25.

Et = 0 .
2 -

0 .

95
=
0 75 ↑
th Approx
Order-
-
.

12 + 1 - 0-75 f(1)-f(0) + f()h + f "(0)h2 + f


"
(0)h3
I!
!
+
f((0)b"
1 2 0 25h
- 0 3) -10 15) .
- .

=
. .

= 1 2 .
-
0 .

25h - o .
go 0 .
14
= 1 2
. -
0 .

25 -
0 5-0 15-0
.
. .

1 = 0 .

True Error = 0 2-0 2


.
. = p

Truncation
Error= -
15 1:t has
degree 4

You might also like