2 - Dynamic Modelling (Process Dynamics and Control)
2 - Dynamic Modelling (Process Dynamics and Control)
Control
CH 3043 A
Email: c.s.bildea-1@tudelft.nl
s_bildea@upb.ro
Room:
Lecture 1 - Introduction
=nRT
4
Mathematical model
• Uses and advantages
• Fast, cheap way to investigate possible designs (including control system)
• Describe the behavior of complex systems
• Calculate the size of equipment
• Optimize existing plants
• Predict the result of an experiment
• Mathematical models consist in:
• Balance equations
• Constitutive equations
06/11/2020 5
Dynamic modeling
• A model is an abstraction (read approximation/simplification) of a
part of reality.
• Furthermore the model should be adequate (fit for purpose).
• What is adequate?
• Approximate what? Formalize by procedure
• Which part?
6
Procedure for developing (dynamic)
models
1. Define
objectives
• Purpose model? 2. Prepare
• Required
information
accuracy?
• Sketch process 3. Formulate
• Determine
model
system boundary
• Identify • Conservation 4. Determine
variables of laws
interest • Constitutive
solution
• State equations • Analytical 5. Analyze
assumptions • DOF”s? • Numerical
results
• Results correct? 6. Validate
• Interpret the
model
results
• Select key
variables
• Compare with
experiment
7
Balance equations
• Conservation laws can be set up for:
1.Mass (total or component)
2.Energy
3.Momentum
• For a lot of process systems mass and energy balances are sufficient, the
momentum balance is replaced by flow assumptions (e.g. ideal mixing, plug
flow…).
8
Balance equations
Accumulation = Net (in) + Net (generated)
dX
X RX
dt
Considered
X – property (kmol)
volume V
x – density of X (kmol/m3) F X
X
RX – total generation rate
(kmol/s) RX
Observation:
S
X n dS div X dV
V
X X
div X i j X k X X (Gauss)
x y z
dx
div X rX
dt
10
Lumped systems
d
dt V
x dV X n dS rX dV
S V
x dV x V X r
V
X dV rX V RX
V
t t t t
X t t
X t X ,in dt X ,out dt
t t
X ,out dt
t t
X ,in
t
X ,in X ,out t
“mean value theorem” t t
(integral calculus)
0 1 12
The ‘integral” approach (2)
X t t
X t X ,in X ,out t
t t
X X dX
X ,in X ,out
t t
t t
t
t
dt t t
dX t
t 0 X ,in t X ,out t
dt 13
Writing balance equations
- the “instantaneous” approach -
dX t
X ,in t X ,out t
dt
14
Mass balance
rate of accumulation = mass flow - mass flow
of mass in out
p q
dM
M , j M ,k
dt j 1 k 1
d V p q
j V , j V ,k
dt j 1 k 1
p q
dV
! For constant density r V , j V ,k
dt j 1 k 1
dx t
f x t ,u t f : R nm R n
dt
y t g x t g : R nm R p
at t 0 x 0 x0
16
Component mass balance
rate of mass accumulation = mass flow in
of component i of component i ( fi )
- mass flow out
of component i
+ rate of formation
of component i
p q
dM i
f i , j fi ,k Ri i 1 n
dt j 1 k 1
p q
dN i
fi , j fi ,k Ri i 1 n (molar)
dt j 1 k 1
17
Constitutive relationships
Gas law pv RT
a
p 2 v b RT
(van der Waals)
v
Equilibrium relations yi Ki xi
18
Conservation balance using intensive variables
•intensive variables enter constitutive equations
(reaction rate, physical properties)
•example:
Mi kg of i
ci kg
M
if well-mixed: ci ci ,out
if M = constant Fin = Fout = F dci
M ci ,in F ci ,out F Ri
dt
Otherwise (well mixed, but M not constant):
dM
Fin Fout
dt
dci
M ci ,in Fin ci Fin Ri
dt
20
Energy balance
rate of change = flow of energy flow of energy
-
of total energy into the system out of the system
E U K E PE
total internal kinetic potential
energy = energy + energy + energy
M w2
M g h h0 Small
H U P V 2 can be neglected
21
Constitutive relationships
Heat transfer
QC UAT QR A T T
1
4
2
4
d
cp T a b T c T
2
22
Example - CSTR
A B
F0, cA,0, cB,0, T0
F [ kg /s ]
c [ kg / kg ] M
cA, cB
Tc
EA
T U, A
r k0 exp cA
RT
(kg A / kg reactor)
F1, cA,1, c T1
B,1
23
Balance equations
Known :
- inlet conditions
dM A - outlet flow rate F1
FA,0 FA,1 r M (an input variable !!)
dt - constitutive relations,
dM B as needed
FB ,0 FB ,1 r M
dt
dH Solution possible
F0 h0 F1 h1 Q (correct model) if:
dt
knowing the state variables
and inputs
M A 0 M A0
=
At t = 0 Can calculate the RHS of
M B 0 M B0
differential equation
H 0 H0 24
Calculating RHS
MA MB
c A,1 cB ,1 M MA MB
M M
H M A hA M B hB (ideal !!)
M A hA Tref cP , A T dT M B hB Tref cP , B T dT
T T
Tref Tref
M A hA Tref cP , A T Tref M h T c T T
B B ref P ,B ref
Solve for T
EA H
Calculate r k0 exp cA h1 Q UA T Tc
RT M 25
Where is the heat of reaction ?
dH d dM A dM B dhA dhB
M A hA M B hB hA hB MA MB
dt dt dt dt dt dt
dhA d dT
hA Tref cP , A T Tref cP , A
dt dt dt
dT dT
M A c P , A M B cP , B dt
McP
dt
hA,0 hA hA Tref cP , A T0 Tref h T c T T c T
A ref P, A 1 ref P,A 0 T1
hB ,0 hA hB Tref cP , B T0 Tref h T c T T c T
B ref P ,B 1 ref P ,B 0 T1
dT
McP F0 c A,0 cP , A cB ,0 cP , B T T0 r H rM UA T TC
dt
McP
dT
F0 cP T T0 r H rM UA T TC
c P, A cP , B !
dt 27
Using moles and m3
d V c pT p
Fj c pj T j T rV H R Q
dt j 1
28
General form of dynamic models
dx t
f x t , z (t ), u t
dt
0 g x(t ), z (t ), u (t )
y t h x t , z t
at t 0 x 0 x0
u t for t 0 29
Degrees of freedom
N DF NU N E
unknowns equations
30
Counting
Physical quantities: variables, parameters, constants
The number of algebraic variables (z) must be equal to the number of algebraic
equations (g)
F1 F2
32
Degrees of freedom
1 state variable : h
6 algebraic variables: P0,P1,P2,P3,F1,F2
3 parameters: A, CV, r
1 constant: g
P0
NDF = 6 – 3 = 3
33
Good specification [ P0, P1, P3 ]
P0
At t=0, h=h0
P1 h P3
calculate: P2
P2 F1 F2
F1
F2
dh 1
dh/dt F1 F2 , h 0 h0
dt A
at t = 0 + Dt F1 CV P1 P2 0
h = h(0)+ Dt*dh/dt
F2 CV P2 P3 0
Index 1 P2 P0 gh 0
34
Bad specification [ P0, P1, P2 ]
Index > 1
P0
?
At t=0, h=h0 P1 h
P2 P3
calculate:
P3, F1, F2 F1 F2
P3 F1 F2
dh 1
F1 F2 , h 0 h0
X dt A
F1 CV P1 P2 0
X X
F2 CV P2 P3 0
P2 P0 gh 0
35
Solving nonlinear, dynamic models
• A set of DAE’s can be solved either by:
• Analytical techniques; normally the chances of success are quit small.
However finding an analytical solution after linearization is standard.
• Numerical techniques; think of Euler, Runga-Kutta methods etc…
• Implicit methods are attractive (the algebraic part already requires
iterations and they are very stable).
dx
f ( x, u ), x(0) x0
dt
xi 1 xi (ti 1 ti ) f ( xi , ui ) (explicit)
xi 1 xi (ti 1 ti ) f ( xi 1 , ui 1 ) (implicit)
36
Solution
• Nowadays there are a number software packages
available to solve DAE’s. There are basically two kind of
packages:
1. General purpose; like Matlab, Mathcad, Mapple and
Mathematica.
2. Process oriented; like gPROMS, Aspen Dynamics,
Hysys
37
Identification (I)
• The basic idea of identification is to fit the input-output
behavior of a parameterized differential equation to an
experiment.
u System y
38
Identification (II) dym
a ym b u
dt
• Assume a model, for example:
ym (0) ym 0
• This model has three parameters (a, b and ym0). The values of these
parameters is determined such that “the difference between ye(t)
and ym(t)” is minimal.
u(t), y (t) ym
ye
time
39
Identification (III)
• The main use of identification is tuning of PID-
controllers and getting models for Model Predictive
Control (MPC).
40
Validation
• To determine whether the model represents the
process with the required accuracy for the specified
range of conditions.
41