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

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

Jan 02, 2016

Download

Documents

George Jackson
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: NUMERICAL ERROR Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.

NUMERICAL ERRORStudent Notes

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

Page 2: NUMERICAL ERROR Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
Page 3: 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

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

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 ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.

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 ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.

increasing accuracy

incr

easi

ng p

reci

sion

Accuracy and Precision

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

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 ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.

Error definitions cont.

valuetrue

valueestimatedvaluetrue

valuetrue

errortruet

100

• True relative percent error

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

Example

Consider 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 ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.

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

a

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

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

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

Example

Consider a series expansion to estimate trigonometric functions

xxxx

xx .....!7!5!3

sin753

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

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

Strategy

Terms Results t % a %

12345

Stop when ea ≤ es

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

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 ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.

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 ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.

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 ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.

TAYLOR SERIES

Zero order approximation

ii xfxf 1

This is good if the function is a constant.

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

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 ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.

Taylor Series Expansion

Second order approximation - captures some of the curvature

2111 !2

''' ii

iiiiii xx

xfxxxfxfxf

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

Taylor Series Expansion

ii

nni

n

iiiii

xxsizestephwhere

Rhn

xf

hxf

hxf

hxfxfxf

1

......

321

!

!3

'''

!2

'''

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

Taylor Series Expansion

1

11

1

......

321

!1

!

!3'''

!2''

'

iin

n

n

ii

nni

n

iiiii

xxhn

fR

xxsizestephwhere

Rhn

xf

hxf

hxf

hxfxfxf

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

Example

Use 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 1

x

f(x)

STRATEGY

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

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 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