1-Modeling, Computers, and Error Analysis
1-Modeling, Computers, and Error Analysis
06/18/24
Course Textbook:
o Applied Numerical Methods with MATLAB for
Numerical Methods
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.
2
CONTENTS
06/18/24
1. Modeling, Computers, and Error analysis
Numerical Methods
2. Roots of equations
3. Linear algebraic equations
4. Curve fitting and interpolation
5. Numerical differentiation & integration
6. Ordinary differential equations
3
GRADES
06/18/24
HWs and Quizzes: 10%
Numerical Methods
Midterm: 20 %
Laboratory: 20 %
Term Project: 15 %
Final Exam: 35 %
4
COURSE OBJECTIVES
06/18/24
To introduce students to the mostly used numerical
methods in the different engineering fields. The course is
Numerical Methods
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.
5
COURSE LEARNING OUTCOMES (CLO)
06/18/24
1. Distinguish and apply the different numerical methods to solve the
algebraic equations and to solve system of linear and nonlinear
equations.
Numerical Methods
2. Select and apply the different numerical methods for interpolation,
differentiation, integration and solving set of ordinary differential
equations.
3. Demonstrate how numerical methods afford a mean to generate
solutions in a manner that can be implemented on digital computers.
4. Apply the built in functions in MATLAB and EXCEL to solve
numerical engineering problems
5. Work on group projects and apply a range of numerical methods to
evaluate solutions to engineering problems 6
COURSE GROUND RULES
1. Use of programmable calculator: not allowed
06/18/24
2. Class Attendance:
a) taken at 10 minutes; after 10 minutes can attend but
recorded absent
Numerical Methods
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
7
Lecture 1: Chapter 1 & 4
06/18/24
Modeling, Computers and Error Analysis
Numerical Methods
INTRODUCTION
8
TOPICS COVERED FROM CHAPTER 1 & 4
1. Why numerical methods?
06/18/24
2. Mathematical Modelling concept
3. Error Analysis:
Numerical Methods
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
9
1. WHY NUMERICAL METHODS?
06/18/24
Numerical Methods
10
1. WHY NUMERICAL METHODS?
06/18/24
Numerical Methods
11
2. MATHEMATICAL MODELLING CONCEPT
Why do we do modelling?
06/18/24
To understand physical phenomena and describe it
Numerical Methods
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.
12
06/18/24 Numerical Methods
13
MATHEMATICAL MODEL…
MATHEMATICAL MODEL…
06/18/24
Complex example:
Numerical Methods
14
MATHEMATICAL MODEL…
06/18/24
Numerical Methods
Independent
variable
06/18/24
Conservation laws are fundamental laws that
Numerical Methods
are used in engineering.
16
MATHEMATICAL MODEL…
06/18/24
Flow in = Flow out
Numerical Methods
17
MATHEMATICAL MODEL…
06/18/24
Numerical Methods
Thus,
18
3. ERROR ANALYSIS
Why errors are concerned ?
06/18/24
Numerical methods yield approximate results, results that are
close to the exact solution.
The question is “How much error is present in our calculation
Numerical Methods
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 1 st 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: 19
3A. SIGNIFICANT FIGURES
06/18/24
Numerical Methods
20
3A. SIGNIFICANT FIGURES (SF)
06/18/24
Numerical Methods
21
3A. SIGNIFICANT FIGURES (SF)
06/18/24
which the quantity is known.
Numerical Methods
The more significant figures, the more precise is the value.
22
3A. SIGNIFICANT FIGURES (SF)
06/18/24
Numerical Methods
23
3B. ACCURACY AND PRECISION
06/18/24
Accuracy: How close is a computed or measured value to
the true value
Numerical Methods
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
24
3B. ACCURACY AND PRECISION
06/18/24
Numerical Methods
25
06/18/24 Numerical Methods
26
3C. ERROR DEFINITIONS
06/18/24 Numerical Methods
27
3C. ERROR…TOLERANCE
3DI. MAJOR ERRORS- ROUND-OFF
ERROR
06/18/24
Numerical Methods
28
3DI. MAJOR ERRORS- ROUND-OFF
ERROR
06/18/24
Numerical Methods
29
3DII. MAJOR ERRORS- TRUNCATION
ERROR
Truncation errors are those that result from using an
approximation in place of an exact mathematical procedure.
06/18/24
Non-elementary functions such as trigonometric, exponential,
and others are expressed in an approximate fashion using
Numerical Methods
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. 30
3DII. TRUNCATION ERROR- TAYLOR
SERIES
06/18/24
Numerical Methods
31
3DII. TAYLOR SERIES…
06/18/24
Numerical 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 32
06/18/24 Numerical Methods
33
3DII. TAYLOR SERIES…
3DII. TAYLOR SERIES…
Derivatives used in Taylor series can be approximated using numerical
differentiation with:
06/18/24
Numerical Methods
34
TRY FOR YOURSELF …
Given
06/18/24
f ( x) 0.1x 4 0.15 x 3 0.5 x 2 0.25 x 1.2
Numerical Methods
at x =0.25, the derivative can be calculated directly as:
f ' ( x) 0.4 x 3 0.45 x 2 1.0 x 0.25
35
SUMMARY
1. Why numerical methods?
06/18/24
2. Mathematical Modelling concept
3. Error Analysis:
Numerical Methods
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
36