chapter 1 enotes.ppt

26
Numerical Methods for Engineers Chapter 1 Modeling, Computers and Error Analysis

Upload: ryuuara-az-zahra

Post on 23-Oct-2015

5 views

Category:

Documents


1 download

DESCRIPTION

chapter 1

TRANSCRIPT

Numerical Methods for Engineers

Chapter 1

Modeling, Computers and Error Analysis

TOPIC OUTCOMES

At the end of the topic, students should be able to:

•Describe the use of mathematical modeling in engineering problem solving.

•Define both exact and numerical solutions.

•Apply the software package (MATLAB) for common mathematical operations

•Calculate true percent relative error t, percent relative error a and percent tolerance s.

1.1 Introduction

1.2 Mathematical Modeling and Engineering Problem Solving

1.3 Programming and Software

1.4 Errors

Chapter Outline

Mathematical Modeling and Engineering Problem Solving

What is the relationship between mathematic modeling and engineering problem-solving?

What is mathematic model?

Equation that expresses the features of system or process in mathematical terms.

Dependent independent forcing

variable = fvariables,parameters,functions

{

A mathematical model is a functional relationship of the form:

{

The exact solution for differential equation can be solved using calculus or by approximation using numerical methods.

Solution for differential equation cannot be solved analytically using simple algebraic solution.

Conservation Laws and Engineering

Conservation laws: fundamental laws that are used in engineering.

Change = increases – decreases

If the no change or steady-state, the increases and decreases must be balance.

Increases =Decreases (Steady-sate)

For steady-state fluid flow in pipe,

Flow in = Flow out

Programming and Software

We are going to use the computer as a tool to obtain numerical solutions to a given engineering model.

Selected software- MATLAB®

MATLAB® is originally developedas a matrix laboratory.MATLAB® is closely related to programming.

Familiar yourself with MATLAB® !!

1) Install MATLAB® software in your notebook.

How to do it??

2) Explore the Appendix B in Chapra and Canale (2006).3) Try any other exercises.

4) Check the answers MATLAB® gave and make sure you understand them.

Errors

Why errors are concerned??

For many engineering problems, we cannot obtain exact solutions.Numerical methods yield approximate results, results that are close to the exact solution.

The question is “How much error is present in our calculation and is it tolerable?”

Accuracy?

Precision?

Inaccuracy?

Imprecision?

How closely a measured value

agrees with the true value.

How closely individual

measured values agree with each

other.

In numerical methods, we use approximation to represent the exact mathematical operations.

Numerical errors rise…

Numerical error equal to discrepancy between the truth and approximation:

True percent relative error, t ??

True error, Et ??

If we cannot solved the problem analytically to get the true value, how to calculate its true error?

We normalized the error to approximate value.

Numerical methods use iterative approach to compute answers. A present approximation is made on the basis of a previous approximation.

Percent relative error, a ??

The may be in +ve or –ve signs. But the most important is its absolute value.

The calculation should proceed until the absolute value of lower than percent tolerance given, .

aεsε

sa ε ε

Result is correct/almost exact after the iteration to at least n significant figures. n= 1,2,3….

%100.5 2 nsε

(See Example 3.2)

What is significant figures?

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,800 How many significant figures?

5.38 x 104 3 5.380 x 104 4 5.3800 x 104 5

Zeros are sometimes used to locate the decimal point not significant figures.

0.00001753 40.0001753 40.001753 4

Number of significant figures indicates precision.

Types of errors- Round-off error

Numbers such as π, e, or cannot be expressed by a fixed number of significant figures.

7

The discrepancy introduced by error ofsignificant figures is called round-off error.

Types of errors- Truncation error

Truncation errors are those that result from using an approximation in place of an exact mathematical procedure.

The Taylor series

A mathematical formulation that used widely in numerical methods to predict a function value in approximate fashion.

Why it is called in series?

It’s build term by term, started with zero-order approximation. The higher the order of approximation applied, the lower the truncation error.

How to solve the derivatives of an equation given using Taylor series?

We use an approximation using numerical differentiation with:

a) Forward divided difference b) Backward divided differencec) Centered divided difference

They are developed from the Taylor series to approximate derivatives numerically.

a) Forward divided difference (1st derivative)

>>> equation 4.17

b) Backward divided difference (1st derivative)

>>> equation 4.20

c) Centered divided difference (1st derivative)

>>> equation 4.22

Try out Example 4.4

CONCLUSION• Mathematical modelling is…• Exact and numerical solution?• Types of error?• Anything else?