Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 34

Quasi-sequential Parameter

Estimation for Large-scale


Dynamic Systems with Multiple
Data Sets
Problem definition

The general dynamic process model


governed by DAE equantions :

x t  State (dependent) variables


f  x t  , x t  , u t  , t   0
u t  Input (independent)
variables
g  x  t  , u t  ,  t    0 1  t  Time-vary parameter

Initial condition of
x  t0   x 0 x  t0 
state variables
The vector of differential
f:
t  [t0 , t f ] equations
g: The vector of algebraic
equations

2
Problem definition

Error in variable (EIV) formulation of parameter estimation


problem:
NS NS NK
 y t   y M t T V -1  y t   y M t   u t   u M t T V -1 u t   u M t 
min
 ,u j , x j , y j

j 1
F j    j i
j 1 i 1 
j i y j i j i j i j i u j i j i 

s.t. Vy , Vu Known covariance


f j  x j t  , x j t  , y j t  , y j t  , u t  ,  t   0 matrices
h: Process restrictions
g j  x j t  , y j t  , u t  ,  t   0
y t  Measured state variables
h j  x j t  , y j t  , u t  , t   0
2
Measurements of
y M t  , u M t 
output and input
θ L  θ t   θU variables

x j t0   x j ,0 NS : Number of data sets

NK :
Number of
measurement points
3
Large-scale NLP problem

The parameter estimation problem with formulation Eq (2) exhibits


the following properties:
1. For estimation problem, the number of variables, DAE constraints
and degree of freedom increase linearly with the number of data sets.
2. Making use of EIV formulation, the optimization is performed on
both the parameters and all variables, thus leading to problems with
many degrees of freedom.

Efficient strategies and numerical algorithms


are needed to handle these computationally
intensive problems

Proposed strategy: Quasi-sequential parameter estimation approach


4
Discretization with collocation on finite elements

Orthogonal collocation applies a polynomial approximation to the


differential equations and requires satisfaction of the equations at
the discrete collocation points.

Radau collocation on finite elements (NC=3)


5
Problem definition

Collocation method:

 NC  - The input variables and


NC NC
t  t parameters are
xl t    Pj t  xl , j    i 
xi , j
 t  t 
j 0 j 0 i 0 i
 i  j j
 represented as piecewise
NC constants in each
xl ti    Pj ti  xl , j
j 0 element
 3 - The state variables are
dxl ti  NC dPj ti 
 xl , j presented as a linear
dt j 0 dt
combination of a set of
i  0, , NC orthogonal polynomials
l  1, , NL using Lagrange
NC : Number of collocation points in one element
polynomial:
NL : Number of elements in the time period

6
Large-scale NLP problem

Discretization with collocation on finite elements


NS NS NL NC
F   Fj    y j .l ,i  y Mj ,l ,i  Vy-1  y j .l ,i  y Mj ,l ,i   u j ,l  uMj ,l  Vu-1 u j ,l  uMj ,l 
T T
min
j 1 l 1 i 1  
θl ,u j ,l , x j ,l ,i , y j ,l ,i
j 1

s.t. The total number of degrees


g j  x j ,l ,i , y j ,l ,i , u j ,l ,i , l   0
of freedom in this problem is
4
h j  x j , l ,i , y j , l , i , u j ,l ,i ,  l   0 NS   NL  NC   n  m   NL  q   NL  p

θ L  θl  θU For large-scale systems,


the problem may be too
where large for a standard NLP
f j 
g j    solver to deal with.
g j 

Note: It is assumed that the measurements points


coincide with the element positions. NL  NK
7
Three stage computation framework

NLP
NS
Upper stage
min F 
θl
F
j 1
j
NS
F   Fj
j 1
s.t .
F NS Fj
θ L  θl  θU 
θl θ j 1 θ

SQP 1 SQP NS Middle stage


min F1 min FNS
u1,l
u NS ,l
s.t. s.t.
h1  x
 1,l ,i , u1,l , θl   0 h NS  x NS ,l ,i , u NS ,l , θl   0
l  1, , NL l  1, , NL
i  1, , NC i  1, , NC

