Anda di halaman 1dari 26

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.

Chapter Outline
1.1 Introduction
1.2 Mathematical Modeling and Engineering Problem Solving 1.3 Programming and Software 1.4 Errors

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.


A mathematical model is a functional relationship of the form:

Dependent variable = f

independent forcing variables,parameters,functions

Solution for differential equation cannot be solved analytically using simple algebraic solution. The exact solution for differential equation can be solved using calculus or by approximation using numerical methods.

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 developed as a matrix laboratory. MATLAB is closely related to programming.

Familiar yourself with MATLAB !!

How to do it??
1) Install MATLAB software in your notebook. 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?

How closely a measured value agrees with the true value.

Accuracy?

Inaccuracy?

How closely individual measured values agree with each other.

Precision? Imprecision?

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 error, Et ?? True percent relative error, t ??

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 a 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 a tolerance given, .
s

a s

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

s 0.5 10

2n

(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 5.380 x 104 5.3800 x 104

3 4 5

Zeros are sometimes used to locate the decimal point not significant figures. 0.00001753 0.0001753 0.001753 4 4 4

Number of significant figures indicates precision.

Types of errors- Round-off error Numbers such as , e, or 7 cannot be expressed by a fixed number of significant figures.

The discrepancy introduced by error of significant 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? Its 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 difference c) 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?