Lec 01 GENG 300 Numerical Methods

37
GENG 300 NUMERICAL METHODS Dr. Mohammad Aman Ullah

description

numerical lectures

Transcript of Lec 01 GENG 300 Numerical Methods

Page 1: Lec 01 GENG 300 Numerical Methods

GENG 300 NUMERICAL METHODS

Dr. Mohammad Aman Ullah

Page 2: Lec 01 GENG 300 Numerical Methods

BOOKS 6/27/2015

2

Num

erical Methods

Course Textbook: o Applied Numerical Methods with MATLAB

for Engineers and scientists, Chapra S.C., 3rd edition, McGraw- Hill, 2012

Reference(s): o Chapra S.C. and R.P. Canale (2006)

Numerical Methods for Engineers, 5th edition, McGraw- Hill.

Page 3: Lec 01 GENG 300 Numerical Methods

CONTENTS 6/27/2015

3

Num

erical Methods

1. Modeling, Computers, and Error analysis 2. Roots of equations 3. Linear algebraic equations 4. Curve fitting and interpolation 5. Numerical differentiation & integration 6. Ordinary differential equations

Page 4: Lec 01 GENG 300 Numerical Methods

GRADES 6/27/2015

4

Num

erical Methods

HWs and Quizzes: 20% Midterm: 20 % Laboratory: 15 % Term Project: 10 % Final Exam: 35 %

Page 5: Lec 01 GENG 300 Numerical Methods

COURSE OBJECTIVES 6/27/2015

5

Num

erical Methods

To introduce students to the mostly used numerical methods in the different engineering fields. The course is not theorem-oriented one. The emphasis will be on understanding the concepts of the numerical methods and on applying these concepts for solving various problems. MATLAB and Microsoft Excel will be used as tools to solve the problems using the different numerical methods.

Page 6: Lec 01 GENG 300 Numerical Methods

COURSE LEARNING OUTCOMES (CLO) 6/27/2015

6

Num

erical Methods

1. Be aware of the mathematical background for the different numerical methods introduced in the course. 2. Understand the different numerical methods to solve the algebraic equations and to solve system of linear and non linear equations. 3. Understand the different numerical methods for interpolation, differentiation, integration and solving set of ordinary differential equations.

Page 7: Lec 01 GENG 300 Numerical Methods

COURSE LEARNING OUTCOMES (CLO)… 6/27/2015

7

Num

erical Methods

4. Understand how numerical methods afford a mean to generate solutions in a manner that can be implemented on digital computers. 5. Use the built in functions in MATLAB and EXCEL. 6. Create MATLAB functions for solving numerical engineering problems. 7. Work on group projects.

Page 8: Lec 01 GENG 300 Numerical Methods

COURSE GROUND RULES 6/27/2015

8

Num

erical Methods

1. Use of programmable calculator: not allowed 2. Class Attendance:

a) taken at 10 minutes; after 10 minutes can attend but recorded absent

b) no makeup except with a valid (medical) reason 3. Plagiarism:

a) will be reported to HoD for formal actions b) borrowing and sharing of resources are not

allowed 4. Cell Phones:

a) during lectures "Silent" or "OFF“, during exams "OFF".

b) not allowed to use as a calculator

Page 9: Lec 01 GENG 300 Numerical Methods

INTRODUCTION

6/27/2015

9

Num

erical Methods

Lecture 1: Chapter 1 & 4

Modeling, Computers and Error Analysis

Page 10: Lec 01 GENG 300 Numerical Methods

TOPICS COVERED FROM CHAPTER 1 & 4 6/27/2015

10

Num

erical Methods

1. Why numerical methods? 2. Mathematical Modelling concept 3. Error Analysis:

a. Significant figures b. Accuracy and precision c. Error definitions

i. For known true value ii. For approximations

d. Major errors i. Round off ii. Truncation

Page 11: Lec 01 GENG 300 Numerical Methods

1. WHY NUMERICAL METHODS? 6/27/2015

11

Num

erical Methods

Page 12: Lec 01 GENG 300 Numerical Methods

1. WHY NUMERICAL METHODS? 6/27/2015

12

Num

erical Methods

Page 13: Lec 01 GENG 300 Numerical Methods

2. MATHEMATICAL MODELLING CONCEPT 6/27/2015

13

Num

erical Methods

Why do we do modelling?

To understand physical phenomena and describe it mathematically To use the mathematically formulated model as a tool to predict the behaviour of a system for the new conditions In order for a model to be used as a simulation tool the model should represent the reality as close as possible. Therefore, validation of a model with experimental observation is an absolute necessity to gain confidence in a model before using it in a simulation processes.

Page 14: Lec 01 GENG 300 Numerical Methods

MATHEMATICAL MODEL… 6/27/2015

14

Num

erical Methods

Page 15: Lec 01 GENG 300 Numerical Methods

6/27/2015

15

Num

erical Methods

Complex example: MATHEMATICAL MODEL…

Model for falling parachute:

Page 16: Lec 01 GENG 300 Numerical Methods

6/27/2015

16

Num

erical Methods

MATHEMATICAL MODEL…

Dependent variable

Forcing function

Parameters

Independent variable

Page 17: Lec 01 GENG 300 Numerical Methods

6/27/2015

17

Num

