MECN 3500 Inter - Bayamon Lecture 3 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo

Slides:



Advertisements
Similar presentations
Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Advertisements

E. T. S. I. Caminos, Canales y Puertos1 Lecture 1 Engineering Computation.
3- 1 Chapter 3 Introduction to Numerical Methods Second-order polynomial equation: analytical solution (closed-form solution): For many types of problems,
Roundoff and truncation errors
2009 Spring Errors & Source of Errors SpringBIL108E Errors in Computing Several causes for malfunction in computer systems. –Hardware fails –Critical.
Computational Modeling for Engineering MECN 6040
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Approximations and Errors
Round-Off and Truncation Errors
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 3 Approximations and Errors.
NUMERICAL ERROR ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
1 Error Analysis Part 1 The Basics. 2 Key Concepts Analytical vs. numerical Methods Representation of floating-point numbers Concept of significant digits.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 31.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Introduction and Analysis of Error Pertemuan 1
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Simple Data Type Representation and conversion of numbers
Numerical Computations in Linear Algebra. Mathematically posed problems that are to be solved, or whose solution is to be confirmed on a digital computer.
Information Representation (Level ISA3) Floating point numbers.
MMJ 1113 Computational Methods for Engineers Mohsin Mohd Sies Fakulti Kejuruteraan Mekanikal, Universiti Teknologi Malaysia.
Lecture 2 Number Representation and accuracy
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
MATH 685/CSI 700 Lecture Notes Lecture 1. Intro to Scientific Computing.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
EE 3561_Unit_1(c)Al-Dhaifallah EE 3561 : - Computational Methods in Electrical Engineering Unit 1: Introduction to Computational Methods and Taylor.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Data Representation in Computer Systems
ME 142 Engineering Computation I Computer Precision & Round-Off Error.
MECN 3500 Inter - Bayamon Lecture 7 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University 1 Chapter 1 Mathematical.
MECN 3500 Lecture 4 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Round-off Errors and Computer Arithmetic. The arithmetic performed by a calculator or computer is different from the arithmetic in algebra and calculus.
CSC 221 Computer Organization and Assembly Language
NUMERICAL ERROR Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
Lecture 3 Mechanical Measurement and Instrumentation MECN 4600 Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus.
Lecture 2 Numerical Methods for Engineering MECN 3500 Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus Dr.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Numerical Methods for Engineering MECN 3500
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 3.
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
MECN 3500 Inter - Bayamon Lecture 8 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Numerical Analysis Intro to Scientific Computing.
MECN 3500 Inter - Bayamon Lecture 6 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Numerical Analysis CC413 Propagation of Errors.
Errors in Numerical Methods
ESO 208A/ESO 218 LECTURE 2 JULY 31, ERRORS MODELING OUTPUTS QUANTIFICATION TRUE VALUE APPROXIMATE VALUE.
Numerical Analysis CC413 Propagation of Errors. 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate.
Module 2.2 Errors 03/08/2011. Sources of errors Data errors Modeling Implementation errors Absolute and relative errors Round off errors Overflow and.
1 Approximations and Round-Off Errors Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers Chapter.
Numerical Methods and Optimization C o u r s e 1 By Bharat R Chaudhari.
1 M 277 (60 h) Mathematics for Computer Sciences Bibliography  Discrete Mathematics and its applications, Kenneth H. Rosen  Numerical Analysis, Richard.
Cosc 2150: Computer Organization Chapter 9, Part 3 Floating point numbers.
Chapter 2 Errors in Numerical Methods and Their Impacts.
Department of Computer Science Georgia State University
ME 142 Engineering Computation I
New head garb has been ordered
Chapter 2 ERROR ANALYSIS
Errors in Numerical Methods
Roundoff and Truncation Errors
Errors in Numerical Methods
Approximations and Round-Off Errors Chapter 3
Numerical Analysis Lecture 2.
SKTN 2393 Numerical Methods for Nuclear Engineers
Chapter 1 / Error in Numerical Method
Roundoff and Truncation Errors
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

MECN 3500 Inter - Bayamon Lecture 3 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus

Lecture 3 MECN 3500 Inter - Bayamon 2 Tentative Lectures Schedule TopicLecture Mathematical Modeling and Engineering Problem Solving 1 Introduction to Matlab 2 Numerical Error 3 Root Finding 3 System of Linear Equations Least Square Curve Fitting Polynomial Interpolation Numerical Integration Ordinary Differential Equations

Lecture 3 MECN 3500 Inter - Bayamon Accuracy and Precision Approximations and Round- Off Errors 3

Lecture 3 MECN 3500 Inter - Bayamon  To understand the concept of error and its importance to the effective use of numerical methods. 4 Course Objectives

