lecture note #4 (chap.7-8) - cheric...identification and closed -loop control • a system operating...

30
1-1 Lecture Note #4 (Chap.7-8) CBE 702 Korea University Prof. Dae Ryook Yang System Modeling and Identification

Upload: others

Post on 03-Sep-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-1

Lecture Note #4(Chap.7-8)

CBE 702Korea University

Prof. Dae Ryook Yang

System Modeling and Identification

Page 2: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-2

Chap.7 Modeling

• Kapur’s Principles of mathematic modeling– The mathematical model can only be an approximation of real-life

processes which are often extremely complex and often onlypartially understood.

– Modeling is a process of continuous development: starting with thesimplest conceptual representation of the process and buildingmore and more complexities as the model develops.

– Modeling is an art but also a very important learning process. Inaddition to a mastery of the relevant theory, considerable insightinto the actual functioning of the process is required. One of themost important factors in modeling is to understand the basiccause and effect sequence of individual processes.

– Models must be both realistic and robust.

Page 3: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-3

• Examples:1.Surge Control Design for a Hydrogen Compressor

– Process model plus control elements considered– Complex nonlinear dynamics and potential discontinuous behavior

2.Fed Batch Metallurgical Reactor– Hybrid model (discrete + continuous) for optimal control– Complex phase behavior (up to 9 phases appearing/disappearing)– Complex radiation modeling– Population balance model for particle dissolution

3.Sugar Drying Control– Grey-box model based on mass & heat transfer combined with particle transport– Validated model against pilot plant data– Provides basis for model-based control system design

4.Wastewater Treatment– complex biological reactions within a mechanistic model– Validation against plant data challenging– Provides basis for model-based plant and control system design

Page 4: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-4

• What is a “ model’? (Minsky, 1965)“A model (M) for a system (S) and an experiment (E) is anythingto which E can be applied in order to answer questions about S

•Process engineering models“A mathematical representation (M) of a physical system (S) for aspecific purpose (P) and experiment (E)”

•The Modeling ProcessReal world ProblemàMathematical ProblemàMathematical Solutionà Interpretation

•Modeling Wisdom (George Box)“All models are wrong … ., … . some are useful !”

Page 5: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-5

• Model Application Areas– Experimental design– Process design and control– Process optimization– Troubleshooting of the process– Process safety– Operator training and education– Environmental impact analysis

• Model Classification– First principle vs. Empirical– Stochastic vs. Deterministic– Lumped vs. Distributed– Linear vs. Nonlinear– Continuous vs. Discrete– Dynamic vs. Steady state

Page 6: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-6

• Model Equation Forms– Algebraic Equations (AE)– Ordinary Differential Equation (ODE)– Partial Differential Equation (PDE): Elliptic/Parabolic/Hyperbolic– Integro-differential equation– AE+ODEàDifferential and Algebraic Equation (DAE)

• The Modeling Goal– Flowsheeting

• simulation (rating), design, optimization

– Process control• prediction, regulation, identification, diagnosis

Page 7: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-7

A Systematic Modeling Procedure

1. Problem definition2. Controlling factors3. Problem data4. Model construction5. Model solution6. Model verification7. Model calibration & validation

Page 8: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-8

• Problem Definition– Clear description of system

• establish underlying assumptions

– Statement of modeling intention• intended goal or use• acceptable error• anticipated inputs/disturbances

• Controlling Factors/Mechanisms– Chemical reaction– Mass transfer: convective, evaporative, …– Heat transfer: radiative, conductive, …– Momentum transfer

Page 9: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-9

• Data for the problem– Physico-chemical data– Reaction kinetics– Equipment parameters– Plant data

• Model construction– Assumptions– Boundaries and balance volumes– Conservation equations

• mass, energy, momentum– Constitutive equations

• reaction rates, transfer rate property relations, balance volumerelations, control relations & equipment constraints

– Characterizing Variables– Conditions (ICs, BCs)– Parameters

Page 10: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-10

• Model solution– Algebraic systems– Ordinary differential equations– Differential-algebraic equations– Partial differential equations– Integro-differential equations

