Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 1 CEE 3704 Statistical and Numerical Analysis.

Slides:



Advertisements
Similar presentations
Roundoff and truncation errors
Advertisements

2009 Spring Errors & Source of Errors SpringBIL108E Errors in Computing Several causes for malfunction in computer systems. –Hardware fails –Critical.
CSE 330: Numerical Methods
Overview CNS 3320 – Numerical Software Engineering.
Chapter 1 Computing Tools Data Representation, Accuracy and Precision Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Villanova University Dept. of Civil & Environmental Engineering CEE 3702 Numerical Analysis 1 CEE 3702 Numerical Analysis Lecture 2 Dr. David W. Dinehart.
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Approximations and Errors
NUMERICAL ERROR ENGR 351 Numerical Methods for Engineers
Part 3 Truncation Errors Second Term 05/06.
Round-Off and Truncation Errors
Lecture 2: Numerical Differentiation. Derivative as a gradient
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 6 Roots of Equations Bracketing Methods.
Chapter 1 Introduction The solutions of engineering problems can be obtained using analytical methods or numerical methods. Analytical differentiation.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 3 Approximations and Errors.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 5 Approximations, Errors and The Taylor Series.
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.
Villanova University Dept. of Civil & Environmental Engineering CEE 3702 Numerical Analysis 1 CEE 3702 Numerical Analysis Fall 2000 Dr. David W. Dinehart.
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
Introduction and Chapter 1
MMJ 1113 Computational Methods for Engineers Mohsin Mohd Sies Fakulti Kejuruteraan Mekanikal, Universiti Teknologi Malaysia.
Lesson Starter Look at the specifications for electronic balances. How do the instruments vary in precision? Discuss using a beaker to measure volume versus.
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.
CSE 541 Rick Parent ELEMENTARY NUMERICAL METHODS Winter 2012.
ES 240: Scientific and Engineering Computation. Chapter 4 Chapter 4: Errors Uchechukwu Ofoegbu Temple University.
ME 142 Engineering Computation I Computer Precision & Round-Off Error.
Correlation and Linear Regression. Evaluating Relations Between Interval Level Variables Up to now you have learned to evaluate differences between the.
Truncation Error and the Taylor Series
NUMERICAL ERROR Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
MECN 3500 Inter - Bayamon Lecture 3 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Physical Science Methods and Math Describing Matter The Scientific Method Measurements and Calculations 1.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Introduction Course Outline.
Numerical Methods.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 3.
Sensitivity derivatives Can obtain sensitivity derivatives of structural response at several levels Finite difference sensitivity (section 7.1) Analytical.
Numerical Analysis Intro to Scientific Computing.
Meeting 15 Introduction to Numerical Methods Error Analysis.
AUGUST 2. MATH 104 Calculus I Review of previous material…. …methods and applications of integration, differential equations ………..
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.
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.
Chapter 2 Errors in Numerical Methods and Their Impacts.
NUMERICAL ANALYSIS I. Introduction Numerical analysis is concerned with the process by which mathematical problems are solved by the operations.
ME 142 Engineering Computation I
Chapter 2 ERROR ANALYSIS
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Errors in Numerical Methods
Class Notes 18: Numerical Methods (1/2)
Roundoff and Truncation Errors
Errors in Numerical Methods
Dr. Clincy Professor of CS
Approximations and Round-Off Errors Chapter 3
Numerical Analysis Lecture 2.
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
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.
Pivoting, Perturbation Analysis, Scaling and Equilibration
Presentation transcript:

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 1 CEE 3704 Statistical and Numerical Analysis Fall 2003 Dr. David W. Dinehart

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 2 Lecture Outline Overview of the second half of the course –Identify expectations –Define and identify Numerical Methods –Topics to be covered Identify the necessary steps of creating a program Identify Different Types and Measures of Error Review of Excel

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 3 Learning Outcomes 1.Identify the necessary steps of creating a program, using either flowcharts, algorithms or pseudocode 2.Identify and define different types and measures of error 3.Use Excel to solve a numerical problem

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 4 Course Overview Attendance and Punctuality –Come on time –Do not walk out mid-lecture Room –Nice facility –PowerPoint – White Board – Computer Examples

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 5 Course Reader

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 6 Homework Requirements Performed on Engineering Paper or Computer Include problem statement Figure/Sketch (use straight edge) Equations Units Significant Figures Stapled Group work No late homework No inferior homework Solutions posted on website

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 7 What are Numerical Methods? Numerical Methods are a class of methods for solving a wide variety of mathematical problems/engineering systems In our case, these mathematical problems will be representing engineering systems

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 8 Mathematical Representation of a Physical System Load on a Beam Flow in a Stream

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 9 Topics to be Covered Formulation and Error Finding Roots of an Equation Linear Algebra - Matrices Numerical Integration Numerical Derivatives

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 10 Numerical Methods Numerical methods only employ arithmetic operations and logic; therefore, they are ideally suited for computer application We won’t be doing a lot of “programming”; we will be using Excel extensively.

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 11 Applicability of Numerical Methods In this course we want to understand the various types of numerical methods so that we know their capabilities and limitations

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 12 Important Limitations 1. No complex physical situation can be exactly simulated mathematically 2. No numerical method is trouble-free in all situations 3. No numerical method is completely error-free 4. No numerical method is optimal for all situations

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 13 Important Limitations Number 1 is very important, but beyond our focus There is a lot of overlap between 2, 3, and 4 This is where we will focus You will see and apply various numerical methods in your other courses

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 14 Computers and Software What is the slope of the line? Numerical Derivative

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 15 Programming Any engineering equation can be expressed as a function The second half of this course will allow us to solve these functions Numerical analysis techniques lend themselves to computer programming Where do we start?

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 16 Your plan of attack (includes equations) Nuts and bolts *VERY IMPORTANT* Revisions/Improvements

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 17 Algorithms, Flowcharts, and Pseudocode

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 18 Flowchart Symbols

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 19 Fundamental Control Structures 1. Sequence 2. Selection 3. Repetition *Any program can be constructed using only these three operations

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 20 Selection

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 21 Repetition

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 22 Types of Error Human Error Data Error –Example: How tall is he/she? As accuracy increases, the number of significant figures increases and the “costs” increase. In general, increasing accuracy and precision increases “costs”.

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 23 Types of Error - Continued Example of Precision vs. Cost –Consider the distance from the football stadium to the entrance of CEER. The “cost” will depend on the accuracy and precision. Use a map with a scale to keep the “cost” low, but sacrifice precision Use a survey crew to gain precision, but the “cost” goes up Round-off Error –Computer Software Truncation Error –Equations –Numerical Methods

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 24 Significant Figures The significant digits of a number are those that can be used with confidence –How many significant digits does 5,000 have? ? It depends on the confidence –How can we show the confidence? Scientific Notation –5 x significant digit –5.00 x significant digits

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 25 Significant Figures - Continued –How many significant figures do the following have Each of the above has 3 significant digits. The zeros are just used to locate the decimal point –What is  ? … Engineers and computers can only retain a finite number of significant figures. The omission of the remaining figures is round- off error.

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 26 Significant Figures - Continued –Example kg 6.1 kg kg 13 kg Add the following measures of weight 55 kg We can’t say kg because we don’t know whether or not 13 is kg or kg Don’t give answers to more significant figures than you know (especially in Excel)! kg

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 27 Accuracy and Precision Accuracy - how close a measured value agrees with a true value Precision - how close measured values agree with each other –Testing concrete cylinders Cement + Sand + Water + Rock = Concrete Experimental work – making and breaking concrete cylinders to measure strength Concrete has many non-uniformities - strength increases as time increases Design strength = 4,000 psi at 28 days (true value)

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 28 Definition of Error Relationship between the exact (or true) result and approximate result is … True Value = Approximation + Error Rewriting… E t = True Value - Approximation E t = Exact Value of the Error t - “True” Error This measure does not account for the magnitude of error relative to the magnitude we are interested in.

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 29 Definition of Error - Continued E t = 2.0” It’s great for measuring distance from stadium to CEER It’s not so good for measuring someone’s height One method to account for the magnitudes of the quantities being evaluated is to normalize the error to the true value. Is this good? True Fractional Relative Error = True Error True Value

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 30 Definition of Error - Continued True Percent Relative Error = E t = True Error True Value x 100% What is the problem with these measures of error? In real world applications we usually don’t know the True Value In these cases what do we do? We can normalize to our best approximation E a = Approximate Error Approximation x 100% ‘a’ denotes we are normalizing to an approximate value

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 31 Definition of Error - Continued E a = Current Approximation - Previous Approximation Current Approximation x 100% One of the challenges of using numerical methods is determining error estimates without knowing the True Value A lot of numerical methods use an iterative approach. A current approximation is made based on a previous approximation. For these cases the percent relative error is... Note ‘E’ can be positive or negative. We are usually not interested in the sign. For an iterative approach, we use E a as a stopping criteria

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 32 Round-off Error Definition: the discrepancy introduced by the omission of significant figures –Computers retain a fixed number of significant figures during a calculation; therefore, numbers like  and e cannot be expressed exactly. –Computers use a Base-2 representation so they cannot precisely represent certain exact Base-10 numbers We are most familiar with Base digits 5214 = 5x x x x x 1 = 4 1 x 10 = 10 2 x100 = x 1000 = ,214

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 33 Chopping vs. Rounding  = If we need to store this number in Base-10 carrying 7 significant figures... One method of approximation is chopping - chop off anything beyond 7 figures E t = True - Approx. = An alternative method is rounding - if the last discarded digit is 5 we round up E t = Rounding reduces the error… in this case almost by 50%

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 34 Truncation Error & Taylor Series Truncation errors occur when we replace an exact mathematical procedure with an approximation Taylor Series –Used to predict a value of a function at one point based on the value of the function and its derivatives at another point f(x i+1 ) = f(x i ) + f ’(x i )h + f ’’(x i )h 2 + f ’’’(x i )h 3 + … + f (n) (x i )h n + R n 2! 3! n! h = Step Size = x i+1 - x i R n = Remainder Term = f (n+1) (  )h n+1 (n+1) R n accounts for all terms from n+1 to h  = Value between x i and x i+1

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 35 Taylor Series - Continued Zero-Order Approximation - 1st Term f(x i+1 ) = f(x i ) Value of the new point is approximately equal to the value of the old point (This is true for a constant function) If the function changes over the interval (h), we need more terms To increase the accuracy of our approximation we can… 1. Increase the number of terms 2. Decrease our step size, h

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 36 Roundoff vs. Truncation Let’s look at Excel

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 37 Homework #1 Review my Excel example Create your weekly schedule in Excel –Borders/Shading –Fonts –Color –Column Width

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 38 Bad Homework

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 39 Better Homework

Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 40 Homework #1 Review my Excel example Create your weekly schedule in Excel “Program” problem 3-13 from structural analysis in Excel (solution is on the course homepage) –Include the figure –Calculations and commentary –Answers (forces and reactions) boxed and highlighted –Use multiple worksheets as necessary –Setup the spreadsheet so that it can solve for the member forces and reactions for various horizontal and vertical lengths and loadings Due next Thursday