0% found this document useful (0 votes)
7 views

2 - Dynamic Modelling

Uploaded by

p9hrfjtqvc
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

2 - Dynamic Modelling

Uploaded by

p9hrfjtqvc
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

Process Dynamics and

Control
CH 3043 A

Lecture 2 – Dynamic Modelling


Models

=nRT

2
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/02/2024 Modeling, design and control of (catalytic) cyclic distil 3


lation columns
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?

4
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

5
Balance equations
• Conservation laws can be set up for:
1.Mass (total or component)
2.Energy
3.Momentum

• Typically a conservation law is implemented as a balance:


Accumulation = In – Out + Production – Conversion
“Production” and “Conversion” occur only for component mass balance and
momentum balance

• 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…).
6
Writing balance equations
- the “instantaneous” approach -

Rate of accumulation = rate of X - rate of X ( Reaction


entering leaving included ! )

dX t 
  X ,in t    X ,out t 
dt

•The “integral” approach (next slides) takes longer, but


it is clearer for distributed parameter systems
7
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

M, V = state variable ; Φ – input variables; r - parameter 8


General form of dynamic models
(will be updated later)

Inputs System Outputs


u(t) y(t)
States x(t)

dx t 
 f  x t  , u t  f : R nm  R n
dt
y t   g  x t  g : R nm  R p
at t  0 x  0   x0
9
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
  fi , j   fi ,k  Ri i  1 n (molar)
dt j 1 k 1
10
Constitutive relationships
Gas law pv  RT
 a
 p  2   v  b   RT
(van der Waals)
 v 

Flow through valves


Reaction rate
Pv
 sx F  Cv f  x 
rA  kc AcB rX  
KS  s

Equilibrium relations yi  Ki xi

11
Conservation balance using intensive variables
•intensive variables enter constitutive equations
(reaction rate, physical properties)
•example:
Mi  kg of i
ci   kg 
M  

•warning: be careful, there may be “index” problems!


12
in
d  ci M 
 ci ,in  Fin  ci ,out  Fout  Ri
dt
dci dM
M  ci  ci ,in  Fin  ci ,out  Fout  Ri
dt dt out

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
13
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

flow of energy = convective + conductive + work


radiative

14
Constitutive relationships

Heat transfer

QC  UAT QR   A T  T
1
4
2
4

d
c p T   a  b  T  c  T 
2

15
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
16
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
=
At t = 0 M A  0   M A0 Can calculate the RHS of
differential equation
M B 0  M B0

H 0  H 0 17
Calculating RHS
MA MB
c A,1  cB ,1  M  MA  MB
M M

(ideal !!)
H  M A hA  M B hB

 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 18
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 AcP, A  M B cP,B  dt  McP dt

hA  F0 c A,0  F1c A,1  R   hB  F0 cB ,0  F 1cB ,1  rM  


rM  hB  hA   hA  F0 c A,0  F1c A,1   hB  F0 cB ,0  F 1cB ,1 
19
Where is the heat of reaction ? (2)
dT
McP  R  hB  hA   hA  F0c A,0  F1c A,1   hB  F0c B,0  F 1c B,1  
dt
F0 c A,0 hA,0  F0 cB ,0 hB ,0   F1c A hA  F1cB hB   Q

   
hA,0  hA  hA Tref   cP , A T0  Tref   hA Tref   cP , A T1  Tref   cP , A T0  T1 

   
hB ,0  hA  hB Tref   cP , B T0  Tref   hB Tref   cP , B T1  Tref   cP , B T0  T1 

dT
McP  F0  c A,0cP , A  cB ,0cP , B  T  T0     r H  rM  UA T  TC 
dt

McP
dT
 F0cP T  T0     r H  rM  UA T  TC 
c P, A  cP , B  !
dt 20
Using moles and m3

d V  c pT  p
  Fj c pj T j  T   rV  H R   Q
dt j 1

21
General form of dynamic models

Inputs System outputs


states: x(t)
u(t) auxiliary: z(t) y(t)

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 22
Degrees of freedom
N DF  NU  N E
unknowns equations

NDF = 0 A unique solution may exist

NDF > 0 the problem is under-specified (optimisation)

NDF < 0 the problem is over-specified (least squares)

23
Counting
Physical quantities: variables, parameters, constants

Parameters : must be known

Variables : differential (state) and algebraic (auxiliary)

Each differential equation (variable x) must have an initial condition x(t=0) = x0

The number of algebraic variables (z) must be equal to the number of algebraic
equations (g)

For distributed parameter systems – we also need boundary conditions


24
Example
dy
dh 1  f  y, z, t  , y  0   y0
  F1  F2  , h  0   h0 dt
dt A
0  g  y, z, t 
F1  CV  P1  P2   0
P0
F2  CV  P2  P3   0
P2  P0   gh  0
h
P1
P3
P2

F1 F2
25
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

1 differential equation with I.C. P1 h P3


3 algebraic equation P2
3 parameter values F1 F2

NDF = 6 – 3 = 3

26
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
27
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
28
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)

29
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

• The general purpose packages offer little support for


modeling and the calculation of properties, however the
integration with analysis and synthesis tools is typically
better.

30
Identification (I)
• The basic idea of identification is to fit the input-output
behavior of a parameterized differential equation to an
experiment.

• Consider a system with a Single Input u and a Single


Output (SISO) y :

u System y

• The experiment is often a step response.

31
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

32
Identification (III)
• The main use of identification is tuning of PID-
controllers and getting models for Model Predictive
Control (MPC).

• Identification is attractive for getting a simple (SISO,


linear) model. First principles are better for
complex (MIMO*, non-linear) models. Basically this
has to do with the time needed for experiments.

* Multiple Input Multiple Output

33
Validation
• To determine whether the model represents the
process with the required accuracy for the specified
range of conditions.

• Given the model purpose one selects key variables


and compares the model with one or more
experiments.

• No set of experiences can fully validate the model.


Good comparisons only demonstrate that the model
has not been invalidated by the data.

34

You might also like