dx 1 u NS ,l dx NS
u1,l
du1 du NS


MOD SIM 1
Lower stage
MOD SIM NS
g 1,l  x 1,l ,i , u1,l , θl   0 g NS ,l  x NS ,l ,i , u NS ,l , θl   0
l  1, , NL l  1, , NL
i  1, , NC i  1, , NC

8
Quasi-squential parameter estimation
approach

Upper stage:

NS NS NL NC
min  Fj    y j .l ,i θl   y j ,l ,i  Vy  y j .l ,i θl   y j ,l ,i   u j ,l θl   u j ,l  Vu-1 u j ,l θl   u Mj ,l 
T M T
 M -1 M

j 1 l 1 i 1  
θl
j 1

s.t
θ L  θl  θU (5)

The size of this optimization problem is NL  p , only θl are treated as


optimization variables

9
Quasi-sequential parameter estimation
approach

Sub NLP problem:

NL NC
min Fj    y j.l ,i  y j ,l ,i  Vy  y j .l ,i  y j ,l ,i   u j ,l  u j ,l  Vu-1 u j ,l  u Mj ,l 
T M T
 M -1 M

l 1 i 1  
u j ,l , y j ,l ,i , x j ,l ,i

s.t.
g j  x j ,l ,i , y j ,l ,i , u j ,l ,i , l   0 6
h j  x j , l , i , y j , l ,i , u j , l ,i ,  l   0

- The dimension of this problem is  NL  NC   n  m   NL  q 


- The number may be still too large for standard NLP solver to
deal with. We employ Quasi-sequential method to efficiently
solve this sub NLP problem
10
The structure of Quasi-sequential approach

Optimization layer Middle stage

SQP Based optimization


method

Controls

Simulation layer Gradients


Lower stage
Value of
Solving model state variables
equations with Newton Calculation of gradients
method

11
Quasi-Sequential approaches

Simulation layer (lower stage):


Employ Newton algorithm to solve model equations :

g j ,l  x j ,l ,i , u j ,l , l   0 l  1, , NL; i  1, , NC The largest part of


variable space
NL  NC   n  m 
where x j   x j , y j  7  will be computed by
solving model
equations
through the Taylor expansion and Newton steps
are generated by:
1
 g j 
x kk   
 x

g  
x
 j kk k, u ,  
  C 1
 
x kk , u k ,  
 g j  x kk , u k ,  
 8 
 
x kk 1  x kk  Δx kk Where kk denotes the Newton iterations

12
Quasi-Sequential approaches

Optimization layer (middle stage) :


NL NC
min Fj    y j.l ,i  y j ,l ,i  Vy  y j.l ,i  y j ,l ,i   u j ,l  u j ,l  Vu-1 u j ,l  u Mj ,l 
T M T
 M -1 M

l 1 i 1  
u j ,l

s.t. This problem consists only


h j  x j ,l ,i , u j ,l ,i , l   0 9  of input variables as well as
the inequality constraints.
The size of problem is only
NL  q

Using a SQP solver to solve above reduced optimization problem, the following QP
sub-problem will be solved at each iteration k.
T
 d 
x
k
1  d 
x
k
  d 
x
k
 
 k   k k k   k k k   k k
min  x Fj   du j ,l   u Fj du j ,l    du j ,l du j ,l  B   du j ,l du j ,l  
u j ,l
  du  j 2  du  j   du  j  
k
s.t.  x h j ,l ,i   du kj ,l   uh kj ,l ,i du lk  h kj ,l ,i  0
k  dx 
 du  j
10 
i  1, , NC l  1, , NL
13
Quasi-Sequential approaches
T
 dx 
Calculation of sensitivity matrix : 
 du 

The model equations in the k iteration of NLP and the in the each
element can be described as :

g j ,l (x kj ,l ,0 , x kj ,l , u kj ,l ,l )  0, l  1, , NL 11

Through first order Taylor expansion of above model equations, we


obtain:
 x l ,0 g Tj ,l (x j ,l ,0  x kj ,l ,0 )   x l g Tj ,l (x j ,l  x kj ,l )  ul g Tj ,l (u j ,l  ukj ,l )  0