erical Methods

Conservation laws are fundamental laws that are used in engineering.

If no accumulation (i.e. no change over time), in and out must be balanced.

MATHEMATICAL MODEL…

Conservation Laws and Engineering:

Page 18: Lec 01 GENG 300 Numerical Methods

6/27/2015 N

umerical M

ethods

18

Flow in = Flow out

MATHEMATICAL MODEL…

For steady-state fluid flow in pipe:

Page 19: Lec 01 GENG 300 Numerical Methods

6/27/2015 N

umerical M

ethods

19

MATHEMATICAL MODEL…

For steady-state condition in falling parachute:

Thus,

Page 20: Lec 01 GENG 300 Numerical Methods

3. ERROR ANALYSIS 6/27/2015

20

Num

erical Methods

Why errors are concerned ? 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?” Motivating example: How long does it take to reach a 11 carat uncut diamond located 20 meter away, if you travel by a car that runs at 10m/s on the 1st second, 5 m/s on the 2nd second, 2.5 m/s on the 3rd second and so on i.e. speed decreases by half on the next seconds?

Answer by a mathematician: Answer by an Engineer: Answer by a lawyer:

Page 21: Lec 01 GENG 300 Numerical Methods

3A. SIGNIFICANT FIGURES 6/27/2015

21

Num

erical Methods

Page 22: Lec 01 GENG 300 Numerical Methods

3A. SIGNIFICANT FIGURES (SF) 6/27/2015

22

Num

erical Methods

Page 23: Lec 01 GENG 300 Numerical Methods

3A. SIGNIFICANT FIGURES (SF) 6/27/2015

23

Num

erical Methods

Significant figures also are indication of the precision with which the quantity is known.

The more significant figures, the more precise is the value.

Generally, if you report the value of a measured quantity with 3 SF, you indicate that the value of the third of these figures may be off by as much as a half-unit.

Example: 8.3 g, means the mass lies between 8.25 and 8.35 g.

Page 24: Lec 01 GENG 300 Numerical Methods

3A. SIGNIFICANT FIGURES (SF) 6/27/2015

24

Num

erical Methods

Page 25: Lec 01 GENG 300 Numerical Methods

3B. ACCURACY AND PRECISION 6/27/2015

25

Num

erical Methods

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

Page 26: Lec 01 GENG 300 Numerical Methods

3B. ACCURACY AND PRECISION 6/27/2015

26

Num

erical Methods

Page 27: Lec 01 GENG 300 Numerical Methods

3C. ERROR DEFINITIONS 6/27/2015

27

Num

erical Methods

Page 28: Lec 01 GENG 300 Numerical Methods

3C. ERROR…TOLERANCE 6/27/2015

28

Num

erical Methods

Page 29: Lec 01 GENG 300 Numerical Methods

3DI. MAJOR ERRORS- ROUND-OFF ERROR 6/27/2015

29

Num

erical Methods

Page 30: Lec 01 GENG 300 Numerical Methods

3DI. MAJOR ERRORS- ROUND-OFF ERROR 6/27/2015

30

Num

erical Methods

Page 31: Lec 01 GENG 300 Numerical Methods

3DII. MAJOR ERRORS- TRUNCATION ERROR 6/27/2015

31

Num

erical Methods

Truncation errors are those that result from using an approximation in place of an exact mathematical procedure. Non-elementary functions such as trigonometric, exponential, and others are expressed in an approximate fashion using Taylor series when their values, derivatives, and integrals are computed Any smooth function can be approximated as a polynomial. Taylor series provides a means to predict the value of a function at one point in terms of the function value and its derivatives at another point. Taylor Series (TS) is built term by term, started with zero-order approximation. The higher the order of approximation applied, the lower the truncation error.

Page 32: Lec 01 GENG 300 Numerical Methods

3DII. TRUNCATION ERROR- TAYLOR SERIES 6/27/2015

32

Num

erical Methods

Page 33: Lec 01 GENG 300 Numerical Methods

3DII. TAYLOR SERIES… 6/27/2015

33

Num

erical Methods

For exact solution infinite number of terms are required In most cases, only a few terms will result in an approximation that is close enough to the true value for practical purposes

Page 34: Lec 01 GENG 300 Numerical Methods

3DII. TAYLOR SERIES… 6/27/2015

34

Num

erical Methods

Page 35: Lec 01 GENG 300 Numerical Methods

3DII. TAYLOR SERIES… 6/27/2015

35

Num

erical Methods

Derivatives used in Taylor series can be approximated using numerical differentiation with:

Page 36: Lec 01 GENG 300 Numerical Methods

6/27/2015 N

umerical M

ethods

36

2.125.05.015.01.0)( 234 +−−−−= xxxxxf

at x =0.25, the derivative can be calculated directly as:

25.00.114.04.0)(' 23 −−−−= xxxxf

Given

9125.0)25.0(' −==xf

TRY FOR YOURSELF …

Page 37: Lec 01 GENG 300 Numerical Methods

SUMMARY 6/27/2015

37

Num

erical Methods

1. Why numerical methods? 2. Mathematical Modelling concept 3. Error Analysis:

a. Significant figures b. Accuracy and precision c. Error definitions

i. For known true value ii. For approximations

d. Major errors i. Round off ii. Truncation