• Model verification– Structured programming approach– Modular code– Testing of separate modules– Exercise all code logic– Conditions– Constraints

Page 11: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-11

• Model calibration/validation– Generate plant data– Analyze plant data for quality– Parameter or structure estimation– Independent hypothesis testing for validation– Revise the model until suitable for purpose

Page 12: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-12

A Systematic Modeling Procedure:Example

• Step 1:– CSTR description

• Details• lumped parameter model• dynamic model

– Goal (intent)• inlet change range• +/-10% accuracy• control design

hV, T

cAi, qi, T i

Coolingmedium, Tc

cA, q, T

Page 13: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-13

• Step 2:– Chemical reaction AàB– Perfect mixing– No heat loss (adiabatic)

• Step 3:– Reaction kinetic data: k0, E, ∆HR

– Physico-chemical properties: specific heats, enthalpies,…

– Equipment parameter: V

Page 14: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-14

• Step 4:– Assumptions

• A1: perfect mixing• A2: first order reaction• A3: adiabatic operation• A4: equal inflow, outflow• A5: constant properties

– Equations• Conservative

• Constitutive– Initial conditions: CA(0)=CA0, T(0)=T0

– Parameters and inputs• V, q, CA, T: 10% accuracy• k0, E, ∆HR: 30-500% accuracy

( )AAi A A

dcV q c c Vkcdt

= − −

( ) ( ) ( )p p i A cdTV C q C T T H Vkc UA T Tdt

ρ ρ= − + −∆ + −

0 exp( / ) Ar k E RT C= −

Page 15: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-15

• Step 5:– Solving DAE

• using structuring techniques• using direct DAE solution

• Step 6:– Model verification

• Verification of separate experimental data

• Step 7:– Model calibration and validation

• Repeat procedures as adjusting parameters andmodel structure

Page 16: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-16

Chap.8 The ExperimentalProcedure

• Experimental conditions– Choice of input– Problems of identification in closed-loop operation– Presence of subsystems in discrete-time operation

è Appropriate planning of experiments required

Page 17: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-17

Identification and closed-loopcontrol

• A system operating with feedback control

– Closed-loop system

• Example 8.2

– Any set of coefficients (−a+λ K, b+λ) for arbitrary λ can be a solution.– The true parameters cannot be know even with exact control law.

( ) , k P k k k kx H z u y x v= = +

( ) (Feedback control)k R ku H z y= −

(1 ( ) ( ))P R k kH z H z y v+ =/ ( )k k Ry u H z= −

Uniquenessproblem

1 1

0k k k k

k k k k

y ay bu vu Ky bu Ky

+ += − + + ⇒= − ⇒ + =

1 1 ( )k k k k k ky ay bu v u Kyλ+ += − + + + +

Lagrangian multiplier

1 1( ) ( )k k k ky a K y b u vλ λ+ += − + + + +

Page 18: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-18

• Example 8.2 –Another aspects– For low-order feedback, the closed-loop system causes trouble.– For higher-order feedback,

• If the controller is known exactly and sufficiently high order, theparameters can be uniquely decided.

• It is not known a priori what exactly a “sufficiently high order”means.(Since the order of the true system is unknown.)

– Also, with two kinds of feedback data, from the identifications of the twocases,the parameter sets (−a+λ K1, b+λ) and (−a+λ K2, b+λ) can beobtained and the parameters a and b can be decided uniquely.

– With external persistently exciting signal in set point, the parameters canalso be obtained. (See Example 8.4)

1 1

1 2 1 1 2 1( ) 0k k k k

k k k k k k

y ay bu vu K y K y bu K y K y

+ +

− −

= − + + ⇒= − + ⇒ + + =

1 1 1 2 1( )k k k k k k ky ay bu v u K y K yλ+ + −= − + + + + +

1 1 2 1 1( ) ( )k k k k ky a K y K y b u vλ λ λ+ − += − + + + + +

Page 19: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-19

• Example 8.3 (Spectral analysis in a closed-loop system)

– The transfer function between y and u:

• Example 8.4 (Identification of a system using a reference signal)

