i error analysis

28
I ERROR ANALYSIS  T ext: Ch 4 1

Upload: lucas-ho

Post on 02-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 1/28

I ERROR ANALYSIS

 Text: Ch 4

1

Page 2: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 2/28

Objective:

Understand:

◦ Measures of Error used in numerical

computation◦ Causes of Error in Numerical

Computation

◦ Some measure to reduce errors incomputation

2

Page 3: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 3/28

ntroduction

• Numerical !nal"sis:# – nexact mathematics – E$ective to%ether &ith computer

• Source of Error – Machine number representation – !rithmetic Error – Mathematical !pproximation

• Challen%es of N! – denti'cation of Error – (uanti'cation of Error – Control)limit &ithin pre#speci'ed error

3

Page 4: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 4/28

*+* Error !nal"sis: Measuresof Error

• Measures of True Error – True Error

 – !bsolute Error

 – True ,elative Error

.ˆ;

 Approx pvalueTrue p

 p p E t 

−−−=

;ˆ p p E t 

−=

 p

 p pt 

ˆ−=ε 

-*.

-/.

-0.

4

Page 5: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 5/28

• !pproximate Error – True value - p.# not available in real problems

 – - p.# available onl" &hen dealin% anal"ticall"solvable function

 – f - p. is not 1no&n2 use the best approx+available

• !pproximate ,elative error3 for 1 step process

• !pprox+ Error3 for Iterative Process%100ˆ

ˆˆ1

i

ii

a

 p

 p p−

−=ε 

%100ion Approximat 

 Error ion Approximat a=ε  -4.

-.

5

Page 6: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 6/28

• Error Control/Limitation in Numerical Analysis

desired number t  significann

valueTolerable specified e

OthershScarboroug 

Criteria

 s

n

 s

n

 s

 sa

−−=

×=

<

/Pr 

2/10%105.0

2

ε 

ε 

ε 

ε ε 

Page 7: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 7/28

Example *:

!000015.0ˆ!00002.0"

!###ˆ!10000"

14.3ˆ!142$5.3"

==

====

 p pc

 p pb

 p pa5ind the Error 6 ,elative Error

%25000005.0"

%1044"

%100#.#002$5.0"

2

2

==

×==

×==

t t 

t t 

t t 

 E c

 E b

 E a

ε 

ε 

ε 

Page 8: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 8/28

Example /: 5unction!pproximation

  !pproximate e x for x=0.5 correct to 0si%ni'cant di%its2 p= e0.5 =1.648721

5unction !pprox+

  Error Criteria&&3&2

132

n

 x x x xe

n

 x

+++=

%05.0%105.0   32 =×=   −

 sε 

$

Page 9: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 9/28

Page 10: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 10/28

Si%ni'cant =i%its

Def.: The number of leadin% di%its of anapproximation that is correct to thecorrespondin% di%its in the true value

countin% ri%ht &ard from the *st non#>erodi%it

• ndicates the level of Condence

Example:

2035$.0035.0ˆ"

44#4.354#.35ˆ"

32222.0222.0ˆ"

====

==

 p pc

 p pb

digitst  significan p pa

10

Page 11: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 11/28

Relative rror  -9. #!n indicator ofthe correct number of si%ni'cant

di%its

2

4

3

102$.002144.0

0213$.002144.0"

10$5.04#4.23

4#.234#4.23"

10#.02222.0

222.02222.0"

×=−

=

×=−=

×=−

=

ε 

ε 

ε 

c

b

a

Exp of *< indicates the ? accurac" of thesi%ni'cant di%its

11

Page 12: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 12/28

*+/ 5inite !rithmetic

=ef+: – Precision# indicates ho& repetitive

 – !cc"rac# # ho& near to the actual)true value

12

Page 13: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 13/28

*+/+* Causes of Error: Numbers"stems used n Computers

• @imited ,an%e of Numbers -Max andMin. –$ver t%e realmax# overow -NaN.

 –&ess t%an realmin#underow -<.• 5inite number can be ,epresented

-step b)n numbers  $x. 6 ncrease &iththe number  x% $x

Example -%#pot%etical.&1' &1 &1"

• Error  E t  proportional to  x 

13

Page 14: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 14/28

*+/+/ Errors: =ue to Choppin%6 ,oundin%!ll numbers C!NNOT be represented exactl"Error is introduced in numerical computation!pproximation made b" Ro"ndin' (C%oppin'

C%oppin'# ? stored to the lo&er end ofinterval  Example# p*& stored as &1' +&"&2

 $x*&&&2 )ax rror ;# $x -BiasedAA.

Ro"ndin'#? stored to the @o&er or Upper  Example# p*& stored as &1' +&"&2

 $x*&&&2 )ax rror *, $x-' -UnbiasedAA.

14

Page 15: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 15/28

Page 16: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 16/28

Example #Smart)5e&er calculationsusin% 0#di%its roundin% !rithmetic

2$5125.52#.5"25.1'

4*4

