0% found this document useful (0 votes)
208 views164 pages

Chemical Engineering Mathematics: Ali Altway

This document provides information about a chemical engineering course on mathematical modeling. The course covers topics like formulating chemical engineering systems mathematically, numerical solutions to equations, and optimization techniques. Students will learn to apply mathematics to solve problems and use software. The evaluation is based on assignments, tests, and an exam. The goal is for students to gain skills in modeling chemical processes mathematically.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
208 views164 pages

Chemical Engineering Mathematics: Ali Altway

This document provides information about a chemical engineering course on mathematical modeling. The course covers topics like formulating chemical engineering systems mathematically, numerical solutions to equations, and optimization techniques. Students will learn to apply mathematics to solve problems and use software. The evaluation is based on assignments, tests, and an exam. The goal is for students to gain skills in modeling chemical processes mathematically.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 164

CHEMICAL ENGINEERING

MATHEMATICS
ALI ALTWAY

REFERENCES
Richard G.Rice, Duong D.Do,Applied Mathematics and Modeling for chemical
Engineers, John Wiley,New York
Mickley, Reed, Sherwood,Applied Mathematics in Chemica Engineering,MsGrawHill
Jenson and Jeffrey,Mathematical Methods in Chemical Engineering,Academic Press
Hangos,K,Cameron,I,Process Modeling and Model Analysis
Course Outline
1. Mathematical Formulation of Chemical Engineering System
2. The Calculus of Finite Difference
3. Approximate solution method of ODE and PDE: Perturbation and Polynomial
Approximation method
4. Numerical solution of ODE and PDE
5. Curve fitting and parameter estimation
6. Mathematical Optimization Techniques
Course Objective
Students have capability to apply mathematics to solve Chemical Engineering
Problems.
Evaluation
Assignment 20 %
Midterm Test 40%
Exam
40%
------100%

Learning Outcomes
Ability to formulate chemical engineering
problems into mathematical model
Ability to apply mathematical model to
solve chemical engineering problem and
to interprete the solution results
Ability to apply mathematical tools to solve
chemical engineering problems
Ability to use modern software to solve
chemical engineering problems

The idea of a model


Real world
problem

1 Mathematical
problem

2 Mathematical
solution

3 Interpretation

Reality to mathematics
Mathematical solution
Interpreting the model outputs
Using the results in the real world

1. Reality to mathematics
What do we understand about the real
world problem?
What is the intended use of the
mathematical model?
What governing phenomena or
mechanisms are there in the system?
What form of model is required?
How should the model be structured and
documented?

1. Reality to mathematics (cont.)


How accurate does the model have to be?
What data on the system are available and
what is the quality and accuracy of the
data?
What are the system inputs, states, outputs
and disturbances?

2. Mathematical solution
There are three solution types: Analytical,
Approximate and Numerical
What variables must be chosen in the
model to satisfy the degrees of freedom?
Is the model solvable?
What numerical (or analytical or
approximate ) solution technique should be
used?
Can the structure of the problem be
exploited to improve the solution speed or
robustness?

2. Mathematical solution (cont.)


What form of representation should be used
to display the results (2D graphs, 3D
visualizations etc.)?
How sensitive will the solution output be to
variations in the system parameters or
inputs?

3. Interpreting the model


outputs
How is the model implementation to be
verified?
What type of model validation is appropriate
and feasible for the problem?
Are the model parameters identifiable?
What needs to be changed, added or deleted
in the model as a result of the validation?
What level of simplification is justified?

3. Interpreting the model


outputs (cont.)
What data quality and quantity is necessary
for validation and parameter estimates?
What level of model validation is necessary?
Should it be static or dynamic?
What level of accuracy is appropriate?
What system parameters, inputs or
disturbances, need to be known accurately to
ensure model predictive quality?

4. Using the results in the


real world
For online applications where speed might be
essential, do I need to reduce the model
complexity?
How can model updating be done and what
data are needed to do it?
Who will actually use the results and in what
form should they appear?
How is the model to be maintained?
What level of documentation is necessary?

LUMP PARAMETER AND DISTRIBUTED


PARAMETER MODELS
Mathematical models can be classified into two distinct types: Lump parameter and
Distributed parameter models. The first type is characterized by the uniformity of
the parameter value in the system such as mixed flow reactor, while the second
type is characterized by the variability of the variable/parameter value in the system
such as plug flow reactor. The distributed parameter model is usually called
Transport Phenomena models, because it involves the phenomena of heat, mass
or momentum transport. For the distributed parameter models, we have to consider
more specifically on the boundary condition of the system.

GENERAL TYPE OF BOUNDRY


CONDITION
HEAT TRANSFER
1. The temperature at a surface may be specified
2. The heat flux at a surface may be given, e.g. q=qo. When a surface is assumed
completely isolated, then the heat flux at that surface is equal to zero.
3. At solid-fluid interface the heat flux may related to the difference between the
temperature at the interface and that in the fluid, thus

q h T Tfluid

h=heat transfer coefficient

4. At solid-solid interface, the continuity of temperature and the normal


component of the heat flux may be specified.
5. At plane, axes or point of symmetry, the heat flux is equal to zero, except
the symmetry is treated as the heat source.

GENERAL TYPE OF BOUNDRY


CONDITION
MASS TRANSPORT
1. The concentration at a surface can be specified.
2. The mass flux at a surface can be specified.
3. If diffusion is occurring in a solid, it may happen that at the solid surface
substance A is lost to a surrounding fluid stream according to the relation,

N A0 k c C A0 C Af

kc = mass transfer coefficient

4. The rate of chemical reaction at the surface can be specified. For example,
if a substance A disappears at a surface by a first-order chemical reaction,

N A0 k1"C A
5. At the plane, axes, or point of symmetry the mass flux is equal to zero.

GENERAL TYPE OF BOUNDRY


CONDITION
MOMENTUM TRANSPORT
1. At solid-fluid interfaces the fluid velocity equals the velocity with which the
surface itself is moving.
2. At liquid-gas interface, the momentum flux (hence the velocity gradient)
is equal to zero.
3. At liquid-liquid interfaces the momentum flux perpendicular to the interface,
and the velocity, are continuous across the interface.
4. At the plane, axes, or point of symmetry the momentum flux is equal to zero.

Gas-liquid interface
liquid

Solid-Liquid interface

Model building steps


Build a sketch and define quantities
Black box

xin

xout
xout = f(xin)

Model building steps


Plug flow

dx/dh = f(x)
h

xout

xin
D
L

Box colors
Black box models:
Empirical
Process fundamentals are not necessary
Based on observed input and output variables
Purely mathematical (as an opposite to a
physical model) form where some parameters
are identified based on observed variables

Box colors
White box models
Based on first principles: Conservation laws
etc.
transparent, the model is understandable to a
process engineer
No process data required
Usually complex models
In principle good extrapolation (scale-up)
properties
Can predict new phenomena (in principle)

Box colors
Grey box models
In practice, purely white or black box models
are rare
Mechanistic first principle building blocks bring
reliability in scale-up and extrapolation, and
functional dependencies to the expressions
a priori knowledge about the model is used as
well to determine the structure and some of the
parameter values

Model building steps


Select variables
input
output
model state
independent (dimensions etc.)

Input and output are usually quite clear.


Model state variables are sometimes
difficult

Selection of variables
For example, energy variables:
Temperature or enthalpy?
Temperature is easier to comprehend
Enthalpy is usually better:
For a pure component system, if temperature
and pressure are known, enthalpy cannot
necessarily be calculated, but if enthalpy and
pressure are known, temperature can be
uniquely determined.

Selection of variables
What is the conserved property for which a
balance can be written?
A batch reactor:

dn
rV
dt

dc
r
dt

