Professional Documents
Culture Documents
Validation UK
Validation UK
Validation
Prof. Cesar de Prada
Dpt. Systems Engineering and Automatic Control
University of Valladolid
prada@autom.uva.es
Outline
Introduction
Parameterization / Calibration
Sensitivities
Identifiability
Dynamic optimization
Model validation
Formulation for a
Simulation
specific calculation Coding language
Process knowledge
There are Aims, Model kind
specific
methods and Hypothesis
tools to facilitate
the Model formulation
implementation
of these steps Parameter estimation
Model Evaluation
time Explotation
Cesar de Prada ISA-UVA 4
Modelling
Two steps:
d x(t)
= f ( x ( t ), u ( t ), p, t ) • Model structure building
dt
y( t ) = g ( x , u ( t ), t ) • Estimating the value of the
model parameters
d x(t)
= f ( x ( t ), u ( t ), p, t )
dt
y( t ) = g ( x , u ( t ), t )
AT
t Product
y y
pa u
Model
pb Given a set of inputs, the
model response depends
p
on the value of the
parameters p
J = ∑ e( t ) = ∑ [y(u , p, t ) − y p ( t )]
1 N 2 1 N 2
N t =1 N t =1
y(p) yp(t)
u y
Model
y(u,p,t)
p
t
Other formulations can be
Cesar de Prada ISA-UVA made also for J 9
Parameterization (calibration)
∑ [y(u, p, t ) − y p ( t )]
N
min J = min
2
p
p t =1
u
It may happen that the model
response to a given set of inputs
for two values p1 and p2 of a
certain parameter does not
change in a significant way.
J = ∑ [y(p, u , t ) − y p ( t )]
N
2
t =1
∂y i ( t ) ∂J
Sij ( t ) =
∂p j ∂p j
Sensitivity of cost function J
Sensitivity of the model output i with respect to parameter j in a
with respect to parameter j in a given experiment.
given experiment. Notice that it
Summarize the effect of the
is a time function.
parameter change over the
Cesar de Prada ISA-UVA whole experiment. 14
Output sensitivities
∂y i ( t )
Sij ( t ) = It is difficult to compare output
∂p j sensitivities due to the different
units in which they are expressed.
It is better to use relative
p j ∂y i ( t ) sensitivities
s ij ( t ) =
y i ∂p j
s11 s12 s1d The norm of column j of the output
s s 22 s 2d sensitivity matrix provides a measure
21
of the importance of parameter pj in
the value of the model outputs.
s s md
m1 s m 2
Cesar de Prada ISA-UVA 15
Computing output sensitivities
∂y i ( t ) y i (p + ∆p, t ) − y i (p, t )
Sij ( t ) = ≈
∂p j ∆p
∂J ∂y
= 2∑ [y(p, u , t ) − y p ( t )]
N
∂p t =1 ∂p
∂x d ∂x ∂f ∂x ∂f
= = + Integrating this equation, besides
∂p dt ∂p ∂x ∂p ∂p the ones of the model, it is possible
to obtain the time evolution of the
∂y ∂g ∂x ∂g sensitivities ∂x/∂p and, hence, the
= +
∂p ∂x ∂p ∂p output sensitivities.
u2
TT
u1 Tr Reactant
Ti T
Reactor
Coolant
AT
Product
If the process has several inputs, changes applied to themshould
be uncorrelated, sothat the optimization algorithm can
distinguish the effects of every input on every output.
Cesar de Prada ISA-UVA 23
Experiments
Notice that, if correlated signals, such as u1=αu2, are applied
simultaneously, there are many combinations of models M1
and M2 that correspond to the same couples of input output
values
y ( t ) = M 1u 1 ( t ) + M 2 u 2 ( t ) = ( α M 1 + M 2 ) u 2 ( t )
u2
TT
u1 Tr Reactant
Ti T
Reactor
Coolant
AT
Product
Change one input while maintaining constant the others, and
repeat the experiment agin with the remainder ones, it is not a
good policy: it increases the time required for data collection and
provides data in special operating conditions.
Cesar de Prada ISA-UVA 25
Solving parameterization problems
min J = ∑ [y(p, u , t ) − y p ( t )]
N
2
p t =1
min J = ∑ [y(p, u , t ) − y p ( t )]
N
2
p t =1
p J
TT AT Row product A
Fr, Tri T, x
Reactor A→B
Coolant
Product: A & B
Cesar de Prada ISA-UVA 28
Dynamic Optimization
q cB
q, Fr
A→B
t t
T max qc B
q , Fr
Component name
COMPONENT reactor_ab_dynamic_max
DATA
Decision Variables
REAL ....
DECLS
REAL q = 2.832 “Volumetric Inflow [m3/h]“
REAL Fr “Coolant flow [m3/h]"
REAL ....
-- Indice a minimizar
REAL J_cost Cost Function
-- Vector de las restricciones no lineales
REAL val_func[3]
…….. Constraints
Cesar de Prada ISA-UVA 31
Constraints / Cost function
CONTINUOUS
... ecuaciones del modelo Dynamic model
-- balance de masa de A
V*cA' = q*(cA0 - cA)- V*k*cA
-- balance de energia en el reactor
V*rho*Cp*T' = q*rho*Cp*(Te - T) - V*k*cA*DH - Q
………
-- calculo de la funcion de costo a minimizar Cost function
J_costo = - q*cB
DECLS
REAL val_objetivo -- valor de la funcion objetivo J
REAL param_estim[2] -- vector de variables a optimizar
REAL L_est_inf[2] -- limite inferior de las variables de decision
REAL L_est_sup[2] -- limite superior de las variables de decision
Te = 21.11
Tre = 21.11
cA0 = 14.46
-- q = 2.832 -- La fija el optimizador en cada iteracion junto a Fr
Cesar de Prada ISA-UVA 33
Experiment / Optimization
BODY
q = 55 Fr = 3.4 -- Inicializaciones
INTEG()
Passing values of const function
func_res[1] = J and constraints
func_res[2] = val_func[1]
func_res[3] = val_func[2]
func_res[4] = val_func[3]
END FUNCTION
Cesar de Prada ISA-UVA 35
Results in EcosimPro (EcoMonitor)
Ti T temperature
q m tank mass
Te H liquid level
V voltage
m q Inflow
V R T h F Outflow
a valve opening
H entalphy
F ce specific heat
a
A tank cross section
Hypothesis: ρ density
R resistence
T lumped temperature
Te external temperature
ρ constant density
Ti inflow temperature
ce constant specific heat
Cesar de Prada ISA-UVA 38
Dynamic model
State space non-linear model
Ti
q
dh 1
= (q − F) Te
dt A
dT q V2 U m
= (Ti − T ) + − amb (T - Te )
dt Ah AhRρc e Ahρc e V R T h
F = ak h
F
CV: T temperature MV: V voltage a
h level a valve opening
Disturbances: q Inflow, Ti Input temperature
States: h , T
Other variables: F outflow Cesar de Prada ISA-UVA 39
Model calibration
Highly non-linear
reactor, difficult to
control
A→B→C
2A → D
Parameters:
Volume: 10 l
Refrigerant mass: 5 Kg
Cesar de Prada ISA-UVA 42
Reactor Van der Vusse
u y
Model
1 N
∑ (y ( t ) − y p ( t ) )2 y
N t =1
model
yp
Errors due to: experiment
t
Initial conditions
Disturbances
Model Cesar de Prada ISA-UVA 52
Error indexes
1 N
∑ (y ( t ) − y p ( t ) )2
model yp
N t =1
experiment
N N
∑ ( y( t ) − y p ( t )) 2
− ∑ ( y( t ) − y p ( t ))
2 /(d j − d i )
t =1
mod i t =1 mod j
N 2
∑ ( y( t ) − y p ( t )) /( N − d j )
t =1 mod j
v
u yp
Process
e
Model y
e e
t t
2σ
2σ
k k
e
Model y
min J = ∑ [y(p, u , t ) − y p ( t )]
N
2
p t =1
ŷ( t + j)
y(t+j)
u(t+j)
t
d x(t)
= f ( x ( t ), u ( t ), p, t )
dt
y( t ) = g ( x , u ( t ), t )
e* ( t ) = y ( p * , t ) − y p ( t )