or Ckj ,l (x j ,l ,0  x kj ,l ,0 )  Dkj ,l ( x j ,l  x kj ,l )  Ekj ,l (u j ,l  ukj ,l )  0
12 
x j ,l x j ,l
   Dkj ,l  Ckj ,l
1
  D 
k 1 k
E
u j ,l
j ,l j ,l
x j ,l ,0

14
Sensitivity matrix for Quasi-sequential method

Using chain rule, from element to element, the sensitivity matrix


can be calculated:
 s1 
s s 
 2,1 2 
      
T

dx 13
 du    s s

j  l ,1 l 
  si, j   
 
 sNL,1 sNL,2  sNL,l  sNL 
where x x i l  1, , NL
sl  l ; si , j 
ul u j i, j  1, , NL, i  j

This is the sensitivity of state variables with respect to input


variables. 15
Quasi-Sequential approaches

Sensitivity of objective function to the parameter

For upper stage NLP, we have

dF NS  F j u j Fj  y j u j y j  
       14 
d j 1  u j  y j  u j    

Rearrange it

dF NS  Fj F j y j  u j F j y j 
       15

d j 1  u j y j u j   x j  

16
Quasi-Sequential parameter estimation
approach
According to optimality condition of Sub NLP (KKT condition),
we have
F j Fj y j
 j u ,   
*
j  0 16 
u j y j u j

Then, the gradient required will change to

dF NS  Fj Fj y j  u j Fj y j  dF NS  Fj y j 


         

d j 1  u j y j u j d j 1  y j   17 
  x j  

du j
Therefore, the value of are not required, and computation

expense will be significantly reduced
17
Quasi-Sequential approaches
T
 dx 
Calculation of sensitivity matrix : 
 dθ 

Consider the model equation system at the convergence of the


Sub-NLPs, the sensitivity matrix can be obtained by linearization

of model equations at x :
g j ,l (x j ,l ,0 , x j ,l , u j ,l , l )  0, l  1, , NL 18 
Through first order Taylor expansion of above model equations,
we obtain:
 x l ,0 g Tj ,l x j ,l ,0   x l g Tj ,l x j ,l  l g Tj ,l l  0
or
C j ,l x j ,l ,0  D j ,l x j ,l  E j ,l  j ,l  0 19 

x j ,l x j ,l
   D j , l  C j ,l
1
   D j ,l  E j , l
1

l x j ,l ,0
18
Discretization with collocation on finite elements

Using chain rule, from element to element, the sensitivity matrix


can be calculated:

 r1 
r r 
 2,1 2 
 dx      
T
 20 
 dθ    r r

j  l ,1 l 
  ri , j   
 
 rNL ,1 rNL ,2  rNL ,l  rNL 
where
x l x i l  1, , NL
rl  ri , j 
θl θ j i, j  1, , NL, i  j

19
Flowsheet of Quasi-sequential estimation
approach

20
Parameter estimation of a CSTR

• CSTR (Continuous stirred-tank reactor) example:


Feed: F0,C0

r
Cooling Jacket
T c

C
A h
T Reaction
A B
Product
F

• An exothermic, irreversible, first-order reaction A  B in liquid


phase; the temperature is regulated with external cooling.
Parameter estimation of a CSTR

• Mass and energy balances lead to the highly nonlinear


state model (ODE):

dh F0  F

dt πr 2
dc F0 (c0  c)
 2
 k1.c (***)
dt πr h
dT F0 (T0  T ) H 2.U
 2
 k1.c  Tc  T 
dt πr h ρC p rρC p
• The controlled (state) variables are h, c and T.
• The manipulate (control) variables are F and Tc;
• F0 and c0 are considered as disturbances.
Parameter estimation of a CSTR

• The reaction rate constant is expressed as:


 E 
k1  c1 exp  
 RT 
• Where c1 and E are the Arrhenius constants. These
parameters need to be estimated according to
measurement data sets.
• We use transformations to form the following rate equations:
  Tr 
k1  θ1 exp  θ2   1 
 T 
 E   E 
