chapter 1 introduction to numerical method · 2018-09-16 · chapter 1 introduction to numerical...

32
CHAPTER 1 INTRODUCTION TO NUMERICAL METHOD Presenter: Dr. Zalilah Sharer © 2018 School of Chemical and Energy Engineering Universiti Teknologi Malaysia 16 September 2018

Upload: others

Post on 20-May-2020

23 views

Category:

Documents


3 download

TRANSCRIPT

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:

Approximation and Errors

Chapter 3: Roots of equations - a variable or parameter that satisfies a single nonlinear equation

Chapter 4:

Linear algebraic equations

- a set of values that satisfies a set of linear algebraic equations

Chapter 5: Curve Fitting - to fit curves to data points

Chapter 6: Numerical differentiation and integration - - area under a curve

Chapter 7: Ordinary differential equations - many engineering applications used rate of change

Approximations and round-off

errors

Bracketing methods

Linear algebraic equations

Least-Squares Regression

Newton-cotes integration of

equations

Runge-Kutta methods

Taylor series

Open methods

Gauss Elimination

Interpolation Numerical differentiation

Engineering Applications

Engineering applications

LU decomposition & matrix inversion

Engineering Applications

Engineering Applications

Gauss Seidel and Engineering

Applications 3

Numerical Methods Roots of equation Linear algebraic

Differentiation & Integration

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

• 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

Newton’s 2nd law of Motion

• 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:

The downward pull of gravity FD and the upward force

of air resistance Fu:

F = FD + Fu (eqn. 1.5)

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)

Fu

FD

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

tmcec

gmtv )/(1)(

Independent variable

Dependent variable Parameters Forcing function

1.10

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.

Mainly from second law of thermodynamics ==> F = ma The model then can be derived with

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

Force on a falling parachute

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

Example 1

Solution

Inserting the parameter into eq. (1.10) yields

which can be used to compute terminal velocity.

v(t) gm

c1 e

c

m

t

v(t) (9.8)(68.1)

12.51 e

12.5

68.1

t

v(t) 53.39 1 e0.18355t

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:

eqn. 1.11

1

1

( ) ( )i i

i i

v t vdv v

dt t

tt t

Substituted into eq. (1.9) to give:

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

derivative time ti.

This eq. then be rearranged to yield:

eqn. 1.12

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)

1

1

( ) ( )i i

i

i i

v t v cg v

m

tt

t t

1 1( ) ( ) - ( ) -

i i i i i

cv v g v

mt t t t t

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

1 1( ) ( ) - ( ) -

i i i i i

cv v g v

mt t t t t

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)

For next interval, use t = 2 to 4s

The calculation is continued in a similar fashion to obtain additional value

12.5

0 9.8 0 2 19.60m/s68.1

v

12.5

19.60 9.8 19.60 2 32.00m/s68.1

v

Solution

t,s v,m/s

0 0.00

2 19.60

4 32.00

6 39.85

8 44.82

10 47.97

12 49.96

53.39 0

10

20

30

40

50

60

0 2 4 6 8 10 12 14

t,s

v,

m/s

Exact, analytical solution

Approximate, numerical solution

Terminal velocity

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