Lecture 3 MECN 3500 Inter - Bayamon  For many engineering problems, we cannot obtain analytical solutions.  Numerical methods yield approximate results, results that are close to the exact analytical solution. We cannot exactly compute the errors associated with numerical methods. Only rarely given data are exact, since they originate from measurements. Therefore there is probably error in the input information. Only rarely given data are exact, since they originate from measurements. Therefore there is probably error in the input information. Algorithm itself usually introduces errors as well, e.g., unavoidable round-offs, etc … Algorithm itself usually introduces errors as well, e.g., unavoidable round-offs, etc … The output information will then contain error from both of these sources. The output information will then contain error from both of these sources.  How confident we are in our approximate result?  The question is “how much error is present in our calculation and is it tolerable?” 5 Introduction

Lecture 3 MECN 3500 Inter - Bayamon Accuracy and Precision  Accuracy. How close is a computed or measured value to the true value  Precision (or reproducibility). How close is a computed or measured value to previously computed or measured values.  Inaccuracy (or bias). A systematic deviation from the actual value.  Imprecision (or uncertainty). Magnitude of scatter. 6

Lecture 3 MECN 3500 Inter - Bayamon Accuracy and Precision 7

Lecture 3 MECN 3500 Inter - Bayamon Significant Figures  Number of significant figures indicates precision. Significant digits of a number are those that can be used with confidence, e.g., the number of certain digits plus one estimated digit. 53,800How many significant figures? 5.38 x x x  Zeros are sometimes used to locate the decimal point not significant figures

Lecture 3 MECN 3500 Inter - Bayamon Error Definitions 9 True Value = Approximation + Error E t = True value – Approximation (+/-) True error

Lecture 3 MECN 3500 Inter - Bayamon 10

Lecture 3 MECN 3500 Inter - Bayamon Error Definitions Example 3.1: Calculation of Errors Problem Statement: Suppose that you have the task of measuring the lengths of a bridge and a rivet and come up with 9999 and 9 cm, respectively. If the true values are and 10 cm, respectively, compute (a) the true error and (b) the true percent relative error for each case. Problem Statement: Suppose that you have the task of measuring the lengths of a bridge and a rivet and come up with 9999 and 9 cm, respectively. If the true values are and 10 cm, respectively, compute (a) the true error and (b) the true percent relative error for each case. Solution: Solution: The error for measuring the bridge E t = =1cm And for the rivet it is E t =10-9=1cm 11

Lecture 3 MECN 3500 Inter - Bayamon Error Definitions The percent relative error for the bridge is And for the rivet it is Thus, although both measurements have an error of 1 cm, the relative error for the rivet is much greater. Thus, although both measurements have an error of 1 cm, the relative error for the rivet is much greater. 12

Lecture 3 MECN 3500 Inter - Bayamon Error Definitions For numerical methods, the true value will be known only when we deal with functions that can be solved analytically (simple systems). In real world applications, we usually not know the answer a priori. Then For numerical methods, the true value will be known only when we deal with functions that can be solved analytically (simple systems). In real world applications, we usually not know the answer a priori. Then Iterative approach, example Newton’s method Iterative approach, example Newton’s method 13 (+ / -)

Lecture 3 MECN 3500 Inter - Bayamon Error Definitions Use absolute value. Use absolute value. Computations are repeated until stopping criterion is satisfied. Computations are repeated until stopping criterion is satisfied. If the following Scarborough criterion is met If the following Scarborough criterion is met you can be sure that the result is correct to at least n significant figures. you can be sure that the result is correct to at least n significant figures. 14 Pre-specified % tolerance based on the knowledge of your solution

Lecture 3 MECN 3500 Inter - Bayamon 15

Lecture 3 MECN 3500 Inter - Bayamon Error Definitions Example 3.2: Error Estimates for Iterative Methods Problem Statement: In mathematics, functions can often be represented by infinite series. For example, the exponential function can be computed using Maclaurin Series Expansion. Starting with the simplest version, e x =1, add terms one at a time to estimate e 0.5. Note that the true value e 0.5 = Problem Statement: In mathematics, functions can often be represented by infinite series. For example, the exponential function can be computed using Maclaurin Series Expansion. Starting with the simplest version, e x =1, add terms one at a time to estimate e 0.5. Note that the true value e 0.5 = Solution: Solution: 16

Lecture 3 MECN 3500 Inter - Bayamon Error Definitions First to determine the error criterion that ensures a result is correct to at least three significant figures: First to determine the error criterion that ensures a result is correct to at least three significant figures: First term First term The True error: Et= – 1= The True error: Et= – 1=

