• Non ci sono risultati.

Model identification

N/A
N/A
Protected

Academic year: 2021

Condividi "Model identification"

Copied!
28
0
0

Testo completo

(1)

SE5

Prof. Davide Manca – Politecnico di Milano

Dynamics and Control of Chemical Processes

Solution to Lab #5

Model identification

(2)

Model identification

In defining a black-box model, the output data (y) of the system are calculated from the input data (u) and from the past history (yold, uold):

old

,

old

y f y u

In general, in order to have a model as close as possible to the real system some adaptive parameters (p) are introduced:

old

,

old

,

y f y u p

It is also possible to introduce in the model the error (e) that is defined as yreal-y:

old

,

old

,

old

,

y f y u e p

(3)

Model identification

       

     

     

1

1

1

1 1

1 1

1 1

1 , , , , 1 , , ,

1 , , , , 1 , , ,

1 , , , , 1 , ,

r

m

r

y r r y

u m m u

e r r e

t y t y t n y t y t n

u t u t n u t u t n

e t e t n e t e t n

     

   

    

y f

       

     

     

1

1

1

1 1

1 1

1 1

1 , , , , 1 , , ,

1 , , , , 1 , , ,

1 , , , , 1 , ,

r

m

r

y r r y

u m m u

T

e r r e

t y t y t n y t y t n

u t u t n u t u t n

e t e t n e t e t n

     

   

    

The system to be identified has the following structure:

The vector is the vector of the regressors:

(4)

Model identification

  t     t ,

y fp

The function f, by means of the parameters p, maps the vector of the regressors in the output variables y:

Mathematical models may have scalar, vector or mixed structure:

SISO: Single Input – Single Output The simplest function f is:

  t     t

y p 

Row vector Column vector

(5)

Identification procedure

1. Determination of the system limits and necessary variables 2. Design of experiments

3. Selection of the model structure 4. Parameters evaluation

5. Simulation and validation

(6)

Identification procedure

1. Definition of the system limits and necessary variables

The exact number of input (u) and output (y) variables is defined.

The variability range of the variables is identified to create a sutiable sampling domain for the next identification step.

2. Design of experiments

Once the variables are identified, the sampling frequency is assigned

All the input variables must be disturbed

(7)

Identification procedure

3. Selection of the model structure

We have to define:

The length of the regressors vector (see the following point)

The order of the model respect to every variable

The linearity or non-linearity respect to the regressors and the parameters

4. Parameters evaluation

We have to choose the numerical algorithm for the evaluation of the model parameters

The models may be classified as:

Deterministic (error minimization)

Stochastic (maximum likelihood method)

(8)

Identification procedure

5. Simulation and validation

Once the model is identified, it is required to test its predictive capability and its goodness by using a set of not formerly used data

The validation procedure is based of a validation data set (cross-validation set), properly chosen a priori and kept separated from the learning set

(9)

Disturbance sequence generation

• The input-output data collection for the identification and validation procedures is obtained by disturbing the process input variables.

• The PRBS (Pseudo Random Binary Sequence) method is used:

Two bounds are chosen, uMIN, uMAX, for the variability range of the disturbed variable u

The variable quantity is varied randomly. The variable can assume only the bound values (i.e. uMIN and uMAX)

The corresponding output vector is measured

(10)

PRBS sequences

1. Input variables can assume only two values, equal in amplitude but with opposite sign, ±Δu, respect to the stationary conditions

2. The shift from the positive condition to the negative one, and vice-versa, is made randomly in order to give the sequence a kind of white noise behaviour (i.e. null average)

3. The disturbance on the input variables is made every n sampling times (ts = sampling time)

4. Usually the range of nts is equal to the 20% of the time needed by the system to end its transient

5. The amplitude of the disturbance Δu should be high enough to eliminate the measurement error due to the system noise

(11)

Disturbance sequences generation

Disturbance sequence

Output variable

0 1000 2000 3000

-0.2 -0.1 0 0.1 0.2

Tempo [s]

Disturbo [-]

0 1000 2000 3000 4000

-0.1 -0.05 0 0.05 0.1

Altezza liquido [-]

Disturbance [-]

Time [s]

Liquid level [m]

(12)

Data pre-processing

• At the stage of field data collection it is possible to apply some appropriate mathematical operators able to damp the excessive oscillations (the moving average for example)

It is possible to apply some high-cut, low-cut filters in order to remove sudden variations beyond the normal operating intervals

It is possible to remove the so called outliers by means of appropriate techniques of statistical analysis

DETREND: the average value is subtracted to the sampled data. By doing so, the sampled variables express the deviation from either the stationary conditions or the mean operating conditions. As a consequence, it is also possible to use the model (at the cost of lower quality results) even for other steady state conditions.

(13)

ARX models

Features

The ARX model is linear both in the regressors and in the parameters

As such, it is not able to describe different steady states

By definition it cannot describe non-linear behaviours

Its identification is quite simple

The computational time for one prediction is extremely low

(14)

ARX – SISO models

       

     

1 2

1 2

1 2

= 1 2

y y

u

n n

n u

y t a y t a y t a y t n

b u t b u t b u t n

       

     

In order to make a prediction, ny values of the dependent variable (y) and nu values of the independent variable (u) are needed.

Example: evaluation based on 3 previous times for both the independent and dependent variables

SISO models:

   1   2   3

y ta y t   a y t   a y t  

(15)

ARX – MIMO models

MIMO models:

Example: system characterized by:

• 3 independent variables (u)