"""5'4'2'3"'

"'

24.5"25.1'

4*10

5423"'

"'

432

==

+−++−+=

=

+−+−=

valueTrue.

additionstionmultiplica

 x x x x x.

b /orm

 0 

additionstionmultiplica

 x x x x x 0 

a /orm

1

Page 17: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 17/28

*+0+* Truncation Error: ,eplacin%a complex function b" a simpler

function pdxe x f  

 x

=== ∫    4544#$104$.0"'

25.0

0

1

4101.0   −×=t ε 

Example:

&&4&3&21"'

2$4

22

n x x x x x x 0 e

SeriesTalor 

n

n x +++++=≅  

;&3&2

1"'4

2

 x x x x 0    +++≈

544#$.0"'&3"5'&23

5.0

0

%535.0

0    =  

  

   +++=∫    x x x xdx 0 

Page 18: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 18/28

Order of !pproximation O-hn.

"'&4&2

1"cos'

"'&3&2

1

42

432

hOhh

h

hOhhheh

++−=

++++=

"cos'heh +

1$

"cos'heh

Example:

!pprox+ of Sums3

!pprox+ of Broducts3

"'&3

2

"'"'&4&3

2

43

443

hOh

h

hOhOhh

h

+++≅

+++++≅

"'&3

1 43

hOh

h   +−+≅

Page 19: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 19/28

*+0+/ @oss of Si%ni'cance)Subtractive Cancellation

xa,ple: Evaluate the function usin% 8di%it roundin% for x;<<

%22.0"'

%10#5.$"'

14.11*

14$.111

"'"

1500.11"1'"'"

4

 factor lossahas x f 

error lessinvolves x g 

baof valueTruedigits

 x x

 x x g b

 x x x x f a

−×

=++

==−+=

1#

Page 20: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 20/28

Example: Subtractivecancellation

0;11

1"'

lnln"'

≈−+

 x x

c

  xb

 x(a)

oncancellatiesubtractivtosensitivenotisthatform

 aobtaintosexpressiontheReorder

20

Page 21: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 21/28

*+4Error Bropa%ation,esults of calculations made &ith numberscontainin% E,,O,

• Errors due to Ordinar" !rithmeticOperations

  x  x  x

  x  x

 x 

 E  E  E  x E    x E   E  x  x

tion 2ultiplica

 E  E   x E   E  x  x

 Addition

 E  x x E    Errors

valuese Approximat   xvaluesTrue  x

×+++×=+×+=×

+++=+++=+

=−=−

ˆˆ"ˆˆ'"ˆ'"ˆ'

"'"ˆˆ'"ˆ'"ˆ'

ˆ;ˆ

ˆ*ˆ;*

21

Page 22: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 22/28

E+am,le- Aritmetic ,eration Error 

Fiven: x;*<)*03 ";<+G8H/<*3 >;HIG8+H3&;<+<<<******2 determine the absolute and therelative error of the operation usin% di%itarithmetic

,eration E+act A,,ro+. As. Error el. Error  

a '+)y" 2.##+10)5

  '+)y"/ 2.#2+10)1

c '+)y" 3.0141+10)10

y6 #.$#+104

22

Page 23: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 23/28

Bropa%ation Error

@ar%e Number computation – Series Computation

 – !ddin% small and lar%e numbers

+++=∑ 21   x x x n

$3...44.1"2/'1"1/'1/1/1

$...44.1#/14/11/1

22210

1

10

1

=+−+−+=

=+++=

∑=

=

=

=

nnn x

 x

n

n

n

n

n

n

23

Page 24: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 24/28

Error: Sin%le Jariable 5unctionEvaluation

 Error  x f  x f 

3alue /unction

 x x f  x x x f  x f  x f  x f  Estimate Error 

 x

 x f 

±=

∆•=−=−=∆

−−

"ˆ'"'

ˆ"ˆ'7"ˆ"'ˆ'7"ˆ'"'"ˆ'

8aluea,,ro+.anˆ

8arialeine,.te9or 8alue9unc."'

24

Page 25: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 25/28

Error: More than one Jariable5unction Evaluation

t t 

 f  4  4  f  

  f  x

 x f t  4   x f 

  

 f  x x

 f   x f  Estimate Error 

   

 f  x x

 x

 f   x f   x f 

SeriesTalor 

∆∂∂+∆

∂∂+∆

∂∂+∆

∂∂=∆

∆∂∂+∆

∂∂=∆=

−∂∂

+−∂∂

+=

ˆˆˆ"!ˆ!ˆ!ˆ'

:eneral

ˆˆ"ˆ!ˆ'

"ˆ'"ˆ'"ˆ!ˆ'"!'

25

Page 26: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 26/28

Examples

4$4$

211211

2

2

1001.010.

/1005.0E/101.2E 

1m0.05.1L 

 N1  N500 

9olloin<= 

<i8en tene9electioon teerrorteEstimateti,.at te 

loa ,ointatosu>ecte eamcantile8er o9 ?e9lection2"

 N.1in< oy ei<aon

'm"masson teerrorteEstimate.m/s#.$1<usin< enm/s0.002<is<itintrouceerrorte@9 1"

m 5 m 5 

m 6 m 6 

 7m

−− ×=∆×=×=∆×=

=∆=

=∆=

= =∆

2

Page 27: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 27/28

*+8Condition

=ef+

Sensitivit" of the =ependent variable toChan%es in the ndependent variable

Cond+ ?;*2 relative error is identical to the

relative error in xCond+ ?K*2 relative error is ma%ni'ed

/Cond+ ?L*2 relative error is attenuated

"'

"'7

 x f 

 x f  x 6umber Condition   =

2

Page 28: I Error Analysis

8/10/2019 I Error Analysis

http://slidepdf.com/reader/full/i-error-analysis 28/28

*+GError Control

•  Not ,ossile to etermine e+act error

• Control trate<ies

 – A8oi sutracti8e cancellation

• earran<e/ e9ormulate te ,rolem• Bse e+tene ,recision

• A smallest numer 9irst

 –Carry out numerical e+,eriments

 – or critical numerical com,utation soul e one y 2 or more ine,enent <rou,s

2$