Part 1 - Introduction To Numerical Methods
Part 1 - Introduction To Numerical Methods
Methods
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
MODELING, COMPUTERS, AND
ERROR ANALYSIS
• Numerical or computational methods are
techniques by which mathematical problems are
formulated so that they can be solved with
arithmetic operations.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Mathematical Background
Roots of Equations:
- Concern with a value that satisfies a single nonlinear
equation.
- It is application is mainly in engineering design
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Mathematical Background
Systems of Linear Algebraic Equations:
- It concerns with values that satisfy system of equations simultaneously.
- Its application is in large systems of interconnected elements such as
structures, electric circuits, fluid networks, curve fitting, differential
equations.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Mathematical Background
Optimizations:
- Determine a value or values that correspond to the optimal
value of a function.
- It is application is in engineering design context.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Mathematical Background
Curve Fitting:
They are either regression or interpolation.
- Regression is usually used to fit experimental data. Single curve that
represents the general trend of the data without necessarily passing
through any point.
- Interpolation for determining intermediate points. Used for tabulated
information. The curve passes through all the points
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Mathematical Background
Integration:
- It is the determination of areas under the curve.
- It has many application areas – calculation of centroid of area
of complex shapes, calculation of quantities based on discrete
sets and also in solution of differential equations
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Mathematical Background
Ordinary Differential Equations:
- It is applicable to problems that can be expressed in the rate
of change of a quantity rather than the magnitude of the
quantity.
- Examples are acceleration of falling bodies, etc.
- They are either initial-value problems or boundary-value
problems
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Mathematical Background
Partial Differential Equations:
It is used when the rate of change is a function of
more than one variable
Example is steady-state temperature distribution
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Summary of Topics
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
CVE325 Computational
Methods
Chapter 1
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 4th Edition, 2003, McGraw-Hill.
th
Objectives and Outcomes
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Mathematical Model
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Mathematical Model and Analytical Solution
Newton Second Law:
Force = Mass X Acceleration
F = ma
Free-body diagram
F = FD – FU
FD = mg
FU = cv
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Acceleration a is given:
a=
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 1.1
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Numerical Solution of the Analytical Model
Numerical approximation of the mathematical model
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Substitute from the mathematical model
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 1.2, cont.
Numerical Solution
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 1.2, cont.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Comparison between Analytical and Numerical
Solutions
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Conservation Laws
Change = Increases – decreases
When there is no change, i.e., change = 0,
Increases = Decreases
For the pipe network:
Flow in = Flow out
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Conservation Laws in Engineering Fields
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Practical Issues in Engineering Applications
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
CVE325 Computational Methods
Chapter 2
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Objectives and Outcomes
Objectives
• Gain fundamental understanding of programming
and software
Outcomes
1. Understand the basic concept of programming.
2. Understand flowchart and its symbols.
4. Know how to translate structured flowcharts and
pseudocode into code in a high-leveI language.
5. Start to familiarize yourself with MATLAB software
package and its programming capability.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Computer Programs
A computer program is a set of instructions that
direct the computer to perform certain tasks
2. MATLAB
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Symbols for Flowchart
Flowchart and Pseudocode
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Selection Structures
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Selection Structures
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Selection Structures
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Repetition Structures
Do-Exit or Break Loop
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Repetition Structures
DO-FOR construct
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 2.1
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 2.1, cont.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 2.1, cont.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
MATLAB and Pseudocode
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
MATLAB and Pseudocode
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
CVE325 Computational Methods
Chapter 3
and
Chapter 4
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Objectives and Outcomes
Objectives
• Gain fundamental understanding of approximations, significant
figures and type of errors in numerical calculations
Outcomes
1. Recognize the distinction between truncation and round-off errors.
2. Understand the concepts of significant figures, accuracy, and
precision.
3. Recognize the difference between true relative error εt, approximate
relative error (εa) and acceptable error (εs), and understand how εa
and εs are used to terminate an iterative computation.
4. Understand how numbers are represented in digital computers and
how this representation induces round-off error. In particular, know the
difference between single and extended precision.
5. Recognize how computer arithmetic can introduce and amplify round-
off errors in calculations. In particular, appreciate the problem of
subtractive cancellation.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Significant Figures
Significant figures (digits) is the number of digits used to
determine the reliability of a numerical value. The significant
digits are those that can be used with confidence. They usually
correspond to a certain digit plus one.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Significant Figures and
Round-off Errors
• We say certain results approximation is acceptable if
it agrees with the exact result to certain numbers of
significant digits.
• Some quantities such as pi, e, sqrt(7), etc. cannot be
represented by specific or limited number of digits.
Such numbers can never be represented exactly in
the computer because only finite number has to be
retained.
• Omission of the remaining significant digits is called
round-off error. I.e., round-off error is the result of using
approximate numbers to represent exact numbers.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Accuracy and Precisions
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Accuracy and Precisions
(a)Inaccurate and
imprecise;
(b)accurate and
imprecise;
(c)inaccurate and
precise;
(d)accurate and
precise
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Error Definitions
True values and True Errors
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Error Definitions
Approximate values and Errors
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 3.1
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 3.2
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 3.2, cont.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 3.2, cont.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Round-off Errors
Computer representation of numbers
Fig 3.3
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Computer representation of a Decimal Integer
Fig 3.4
Fig 3.5
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 3.3
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Computer representation of a floating point number
Fig 3.6
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Truncation Errors
Truncation errors are those result from
using an approximation in place of an
exact mathematical procedure. For
example approximating the derivative or
slope by a secant as shown below.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Taylor Series
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Taylor Series
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 4.1
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 4.1
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 4.1
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Example 4.2
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.
Other Types of Error
• Blunders or mistakes
• Formulation errors
• Data uncertainty
Prepared by: Jamal A. Abdalla Ref. Chapra, S. C. and Canale, R. P. , Numerical methods for Engineers , 6th Edition, 2010, McGraw-Hill.