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

Post on 02-Jan-2016

223 Views

Category:

Documents

4 Downloads

Preview:

Click to see full reader

Transcript

NUMERICAL ERRORStudent Notes

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

Objectives

• To understand error terms• Become familiar with notation and

techniques used in this course

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

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

increasing accuracy

incr

easi

ng p

reci

sion

Accuracy and Precision

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

Error definitions cont.

valuetrue

valueestimatedvaluetrue

valuetrue

errortruet

100

• True relative percent error

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?

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

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

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

Strategy

Terms Results t % a %

12345

Stop when ea ≤ es

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

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

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

TAYLOR SERIES

Zero order approximation

ii xfxf 1

This is good if the function is a constant.

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 '

Taylor Series Expansion

Second order approximation - captures some of the curvature

2111 !2

''' ii

iiiiii xx

xfxxxfxfxf

Taylor Series Expansion

ii

nni

n

iiiii

xxsizestephwhere

Rhn

xf

hxf

hxf

hxfxfxf

1

......

321

!

!3

'''

!2

'''

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

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

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

Objectives

• To understand error terms• Become familiar with notation and

techniques used in this course

top related