– Since rank(Φ)=2, there is no problem to find parameters by

1 1 ( { } 0, { } )Tk k k k k i j ijy ay bu e E e E e e δ− −+ = + = =

k ku Ky= −

( ) ( ) / ( )i hP yy uyH e S i S iω ω ω=

21

( )1 ( )yy iS i

a bK e ωω −=+ +

1( )

1 ( ) 1 ( )uy i i

KS i

a bK e a bK eω ωω − −=+ + + +

( ) ( ) / ( ) 1/i hP yy uyH e S i S i Kω ω ω= =

) ))Controller, not process

1 1k k k ky ay bu v− −= − + +

( )k k cu K y u= − +

0 0 0 0

1 1 1 1

01

0

c

N N N cN

y u y KuK

y u y Ku

Φ

− − − −

= = − +

M M M M M

( ) 0T T TYΦ Φ θ Φ− =)

Page 20: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-20

Indirect Identification• Indirect identification

– Identify the closed-loop system from uc to y.– Then, compute the open-loop transfer function

• The linear time-invariant controller GR(iω) should be known exactly.• In discrete-time system, there should be well-defined synchronization

between the measurement and control.

( )( )1 ( ) ( )P

R

G iG iG i G i

ωωω ω

=−

)) )

Page 21: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-21

• Example 8.5– Assume that the noise w and the

external input r are uncorrelated.– The control law is

– Then( ) ( ) ( ) ( ) ( )FF RU s G s R s G s Y s= −

( ) ( ) ( ) ( ) ( )yr P ur v wrS i G i S i G i S iω ω ω ω ω= +0

( ) ( ) ( )yr P urS i G i S iω ω ω=

( ) ( ) / ( )P yr urG i S i S iω ω ω=) ) )

Page 22: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-22

Choice of Input• The goodness of identification

– The last equality follows from Parseval theorem.

• Weighted least squares methods– For control design, the input spectrum should be richer around the

bandwidth frequency to reduce the modeling error for control purpose.– Filter the regressors and observations so that the frequency contents

around the critical region is richer.– But the bandwidth frequency is unknown a priori. Thus, an iterative

scheme is required.

22 2

1 1 1( ) ( ) (1 /2 ) ( )N N NT T

k k k k kk k ky Y iε θ φ θ π Φ ω θ

= = == − = −∑ ∑ ∑) ) )

Page 23: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-23

• Definition 8.1 (Persistency of excitation)– A signal u fulfils the condition of persistent excitation of order n if the

following limits exist

– and if the correlation matrix is positive definite.

– The persistent excitation is sufficient to obtain consistent estimates fro theleast squares method and maximum-likelihood identification.

– Method for experimental verification of the number of identificationparameters (p) from the regressor matrix ΦN=[Φy Φu]

• There should be at least p nonzero singular values.

1lim(1/ ) N

kkNu N u

=→∞= ∑ 1

( ) lim(1/ )N T

uu k kkNC N u u ττ −=→∞

= ∑)

(0) ( 1)( ) 0

(1 ) (0)

uu uu

uu

uu uu

C C nR n

C n C

− = > −

…M O M

L

11, { 0 0} (SVD)T TN N ppU V diagΦ Φ Σ Σ σ σ= = L L

Page 24: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-24

• Optimal input signals– From Cramer-Rao lower bound

where the Fisher information matrix M is defined as

– Choose input so that the Cramer-Rao lower bound M−1 is minimized underthe input constraint

– It is an optimization problem which involves inputs and outputs. However,the output is unknown before identification. Thus, it requires an iterativeapproach.

– Pseudorandom binary sequence (PRBS) are often close to optimizing thecriteria under the constraint.

{ } 1( )( )TE Mθ θ θ θ −− − ≥) )

log ( ) log ( )T

p Y p YM E

θ θθ θ

∂ ∂ = ∂ ∂

11 2

2

1

min ( ) ( ) or ( ) logdet

subject to (1/ ) 1

U

N

kk

J U tr WM J U M

N u

=

= = −

=∑

Page 25: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-25

Parameter Uncertainty and Control• Unstructured multiplicative uncertainty, L(s)

