You are on page 1of 32

CHAPTER 1

INTRODUCTION TO
NUMERICAL METHOD
Presenter: Dr. Zalilah Sharer
© 2018 School of Chemical and Energy Engineering
Universiti Teknologi Malaysia
16 September 2018
Chemical Engineering, Computer
& Numerical Methods
Role of Chemical Engineers

• Chemical engineering covers basic skill in mathematics, chemistry,


physic and biology, also engineering practical aspect.
• Its definition was purposely general because chemical engineers can
work in many types of industry.
• Chemical engineers involve in chemical process that transform raw
material into product.
• It covers all aspect of design, testing, scale-up, operation, control and
optimizations.
• These processes involve solution to huge system of algebraic
equation, nonlinear and complex equation, which are difficult to be
solved analytically.
Chapter 2: Chapter 3: Chapter 4: Chapter 5: Chapter 6: Chapter 7:
Approximation Roots of Linear Curve Fitting Numerical Ordinary
and Errors equations - algebraic - to fit curves to differentiation differential
a variable or data points and equations -
equations
parameter integration - - many
- a set of values
that satisfies a area under a curve engineering
that satisfies a set
single applications
of linear algebraic
nonlinear used rate of
equations
equation change

Approximations Bracketing Linear algebraic Least-Squares Newton-cotes Runge-Kutta


and round-off methods equations Regression integration of methods
errors equations

Taylor series Open Gauss Interpolation Numerical Engineering


methods Elimination differentiation Applications

Engineering LU Engineering Engineering


applications decomposition & Applications Applications
matrix inversion

Gauss Seidel
and Engineering
Applications
3
Differentiation & Integration

Numerical
Linear algebraic Roots of equation
Methods

Curve fitting Ordinary differential equations


Numerical methods

Techniques by which mathematical problems


are formulated so that they can be solved with
arithmetic operations – involve large numbers
of calculation
Numerical methods

Example: Integration

Analytical solution: Computer as usual as in


calculus

Numerical method: Use trapezoidal rule or


Simpson’s rules
Advantages
1. Powerful problem-solving tools
capable of handling large systems of equations,
nonlinearities and complicated geometries – that
are often impossible to solve analytically
2. Able to design and develop own programs
without having to buy or commission expensive
software
3. Able to reduce higher mathematics to basic
arithmetic operations
Computers and Software

MATLAB, Mathematica, Dynafit etc are some


software packages to implement numerical
methods.

Help to solve engineering problem in


numerical methods.

Else. MS-EXCEL also can be used to solve


Numerical problems.
Problem Solving
Process
Problem Solving Process
Mathematical model
Equations that expresses the essential features of a physical
systems
Represented as a functional relationship in the form of

Dependent Variables = f (independent, parameters, forcing


function, variables )

Dependent Variables - Reflects the behavior or state of the


system
 Independent Variables - Dimensions, such as time and space
 Parameters - Reflective of the system’s properties or
composition
 Forcing Function - External influence acting upon it
Newton’s 2nd law of Motion

• States that “the time rate change of momentum of a


body is equal to the resulting force acting on it.”
• The model is formulated as
F = ma (eqn 1.2)
F=net force acting on the body (N)
m=mass of the object (kg)
a=its acceleration (m/s2)
Newton’s 2nd law of Motion

• Equation 1.2 can be written as:

• a=F/m eqn 1.3

• simple algebraic equation that can be


solved analytically
• To determine the terminal velocity of a free-falling body near
the earth’s surface using Newton 2nd law.
• Express acceleration as the time rate of change of the velocity
(dv/dt) and substituting into eq. (1.3) to yield
d/dt = F/m (eqn. 1.4)

or

F = m (d/dt)
F ‘+ve’ : accelerate
F ‘-ve’ : decelerate
F = 0 (constant velocity)
 Express the net force in term of measurable variables and parameters,
in which the net force is composed of 2 opposing forces:

Fu
The downward pull of gravity FD and the upward force
of air resistance Fu:

F = FD + Fu (eqn. 1.5) FD

 If downward force is ‘+ve’, 2nd law can be used to formulate the force
due to gravity, as
FD = mg (eqn. 1.6)
g = 9.8 m/s2

 The air resistance that acts in an upward direction;


Fu = -c (eqn. 1.7)
c = drag coefficient (kg/s)
 The net force is the difference between the downward (FD) and upward
(FU).

 By combining eqs. (1.4) through (1.7) to yield:

