10/16/20151 sources of error major: all engineering majors authors: autar kaw, luke snyder ...

28
03/22/22 1 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder http://numericalmethods.eng.usf.ed u

Upload: dennis-gibbs

Post on 01-Jan-2016

233 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

04/20/23 1

Sources of Error

Major: All Engineering Majors

Authors: Autar Kaw, Luke Snyder

http://numericalmethods.eng.usf.eduTransforming Numerical Methods Education for STEM

Undergraduates

Page 2: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

Sources of Error

http://numericalmethods.eng.usf.edu

Page 3: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

3

Two sources of numerical error

1) Round off error

2) Truncation error

Page 4: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

4

Round-off Error

http://numericalmethods.eng.usf.edu

Page 5: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

5

Round off Error

• Caused by representing a number approximately

333333.03

1

...4142.12

Page 6: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

6

Problems created by round off error

• 28 Americans were killed on February 25, 1991 by an Iraqi Scud missile in Dhahran, Saudi Arabia.

• The patriot defense system failed to track and intercept the Scud. Why?

Page 7: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

7

Problem with Patriot missile

• Clock cycle of 1/10 seconds was represented in 24-bit fixed point register created an error of 9.5 x 10-8 seconds.

• The battery was on for 100 consecutive hours, thus causing an inaccuracy of

1hr

3600s100hr

0.1s

s109.5 8

s342.0

Page 8: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

8

Problem (cont.)

• The shift calculated in the ranging system of the missile was 687 meters.

• The target was considered to be out of range at a distance greater than 137 meters.

Page 9: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

9

Effect of Carrying Significant Digits in Calculations

http://numericalmethods.eng.usf.edu

Page 10: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

10

Find the contraction in the diameter

dTTDDc

a

T

T

)(

Ta=80oF; Tc=-108oF; D=12.363”

α = a0+ a1T + a2T2

Page 11: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

11

Thermal Expansion Coefficient vs Temperature

TDD

T(oF) α (μin/in/oF)

-340 2.45

-300 3.07

-220 4.08

-160 4.72

-80 5.43

0 6.00

40 6.24

80 6.47

Page 12: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

12

Regressing Data in Excel(general format)

0.00

4.00

8.00

-400 -200 0 200

T (oF)

Alp

ha

(in

/in/o

F)

α = -1E-05T2 + 0.0062T + 6.0234

Page 13: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

13

Observed and Predicted Values

T(oF) α (μin/in/oF)Given

α (μin/in/oF)Predicted

-340 2.45 2.76

-300 3.07 3.26

-220 4.08 4.18

-160 4.72 4.78

-80 5.43 5.46

0 6.00 6.02

40 6.24 6.26

80 6.47 6.46

α = -1E-05T2 + 0.0062T + 6.0234

Page 14: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

14

Regressing Data in Excel (scientific format)

0.00

4.00

8.00

-400 -200 0 200

T (oF)

Alp

ha

(in

/in/o

F)

α = -1.2360E-05T2 + 6.2714E-03T + 6.0234

Page 15: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

15

Observed and Predicted Values

T(oF) α (μin/in/oF)Given

α (μin/in/oF)Predicted

-340 2.45 2.46

-300 3.07 3.03

-220 4.08 4.05

-160 4.72 4.70

-80 5.43 5.44

0 6.00 6.02

40 6.24 6.25

80 6.47 6.45

α = -1.2360E-05T2 + 6.2714E-03T + 6.0234

Page 16: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

16

Observed and Predicted Values

T(oF) α (μin/in/oF)

Given

α (μin/in/oF)

Predicted

α (μin/in/oF)

Predicted

-340 2.45 2.46 2.76

-300 3.07 3.03 3.26

-220 4.08 4.05 4.18

-160 4.72 4.70 4.78

-80 5.43 5.44 5.46

0 6.00 6.02 6.02

40 6.24 6.25 6.26

80 6.47 6.45 6.46

α = -1.2360E-05T2 + 6.2714E-03T + 6.0234α = -1E-05T2 + 0.0062T + 6.0234

Page 17: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

17

THE END

Page 18: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

18

Truncation Error

http://numericalmethods.eng.usf.edu

Page 19: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

19

Truncation error

• Error caused by truncating or approximating a mathematical procedure.

Page 20: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

20

Example of Truncation Error

Taking only a few terms of a Maclaurin series toapproximate

....................!3!2

132

xx

xex

xe

If only 3 terms are used,

!21

2xxeErrorTruncation x

Page 21: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

21

Another Example of Truncation Error

Using a finite

x to approximate

)(xf

x

xfxxfxf

)()()(

P

Q

secant line

tangent line

Figure 1. Approximate derivative using finite Δx

Page 22: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

22

Another Example of Truncation Error

Using finite rectangles to approximate an integral.

y = x2

0

30

60

90

0 1.5 3 4.5 6 7.5 9 10.5 12

y

x

Page 23: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

23

Example 1 —Maclaurin series

Calculate the value of

2.1e with an absoluterelative approximate error of less than 1%. ...................

!3

2.1

!2

2.12.11

322.1 e

n

1 1 __ ___

2 2.2 1.2 54.545

3 2.92 0.72 24.658

4 3.208 0.288 8.9776

5 3.2944 0.0864 2.6226

6 3.3151 0.020736 0.62550

aE %a2.1e

6 terms are required. How many are required to get at least 1 significant digit correct in your answer?

Page 24: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

24

Example 2 —Differentiation

Find )3(f for 2)( xxf using

x

xfxxfxf

)()()(

and

2.0x

2.0

)3()2.03()3('

fff

2.0

)3()2.3( ff

2.0

32.3 22

2.0

924.10

2.0

24.1 2.6

The actual value is ,2)(' xxf 632)3(' f

Truncation error is then,

2.02.66

Can you find the truncation error with

1.0x

Page 25: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

25

Example 3 — Integration

Use two rectangles of equal width to approximate the area under the curve for 2)( xxf over the

interval]9,3[

y = x2

0

30

60

90

0 3 6 9 12

y

x

9

3

2dxx

Page 26: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

26

Integration example (cont.)

)69()()36()(6

2

3

29

3

2 xx

xxdxx

3)6(3)3( 22 13510827

Choosing a width of 3, we have

Actual value is given by

9

3

2dxx9

3

3

3

x234

3

39 33

Truncation error is then99135234

Can you find the truncation error with 4 rectangles?

Page 27: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

Additional Resources

For all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit

http://numericalmethods.eng.usf.edu/topics/sources_of_error.html

Page 28: 10/16/20151 Sources of Error Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder  Transforming Numerical Methods

THE END

http://numericalmethods.eng.usf.edu