with θ1  c1 exp   and θ2  exp  
 RTr   RTr 
Parameter estimation of a CSTR

where Tr is the reference temperature, Tr = 350K.


Following Hong et al., experimental data sets were generated by
adding white noise to the signals of the simulation model in MATLAB
with the parameter values:

1  0.999932 ( min 1 ) and  2  25.0


We assume that the system has steady-state operating point:
Hs=0.659m; Cs=0.877 mol/l; Ts=324.5 K;
Fs=100l/min and Tcs=300K.
Here, we carry out the parameter estimation in challenging test by
doing simulation in transient state, in that we introduce step changes
to input variables F0, c0, F, Tc; and produce 5 data sets.
Parameter estimation of a CSTR

• The problem is formulated as following:


NS NS NL
F   Fj    y j .l ,3  y Mj ,l ,3  Vy-1  y j .l ,3  y Mj ,l ,3   u j ,l  u Mj ,l  Vu-1 u j ,l  uMj ,l 
T T
min
j 1 l 1  
θl ,u j ,l , x j ,l ,i , y j ,l ,i
j 1

s.t.
model equation (* * *)
0.5  h  2.5 m ; 0.87  c  1.0 mol / l ; 290  T  350 K
85  F 115 l / min ; 290  Tc  310 K
θ L  θl  θU
Where :   [1 ,  2 ]T
u  [ F , Tc ]T
x  [T ]T
y  [h, c]T
NS  5; NL  50
Numerical Experiment

• In two stages, upper and middle stage, we use IPOPT


as optimization solver that uses interior-point method.

• In the program written in C++, we use a subroutine called


nag_zero_nonlin_eqns_deriv_1 to solve nonlinear
equations formed from model ODE equations in the lower
stage, simulation stage.
Numerical Experiment

• After running program, we extract the following in


formation:
- The time to solve the whole problem (NLP time (ms) )
* NLP time= 31.7 s
- The number of iteration (N. of iteration)
* N=9
- The Objective function value (Ob. value)
* Ob. Value = 0.0071
- The parameter value:
θ1  0.993371 (True value θ1  0.999932)
θ2  24.98827 (True value θ2  25.0)
Numerical Experiment
Tank level h profile
2
measurements (with noise)
estimates by Optimizer
1.8 simulations with true parameters
simulations with estimate parameters
Tank level profile h (m)

1.6

1.4

1.2

0.8

0 5 10 15 20 25 30 35 40 45 50
Time (minute)

Optimal outlet flow


Numerical Experiment

Molar concentration c profile


1.05
Molar concentration c (mol/l)

measurements (with noise)


1
estimates by Optimizer
simulations with true parameters
simulations with estimate parameters
Input concentration c0 simulation
0.95

0.9

0.85
0 5 10 15 20 25 30 35 40 45 50
Time (minute)

Molar concentration profiles


Numerical Experiment
Reactor Temperature T profile
326

324
Reactor Temperature T (K)

322

320

318

316

314

estimates by Optimizer
312
simulations with true parameters
simulations with estimate parameters
310
0 5 10 15 20 25 30 35 40 45 50
Time (minute)

Reactor Temperature T profile (unmeasured variable)


Numerical Experiment
Outlet flowrate F profile
105

Measurements (with noise)


104 Estimates by Optimizer
Simulation Outlet flowrate
Outlet flowrate F (l/min)

Simulation Inlet flowrate


103

102

101

100

99
0 5 10 15 20 25 30 35 40 45 50
Time (minute)

Outlet flowrate F and inlet flowrate F0 (independent variables)


Numerical Experiment
Coolant liquid temperature Tc profile
300.14
measurements (with noise)
300.12 estimates by Optimizer
Coolant liquid temperature Tc (K)
simulations true value
300.1

300.08

300.06

300.04

300.02

300

299.98

299.96

299.94
0 5 10 15 20 25 30 35 40 45 50
Time (minute)

Coolant liquid temperature Tc profile (independent variable)


Further study

• Further study:
• Compare Quasi-sequential Interior point method with
simultaneous method.
• Study the case of time dependent parameters estimation.
Thank you
for your attention!

You might also like