Selection of variables
concentration is not a
conserved property (extensive
variable), but amount of moles
is.

dn
rV
dt

n=cV

dV
dc
c
V rV
dt
dt

dcV
rV
dt
dc
r
dt

This reduces to
only if volume does
not change

Model building steps


List parameters that are important. Look for
nonlinearities (in the parameters or in the
model)
Draw a sketch of expected behavior
Write balances and constitutive relations.
Check sign conventions (direction of
transfer that is positive, whether component
is produced or consumed in a reaction etc.)
Derive a set of equations that can be solved
and introduce initial and boundary
conditions

Model building steps


Solve the model
Interpret results

Improve the model if it is not good enough


Carry out sensitivity analysis
Carry out optimization
Test the model at extreme conditions (near
the applicability limits of the variables)

Model application areas


Process design
Feasibility analysis of novel designs
Technical, economic, environmental assesment
Effects of process parameter changes on
performance
Optimization using structural and parametric
changes
Analysing process interactions
Waste minimization in design

Model application areas


Process control
Examining regulatory control strategies
Analysing dynamics for setpoint changes or
disturbances
Optimal control strategies for batch operations
Optimal control for multi-product operations
Optimal startup and shutdown policies

Model application areas


Trouble-shooting
Identifying likely causes for quality problems
Identifying likely causes for process deviations

Process safety
Detection of hazardous operating regimes
Estimation of accidental release events
Estimation of effects from release scenarios

Model application areas


Operator training
Startup and shutdown for normal operations
Emergency response training
Routine operations training

Environmental impact
Quantifying emission rates for a specific design
Dispersion predictions for air and water
releases
Characterizing social and economic impact
Estimating acute accident effects (fire,
explosion)

Some tubular reactor models


Conceptual:

Reagents in

Products out

Filled with catalyst (could be empty as well)


Reagents flow evenly through the reactor
Adiabatic or at least constant profile along reactor diameter

Some tubular reactor models


In practice:

Reagents in

distributor
grading
particles that
induce dispersion,
deviation from plug flow
support plate

empty spaces

Products out

Homogeneous plug flow


A slice of the catalyst bed
Length h
Cross-sectional area A

Integral material balance for a slice


n fin n init NA in t NA out t rAht
Note dimension and sign!

Homogeneous plug flow


n fin ninit NAin t NAout t rAh t

cV
NA rV
t
c
N

r
t
h

V Ah
Note! here V and A are constant
(can be specified since reactor
shape does not change)

Homogeneous plug flow


c
N

r
t
h

Integral form

c
N

r
t
h

Differential form

c
N cv D
h

Flux (mol/m2s)
convective and diffusive part

Homogeneous plug flow


c

c
cv D
D
c
cv h
h

r
t
h
h
h

So?

Homogeneous plug flow


v
0
h

Let us make some


assumptions:
D
0
h

cv
c
v
h
h

c
D
2

h D c
h
h 2

c
c
c
v D 2 r
t
h
h
2

Plug flow with axial


dispersion, constant
(frozen) coefficients

Homogeneous plug flow


c
c
2c
v D 2 r
t
h
h

Steady-state
Plug-flow
(no axial
dispersion)

c
dc
d 2c
0 v
D 2 r
t
dh
dh

dc
v
r
dh

Boundary conditions
dc
v
r
dh

First order ordinary differential


equation (usually nonlinear)

Usually inlet condition is known


Can be solved with a standard solver by
marching along the reactor length

What can be done if outlet conditions are


specified (a design problem)?

Boundary conditions
Steady state axial dispersion
2

dc
d c
v
D 2 r
dh
dh

Second order ordinary differential


equation (usually nonlinear)

Two boundary conditions required. Physical


boundary conditions arise from continuity of the flux
at the inlet and at the outlet
c
cin vin cv D
h

cout v out

c
cv D
h

Boundary conditions
Danckwerts boundary conditions
Danckwerts (1953)
Langmuir (1908)
c
cin vin cv D
h

Inlet

c
0
h

This is based
on intuition,
not physics!

Outlet

With these boundary conditions and first order


reaction, there is an analytical solution

concentration

A schematic example
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0

plug flow
axial dispersion

0.2

0.4

0.6

reactor length

0.8

A dynamic stirred tank reactor

Initially, a batch is set

Reactor is stirred vigorously so


that it is uniform in composition
No feed or heat transfer during the
batch

A dynamic stirred tank reactor


n fin n init

t fin

rVd

Integral form

t init

dn
rV
dt

Differential form

Negligible volume change

dc
r
dt

dV
0
dt

Comparison
dc
r
dt

dc
v
r
dh

Dynamic stirred tank


Constant volume

Plug-flow reactor
Steady state
Constant velocity
No axial dispersion

Comparison
h
t
v

Residence time in the


plug flow reactor

dh
dt
v

Plug-flow reactor

dc
v
r
dh

dc
r
dt

Comparison
dc
r
dt

Dynamic stirred
tank

dc
r
dt

Plug-flow reactor

The same problem The same numerical


solution!

Some solutions
dc
r
dt

Model

c t 0 c 0

Initial condition

r kc

Closure:
first order reaction

Some solutions
dc
kc
dt

c t 0 c 0

Separable form, analytical solution possible


c1

dc
c c 0 kdt
0

c1 c 0 exp k

Numerical solution: Eulers method


dc
kc
dt

c t 0 c 0

Numerical solution: Eulers method

dc
c n 1 c n t
dt
Explicit Euler if
Implicit Euler if

dc
dt

is calculated at tn
is calculated at tn+1

Numerical solution: Eulers method


dc
kc
dt

c t 0 c 0

dc
c n 1 c n t
dt

For the test problem:

c n 1 c n kc n t

Explicit Euler

c n 1 c n kc n 1t

Implicit Euler

Numerical solution: Eulers method


c n 1 c n kc n 1t

Implicit Euler

For this linear test problem we


have an explicit formulation

cn
c n 1
1 kt

Usually implicit methods require solution of a


nonlinear set of equations at each time step
For example,
pth order reaction

c n 1 c n kc

p
n 1

Example
1

c0=1
k=0.1
t=1

0.9

explicit Euler

0.8

implicit Euler

0.7
0.6

analytical

0.5
0.4
0.3
0.2
0.1
0
0

10

Example
c0=1
k=0.5
t=1

1
0.9

explicit Euler

0.8

implicit Euler

0.7
0.6

analytical

0.5
0.4
0.3
0.2
0.1
0
0

10

Example
1

c0=1
k=1
t=1

0.9

explicit Euler

0.8

implicit Euler

0.7
0.6

analytical

0.5
0.4
0.3
0.2
0.1
0
0

10

Example
1

c0=1
k=1.5
t=1

0.8

explicit Euler
implicit Euler

0.6

analytical

0.4
0.2
0
-0.2
-0.4
-0.6

10

Example
c0=1
k=2
t=1

1
0.8
0.6
0.4
0.2
0
-0.2 0
-0.4
-0.6
-0.8
-1

explicit Euler
implicit Euler
analytical

10

Example
80

c0=1
k=2.5
t=1

60

explicit Euler
implicit Euler

40

analytical

20
0
0
-20
-40
-60

10

Shorter time steps


1

c0=1
k=2.5
t=0.2

0.9

explicit Euler

0.8

implicit Euler

0.7

analytic

0.6
0.5
0.4
0.3
0.2
0.1
0
0

10

Other options
Calculate

dc
dt

at average of tn and tn+1

dc
c n 1 c n t
dt
c n c n 1
c n 1 c n k
t
2

dc
kc
dt
k
c n 1 t
2

c n 1
k
1 t
2

Crank-Nicolson method
1

c0=1
k=0.5
t=1

