CHE 306 Lesson Note 1
CHE 306 Lesson Note 1
A. S. Osunleke,
COURSE NOTE ON PhD., (MNSChE, MNSE,
R. ENG.)
NUMERICAL DEPARTMENT OF
CHEMICAL ENGINEERING
METHODS IN OBAFEMI AWOLOWO
ANALYSIS
Here is the course note for the
first Part of the Engineering
Analysis taken at Obafemi
Awolowo University, Ile-Ife
Nigeria by all Year III Engineering
students.
INTRODUCTION In preparing this note, I took
cognisance of the fact that the
students in this category
represent all areas of
engineering disciplines namely,
students with Agricultural &
Environmental, Chemical, Civil,
Computer, Electronic/Electrical,
With this in mind, I typically
chose examples in those
various areas in illustrating the
principles and methods in this
course.
This course note is designed to
INTRODUCTION support a one-semester course
in numerical methods. It has
been
written for students who want
to learn and apply numerical
methods to solve problems in
engineering and science. As
That said, sufficient theory is
provided so that students come
away with insight into the
techniques and their
shortcomings.
This course note does assume
INTRODUCTION that the student has some
working knowledge of
programming, features and
characteristic of nonlinear
equations, difference equations,
differential equations, linear and
polynomial approximations.
What to note!
CA: 35 – 40 %
Attendance (2 marks)
Classwork (5 – 10 marks)
Home assignments (15 – 20
INTRODUCTION
marks)
Tests (40 – 50 marks)
Exam: 60 – 65 %
Mainly (80 – 100 marks)
Not all in all a Note on
the course
Bisection Method
CONTENTS Fixed-Point Iterative (FPI) Methods
Jacobi Iteration
Gauss-Seidel Iteration
INTERPOLATION AND
POLYNOMIAL
APPROXIMATION
Linear Interpolation
Quadratic Interpolation
CONTENTS Lagrange interpolation
Divided Difference Interpolation –
Divided differences and polynomials
Equal-spaced Interpolations
Difference operators and difference Tables
Forward, backward, and central differences
NUMERICAL INTEGRATION
AND DIFFERENTIATION
Numerical Differentiation
Difference Notation and Operators
Numerical Integration
CONTENTS - Trapezoidal Rule
- Simpson’s Rule
- Mid-Point Rule
- Romberg Integration
NUMERICAL SOLUTION OF
INITIAL VALUE PROBLEMS
Euler Method
CONTENTS Runge-Kutta Methods
Predictor-Corrector Methods.
In the process of solving
problems in Science, Engineering,
Economics, etc., a physical
situation is first converted into a
mathematical model.
This is often called formulation of
PRELIMINARIES
the problem.
This mathematical model often
gives rise to mathematical
problems which are too difficult to
1
solve in a neat, closed
x 2 form e.g.
Integration:
e
Find
dx
0
cos x
Nonlinear Equation: Solve x
Linear Algebra: Find the
eigenvalues of a large matrix
Differential equations: Solve a
system of nonlinear differential
equations.
PRELIMINARIES
When such problem arises,
numerical analysis is then used
for developing techniques to find
a solution or approximate
solution of the mathematical
equations describing the model.
A numerical method (or a
combination of numerical
methods) which can be to solve
a problem is often called an
algorithm.
An algorithm is a complete and
PRELIMINARIES
unambiguous set of procedures
leading to the solution of a
mathematical problem.
The results obtained for the
solution of a problem will be
affected by various source of
Numerical analysts must consider
how much accuracy is required,
estimate the magnitude of round-off
and discretization errors, determine
an appropriate step-size or the
number of iterations required, provide
for checks on the accuracy and make
allowance for corrective action in
PRELIMINARIES cases of non-convergence.
The efficiency of any numerical
method (or algorithm) must also be
considered.
An algorithm would be of no practical
use if it required the largest computer
error built to obtain a useful answer.
The final phase in solving a problem is
programming. Programming is the
transformation of the algorithm into a set of
unambiguous step-by-step instructions for
the computer.
In this segment of the course, we will look at
the design (formulation) and analysis of
various numerical methods and assess them
in terms of accuracy, efficiency and
PRELIMINARIES computer effort.
This will involve some mathematical
analysis and some practical work using
MATLAB.
It is expected that students attending this
course avail themselves some software
packages and get them installed on their
computing facilities (Laptop, PC, etc.).
You may be required to bring these facilities
What are numerical methods and why
should you study them?
Numerical methods are techniques by
which mathematical problems are
formulated so that they can be solved
PRELIMINARIES with arithmetic and logical
operations.
1.1 Because digital computers excel at
Motivation performing such operations,
numerical methods are sometimes
referred to as computer mathematics.
In the pre–computer era, the time and
drudgery of implementing such
calculations seriously limited their
However, with the advent of fast,
inexpensive digital computers, the role
of numerical methods in engineering and
scientific problem solving has exploded.
Because they feature so prominently in
much of our work, I believe that
PRELIMINARIES numerical methods should be a part of
every engineer’s and scientist’s basic
1.1 education.
Motivation Just as we all must have solid
foundations in the other areas of
mathematics and science, we should
also have a fundamental understanding
of numerical methods.
In particular, we should have a solid
Beyond contributing to your
overall education, there are
several additional reasons why
you should study numerical
methods:
PRELIMINARIES They greatly enhance your
problem-solving skills.
1.1
Numerical methods allow you to
Motivation use “canned” software with
insight.
It enables you to design your own
programs to solve problems
without having to buy or
Numerical methods are an efficient
vehicle for learning to use computers.
Because numerical methods are
expressly designed for computer
implementation, they are ideal for
illustrating the computer’s powers and
PRELIMINARIES limitations.
Numerical methods provide a vehicle
1.1 for you to reinforce your understanding
of mathematics.
Motivation
With these reasons as motivation, we
can now set out to understand how
numerical methods and digital
computers work in tandem to
The primary objective of this
Session is to provide you with a
concrete idea of what numerical
methods are and how they relate
PRELIMINARIES to engineering and scientific
problem solving.
1.2 Problem
Formulation
and Problem Modelling Example 1.1
Solving A mathematical model can be
broadly defined as a formulation
or equation that expresses the
essential features of a physical
In a very general sense, it can be
represented as a functional relationship of
the form
Dependent independent forcing
f , parameters,
(1.1
variable variables functions
PRELIMINARIES )
where the dependent variable is a
characteristic that typically reflects the
1.2 Problem behavior or state of the system;
Formulation the independent variables are usually
and Problem dimensions, such as time and space, along
which the system’s behavior is being
Solving determined;
the parameters are reflective of the
system’s properties or composition; and
the forcing functions are external influences
acting upon it.
The actual mathematical expression
of Eq. (1.1) can range from a simple
algebraic relationship to large,
complicated sets of differential
PRELIMINARIES equations.
For example, based on his
1.2 Problem observations, Newton formulated his
Formulation second law of motion, which states
and Problem that the time rate of change of
Solving momentum of a body is equal to the
resultant force acting on it.
The mathematical expression, or
F m a
model, of the second law is the well-
(1.2
known equation, )
where F is the net force acting on the body
(N, or kg m/s2), m is the mass of the object
(kg), and a is its acceleration (m/s 2).
The second law can be recast in the format
of Eq. (1.1) to give
PRELIMINARIES F (1.3
a
m )
1.2 Problem where a is the dependent variable reflecting
Formulation the system’s behavior, F is the forcing
and Problem function, and m is a parameter. Note that
for this simple case there is no independent
Solving variable because we are not yet predicting
how acceleration varies in time or space.
Equation (1.3) has several characteristics
that are typical of mathematical models of
the physical world.
It describes a natural process
or system in mathematical terms.
It represents an idealization and
simplification of reality. That is, the
PRELIMINARIES
model ignores negligible details of
the natural process and focuses on
1.2 Problem its essential manifestations.
Formulation It yields reproducible results and,
and Problem consequently, can be used for
Solving predictive purposes. For example,
if the force on an object and its
mass are known, Eq. (1.3) can be
used to compute acceleration.
Because of its simple algebraic
form, the solution of Eq. (1.2) was
obtained easily. However, other
mathematical models of physical
PRELIMINARIES phenomena may be much more
complex, and either cannot be solved
exactly or require more sophisticated
1.2 Problem mathematical techniques than simple
Formulation algebra for their solution.
and Problem To illustrate a more complex model of
Solving this kind, Newton’s second law can be
used to determine the terminal
velocity of a free-falling body near the
earth’s surface. Our falling body will
be a bungee jumper (Fig. 1.1).
For this case, a model can be derived
by expressing the acceleration as the
time rate of change of the velocity (dv/dt)
and substituting it into Eq. (1.3) to yield
dv F
PRELIMINARIES (1.4
dt m )
1.2 Problem where v is velocity (in meters per
second). Thus, the rate of change of the
Formulation velocity is equal to the net force acting
and Problem on the body normalized to its mass.
Solving If the net force is positive, the object will
accelerate. If it is negative, the object will
decelerate. If the net force is zero, the
object’s velocity will remain at a constant
level.
PRELIMINARIES
1.2 Problem
Formulation
and Problem
Solving
dv cd 2
PRELIMINARIES g v (1.8
dt m
)
1.2 Problem Equation (1.8) is a model that
Formulation relates the acceleration of a falling
and Problem object to the forces acting on it.
Solving It is a differential equation because
it is written in terms of the
differential rate of change (dv/dt) of
the variable that we are interested
in predicting.
However, in contrast to the solution
of Newton’s second law in Eq. (1.3),
the exact solution of Eq. (1.8) for
the velocity of the jumper cannot
PRELIMINARIES be obtained using simple algebraic
manipulation.
1.2 Problem Rather, more advanced techniques
Formulation such as those of calculus must be
and Problem applied to obtain an exact or
analytical solution.
Solving
For example, if the jumper is
initially at rest (v = 0 at t = 0),
calculus gm be used
can gcd to solve Eq.
v(t ) tanh t (1.9
(1.8) for cd
m )
Note that Eq. (1.9) is cast in the general
form of Eq. (1.1) where v(t) is the
dependent variable, t is the independent
variable, cd and m are parameters, and g
is the forcing function.
PRELIMINARIES
Illustration 1: Analytical Solution to the
Bungee Jumper Problem
1.2 Problem Problem Statement: A bungee jumper
Formulation with a mass of 68.1 kg leaps from a
and Problem stationary hot air balloon.
Use Eq. (1.9) to compute velocity for the
Solving
first 12 s of free fall.
Also determine the terminal velocity that
will be attained for an infinitely long cord.
Use a drag coefficient of 0.25 kg/m.
Solution: Inserting the
parameters into Eq. (1.9) yields
9.81(68.1) 9.81(0.25)
PRELIMINARIES v(t ) tanh t
0.25 68.1
51.6938 tanh(0.18977 t)
1.2 Problem
Formulation which can be used to compute the
and Problem
Table below
Solving
PRELIMINARIES
1.2 Problem
Formulation
and Problem
Solving
According to the model, the jumper
accelerates rapidly (Fig. 1.2). A
velocity of 49.4214 m/s (about 110
Note also that after a sufficiently
long time, a constant velocity,
called the terminal velocity, of
51.6983 m/s (115.6 mi/hr) is
PRELIMINARIES reached.
This velocity is constant because,
1.2 Problem eventually, the force of gravity
Formulation will be in balance with the air
and Problem resistance.
Solving Thus, the net force is zero and
acceleration has ceased.
PRELIMINARIES
1.2 Problem
Formulation
and Problem
Solving FIGURE 1.2: The analytical solution for the bungee
jumper problem as computed in Example 1.1. Velocity
increases with time and asymptotically approaches a
terminal velocity.
Modelling Example 1.2
0
PRELIMINARIES
Cannon
Target
1.2 Problem
d
t (V0 sin 1/ 2 gt ) 0
1.2 Problem
Formulation t 0, V0 sin 1/ 2 gt 0
and Problem
Solving V0 sin 1/ 2 gt 0
2V0 sin (1.1
t
g 5)
Distance travelled to hit the target,
x v0 cos t
PRELIMINARIES
2v0 sin
v0 cos t.
1.2 Problem g
Formulation
and Problem 2v0 sin cos
2
(1.1
x
Solving g 6)
The distance travelled by the canon
ball is given by (1.16) where g=
acceleration due to gravity.
Distance travelled to hit the target,
x v0 cos t
PRELIMINARIES
2v0 sin
v0 cos t.
1.2 Problem g
Formulation
and Problem 2v0 sin cos
2
(1.1
x
Solving g 6)
The distance travelled by the canon
ball is given by (1.16) where g=
acceleration due to gravity.
In order to find the correct
elevation to hit the target
requires satisfying the equation
PRELIMINARIES 2v0 sin cos
2
(1.1
d
g 7)
1.2 Problem
so, we require to solve f()=0 ;
Formulation
where,
and Problem 2v0 sin cos
2
Solving f ( ) d (1.1
g 8)
Note the following observations:
The modelling process gives an
idealisation: Some features have
PRELIMINARIES been ignored e.g. air resistance,
length of the muzzle. They may
1.2 Problem be significant.
Formulation The nonlinear equation v0 2
maynot
g
and Problem have a solution. The maximum
Solving range
d
is
v0 2 when = /4.
So, if g
, the target is out of
range.
The nonlinear equation may
have many solutions. If = * is
a solution, then so is = * +2k
PRELIMINARIES for any integer k. These are trivial
rotated
/ 2 solutions.
/ If
2 a* solution,
then so is
1.2 Problem
The equation can be rearranged
Formulation
and solved easily as
and Problem 2v0 sin cos
2
d (1.1
Solving g
9)
dg
sin(2 ) 2
v0
1 1 dg
sin 2 (1.2
2 v0
Aside from Newton’s second law,
there are other major organizing
principles in science and engineering.
PRELIMINARIES Among the most important of these
are the conservation laws.
1.3 Although they form the basis for a
CONSERVATIO variety of complicated and powerful
N LAWS IN mathematical models, the great
conservation laws of science and
ENGINEERING engineering are conceptually easy to
AND SCIENCE understand.
They all boil down to
(1.2
Change = increases - decreases
4)
This is precisely the format that we employed
when using Newton’s law to develop a force
balance for the bungee jumper [Eq. (1.8)].
Although simple, Eq. (1.14) embodies one of
PRELIMINARIES the most fundamental ways in which
conservation laws are used in engineering
and science-that is, to predict changes with
1.3 respect to time. We will give it a special
CONSERVATIO name-the time-variable (or transient)
computation.
N LAWS IN
Aside from predicting changes, another way
ENGINEERING in which conservation laws are applied is for
AND SCIENCE cases where change is non-existent. If
change is zero, Eq. (1.14) becomes
Change = 0 = increases – decrease
Or
(1.2
5)
Thus, if no change occurs, the
increases and decreases must be
in balance.
PRELIMINARIES This case, which is also given a
special name—the steady-state
1.3 calculation—has many
CONSERVATIO applications in engineering and
N LAWS IN science. For example, for steady-
ENGINEERING state incompressible fluid flow in
AND SCIENCE pipes, the flow into a junction
(1.2
must be balanced by flow going6)
out, as in,
Flow in = Flow out
PRELIMINARIES
1.3
CONSERVATIO
N LAWS IN FIGURE 1.5: A flow balance for steady incompressible fluid flow at the junction of pipes.
ENGINEERING
AND SCIENCE
For the junction in Fig. 1.5, the
balance can be used to compute
that the flow out of the fourth
For the bungee jumper, the steady-
state condition would correspond to
the case where the net force was
PRELIMINARIES zero or [Eq. (1.8) with dv/dt = 0]
2
mg cd v (1.2
1.3 6)
Thus, at steady state, the downward
CONSERVATIO and upward forces are in balance
N LAWS IN and Eq. (1.26) can be solved for the
terminal velocity,
ENGINEERING gm
v (1.2
AND SCIENCE cd
Eqs. (1.24) and (1.25) embody7)
the
two fundamental ways that
conservation laws are employed in
PRELIMINARIES
1.3
CONSERVATIO
N LAWS IN
ENGINEERING
AND SCIENCE