numerical error student notes

24
NUMERICAL ERROR Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier

Upload: orea

Post on 22-Feb-2016

31 views

Category:

Documents


1 download

DESCRIPTION

NUMERICAL ERROR Student Notes. ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier. Objectives. To understand error terms Become familiar with notation and techniques used in this course. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: NUMERICAL ERROR Student Notes

NUMERICAL ERRORStudent Notes

ENGR 351 Numerical Methods for EngineersSouthern Illinois University CarbondaleCollege of EngineeringDr. L.R. Chevalier

Page 2: NUMERICAL ERROR Student Notes
Page 3: NUMERICAL ERROR Student Notes

Objectives• To understand error terms• Become familiar with notation and

techniques used in this course

Page 4: NUMERICAL ERROR Student Notes

Approximation and ErrorsSignificant Figures• 4 significant figures

• 1.845• 0.01845• 0.0001845

• 43,500 ? confidence• 4.35 x 104 3 significant figures• 4.350 x 104 4 significant figures• 4.3500 x 104 5 significant figures

Page 5: NUMERICAL ERROR Student Notes

Accuracy and Precision• Accuracy - how closely a computed or

measured value agrees with the true value

• Precision - how closely individual computed or measured values agree with each other• number of significant figures• spread in repeated measurements or

computations

Page 6: NUMERICAL ERROR Student Notes

increasing accuracy

incr

easi

ng p

reci

sion

Accuracy and Precision

Page 7: NUMERICAL ERROR Student Notes

Error Definitions• Numerical error - use of approximations

to represent exact mathematical operations and quantities

• true value = approximation + error• error, et=true value - approximation• subscript t represents the true error• shortcoming....gives no sense of magnitude• normalize by true value to get true relative

error

Page 8: NUMERICAL ERROR Student Notes

Error definitions cont.

valuetruevalueestimatedvaluetrue

valuetrueerrortrue

t

100e

• True relative percent error

Page 9: NUMERICAL ERROR Student Notes

ExampleConsider a problem where the true answer is

7.91712. If you report the value as 7.92, answer the following questions.

1. How many significant figures did you use?2. What is the true error?3. What is the true relative percent error?

Page 10: NUMERICAL ERROR Student Notes

Error definitions cont.• May not know the true answer

apriori• This leads us to develop an iterative approach to numerical methods

100.

..

100

approxpresentapproxpreviousapproxpresent

ionapproximaterroreapproximat

ae

Page 11: NUMERICAL ERROR Student Notes

Error definitions cont.

• Usually not concerned with sign, but with tolerance

• Want to assure a result is correct to n significant figures

%105.0 2 ns

sa

e

ee

Page 12: NUMERICAL ERROR Student Notes

ExampleConsider a series expansion to estimate trigonometric functions

xxxxxx .....!7!5!3

sin753

Estimate sin(p/ 2) to three significant figures. Calculate et and ea. STRATEGY

Page 13: NUMERICAL ERROR Student Notes

StrategyTerms Results et % ea %

12345

Stop when ea ≤ es

Page 14: NUMERICAL ERROR Student Notes

Error Definitions cont.• Round off error - originate from the

fact that computers retain only a fixed number of significant figures

• Truncation errors - errors that result from using an approximation in place of an exact mathematical procedure

Page 15: NUMERICAL ERROR Student Notes

Error Definitions cont.• Round off error - originate from the

fact that computers retain only a fixed number of significant figures

• Truncation errors - errors that result from using an approximation in place of an exact mathematical procedureTo gain insight consider the mathematical

formulation that is used widely in numerical methods - TAYLOR SERIES

Page 16: NUMERICAL ERROR Student Notes

TAYLOR SERIES

• Provides a means to predict a function value at one point in terms of the function value at and its derivative at another point

Page 17: NUMERICAL ERROR Student Notes

TAYLOR SERIES

Zero order approximation ii xfxf 1

This is good if the function is a constant.

Page 18: NUMERICAL ERROR Student Notes

Taylor Series Expansion

First order approximation

slope multiplied by distance

Still a straight line but capable of predicting an increase or decrease - LINEAR

iiiii xxxfxfxf 11 '

Page 19: NUMERICAL ERROR Student Notes

Taylor Series Expansion

Second order approximation - captures some of the curvature

2111 !2

''' iii

iiiii xxxfxxxfxfxf

Page 20: NUMERICAL ERROR Student Notes

Taylor Series Expansion

ii

nni

n

iiiii

xxsizestephwhere

Rhn

xf

hxfhxfhxfxfxf

1

......

321

!

!3'''

!2'''

Page 21: NUMERICAL ERROR Student Notes

Taylor Series Expansion

1

11

1

......

321

!1

!

!3'''

!2'''

iin

n

n

ii

nni

n

iiiii

xxhn

fR

xxsizestephwhere

Rhn

xf

hxfhxfhxfxfxf

Page 22: NUMERICAL ERROR Student Notes

ExampleUse zero through fourth order Taylor series expansion to approximate f(1) given f(0) = 1.2 (i.e. h = 1). Calculate et after each step. f x 01 015 0 5 0 25 1 24 3 2. . . . .x x x x

Note:f(1) = 0.2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

0 0.2 0.4 0.6 0.8 1x

f(x)

STRATEGY

Page 23: NUMERICAL ERROR Student Notes

Strategy• Estimate the function using only the first term

• Use x = 0 to estimate f(1), which is the y-value when x = 1

• Calculate error, et• Estimate the function using the first and second

term• Calculate the error, et• Progressively add terms

Page 24: NUMERICAL ERROR Student Notes

Objectives• To understand error terms• Become familiar with notation and

techniques used in this course