0.9

explicit Euler

0.8

implicit Euler
analytical

0.7

Crank-Nicolson

0.6
0.5
0.4
0.3
0.2
0.1
0
0

10

Crank-Nicolson method
1.2

c0=1
k=2.5
t=1

implicit Euler
analytical

0.8

Crank-Nicolson

0.6
0.4

Stable,
but
oscillates!

0.2
0
0
-0.2

10

Stages-Process Models:
The calculus of Finite Difference

INTRODUCTION
Chemical processing often requires
connecting finite stages in series fashion.
Thus, it is useful to develop a direct
mathematical language to describe
interaction between finite stages.
Examples: plate-to-plate distillation, mixersettler systems for solvent extraction

INTRODUCTION
Modeling Multiple Stages
Assumptions:
CSTR Assumption: the composition
everywhere within mixed fluid in the vessel
is the same as the composition leaving the
vessel
Ideal Equilibrium Stage Assumption: all
departing streams are in a state of
thermodynamic equilibrium

INTRODUCTION
Example: Countercurrent liquid-liquid
extraction battery
V,Y1

V,Yn
1

L, X0

L, Xn-1

Equilibrium Relation:
Yn K X n

V,Yn+1

V,YN+1
N

L, Xn

L, XN

Y = mass solute/mass extracting solvent


X = mass solute/mass carrier solvent

Material balance on nth stage:

L X n 1 V Yn 1 L X n V Yn 0
Eliminate X:

L
L
Yn 1 V Yn 1 Yn V Yn 0
K
K

L
VK

Yn 1 1Yn Yn 1 0

Yn 2 1Yn 1 Yn 0

SOLUTION METHODS FOR LINEAR


FINITE DIFFERENCE EQUATION
General linear finite difference equation of k th order:
Yn k a k 1 n .Yn k 1 ..... a0 n Yn f n

Second order equation:


Yn 2 a1 Yn 1 a 0 Yn 0

Complementary Solutions:

Yn A r

r 1 r 0

r1, 2

Yn A r1 Br2 A B 1
n

KX 0 A B 1 A B
0

YN 1 A

N 1

General Solution:

K X 0 YN 1
A
1 N 1

1 12 4
2

r1 ;

1 1

r2 1

YN 1 KX 0 N 1
B
1 N 1

KX 0 YN 1 n YN 1 KX 0 N 1


Yn
N 1
N 1
1

SOLUTION METHODS FOR LINEAR


FINITE DIFFERENCE EQUATION
Exit Composition:

KX 1 Y

1
N

Y1

N 1

N 1

Required Number of Stages:

N 1

YN 1

1 KX 0
1
Y1
Y1

KX 0
1

Y1

N 1 log
log

SOLUTION METHODS FOR LINEAR


FINITE DIFFERENCE EQUATION
If the roots to be equal (r1= r2 = r) :
Yn A B n r n

If the roots to take on complex values:

r1 i ; r2 i

In polar from: r1 i r expi


r2 i r exp i
Euler formula:
Then,
since

Yn r

modulus

r 2 2 ; tan 1 /

r expi r cos i sin


n

A cosn B sinn

exp in cosn i sin n

Phase angle

EXAMPLE-1: EXTRACTION CASCADE


It is desired to find the required number of ideal stages in the extraction cascade.

V,Y1

V,Yn
1

L, X0

V,Yn+1
n

L, Xn-1

V,YN+1
N

L, Xn

L, XN

Feed-to-solvent ratio (L/V)=1; Equilibrium constant (K) = 1; Then = L/(KV) =1


Pure solvent is specified, so YN+1 = 0 kg solute/kg solvent
The feed is X0 = 1 kg solute / kg carrier.
It is desired to produce a rich extract product such that Y1 = 0.9 kg solute / kg solvent

SOLUTION BY CLASSICAL METHOD


Material balance:
V Yn 1 L X 0 V Y1 L X n

Rearrange:
L
L

Yn 1 X n Y1 X 0
V
V

Operating line

Stages are stepped-off as illustrated to yield N = 9

SOLUTION BY DIRECT COMPUTATION


METHOD
N 1 log
log

Problem arises, since: = 1 = 1

YN 1

1 KX 0
1
Y1
Y1

KX 0
1

Y1

log / log log 1 / log 1 0 / 0

indeterminate
Then,

L
VK

log
N 1 lim
1 log
log x x 1

N 9

N 1

1
10
1 0.9

1
x 12 .......
2

YN 1 1 KX 0 1 K X 0 YN 1
N 1 lim

1
Y1 K X 0 1 K X 0 Y1

Variable Coefficient Finite Difference


Equation
n 2n 1Yn 2 An 1Yn1 BYn
Zn
Yn
n!

Z n 2 AZ n 1 BZ n 0

PARTICULAR SOLUTION METHODS


Method of Undetermined Coefficients
Method of Inverse Operators

Method of Undetermined Coefficients


It is desired to determine the particular solution of the
following finite difference equation:

Yn 2 a1Yn 1 a 0Yn f n
If the forcing function is of the form:
f n b0 b1 n b2 n 2 ....
Then, the particular solution is also assumed to be of the same form:
Ynp 0 1 n 2 n 2 ....

Undetermined coefficients

The particular solution is inserted into the defining equation, yielding a


series of algebraic relations obtained by equating coefficients of like
powers

Inverse Operator Method


Define the incrementing operators

Ey0 y1

Ec n c n 1 c c n

E y n 1 y n

E m c n c mn c m c n

E Eyn 2 E 2 y n 2 y n

PE c n Pc c n

yn E n y0
RULE 1

If n is negative, we increment downward.

P E c n f n

f n Kc n

then,

RULE 2

Yn 2 a1Yn 1 a 0Yn f n
If

c PcE f
2

a1 E a 0 y n f n

1
y np 2
Kc n
E a1 E a 0

or

Kc n
y 2
c a1c a0
p
n

Examle-1
Find the particular solution for the forced finite difference
equation using undetermined coefficient method
y n 1 2 y n 3 y n 1 n 1
Assumed particular solution:

y np 0 1 n

0 1 n 1 2 0 1 n 3 0 1 n 1 n 1
Equating unity term:
Equating n term:
Particular solution:
Characteristic equation:

0 1 2 0 3 0 3 1 1

1 2 1 3 1 1

1 1
y np n
2 4

r 2 2r 3 0 r1,2 3, 1

Complementary solution: ync A3n B 1n

4 1 4 0 1
1

1
4

1
2

Linearly independent

Example 2
Find the particular solution for the forced finite difference
equation using undetermined coefficient method
yn1 2 yn 3 yn1 3

Complementary solution:

ync A3 B 1
n

Linearly dependent with


complementary solution:

ynp n 3

Assumed particular solution: ynp 3n

n 13n 1 2 n 3 n 3 n 13n 1 3n
Unity term:
n term:

3 n 1 2 n n 1 1

3 n 2 n 1 n 0

The particular solution:

p
n

Substitute into the


difference equation
3 1

1
4

General solution:

3
n

yn

3
A3 B 1 n
n

Example 3
Find the particular solution for the forced finite difference
equation using inverse operator method

y n 2 2 y n 1 8 y n e n
p
Particular solution: y n

Characteristic equation:

General solution:

1
1
n
n
e

e
E 2 2E 8
e 2 2e 8
r 2 2r 8 0 r1,2 4,2
y n A4 B 2
n

en
2
e 2e 8

Non Linear Difference Equation


(Riccati equation)
y n 1 y n A y n 1 B y n C 0
yn zn
z n 1 z n A z n 1 B z n 2 A B C 0
2 A B C 0
vn

1
1

zn
yn

B vn1 A vn 1 0
Particular solution:

v np