Lecture 3 MECN 3500 Inter - Bayamon Error Definitions Second term Second term The True error: Et= – 1.5= The True error: Et= – 1.5=

Lecture 3 MECN 3500 Inter - Bayamon Error Definitions The entire computation can be summarized as The entire computation can be summarized as Thus, after the six terms are included, the approximate error falls below ε s =0.05% and the computation is terminated Thus, after the six terms are included, the approximate error falls below ε s =0.05% and the computation is terminated 19 TermsResultsε t (%)ε a (%)

Lecture 3 MECN 3500 Inter - Bayamon Round-Off Error Round-off errors originate from the fact that computers retain only a fixed number of significant figures during a calculation. Number such as pi, e, or sqrt(7) cannot be expressed by a fixed number of significant figures. Therefore they cannot be represented exactly by the computer. Round-off errors originate from the fact that computers retain only a fixed number of significant figures during a calculation. Number such as pi, e, or sqrt(7) cannot be expressed by a fixed number of significant figures. Therefore they cannot be represented exactly by the computer. Computer use a base-2 representation, they can not precisely represent certain exact base-10 numbers. Computer use a base-2 representation, they can not precisely represent certain exact base-10 numbers. The discrepancy introduced by this omission of significant figures is called round-off error. The discrepancy introduced by this omission of significant figures is called round-off error. 20

Lecture 3 MECN 3500 Inter - Bayamon Computer Representation of Numbers Numerical round-off error is related to the manner in which number are stored. Numerical round-off error is related to the manner in which number are stored. “Word” is the fundamental unit of information storage. It consist of a string of binary digits or bits. “Word” is the fundamental unit of information storage. It consist of a string of binary digits or bits. Number Systems: Number Systems:  Decimal-Base-10 System: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9  Binary-Base-2 System: 0, 1 21

Lecture 3 MECN 3500 Inter - Bayamon Computer Representation of Numbers 22

Lecture 3 MECN 3500 Inter - Bayamon Computer Representation of Numbers Integer Representation: The previous slides show how to represent 10-based numbers to binary form. Integer Representation: The previous slides show how to represent 10-based numbers to binary form. The most straightforward approach to represent integers on a computer is called signed magnitude method. It employs the first bit of a word to indicate the sign, with o for positive and a 1 for negative. The most straightforward approach to represent integers on a computer is called signed magnitude method. It employs the first bit of a word to indicate the sign, with o for positive and a 1 for negative. Representation of the decimal integer -173 on a 16-bit computer. Representation of the decimal integer -173 on a 16-bit computer. 23

Lecture 3 MECN 3500 Inter - Bayamon Computer Representation of Numbers Floating-Point Representation: Fractional quantities are typically represented in computer using floating-point form. In this approach, the number is expressed as a fractional part, called a mantissa or significand, and a integer part, called an exponent or characteristic, as in Floating-Point Representation: Fractional quantities are typically represented in computer using floating-point form. In this approach, the number is expressed as a fractional part, called a mantissa or significand, and a integer part, called an exponent or characteristic, as in 24 exponent Base of the number system used mantissa Integer part

Lecture 3 MECN 3500 Inter - Bayamon Computer Representation of Numbers  x10 3 in a floating point base-10 system  x10 3 in a floating point base-10 system. 25

Lecture 3 MECN 3500 Inter - Bayamon Computer Representation of Numbers Normalized to remove the leading zeroes. Multiply the mantissa by 10 and lower the exponent by 1. Normalized to remove the leading zeroes. Multiply the mantissa by 10 and lower the exponent by x x Suppose only 4 decimal places to be stored Additional significant figure is retained

Lecture 3 MECN 3500 Inter - Bayamon Computer Representation of Numbers Therefore for a base-10 system 0.1 ≤m<1 for a base-2 system0.5 ≤m<1  Floating point representation allows both fractions and very large numbers to be expressed on the computer. However, Floating point numbers take up more room. Floating point numbers take up more room. Take longer to process than integer numbers. Take longer to process than integer numbers. Round-off errors are introduced because mantissa holds only a finite number of significant figures. Round-off errors are introduced because mantissa holds only a finite number of significant figures. 27

Lecture 3 MECN 3500 Inter - Bayamon Chopping Example:  π = to be stored on a base-10 system carrying 7 significant digits.  π = chopping error e t =  π = rounded error e t =  Some machines use chopping, because rounding adds to the computational overhead. Since number of significant figures is large enough, resulting chopping error is negligible. 28

Lecture 3 MECN 3500 Inter - Bayamon Homework2  Omar E. Meza Castillo Ph.D. 29