Process Dynamics and Control - chemeng.aut.ac.ir
Transcript of Process Dynamics and Control - chemeng.aut.ac.ir
9/30/2019
1
Ali M. Sahlodin
Department of Chemical Engineering
AmirKabir University of Technology
1397 S.H
Fixed inlet concentration
Variable inlet concentration
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 2
F, C1
F, C2 21 2( ) ( )
dC Ft C C t
dt V Ordinary-differential
equation
21 2
1
( ) ( ) ( )
( ) ( )
dC Ft C t C t
dt V
C t t
Differential-algebraic equation
9/30/2019
2
Fully-implicit DAE
Implicit ODE
Semi-explicit DAE
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 3
F(x( ),x( ), ) 0t t t F Singular
x
F Non-singular
x
x( ) f(x( ), )t t t
F(x( ), x( ), y( ), ) 0
G(x( ), y( ), ) 0
t t t t
t t t
F Non-singular
x
Conservation of mass/energy
Hydraulic relations
Reaction kinetics
Thermodynamic relations
Total volume
…
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 4
9/30/2019
3
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 5
Q
VF
LF
inF ,P T
Sahlodin et. al. 2016, AIChE J.
All algebraic equations
Method of lines
Convert PDE to system of ODEs by discretizing
the space
Example 1: one-dimensional heat
equation
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 6
2
2
T T
t x
1 1
2
20, 2, , 1
( )
j j j jT T T Tj N
t x
ODE System
9/30/2019
4
Example 2:
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 7
2
2
2
2
y z yb
t x x
za
x
Discretization of the spatial derivative
results in a DAE
System of ODEs
If (variables y have fast dynamics)
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 8
x( ) f(x( ), y( ), , )
y( ) g(x( ), y( ), , )
t t t t
t t t t
0 1
x( ) f(x( ), y( ), ,0)
0 g(x( ), y( ), ,0)
t t t t
t t t
Semi-explicit DAE
Singular perturbation problem
9/30/2019
5
What is stiffness? No agreed-upon definition!
Depends on differential
equation, initial conditions,
and numerical method
Presence of both fast and slow
dynamics
Non-stiff solvers must take very
small steps
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 9
2 3x x x
DAEs are similar to stiff ODEs in the limit.
Recall singular perturbation problem
Stiff ODE methods can be used to solve DAEs
(discussed later).
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 10
x( ) f(x( ), y( ), ,0)
0 g(x( ), y( ), ,0)
t t t t
t t t
x( ) f(x( ), y( ), , )
y( ) g(x( ), y( ), , )
t t t t
t t t t
9/30/2019
6
1. Accuracy of numerical solution
2. Stability of numerical solution
3. Constraint satisfaction
4. Initialization
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 11
Numerical solution of ODEs
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 12
( ) ( , )dxt f x t
dt
2
1 1 1( ) ( ) ( , ) ( )k k k kx t x t hf x t O h
2
1 1 1 1 1( ) ( ) ( , ) ( , ) ...2
k k k k k k
hx t x t hf x t f x t
•Forward Euler
2
1( ) ( ) ( , ) ( )k k k kx t x t hf x t O h
•Backward Euler
9/30/2019
7
Tank example: Case I
Dynamic Simulation problem (known input)
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 13
F, C1
F, C2
21 2
1
( ) ( ) ( )
( ) ( )
dC Ft C t C t
dt V
C t t
2( )O hOrder of error
Tank example: Case II
Dynamic design problem (known output)
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 14
F, C1
F, C2
21 2
2
( ) ( ) ( )
( ) ( )
dC Ft C t C t
dt V
C t t
( )O hOrder of error
9/30/2019
8
Tank example: Case III
Tanks in series with known output
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 15
F, C1
F, C2
F, C3
21 2
32 3
3
( ) ( ) ( )
( ) ( ) ( )
( ) ( )
dC Ft C t C t
dt V
dC Ft C t C t
dt V
C t t
(1)OOrder of error
Reducing step size will not improve order of accuracy!
Tank example: Case I
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 16
21 2
1
( ) ( ) ( )
( ) ( )
dC Ft C t C t
dt V
C t t
F, C1
F, C2
How close is this to an ODE?
Differentiate the system until appears.
One differentiation is enough.
1 ( )dC
tdt
9/30/2019
9
Tank example: Case II
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 17
F, C1
F, C2
21 2
2
( ) ( ) ( )
( ) ( )
dC Ft C t C t
dt V
C t t
Differentiate the system until appears.
Two differentiations are needed.
1 ( )dC
tdt
Tank example: Case III
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 18
F, C1
F, C2
F, C3
21 2
32 3
3
( ) ( ) ( )
( ) ( ) ( )
( ) ( )
dC Ft C t C t
dt V
dC Ft C t C t
dt V
C t t
Differentiate the system until appears.
Three differentiations are needed.
1 ( )dC
tdt
9/30/2019
10
The minimum number of times a DAE system or
part of it must be differentiated in order to
arrive at an implicit ODE
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 19
1 : F(x( ), x( ), ) 0d
F t t tdt
2
2 2: F(x( ),x( ), ) 0d
F t t tdt
1
1 1F(x( ),x( ), ) 0
j
j j
dF t t t
dt
0: F(x( ), x( ), ) 0F t t t
Find index
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 20
Wikipdia by Ruryk
2 2 2
0
0
0
xmx T
Ly
my mg TL
x y L
What is the index?
9/30/2019
11
Semi-explicit DAE
is index 1 IFF
Example: a CSTR with the rate equation
written separately.
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 21
F(x( ), x( ), y( ), ) 0
G(x( ), y( ), ) 0
t t t t
t t t
F Non-singular
x
Non-singularg
y
High-index DAEs (v>1) can be problematic.
ODE solvers with high-index DAEs may
Converge poorly
Converge to wrong results!
Fail to converge
Problem formulation can affect the index.
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 22
9/30/2019
12
Use high-index DAEs solvers
No general-purpose solver available
Solvers available for specialized forms
Reduce DAE index to <=1.
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 23
Convert a high-index DAE (v>1) to a low-index
DAE (v<2).
Simplify computational complexity
How to do it?
Successive differentiation
Change of variables
Regularization
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 24
9/30/2019
13
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 25
2 1 1
3 2 2
3 3
0
0
0
x x f
x x f
x f
Applicable when time derivative of a state variable does not appear in
the system
Not easily automatable
1 1z xDefine and substitute above.
Obtain the index again.
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 26
x( ) f(x( ), y( ), ,0)
0 g(x( ), y( ), ,0)
t t t t
t t t
x( ) f(x( ), y( ), , )
y( ) g(x( ), y( ), , )
t t t t
t t t t
•Converts DAEs to stiff ODEs (we know how to solve ODEs!)
9/30/2019
14
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 27
1 3 1
2 1 2
2 3
0
0
0
x x f
x x f
x f
Substitution will reveal two additional constraints
This issue will be discussed further.
1 apparent algebraic equation