1
A B 2

1
1
A
K

yn
A B 2
B
n

General solution:

Root of characteristic
equation
r

A
B

Example: Plate-to-plate distillation operation


Equilibrium line equation:

yn

xn
1 1x n

x n 1
L / V x n y1 x0 L / V
1 1xn1

Operating line equation: y n1 L / V xn y1 x0 L / V

R L/ D
V LD
L / V R /( R 1)

x n 1 x n A x n 1 B x n C 0
A


R
1xn xn1 1 x0 xn1 R xn xD 0
R 1
R 1
R 1
R 1

x0 1 R 1
1R

1
1
A
K

xn
A B 2
B
n

1
1

x0
C
R 1

x
R
x 0
R 1
R 1
x
1 1x

General solution
K

1
1

x0 A B 2

2
x 2 A B x C 0 A B C 0

Approximate Solution Methods


for ODE: Perturbation Methods

INTRODUCTION
Perturbation method is an approximate solution
technique which is particularly useful for model
equations that contain a small parameter, and
the equation is analytically solvable when that
small parameter is set to zero.
It is in the class of nonlinear differential
equations that the perturbation finds the most
fruitful application, since numerical solutions to
such equations are often mathematically
intractable.

INTRODUCTION
Modeling problems nearly always contain
parameters, which are connected to the
physicochemical dynamics of the system. These
parameters may take a range of values. The
solution obtained when the parameter is zero is
called the base case. If one of the parameters is
small, the behavior of the system either deviates
slightly from the base case, or it can take a
trajectory that is remote from the base case. The
analysis of systems having the former behavior
is called regular perturbation, whereas that of
the latter is referred to as singular perturbation

INTRODUCTION
Perturbation methods involve series
expansions, which are called asymptotic
expansions in terms of a small parameter.
This is sometimes called parameter
perturbation.
The asymptotic implies that the solution
can be adequately described by only a few
terms of the expansion.

INTRODUCTION
The perturbation method can be applied to
algebraic equations as well as differential
equations.
Examples:
Algebraic equation:
Differential equation:

y2 y a 0
dy
y 0
dx

Form of solution (asymptotic form):


y x; y 0 x y1 x 2 y 2 x .......... .... n y n x .......... .

BASIC CONCEPT
Several basic terms should be understood:
Gauge functions, used to compare the
size of function
Order concept, convenient in expressing
the order of a function (speed it moves
when tends small)
Asymptotic expansion and sequence
Nonuniformity

BASIC CONCEPT
GAUGE FUNCTION
Consider a function containing a small parameter :

There are three possible behavior that

f can take as tends to zero:

f 0

f
f

is finite

We need to analyze how fast the magnitude of

f moves as tend to zero.

To help us with this, we use gauge function. We compare

with known functions called gauge function


Example of gauge function:

......, n , n 1 ,......., 1 ,1, , 2 , ........., n ,......... .

log 1 , log log 1 ,.........

To compare the behavior of a function

f relative to a gauge function

we need to define the order symbols, O and o

BASIC CONCEPT
ORDER SYMBOLS
The notation: f O g

express bounded ness, and implies the sense of a limit


sin
sin O
lim
1
0
For example:
cos O1

coth O 1

The notation: f og
This means that

For example:

lim

f
0
implies a zero limit lim
0 g

f decreases to zero faster than the function g


sin

lim
0
sin o1
0
1

BASIC CONCEPT
ASYMPTOTIC EXPANSION AND SEQUENCES
For the presentation of an asymptotic expansion, we could use a general
sequence of functions {n} such that,
n 1
0
0
n

n 1 o n lim

Such a sequence is called an asymptotic sequence. Using this asymptotic


sequence, we can write the asymptotic expansion

y y 0 0 y1 1 .......... .. y j j
j 0

We could truncate the series:


N

y y j j O N 1
j 0

The truncation error has the order of magnitude as the sequence


N

y y j j
lim

j 0

N 1

N 1

BASIC CONCEPT
ASYMPTOTIC EXPANSION AND SEQUENCES
Determination of coefficients

yj

j
y
y0 y j
0
0
j 1

y y0 0

y1 y j
j 2

y 0 lim

y1 lim

j
1

In general

since

y y 0 0

n 1

y n lim

j
0,
0
0

lim

y y j j
j 0

Then the solution of the problem when y is a function of t besides :

y t ; y j t j

or

j 0

j 0

R N 1 t ; O N 1

y t ; y j t j R N 1 t ;

or

lim

R N 1 t ;

N 1

For the uniformity condition to be valid, the next term in the asymptotic
expansion must be smaller than the preceding term,

n 1 o n

or

n 1
0
0
n

lim

j 1

BASIC CONCEPT
Source of Uniformity

Infinite domain (either time or space)


Small parameter multiplying the highest
derivative
Type change of a partial dofferensial
equation (e.g. from parabolic to hyperbolic
equation)
Nonlinearity

ILUSTRATIVE EXAMPLES
Example-1: Solve the following nonlinear
algebraic equation,
y y2 a

(1)

Solution of for this problem when is zero (the base case) is


simply:

y0 a
y y 0 y1 2 y 2 .........

Asymptotic Expansion:

Substitution this into equation (1):

Expanding the squared function:


Identity:
01: y 0 a
0( ) : y1 y a
2
0

0( 2 ) : y 2 2 y1 y 0 2 a 3

y0 y1 2 y2 ......... a y0 y1 ........

y
y 0 y1 2 y 2 ......... a y 02 1 2 1 ........
y0

y a a 2 2 2 a 3 .......... .

ILUSTRATIVE EXAMPLES
Second solution:

u0 u1 .......

Substitution into original equation:


1

Identity:

u 0 u1 ....... a 12 u 0 u1 ........ 2

u0 1

u 0 u 02

u1 a 2u1

u1 a 2 u 0 u1
y

1 a .....

Note, the exact solution:

1 1 4 a
2

u1 a

ILUSTRATIVE EXAMPLES
Example 2:
Solve the following differential equation:

y 0 1

dy
y 0
dx

y exp x 1 x

Exact solution:

2 x2
2

....

y y 0 x y1 x 2 y 2 x .........

Approximate Solution:

dy0
dy
dy
1 2 2 ........ y 0 y1 2 y 2 ......... 0
dx
dx
dx

Substitution:
Identity:

dy0
0 y0 K 0
dx

dy1
y 0 y1 K 0 x K1
dx

K0 x2
dy 2
y1 y 2
K1 x K 2
dx
2

Initial Condition:
So, the solution:

y 0 y 0 0 1 K 0 1

y1 0 y 2 0 ......... 0 K1 0; K 2 0;
x2
yx 1 x
.......... .
2
2

ILUSTRATIVE EXAMPLES
Example 3:
Solve the following differential equation:
d 2 y dy
2 y 0;
dx
dx

x 0;

x 1;

Solution
Attempt the following asymptotic expansion

y x; y 0 x y1 x ....
Substitution and identity:
y1

dy0
O (1) :
y0 0
dx
d 2 y0
dy1
O :
y1
dx
dx 2

y1 1 0

1
Note: y 0; 1 e

Exact solution: y exact

y1 x 1 x e1 x

y x; e1 x 1 x e1 x O 2

Asymptotic Expansion:

y 0 x e1 x

s1

e s1x e s2 e s2 x
e s2 e s1

s1, 2

1 1 4
2

ILUSTRATIVE EXAMPLES
Example 3:
Solve the following differential equation:
d 2 y dy
2 y 0;
dx
dx

x 0;

x 1;

Solution
Attempt the following asymptotic expansion

y x; y 0 x y1 x ....
Substitution and identity:
y1

dy0
O (1) :
y0 0
dx
d 2 y0
dy1
O :
y1
dx
dx 2

