Chemical Engineering Mathematics: Ali Altway
Chemical Engineering Mathematics: Ali Altway
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
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?
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?
q h T Tfluid
N A0 k c C A0 C Af
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.
Gas-liquid interface
liquid
Solid-Liquid interface
xin
xout
xout = f(xin)
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
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
Process safety
Detection of hazardous operating regimes
Estimation of accidental release events
Estimation of effects from release scenarios
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)
Reagents in
Products out
Reagents in
distributor
grading
particles that
induce dispersion,
deviation from plug flow
support plate
empty spaces
Products out
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)
r
t
h
Integral form
c
N
r
t
h
Differential form
c
N cv D
h
Flux (mol/m2s)
convective and diffusive part
c
cv D
D
c
cv h
h
r
t
h
h
h
So?
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
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
Boundary conditions
Steady state axial dispersion
2
dc
d c
v
D 2 r
dh
dh
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
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
t fin
rVd
Integral form
t init
dn
rV
dt
Differential form
dc
r
dt
dV
0
dt
Comparison
dc
r
dt
dc
v
r
dh
Plug-flow reactor
Steady state
Constant velocity
No axial dispersion
Comparison
h
t
v
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
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
dc
c c 0 kdt
0
c1 c 0 exp k
c t 0 c 0
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
c t 0 c 0
dc
c n 1 c n t
dt
c n 1 c n kc n t
Explicit Euler
c n 1 c n kc n 1t
Implicit Euler
Implicit Euler
cn
c n 1
1 kt
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
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
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
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
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
KX 1 Y
1
N
Y1
N 1
N 1
N 1
YN 1
1 KX 0
1
Y1
Y1
KX 0
1
Y1
N 1 log
log
r1 i ; r2 i
Yn r
modulus
r 2 2 ; tan 1 /
A cosn B sinn
Phase angle
V,Y1
V,Yn
1
L, X0
V,Yn+1
n
L, Xn-1
V,YN+1
N
L, Xn
L, XN
Rearrange:
L
L
Yn 1 X n Y1 X 0
V
V
Operating line
YN 1
1 KX 0
1
Y1
Y1
KX 0
1
Y1
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
Z n 2 AZ n 1 BZ n 0
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
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
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
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
ynp n 3
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
p
n
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
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
yn
xn
1 1x n
x n 1
L / V x n y1 x0 L / V
1 1xn1
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
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
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 :
f 0
f
f
is finite
BASIC CONCEPT
ORDER SYMBOLS
The notation: f O g
coth O 1
The notation: f og
This means that
For example:
lim
f
0
implies a zero limit lim
0 g
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
y y 0 0 y1 1 .......... .. y j j
j 0
y y j j O N 1
j 0
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
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
ILUSTRATIVE EXAMPLES
Example-1: Solve the following nonlinear
algebraic equation,
y y2 a
(1)
y0 a
y y 0 y1 2 y 2 .........
Asymptotic Expansion:
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 .......
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 .....
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
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
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
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 *
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
x*
y 0i C C e x*
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
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
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
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
d y
1
f y n f y n 1
dt t tn 2
y n1 y n h f y n1
y n1 y n
h
f y n f y n1
2
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
h
55 f yn 59 f yn1 37 f yn2 9 f y n3
24
h
9 f y n1 19 f y n 5 f y n1 f y n2
24
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
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
w1 0; w2 1;
a 0.5
c 1
w1 w2
1
; a 1
2
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
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
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
Approximate solution:
N
y a x y 0 x aii x
Trial function
y 0 x and i x
i 1
Residual
N
Rx L y0 x aii x
i 1
Minimizing Residual
Rx wk x dx R, wk 0
k 1,2,3,.....,N
Test function
xk
f x x x dx f x
k
xk
k th collocation points
xk
wk 1 in subdomain V k
xk
f x x x dx f x
k
xk
k th collocation points
xk
wk 1 in subdomain V k
R
wk
a k
1
R, R 0
2 a k
R
1
dx
a k
2 a k
2
R
dx 0
V
wk x k 1 ;
k 1,2,....., N
wk k x
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;
y dx
0
coshx
y
cosh
cosh x
cosh1
tanh
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
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
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
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
=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
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
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
a 2 2.040737
a y a dx 0.111
0
JN
,
,
JN
x 1N i N ,i x i
i 0
N ,0 1
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 ,1 ; N , 2 ; N ,3 ;......... ..; N , N
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 !
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
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
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
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
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
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.
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
dy
0
dx
x 1; y 1
x 0;
d2y
dy
4u 2 2
2 y 0
du
du
u 1;
y 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
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
j 1
j 1
y N u y j l j u l N 1 u y j l j u
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
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
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
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
2u 2u
2 0
2
x
y
2
u
2 u
c
t
x 2
2
2u
2 u
c
2t
x 2
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
Dt
r
; 2;
R
R
C0 C
C0 C B
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
3.38514
Using Laplace
transform analysis
method
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
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
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
x X ;
x 2
Penetration front
x X
a
1 X
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
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
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
1 y
2
3
3 0.2899
Computation Results
y 2 y
2
x
x 0; y 1
x ; y 0;
y
0
x
C
C*
Dt
x
y 1 erf
Analytical solution:
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
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
0; X 0 0
yx, dx
X 2 3
Then:
x
y a x, 1
2 3
y
x
x 0
y
0 x
1
3
e
d 2
3
x 0
Computation Results
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
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