You are on page 1of 25

Numerical Methods

for Engineers

Chapter 1
Modeling, Computers and
Error Analysis
Chapter Outline
1.1 Introduction
1.2 Mathematical Modeling and
Engineering Problem Solving
1.3 Programming and Software
1.4 Errors
Topic Outcome
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 and use
MATLABs graphic capabilities to create
graphs from data given.
Calculate true percent relative error t,
percent relative error a and percent tolerance
s.
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 independent forcing
{
variable = f variables,parameters,functions
Simple example: Newtons 2nd law of motion

F=ma
F = net force (kgm/s2)
m = mass of the object (kg)
a = acceleration (m/s2)
Some mathematical models more complex.

Complex example:
Model for falling parachute,
dv c
g v
dt m
v = terminal velocity (m/s)
t = time (s)
g = gravitational constant (9.8 m/s 2)
c = drag coefficient (kg/s)
m = mass of the object (kg)
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.

(See Example 1.2)


Example 1.1: Analytical
solution to the falling
parachutist problem
Example 1.2: Numerical
solution to the falling
parachutist problem
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 condition in falling
parachute,
dv
0
dt
thus,
mg
v
c
For steady-state fluid flow in pipe,
Flow in = Flow out
Warming you up
Figure shows various ways of an average man
gains and losses water in one day. 1L is ingested
as food and body metabolically produces 0.3L. In
breathing air, the exchange is 0.05L while inhaling
and 0.4L while exhaling. The body also lose 0.2,
0.4, 0.2 and 0.5L through sweat, urine, feces and
skin, respectively. In steady-state condition, how
much water must be drunk per day?
urine skin feces

food air
drink Body sweat

metabolism
What have you learned
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 yourself the
Appendix B in Chapra
and Canale (2006).
3) Print out your work as
Assignment 1.
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? Inaccuracy?

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:
E t true value approximation
True percent relative error, t
true error
t 100%
true value
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


current approx.- previous approx.
a 100%
current approx.
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
Types of errors- Round-off error

7
Numbers such as , e, or 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.
What have you learned

You might also like