y1 1 0

1
Note: y 0; 1 e

Exact solution: y exact

y1 x 1 x e1 x

y x; e1 x 1 x e1 x O 2

Asymptotic Expansion:

y 0 x e1 x

s1

e s1x e s2 e s2 x
e s2 e s1

s1, 2

1 1 4
2

ILUSTRATIVE EXAMPLES

METHOD OF MATCHED ASYMPTOTIC


EXPANSION
This method is useful for obtaining expansions from separate domain of validity

There are two solution:


Outer solution, valid over most of the domain of interest
The solution is obtained by straight forward expansion
Inner solution, valid in a small region called boundary layer

To obtain this solution we need to magnify the scale


We need to match solution with the outer solution using matching principle of
Van Dyke (1975):
The inner limit of the outer solution must match with the outer limit of
the inner solution

ILUSTRATIVE EXAMPLES
Example 4:
The solution problem in example 3 is outer solution. Find the inner solution.
Solution:
x*

d2y
n 1 dy

2 n 1 y 0
2
dx *
dx *

y i x*; y 0i x * y1i x * .......... ...


Since the second order derivative term did not appear in the zero order equation
of the outer expansion, we must ensure that it appear in the leading order
equation of the inner solution.
Two possibilities: second order derivative term balances with the first order term
second order derivative term balances with the third term

Second order derivative term balances with the third term


1
2 n 1 0 n
2

d2y

d x *

1 / 2

dy
y0
dx *

dy0i
0 y 0i x * cons tan t
dx *

This is not acceptable because the boundary layer solution must sustain
sharp behavior from the boundary point to the outer region

ILUSTRATIVE EXAMPLES
Solution Example 4(continued)
Second order derivative term balances with the third order derivative

n 1 0 n 1
Substitution:

d2y

d x *

dy
y 0
dx *

d 2 y0i

dy0i

0
2
dx *
d x *

d 2 y1i

dy1i

y0i 0
2
dx *
d x *

Matching:

y 0 0

lim y ( 0) x; lim y i x*;


x 0

x*

y 0i C C e x*

Zero order sub problem: x* 0;

y 0i x * e1 e1 e x*

y 00 0 y 0i

y 0i C

y 00 0 e1

C e1

Composite solution: By adding inner and outer solution and subtract the common
part. The common part for zero order solution:

y com e1

y e1 x e1 e x / O

ILUSTRATIVE EXAMPLES

NUMERICAL SOLUTION OF
ORDINARY DIFFERENSIAL
EQUATION

TYPES OF PROBLEMS
INITIAL VALUE PROBLEMS
Conditions are specified at one boundary
in time or space
BOUNDARY VALUE PROBLEMS
Conditions are specified at two boundary
points

INITIAL VALUE PROBLEMS


EXAMPLE 1: Reaction in series in batch reactor
k1
k2
A
B
C

dC A
k1C An
dt

dC B
k1C An k 2 C Bm
dt

dCC
k 2 C Bm
dt

t 0; C A C A0 ; C B C B 0 ; CC CC 0
EXAMPLE 2: Reaction in series in plug flow reactor
k1
k2
A
B
C

dC A
u
k1C An
dz

dC B
k1 C An k 2 C Bm
dz

z 0; C A C A0 ; C B C B 0 ; CC CC 0

dCC
k 2 C Bm
dz

INITIAL VALUE PROBLEMS


General Form of Problems
Autonomous systems

dyi
f i y1 , y 2 , y 3 ,.......,y N
dt
t 0;
yi 0 i

i 1,2,............, N

Nonautonomous systems

dyi
f i y1 , y 2 , y 3 ,.......,y N , t
dt
dyi
f i y1 , y 2 , y3 ,.......,y N , y N 1
dt

t 0;

dy N 1
1
dt

yi 0 i

t 0;

i 1,2,............, N

y N 1 0 0

INITIAL VALUE PROBLEMS


EULER METHOD (explicit)
Problem:

dy
dt

Solution

dy
dt

f y

t 0;

y t n 1 y t n
t

y t n 1 y t n h f y t n
y t n 1 y t n h

d y t n
dt

t h

O h2

TRAPEZOIDAL METHOD (implicit)

d y
1

f y n f y n 1

dt t tn 2

BACKWARD EULER METHOD (implicit)

y n1 y n h f y n1

y n1 y n

h
f y n f y n1
2

INITIAL VALUE PROBLEMS


STABILITY
Example problem:

dy
y
dt
y ye

t 0;

y 1

d

dt

Euler explicit:
n 1 n h h n n 1 h
Trapezoidal implicit
h
n 1 n n n 1
2
Backward Implicit

n 1 n h n 1

n 1
1
n

1 h 1

n 1 1 h / 2

n 1 h / 2

n 1
1

n 1 h

0 h 2

Always stable

INITIAL VALUE PROBLEMS


PREDICTOR-CORRECTOR METHODS

Adams-Bashford (for prediction)


y n1 y n

h
55 f yn 59 f yn1 37 f yn2 9 f y n3
24

Adams-Moulton (for correction)


y n1 y n

h
9 f y n1 19 f y n 5 f y n1 f y n2
24

INITIAL VALUE PROBLEMS


RUNGE KUTTA ETHOD
t 0; y 0 y 0

dy
f t , y
dt
p

y n 1 y n wi k i
i 1

i 1

k i hf t n ci h, y n aij k j
j 1

INITIAL VALUE PROBLEMS


RUNGE-KUTTA METHODS (Second Order)
Problem:

dy
f t , y
dt

t 0; y 0 y 0

Solution:

y n 1 y n w1 k1 w2 k 2

k1 h f t n , y n h f n

k 2 h f t n c h, y n a k1
y n 1

.......

y t n
1 2 y t n 2
y t n 1 y t n h y t n
h
h .......... ..
t
2 t 2

y
f t , y
t

y n 1

k 2 hf n h 2 cf t a f f y

2 y f f y

'
t y t
t 2

h2
y n hf n f t f f y n .......... ..
2

c 0.5
w1 w2 1
c w2 0.5

yn1 yn w1 w2 hf n w2 h 2 c f t a f f y n .... a w2 0.5

w1 0; w2 1;

a 0.5

c 1
w1 w2

1
; a 1
2

INITIAL VALUE PROBLEMS


RUNGE-KUTTA METHODS (Fourth Order)
Runge-Kuta-Gill
y n1

Standard Rung-Kutta
y n1 y n

1
1
y n k 1 k 2 bk 2 d k 3
6
3

k 1 h f tn , y n

k 1 h f tn , y n

h
1

k 2 h f tn , y n k 1
2
2

h
1

k 3 h f tn , y n k 2
2
2

k 4 h f t n h, y n k 3

h
1

k 2 h f tn , y n k 1
2
2

k 3 h f t n , y n a k 1 bk 2
2

k 4 h f t n h, y n c k 2 d k 3

1
k 1 2k 2 2k 3 k 4
6

2 1
2 2
2
2
, b
, c
, d 1
2
2
2
2

y y1 , y2 ,......,y N ;
T

f f1 , f 2 ,........,f N

BOUNDARY VALUE PROBLEMS


METHODS

WEIGHTED RESIDUAL METHODS


FINITE DIFFERENCE METHODS
FINITE VOLUME METHODS
FINITE ELEMENT METHODS

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
STANDARD FORM OF PROBLEMS:
Differential equation:

L y 0

For example:

d2y
L y 2 100 y 2 0
dx

Boundary condition:

M y 0

For example:

dy0 / dx 0, y1 0

CONSTRUCT APPROXIMATE SOLUTION:

ya

In general the approximate solution may not satisfy the equation and the
boundary condition.

