Professional Documents
Culture Documents
Arcady Dyskin
Topics
! Computer arithmetic. Truncation and roundoff errors ! Matrices ! Linear equations. Methods of solution ! Ill-conditioned matrices ! Interpolation and curve fitting
GENG4405
Slide 2
Errors
! Types of errors ! Computer arithmetic. Truncation and roundoff errors ! Example. Numerical differentiation ! Example. Unstable algorithm
Absolute error Relative error
" r = ra ! r
!r !r #r = " r ra
Points to learn
! ! ! ! ! Types of error Precision Catastrophic cancellation Numerical differentiation Sensitivity of numerical differentiation to errors ! How to choose the increment - Later ! Unstable algorithms
GENG4405 Slide 4
stress (MPa)
Tangential modulus
d# "# E (! ) = $ d! "!
E(!) [MPa]
80000 70000 60000 50000 40000 30000 20000 10000 0 -10000 -20000
GENG4405
10
20
30
40
50
60
70
80
! [10-6]
Slide 6
! Errors of measurements
! Systematic
! Calibration
! Random
! Repeated measurements ! Statistical treatment
! Truncation/Roundoff errors
! Computer arithmetic ! Small ! Double precision computations
GENG4405 Slide 7
f = d1 ! + + d t !t
Precision
PC
Real (real*4) mode Double precision (real*8) mode,
! = 2 , t = 53, U = 1023,
L = "1023
Any real number x is replaced in a computer by the closest number, fl(x), from F
fl ( x) ! x 1 1!t # " x 2
GENG4405 Slide 9
! Numerical differentiation
GENG4405
Slide 10
I y = ! x 2"( x)dx
0
" ( x) = e x!1
I y = " x e dx ! E2
0
2 x #1
1m
x
GENG4405 Slide 11
I y = " x 3e x #1dx ! E3
0
1m y 1m
I y = " x 4e x #1dx ! E4
0
1m
x
GENG4405 Slide 12
General case
y 1m
En =
1m x
"
0
x n e x!1 dx > 0
Calculations
n
2 3 4 5 6 7 8 9 Recurrent formula 0.264242 0.207274 0.170904 0.14548 0.12712 0.11016 0.11872 -0.06848 Exact 0.264241 0.207277 0.170893 0.14533 0.126802 0.112384 0.100932 0.091612
GENG4405
Slide 14
$ # 0.368 "10 !6
En = 1 ! nEn!1
E3 = 1 # 3 " 0.264242 # 3 " 2 " ! = 0.207274 # 6 " ! ! E9 = E9exact # 9!"! = E9exact # 362880 " !
The error of 9-th step is 0.133>E9exact
Stable algorithm
1 ! Note En = " x n e x!1 dx < " x n dx = n +1 0 0 ! Inverse recurrent formula 1 ! En En!1 = n ! Error is damped ! Start with E20 ! 0 ! This approximation has an error not greater than 1/21. ! When the 9th term is approached, the initial error is divided by 20 ! 19 ! ! 10 = 362880 "7 ! It becomes less than 1.3 ! 10 ! The obtained result is E9 ! 0.09161123 ! The relative error is about 1.4 ! 10 "6
GENG4405 16
Summary
! Errors
! Measurements ! Computational
! Computer arithmetic ! Truncation and roundoff errors ! Controlled by precision - formula
! Catastrophic cancellation
! Subtraction of close numbers
! Unstable algorithms
! Simple methods could lead to catastrophic accumulation of errors
GENG4405
Slide 17