• 2 dependent variables (y)

• 4 previous times

         

       

       

       

       

1 1 2 1 3 1 4 1

5 2 6 2 7 2 8 2

1 1 2 1 3 1 4 1

5 2 6 2 7 2 8 2

9 3 10 3 11 3 12 3

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

y t a y t a y t a y t a y t

a y t a y t a y t a y t

b u t b u t b u t b u t b u t b u t b u t b u t

b u t b u t b u t b u t

        

        

        

        

       

8 + 12 = 20 parameters

(16)

Parameters determination (SISO)

     

     

1 2

1 2

y

T u

y t y t y t n

u t u t u t n



 

y t

1 1 2

1 2

y

u

n

n

p a a a

b b b

 



2 1 2

1 2

y

u

n

n

p a a a

b b b

  



     

     

1 1

1 1

y

T u

y t y t y t n

u t u t u t n

 

1

y t 

First parameters set

   

y t  p  t Given the following measurements on

the real system

Different sets of parameters can be derived

   

y t  p  t

(17)

Parameter determination

Searching for the best parameters set, an objective function should be optimized

 Least squares method

     

2

1 1

min ,

y s

n n

real

obj i i

p i t

f y t f t

 

   

       p    

   

2

1 1

min

y s

n n

real ARX

obj i i

p i t

f y t y t

 

   

          

(18)

Parameters determination

   

ARX

y

i

t   p  t

Dependent variables calculation

Objective function value calculation

1

i i

obj obj

f

obji

f

obji1

  f

obji

f

obji1

  ff

 

   

2

1 1

min

y s

n n

real ARX

obj i i

p i t

f y t y t

 

   

 



   

 n

p

n 1

p

(19)

Practical

• Consider two interacting tanks

• Find the parameters of an ARX model considering that the independent variable is the inlet flowrate and the dependent variable is the level of the second tank

• In order to compute the dependent variable at time t, consider 2 old values for both the independent and the dependent variables

• Consider that the independent variable oscillates around the steady state value (which is assigned) of 10%

(20)

System model

1 1 2

1

1

2 1 2 2

2

1 2

i

dh h h

A F

dt r

dh h h h

A dt r r

   

  

  



Data: I.C.:

2

2

30 m

A

2

1

40 m

A

10 m s

3

F 

i

 

 

 

 

1 1

2 2

0 0

s

s

h h

h h

Fi

r1

A2

h2

A1

h1 r2

Tank 1: Tank 2:

(21)

Solution procedure

1. Determine the steady state conditions

2. Give a disturbance to the system in order to assess the characteristic time (for example +10% F

i

)

3. Evaluate the system dynamics according to the PRBS method

 

 

 

1 1 2

1

1 1 2

1

2 1 2 2 2 2

2

1 2

0

0

i s

i s

i

dh h h

A F

h r r F

dt r

dh h h h h r F

A dt r r

    

   

  

   

    



(22)

20 22 24 26 28 30 32 34

A lte zza li q u id o [ m ]

Characteristic time assessment

Step disturbance on the inlet stream (+10%)

Characteristic time ( )  750 s

Tank 1

Tank 2

Liquid level [m]

(23)

Determination of the times

• Interval between two disturbances( ):

• Sampling time ( ):

t

d

0.2 150 s

t d   

t

s

3 50 s

s d

tt

(24)

MatLab implementation

for i = 1:nSteps

cont = cont + 1;

if(cont == 3)

randNum = rand();

if(randNum <= 0.5)

Fi = Fi0 * 1.1;

else

Fi = Fi0 * 0.9;

end

cont = 0;

end

(25)

Disturbance sequence

0 1000 2000 3000

-0.2 -0.1 0 0.1 0.2

Tempo [s]

D istu rb o [ -] D ist urb an ce [ -]

Time [s]

(26)

Real system response

0 1000 2000 3000 4000

-0.1 -0.05 0 0.05 0.1

A lte zza li q u id o [ -]

Liquid level [-]

(27)

ARX performance assessment

Real system ARX model

0 1000 2000 3000 4000

18 19 20 21 22 23

Tempo [s]

A lte zza li q u id o [ m ]

Confronto con i dati con cui è stato istruito il modello

REMARK:

this is NOT the validation of the

ARX model

Liquid level [m]

Time [s]

Comparison of the ARX model with the original identification data

(28)

ARX validation

0 1000 2000 3000 4000

18 19 20 21 22 23

A lte zza li q u id o [ m ]

Convalida

Liquid level [m]

Validation

Real system ARX model

Riferimenti

Documenti correlati

Genes differentially expressed in the normal and Dlx5-/- developing murine olfactory system, prioritized using human KS-causing genes and the coexpression network.. regulator

Artists like Yan Jun (an electronic musician, improviser, and au- thor born in 1973 in Lanzhou), Bun–Ching Lam (a composer, pia- nist, and conductor born in 1954 in Macao), Wang Fan

Comparison between computed and experimental data Possible relationships between values obtained experimentally and reported in the literature, (e.g. ionic conductivity at 30 °C

Building upon [5], we propose the use of a classic mobile robot to perform a pushing operation (see Fig. 1), by considering the robot’s nonholonomic constraints in the

fatti i tuberi di Rossa di Cetica rappresentano un prodotto molto apprezzato sul mercato locale che agisce anche come motore propulsivo per la commercializzazione di altri

Second, we introduce upside and downside corridor implied volatilities and we combine them in the risk-asymmetry index ( ) which is intended to disentangle the