L y a R 0
Boundary method:
Interior method:

Mixed method:

M y a Rb 0

R0

Rb 0
R 0, Rb 0

R, Rb

Residuals

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
The method of weighted residuals will require two types of known functions:

Trial function is used to construct trial solution


Test function is used as a basis (criterion) to make the residual small. To
minimize the residual, we need a means to convert this into a scalar quantity.
This is done by way of some form of averaging, which we call an inner product

Approximate solution:
N

y a x y 0 x aii x

Trial function
y 0 x and i x

must satisfy B.C.

i 1

Residual
N

Rx L y0 x aii x
i 1

Minimizing Residual

Rx wk x dx R, wk 0

A set of N nonlinear algebraic equations


are used to determine coefficients a i
wk x

k 1,2,3,.....,N

Test function

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
VARIATIONS OF METHOD:

The collocation method


The subdomain method
The least square method
The moment method
The Galerkin method

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
1. THE COLLOCATION METHOD
wk x x k

Dirac delta function at N interior points called


collocation points

xk

f x x x dx f x
k

xk

k th collocation points

xk

If these N interior collocation points are chosen as roots of an


orthogonal Jacobi polynomial of N th degree, the method is called the
orthogonal collocation method (Villadsen and Michelsen 1978)

2. THE SUBDOMAIN METHOD

wk 1 in subdomain V k

and is zero elsewhere

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
1. THE COLLOCATION METHOD
wk x x k

Dirac delta function at N interior points called


collocation points

xk

f x x x dx f x
k

xk

k th collocation points

xk

If these N interior collocation points are chosen as roots of an


orthogonal Jacobi polynomial of N th degree, the method is called the
orthogonal collocation method (Villadsen and Michelsen 1978)

2. THE SUBDOMAIN METHOD

wk 1 in subdomain V k

and is zero elsewhere

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
3. THE LEAST SQUARE METHOD
R
R,
ak

R
wk
a k

1

R, R 0
2 a k

R
1
dx
a k
2 a k

2
R
dx 0
V

4. THE MOMENT METHOD

wk x k 1 ;

k 1,2,....., N

5. THE GALERKIN METHOD

wk k x

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
EXAMPLE: DIFFUSION AND FIRST ORDER REACTION IN A SLAB CATALYST

ODE:

d 2C
De
kC 0
2
dz

C
y
;
C0
2

d y
2

y0
2
dx

z
x ;
B

B.C.:

z 0;
z B;

dC
0
dz
C C0

kB2

De
2

dy
0
dx
x 1; y 1
x 0;

The quantity of interest: Effectiveness factor


1

y dx
0

Actual Re action rate


Re action rate for hom ogeneous concentration in catalyst

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
1
EXACT SOLUTION:

coshx
y
cosh

cosh x
cosh1

tanh

ydx tanh1 0.7616


0

APPROXIMATE SOLUTION:

y a 1 a1 1 x 2

y 0 x 1,

d1
0
dx
x 1; 1 0
x 0;

dy a
0
dx
y a 1

x 0;
x 1;

1 x 1 x 2 ,

Rx 2a1 1 a1 1 x 2 0

d 2 ya
Ly a
ya R
dx 2

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
Collocation:

w1 x x x1

R, w1 R w1 dx 0
0

R, w1 2a1 1 a1 1 x 2 x x1 dx
1

2a1 1 a1 1 x

2
1

a1

1
2 1 x12

y a 1 a1 1 x 2

1 x
1
2 1 x
2

ya

2
1

ydx y a dx

a 1

2
3 2 1 x12

x1 0.5 a 0.7576

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
SUBDOMAIN

w1 x 1;

R, w1 R w1dx 2a1 1 a1 1 x 2 1 dx 0

0 x 1
1

ya 1

a y a dx 0.75
0

w1

LEAST SQUARE

3
1 x2
8

a1

10
27

a1

3
8

R
a1

R, w1 R. R dx 1 R 2 dx 0
a1
2 a1 0
0
1

2 a1

2a 1 a 1 x dx
1

ya 1

10
1 x2
27

1 216
16

a1 0
2 15
3

MOMENT METHOD

a 0.75309
w1 x 0 1

The same as Subdomain method

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
GALERKIN

w1 1 x 2

R, w1 2a1 1 a1 1 x 2 1 x 2 dx 0
1

a1

10
28

ya 1

10
1 x2
28

2
1 2a1 8 a1 0
3
15

a 0.7619

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
Method

=1

= 10

Exact

0.7616

0.1

Collocation

0.7576

0.1342

Subdomain

0.75

0.02913

Least square

0.75309

0.183123

Moment

0.75

0.02913

Galerkin

0.7619

0.18699

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL

y a 1 a j x 2 j 1 1 x 2

j 1

y a 1 a1 1 x 2 a 2 x 2 1 x 2

R 2a1 10 a 2 100 12 a 2 100 a1 1 x 2 100 a 2 x 2 1 x 2

Collocation

w1 x x1
1

R, w1 R w1 dx 0

w2 x x2
1

R, w2 R w2 dx 0

1
2
x1 , x2 a1 0.932787
3
3

a2 1.652576

a y a dx 0.1578
0
1

x1 0.285231517 , x2 0.765055325 a1 0.925134

a 2 2.040737

a y a dx 0.111
0

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
JACOBI POLYNOMIALS
,

JN

,
,

JN

x 1N i N ,i x i
i 0

N ,0 1

=parameters characterizing the polynomials

x = The polynomial orthogonal with respect to the weighting function

Rodrigues formula:

JN

x 1 x

1 1 d N N
N

xx 1 x

x
1

x
N
N 1 dx

J 1 x 1 2 x

J 2 x 6 x 2 6 x 1

J 3 x 20 x 3 30 x 2 12 x 1

x
1

Orthogonal condition:

1 x J j , x J N , x dx 0,

j 0,1,2,......N 1

N equations with N unknowns:

N ,1 ; N , 2 ; N ,3 ;......... ..; N , N

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
JACOBI POLYNOMIALS

Villadsen solution

N ,i

N N i 1 1

i N 1i 1
Recurrence formula:

N ,i
N i 1 N i

.
N ,i 1
i
i

N
N!

i i!N i !

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
JACOBI POLYNOMIALS
Roots of Jacobi polynomials can be determined numerically using Newton
Raphson Method or Bairstow method

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
LAGRANGE POLYNOMIALS
Lagrange polynomial is an interpolation polynomial passing through all (N+1) data points:
(x1,y1), (x2,y2), (xN,yN), (xN+1,yN+1).
N 1

y N x yi li x
i 1

0 i j
li x j
1 i j

x x
p x
l x

x x x x dp x
N 1

N 1

j 1
j i

N 1

dx

p N 1 x x x1 x x 2 .......... ..x x N x x N 1
N 1

y N x * y i l i x *
i 1

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD

Differentiation of a Lagrange Polynomial

Derivative at the interpolation points

dy N x N 1 d li x
yi
dx
dx
i 1

dy N xi N 1 d l j xi

yj
dx
dx
j 1

d 2 y N x N 1 d 2 l i x
yi
dx 2
dx 2
i 1

dy x dy x
dy x dy x
y' N N 1 , N 2 , ........., N N , N N 1
dx
dx
dx
dx

y' A. y

2
d 2 y N xi N 1 d l j xi

yj
2
dx 2
dx
j 1

d 2 y N x1 d 2 y N x 2
d 2 y N x N d 2 y N x N 1
y" N
,
, .........,
,

2
2
2
dx
dx
dx
dx 2

y" B . y

y y1 , y2 ,.........., y N , y N 1

dl j xi

A aij
; i, j 1,2,....,N , N 1
dx

