Download presentation
Presentation is loading. Please wait.
Published byAlvin Barber Modified over 9 years ago
1
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
2
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
3
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
4
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
5
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 5 Course Reader
6
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
7
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
8
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
9
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
10
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.
11
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
12
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
13
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
14
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
15
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?
16
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
17
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 17 Algorithms, Flowcharts, and Pseudocode
18
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 18 Flowchart Symbols
19
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
20
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 20 Selection
21
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 21 Repetition
22
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”.
23
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
24
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? 1 - 2 - 3 - 4 ? It depends on the confidence –How can we show the confidence? Scientific Notation –5 x10 3 - 1 significant digit –5.00 x 10 3 - 3 significant digits
25
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 0.00562 0.0000562 0.000000562 Each of the above has 3 significant digits. The zeros are just used to locate the decimal point –What is ? 3.14159265… Engineers and computers can only retain a finite number of significant figures. The omission of the remaining figures is round- off error.
26
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 26 Significant Figures - Continued –Example 10.34 kg 6.1 kg 25.21 kg 13 kg Add the following measures of weight 55 kg We can’t say 54.65 kg because we don’t know whether or not 13 is 13.00 kg or 13.45 kg Don’t give answers to more significant figures than you know (especially in Excel)! 54.65 kg
27
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)
28
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.
29
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
30
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
31
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
32
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-10 - 10 digits 5214 = 5x10 3 + 2x10 2 + 1x10 1 + 4x10 0 4 x 1 = 4 1 x 10 = 10 2 x100 = 200 5 x 1000 = 5000 5,214
33
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 33 Chopping vs. Rounding = 3.14159265358 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 3.141592 E t = True - Approx. = 0.00000065 An alternative method is rounding - if the last discarded digit is 5 we round up 3.141593 E t = -0.00000035 Rounding reduces the error… in this case almost by 50%
34
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
35
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
36
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 36 Roundoff vs. Truncation Let’s look at Excel
37
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
38
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 38 Bad Homework
39
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 39 Better Homework
40
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.