• Sensitivity function, S(s)

• Complementary sensitivity function, T(s)

• Objective of control design– Minimize the sensitivity S(s) to parameter uncertainties and variations

R1: Make S(iω) small whenever R(iω) or V(iω) is largeR2: Make T(iω) small whenever m(ω) is large

• Objective of identification– Reduce the uncertainty bound m(ω) as much as possible: Freq. weighting

( ) ( ) ( ( )) ( )P P PG s G s I L s G s∆+ = +

1( ) ( ) / ( ) ( ( ) ( ))P RS s E s V s I G s G s −= = +

1( ) ( ) ( ) ( )( ( ) ( ))P R P RT s I S s G s G s I G s G s −= − = +

[ ]( ) ( )L i mσ ω ω≤ Upper bound of max.singular value

Page 26: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-26

• Stability despite the uncertainty– Check for gain and phase margins from Bode plot for worst case– Robust stability:

• Example 8.8 (The sensitivity function of a motor drive)– Process with state feedback regulator with integral action

– Sensitivity function

• At low freq., smaller than open loop– Good steady-state behavior

• At high freq., higher than open loop– May cause stability problem

è Identify the process better (reduce L) in the critical region!

[ ]( ) 1/ ( ),T i mσ ω ω ω≤ ∀

1 1

2 1 1 1

0 0 / 1/ 0( )

0 / / ( ) 0 ( ) 1/ ( )

1 1 0 0 0

k J Jdx t

d J k J x t u t J v tdt

= − − + − −

( )( ) 1 0 0 ( )y t x t=

1( ) ( ) / ( ) (1 )P RS s E s V s G G −= = +

1( ) ( ) / ( ) ( )PG s X s U s sI A B−= = −

( ) ( ) / ( ) ( 1) /R cG s U s X s K s s= = +

Open loop

Closed loop

Page 27: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-27

Planning and Operation ofExperiments

• Standard procedure– Simple experiments: First-stage experiments– Continued experiments: Second-stage experiments

• Careful choice of instrumentation• Method prerequisites• Choice of experimental inputs and duration

– Repeat the second-stage experiments until termination• Determined by model validation criteria• Identification of major source of error that may put

limitations on the results of system identification

Page 28: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-28

• First-stage experiments– Clarify and state the purpose of model

• Required accuracy: depending on the purpose such as control design,simulator design, fault detection, or simply for process knowledge

• Prior knowledge: model complexity, error source, time-variation ofdynamics, and other important conditions

– Practical considerations• Instruments – calibration problem• Actuators – saturation• System limitation• Information about operation in closed-loop control

– Simple experiments• Data logging during normal operation• Step or impulse changes in available inputs, disturbances• Correlation analysis

– Evaluation• Simple causal relations between available inputs and outputs• Coherence analysis• Frequency range where the model is valid

Page 29: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-29

• Second-stage experiments– Sampling interval– Signal filtering– Desirable signal levels with respect to nonlinearities, noise levels, and

physical limitations and saturations– Test of linearity

• Estimate the models for different input amplitude• Symmetry of the response

– Test of time invariance• Presence of trends in the data

– Test of disturbance conditions and noise properties• Independence to inputs• Lost signals, outliers, aliasing

– Test of experimental conditions• Correct input• Sufficient excitation for feedback and possible interference due to

discrete-time control

Page 30: Lecture Note #4 (Chap.7-8) - CHERIC...Identification and closed -loop control • A system operating with feedback control – Closed-loop system • Example 8.2 – Any set of coefficients

1-30

• Choice of input– Form of the input

• Sinusoids: frequency response analysis• Step or impulse: transient analysis

– Amplitude of the input• Trade-off between SNR and nonlinearities

(Cov(θ) is inversely proportional to input power)

• Experiment duration– Sampling frequency should chosen based on the system dynamics

• Avoid aliasing• Trend detection• Trade-off between data economy and experiment economy

– Cov(θ) is inversely proportional to experiment duration– Experiment duration should be longer than 5-10 times of the longest time

constant.– Statistical inconsistency may cause no improvement with longer duration.