d 2 l j xi
B bij
; i, j 1,2,...., N , N 1
2
dx

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD
CAMPUTATION OF

a ij

and

bij

1 p N 1 xi
j i

1
2

dl j xi p N 1 xi
aij

1
dx
p
1
N
1 xi

i j
xi x j p N11 x j

1 p N3 1 xi
ji

1
2
3

p
x
d l j xi
N 1
i
bij

dx 2
1
2 a a
i j
ij ii x x
i
j

p0 x 1

p j x x x j p j 1 x ;

j 1,2,.....,N 1

p j1 x x x j p j11 x p j 1 x

p j2 x x x j p j21 x 2 p j11 x
p j3 x x x j p j31 x 3 p j21 x
p 01 x p 02 x p 03 x 0

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD
GAUSS-JACOBI QUADRATURE
LAGRANGE POLYNOMIAL
N

y N 1 x y j l j x

N 1

l j x
i 1
i j

j 1

x xi

j xi

pN 1 x
x x j dpNdx1 x j

p N x x xi

EVALUATING INTEGRAL:
N
1

W
x
y
x
dx

W
x
y
l
x
dx

y
W
x
l
x
dx

j j

N 1
j
j
0
0
j 1
j 1

w j W x l j x dx
0

W x y x dx w
N 1

j 1

yj

i 1

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD

GAUSS-JACOBI QUADRATURE
FOR JACOBI WEIGHT
1

w j x 1 x l j x dx

wi

dp N xi
dx

Evaluating

p j1 x x j p j11 x p j 1 x
Villadsen formula for
,

cN

N2 , N

2 N 1c N ,

dp
x

xi 1 xi N i

dx

p j x x x j p j 1 x

c N ,

2 1 N!N 1
N 1N 12 N 1

p 0 x 1,

p 01 x 0

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD
If we use N+1 interpolation points [ N interior collocation points and (N+1)th
point at x=1] than Lagrange polynomial (of degree N) and the integral becomes:
N 1

y N x y j l j x
j 1

x 1 x
0

N 1

y N x dx w j y j
j 1

Adding one point does not increase significantly the accuracy of integral
estimation.

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD
LINEAR BOUNDARY VALUE PROBLEM: DIRICHLET BOUNDARY CONDITION
We rework previous problem of a slab catalyst particle. To insure the independent
variable x has a domain from 0 to 1 and realize that the problem is symmetrical at
x=0, the following transformation is convenient

u x2
Then,
2

dy dy du
dy

.
2 u
dx du dx
du

d y
2

y0
dx 2

d2y d
dy d
dy du
dy
d2y

2
4u 2
2 u

2 u
.
du du
du dx
du
dx 2 dx
du

Note that b.c. at x=0 is no longer needed owing to the


transformation u=x2 , which makes y always an even
function

dy
0
dx
x 1; y 1
x 0;

d2y
dy
4u 2 2
2 y 0
du
du
u 1;
y 1

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD
LINEAR BOUNDARY VALUE PROBLEM: DIRICHLET BOUNDARY CONDITION
The ultimate objective is to evaluate effectiveness factor,
1

1 2
y dx u y du
20
0
The weighting function:

W u u
0;

1
2

1 u 0

1
2
To be continued

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD
LINEAR BOUNDARY VALUE PROBLEM: DIRICHLET BOUNDARY CONDITION
The ultimate objective is to evaluate effectiveness factor,
1

1 2
y dx u y du
20
0
The weighting function:

W u u
0;

1
2

1 u 0

1
2
To be continued

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD
LINEAR BOUNDARY VALUE PROBLEM: DIRICHLET BOUNDARY CONDITION
The interpolation polynomial for this problem:
N 1

j 1

j 1

y N u y j l j u l N 1 u y j l j u

The differential equation is satisfied at N internal collocation points,


d 2 y dy
Rui 4 u 2 2 2 y i 0, i 1,2,.....,N
du i du i

System of
linear
algebraic
equation in yi,
i=1,2,,N

N 1
dy

du Aij y j
j 1
i

N 1

N 1

j 1

j 1

4 u i Bij y j 2 Aij y j 2 y i 0, i 1,2,......, N

d 2 y N 1
2 Bij y j
du i j 1

N
N

4 ui Bij y j Bi , N 1 y N 1 2 Aij y j Ai , N 1 y N 1 2 yi 0
j 1
j 1

j 1

j 1

4 u i Bij y j 2 Aij y j 2 y i 4u i Bi , N 1 2 Ai , N 1 , i 1,2,......, N

BOUNDARY VALUE PROBLEMS


METHOD OF WEIGHTED RESIDUAL
ORTHOGONAL COLLOCATION METHOD
LINEAR BOUNDARY VALUE PROBLEM: DIRICHLET BOUNDARY CONDITION

Matrix representation of system of linear algebraic equations:


C Cij 4ui Bij 2 Aij 2 ij ; i, j 1,2,...,N

C. y b

b bi 4u i Bi , N 1 2 Ai , N 1 ; i 1,2,..., N

y C . b

Effectiveness factor:

N 1

w
j 1

y j (numeric)

tanh

(exact)

1
2
3
5
1
2
5
7
10
15

%Error

10
10
10
10

0.186992
0.111146
0.100917
0.100001

87
11
1
0.001

100
100
100
100
100
100

0.166875
0.067179
0.017304
0.012006
0.010203
0.010001

1569
572
73
20
2
0.01

1 i j
0 i j

ij

exact 0.1

exact 0.01

APPROXIMATION AND
NUMERICAL SOLUTION OF
PARTIAL DIFFERENSIAL
EQUATION
ALI ALTWAY

PARTIAL DIFEERENTIAL EQUATION


Partial differential equation is a differential equation containing an unknown
function ( or dependent variable) and several independent variables. So,
the partial differential equation involves partial derivatives
The order of a partial differential equation is the order of the highest
derivative appearing in the equation. A partial differential equation is
said to be linear if no powers or product of the dependent variable or
its partial derivatives are present.
If all terms in the partial differential equation have the same order
than the equation is said to be homogeneous
Linear second order partial differential equation with constant coefficients:

2u
2u
2u
u
u
A 2 2B
Cx 2 D E
Fu f ( x, y)
xy
x
y
x
y
Homogeneous linear second order partial differential equation with constant coefficients:

2u
2u
2u
u
u
A 2 2B
Cx 2 D E
Fu 0
xy
x
y
x
y

PARTIAL DIFEERENTIAL EQUATION


CLASSIFICATION OF PARTIAL DIFFERENSIAL EQUATION
The second order partial differential equation can be classified as :
- Elliptic, if B2-AC < 0
- Hyperbolic, if B2 - AC > 0
- Parabolic, if B2 - AC = 0

2u 2u
2 0
2
x
y

Two dimensional Laplace equation or Potential equation is Elliptic


A = 1, B = 0, and C = 1, therefore B2 - AC = 0 - 1.1 = -1 < 0.

2
u
2 u
c
t
x 2

2
2u
2 u
c
2t
x 2

One dimensional Heat equation is Parabolic


*A = c2 , B = 0, and C = 0, therefore B2 - AC = 0 c2 .0 = 0.
One dimensional Wave equation is Hyperbolic
A = C2, B = 0, and C = -1, therefore B2 - AC = 0 c2 (-1) = c2 > 0.

PARTIAL DIFEERENTIAL EQUATION


SOLUTION OF PARTIAL
DIFFERENTIAL EQUATION
The solution of a partial differential equation in a
region R of its independent variables is a function
where all the partial derivatives are exist in this
region and the function satisfies the equation at
all points in this region. The function has to be
continue at boundary of R. Such functions are
very numerous. A unique solution is limited by
boundary condition and initial condition.

PARTIAL DIFEERENTIAL EQUATION


