Download presentation
1
NUMERICAL ERROR ENGR 351 Numerical Methods for Engineers
Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier
2
Copyright© 1999 by Lizette R. Chevalier
Permission is granted to students at Southern Illinois University at Carbondale to make one copy of this material for use in the class ENGR 351, Numerical Methods for Engineers. No other permission is granted. All other rights are reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the copyright owner.
3
SIMPLE STATISTICS Arithmetic mean Standard deviation
4
Simple Statistics cont.
Variance, sy2 Coefficient of variation
5
Pseudo Code Review for First Programming Assignment
Raw Data Code Output Data
6
ASCII Acronym for American Standard Code for Information Interchanged
Pronounced ask-key Also referred to as a text file Generate in C++, Fortran, Basic, etc. editors Generate in Notepad Can generate in Word, but need to save as a text file Executable programs are never stored in ASCII format
7
Pseudo Code Review for First Programming Assignment
Raw Data Code Output Data These are in ASCII format, unless you are using an executable version of your code. In that case, only the data (input and output) are ASCII format.
8
Pseudo Code for Average
10 77.8 39.2 56.7 98.2 88.7 86.2 76.3 82.5 93.6 78.2 Data file input.dat Read an ASCII file that 1. Inputs number of students n 2. Inputs scores y(n)
9
Pseudo Code for Average
DIMENSION Y OPEN INPUT.DAT READ N DO I=1,N READ Y(N) CONTINUE DO J=1,N SUM=SUM+Y(J) AVERAGE = SUM/N PRINT “AV”
10
PROBLEM Modify the pseudo-code to calculate the variance.
11
Approximation and Errors Significant Figures
1.845 43,500 ? confidence 4.35 x significant figures 4.350 x significant figures x significant figures
12
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
13
increasing accuracy increasing precision
14
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
15
Error definitions cont.
True relative percent error But we may not know the true answer apriori
16
Error definitions cont.
May not know the true answer apriori This leads us to develop an iterative approach of numerical methods
17
Error definitions cont.
Usually not concerned with sign, but with tolerance Want to assure a result is correct to n significant figures
18
Example Consider a series expansion to estimate trigonometric
functions Estimate sin p/ 2 to three significant figures
19
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 To gain insight consider the mathematical formulation that is used widely in numerical methods - TAYLOR SERIES
20
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 Zero order approximation This is good if the function is a constant.
21
Taylor Series Expansion
First order approximation slope multiplied by distance Still a straight line but capable of predicting an increase or decrease - LINEAR
22
Taylor Series Expansion
Second order approximation - captures some of the curvature
23
Taylor Series Expansion
24
Taylor Series Expansion
25
Example Use zero through fourth order Taylor series expansion to approximate f(1) given f(0) = 1.2 (i.e. h = 1) Note: f(1) = 0.2
26
Functions with infinite number of derivatives
f(x) = cos x f '(x) = -sin x f "x) = -cos x f "'(x) = sin x Evaluate the system where xi = p/4 and xi+1 = p /3 h = p /3 - p /4 = p /12
27
Functions with infinite number of derivatives
Zero order f(p /3) = cos (p/4 ) = et = 41.4% First order f(p /3) = cos (p/4 ) - sin (p/4 )(p/12) et = 4.4% Second order f(p /3) = et = 0.45% By n = 6 et = 2.4 x 10-6 %
28
Exam Question How many significant figures are in the following numbers? A B C x 10-3 D. 23,000,000 E. 2.3 x 107
29
TAYLOR SERIES PROBLEM Use zero- through fourth-order Taylor series expansions to predict f(4) for f(x) = ln x using a base point at x = 2. Compute the percent relative error et for each approximation.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.