d/dt = (mg – c)/m (eqn. 1.8)

or simplifying the right side,

d/dt = g – (c/m)v (eqn. 1.9)

 Eq. (1.9) is a differential equation. The exact solution of eq. (1.9) cannot
obtained by simple algebraic manipulation, which needs calculus to
obtain an exact or analytical solution.

 If  = 0 at t=0, calculus can be used to solve eq. (1.9) for

(t)= (gm/c)[1-e-(c/m)t] (eqn. 1.10)


• This is a differential equation and is written in
terms of the differential rate of change dv/dt of
the variable that we are interested in predicting.
• If the parachutist is initially at rest (v=0 at t=0),
using calculus

Independent variable

v(t ) 
gm
c

1 e ( c / m ) t
 1.10

Dependent variable
Forcing function Parameters
 Eq. 1.10 is called analytical/exact solution because it
exactly satisfies the original differential equation.
 (t) = dependent variable
t = independent variable
c & m = parameters
g = the forcing function

 However, many mathematical models cannot be solved as


shown in eqn. 1.10.
 The only alternative is to develop a numerical solution that
approximates the exact solution i.e. numerical method.
Force on a falling parachute
 Mainly from second law of thermodynamics ==> F = ma
 The model then can be derived with

™The force acting on the body : F = FU + FD


Example 1
Analytical Solution to the Falling
Parachutist Problem

A parachutist of mass 68.1 kg jumps out


of a stationary hot air balloon. Use
equation 1.4 to compute velocity for every
2 seconds. The drag coefficient is equal to
12.5 kg/s and g = 9.8 m/s2
Solution
Inserting the parameter into eq. (1.10) yields

gm  
 c  
 t
v(t)  
1
 e m 


c  
(9.8)(68.1) 
12.5  
 t
v(t)  
1 e 68.1 


12.5  
v(t)  53.391 e0.18355t 

which can be used to compute terminal velocity.



Solution
Terminal velocity, ut
The terminal velocity of a falling body occurs during free fall
when a falling body experiences zero acceleration.
Using Numerical Method Approach
The time rate of change of velocity can be approximated using:

dv v v(ti 1 )  v(t i )
  eqn. 1.11
dt t t i 1  t i
 Substituted into eq. (1.9) to give:

v(ti 1 )  v(t i )
 g  v t i 
c
t i 1
ti m

 Eq. 1.11 is called a finite divided difference approximation of the


derivative time ti.
 This eq. then be rearranged to yield:

 
v(t i 1)  v(t i )   g - v(t i )  t i 1 - t i 
c eqn. 1.12
 m 

 The term in [brackets] is the differential equation in eq.(1.9). This


provides a means to compute the rate of change or slope of .

 Eq. 1.12 can be used to determine the velocity at ti+1(new value of


velocity) using slope and initial value for velocity at sometime ti.
New value = old value +(slope x step size)
Example 2

Perform the same computation as in


Example 1 but use Equation 1.12 to
compute the velocity. Employ a step size of
2 s for the calculation

 
v(t i 1)  v(t i )   g - v(t i )  t i 1 - t i 
c
 m  Eqn. 1.12
Solution
At start of the computation (ti=0), the velocity of the
parachutist is zero. First interval (from t=0 to 2s)
 12.5 
v  0  9.8   0  2  19.60m/s
 68.1 

For next interval, use t = 2 to 4s

 12.5 
v  19.60  9.8  19.60  2  32.00m/s
 68.1 

The calculation is continued in a similar fashion to obtain


additional value
Solution

t,s v,m/s 60 Terminal velocity


0 0.00
50 Approximate, numerical solution
2 19.60
40
4 32.00
v, m/s

6 39.85 30 Exact, analytical solution

8 44.82 20
10 47.97
10
12 49.96
 53.39 0
0 2 4 6 8 10 12 14
t,s
Analytical vs numerical solution

• Equation 1.4 is called analytical or exact


solution – exactly satisfies the original
differential equation (no error)

• Unfortunately, many mathematical models


cannot be solved exactly – numerical methods
– approximate the exact solution
• Equation 1.12 can be used to determine the velocity
at time ti+1 if an initial value for velocity at time ti is
given.

• This new value of velocity at ti+1 can in turn be


employed to extend the computation to velocity at
ti+2 and so on.

• In general:
• New value = old value + (slope x step size)

• This approach is formally called Euler’s method


Question?
THE END

Thank You for the Attention

You might also like