TYPES OF PROBLEMS AND METHODS OF SOLUTION

There two kinds of problems: Initial value problems and


Boundary value problems. For the Boundary value
problem, the region is finite and the boundary condition
is set at all part of region boundary, while for initial value
problem, the region is not finite.
There are some methods to solve the partial
differential equation. The following are some of the
methods: Analytical
Numerical
Laplace Transform.
Finite Difference
Separation of Variables.
Finite Volume
Combination of Variables. Finite Element
Collocation

Polynomial Approximation Solution


Selection of the form of the solution
normally presented as a polynomial
expression in the spatial variable with time
dependent coefficients
Convert the differential equation into an
integral form
differential heat balance equation is
converted into an integral heat balance
equation

Example 1
Find an approximate solution, valid for long times, to the linear parabolic
partial differential equation, describing mass or heat transport from/to a
sphere with constant physical propeties, such as thermal conductivity and
diffusion coefficient

y
1 2 y
2
x

x x
x
0;
x 0;
x 1;

y0
y
0
x
y1

For mass transfer


x

Dt
r
; 2;
R
R

C0 C
C0 C B

C0 = initial composition, CB= bulk fluid composition at the boundary r = R

Analytical solution
2 cos n sin nx
y x, 1
exp n 2 2
x n 1
n

Average concentration:

exp n 2 2
y 3 x yx, dx 2
n1
n2
0
1

Except for short times, the series converges quite fast,

hence, only a few terms are needed


For short times,

3.38514

Using Laplace
transform analysis
method

Polynomial Approximation Method


Assume a form of solution:
y a x, a1 a 2 x 2

Integrate the differential mass (heat) balance equation:


1

dy
y
3
d
x x 1

where

y dx

d ya
15 1 y a
d

3 x 2 y dx

0
1

Then obtain,

dx

0;

ya 0

y a
x 5 1 y a

x 1

3
y a 3 x 2 y a x, dx a1 a 2
5
0
y a
x 2 a 2

x 1

y a 1 exp 15

1 ya

Substitute the assumed solution into b.c at the particle surface


y a 1, a1 a 2 1

Not good for short times

5
5
y a x, 1 exp 15 exp 15 x 2
2
2

2
a 2
5

a2

5
5
1 y a exp 15
2
2
5
a1 1 a2 1 exp 15
2

COMPUTATION RESULTS
Plots of exact and approximate
average concentrations

Exact and approximate


concentration profiles

Polynomial Approximation Method


(for short times)
y
1 2 y
2
x

x x
x

Define: y

dy 1 d

2
dx x dx x
d 2 dy d 2 1 d
d 2
x
x 2
x

dx dx dx x dx x 2
dx

a a 0 a1 x a 2 x 2

x X ;

a 0
a
0
x

0;

x 0;

y finite ~ x

x 1;
X

Assume approximate solution:

x X ;

x 2

Penetration front

x X
a

1 X

Polynomial Approximation Method


(for short times)
Integral equation
d
d


dx

x x X
X
1

x X
a

1 X

d
1 X 6
d
1 X

0;

X 0 1

1 x X
y a x,
x 1 X

X 1 2 3

ya

y a dx

x
0

dx

3
2
3 x 2 y a dx 1 X X 1 X
4
X

y a 2 3 3

y a 2 3

Very short times

COMPUTATION RESULTS FOR SHORT TIMES


Plots of the mean concentration
versus dimensionless time

Polynomial Approximation Method


(good for short and long times)
Approximate solution:
y a x, a 0 a n x

y a
x n an

x1

3
y a a0
an
3 n

y a 3 x y a dx
2

a0 1 a n

y a 1, a 0 a n 1

For small times

1 ya
d ya
33
d

ya

d y a 3

d
ya

1 y a

d ya
y
3 a
d
x x 1

y a 6 3.3845

an

1
ln
1 ya

ln
3 3 y
a

d ya
33 n 1 y a
d

0.591;

y a
x 1 y a n 3

x 1

1 y

0; y a 0

1 y n 3

1 d y

3 d
1 y

Exact solution
1.9091

33

See figures in reverse


page

Polynomial Approximation Method


(good for short and long times)

1 y

2
3

3 0.2899

Computation Results

Problem with Semi-infinite Domain


Physical absorption problem:
0; y 0

y 2 y
2
x

x 0; y 1

x ; y 0;

y
0
x

C
C*

Dt

x
y 1 erf

Analytical solution:

In term of original variables:


Flux:

Fx D

C
X

X 0

2 DC *

2 Dt

1 e
C
Fx D
te 0
x
t

Average flux:
In term of e

y
x

C*

D
dt 2 C *
te
x 0

d 2
x 0

D
t

y
x

x 0

Problem with Semi-infinite Domain


Polynomial approximation solution:
Penetration front

y a x, a 0 a1 x a 2 x 2

Form of solution:
x X ;
y a x, 0

x 0; y a 1

y a
x X ;
0
x

x
y a x, 1

d X
6

d
X

Integral mass balance equation:


dy
y

d
x x 0
y

0; X 0 0

yx, dx

X 2 3

Then:

x
y a x, 1

2 3

Mass flux and average flux:

y
x

x 0

y
0 x

1
3

e
d 2
3
x 0

Computation Results

FINITE DIFFERENCE METHOD


Forward explicit scheme
Backward implicit scheme
Crank Nicholson
First Derivative

Second Derivative

y yi
dy
i 1
dx i
x

Forward

y y i 1
dy
i 1
dx i
2 x

Central

y y i 1
dy
i
dx i
x

Backward

yi 2 2 yi 1 yi
d2y

dx 2 i
x 2
yi 1 2 yi yi 1
d2y

dx 2 i
x 2

Forward

Central

Forward explicit scheme


Example: Unsteady state 1-D Conduction

Ti , j 1 Ti , j

T
2T
2
t
x

t
x

T
t

j+1
j

2T
x 2

i 1, j

Ti , j 1 Ti , j

i, j

i, j

2 Ti , j Ti 1, j

t
Ti 1, j 2Ti , j Ti 1, j
x 2

Stability criterion:

t
x

i-1

i+1

0.5

BACKWARD IMPLICIT
Example: Unsteady state 1-D Conduction
T
2T
2
t
x

T
t

Ti , j 1 Ti , j

i , j 1

2T
x 2

Ti , j 1 Ti , j

Ti 1, j 1 2 Ti , j 1 Ti 1, j 1

x 2

Ti 1, j 1 2 Ti , j 1 Ti 1, j 1
x 2

j 1

M Ti 1, j 1 (1 2M )Ti , j 1 M Ti 1, j 1 Ti , j

j+1

i-1

i+1

t
x 2

CRANK NICHOLSON
Example: Unsteady state 1-D Conduction
Ti , j 1 Ti , j

T
2T
2
t
x

2T
x 2
T
t

Ti 1, j 1 2 Ti , j 1 Ti 1, j 1 Ti 1, j 2 Ti , j Ti 1, j

2 x 2

1 Ti 1, j 1 2 Ti , j 1 Ti 1, j 1 Ti 1, j 2 Ti , j Ti 1, j

2
x 2
x 2

Ti , j 1 Ti , j

M Ti 1, j 1 2 M 1Ti , j 1 M Ti 1, j 1 2 M 1Ti , j M Ti 1, j Ti 1, j

j+1

i-1

i+1

t
x 2

EXAMPLE
Diffusion of a solute through a slab membrane with constant physical properties:

y 2 y
2
x
Initial Condition

t 0;

Boundary condition:
Analytical solution:

x'
L

C
C*

Dt
L2

y0

x 0;

y 1

x 1;

y0

sin nx
y 1 x
exp n 2 2 t
n 1
n
2

You might also like