Ident 001122

  • Upload
    makroum

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

  • 7/25/2019 Ident 001122

    1/7

    Practical Control Systems

    System Identification I

    Bart De Schutter & Robert Babuska

    Web Page: Blackboard or http://www.dcsc.tudelft.nl/sc4070

    Delft Center for Systems and Control

    Delft University of Technology

    Practical Control Systems pcs id.1

    Outline of this lecture

    1. Identification: General overview

    models

    time domain / frequency domain identification

    2. System identification in the time domain

    general case

    identification of 1st order models identification of 2nd order models

    ARX, OE, and ARMAX models

    Practical Control Systems pcs id.2

    1. Identification: General overview

    Models:

    tailor-made

    black-box

    Tailor-made models(based on physical modeling):

    d

    dtx(t) = f(x(t),u(t),e(t),)

    y(t) =h(x(t),u(t),e(t),)

    Practical Control Systems pcs id.3

    Black-box models:

    1st order & 2nd order linear models (continuous-time):

    G1(s) = 1

    s+1G2(s) =

    2

    s2 +2s+2

    linear models (ARX, OE, ARMAX, BJ discrete-time):

    y(k) =G(q,)u(k) +H(q,)e(k)

    nonlinear models (neural networks, fuzzy models, . . . )

    Practical Control Systems pcs id.4

  • 7/25/2019 Ident 001122

    2/7

    Box-Jenkins and Output-Error model

    +

    +

    Output-Error (OE)

    y(k) =B(q)

    F(q)u(k) +e(k)

    Box-Jenkins (BJ)

    y(k) =B(q)

    F(q)u(k) +

    C(q)

    D(q)e(k)

    u

    u

    e

    e

    y

    yB

    F

    B

    F

    C

    D

    Practical Control Systems pcs id.5

    ARMAX and ARX models

    +

    +

    ARX

    A(q)y(k) =B(q)u(k) +e(k)

    ARMAX

    A(q)y(k) =B(q)u(k) +C(q)e(k)u

    u

    e

    e

    y

    y1

    A

    1

    A

    B

    B

    C

    Practical Control Systems pcs id.6

    Identification

    Time domain

    Frequency domain (yields transfer functionG, for linear systems)

    frequency analysis (sines as input signal)

    Fourier analysis (arbitrary input signals)

    spectral analysis (signal spectraG)

    We concentrate onidentification in the time domain.

    Practical Control Systems pcs id.7

    References

    L. Ljung,System Identification: Theory for the User, 2nd edition,

    Prentice-Hall, 1999

    L. Ljung,System Identification, Chapter 58 of theControl Engineering

    Handbook, pp. 10331054, CRC Press, 1996

    K.J. Astrom & B. Wittenmark,Computer-Controlled Systems,

    Prentice-Hall, 1997, Chapter 13

    Lecture notes of the courses Filtering & identification (SC4040) or

    System identification (SC4110)

    Manual of MATLAB System Identification Toolbox

    Practical Control Systems pcs id.8

  • 7/25/2019 Ident 001122

    3/7

    2. Identification in the time domain

    Overview:

    General case

    Identification of 1st order models

    Identification of 2nd order models

    ARX, OE, and ARMAX models

    Practical Control Systems pcs id.9

    General case (nonlinear)

    Model:

    d

    dtx(t) = f(x(t),u(t),e(t),)y(t) =h(x(t),u(t),e(t),)

    Optimal value of?

    Model,prediction of output y(tk|)att= tk=kh

    Prediction error: (k,) =y(tk)y(tk|)

    Performance:

    JN() = 1

    N

    N

    k=1

    g((k,))

    withN: # data points

    Practical Control Systems pcs id.10

    General case (continued)

    Performance:

    JN() = 1

    N

    N

    k=1

    g((k,))

    Usually:g() =2

    Note: g() =log fe() with fe probability density function of noisee

    maximum likelihood estimate

    Optimal value:

    N=argmin

    JN()

    Practical Control Systems pcs id.11

    General case (continued)

    d

    dtx(t) = f(x(t),u(t),e(t),)

    y(t) =h(x(t),u(t),e(t),)

    Optimal value of:

    N= argmin

    1

    N

    N

    k=1

    2(k,)

    In general: use numerical, nonlinear optimization algorithms to compute N

    (see course Optimization in Systems and Control (SC4090))

    Matlab optimization toolbox (lsqnonlin)

    Matlab NCD toolbox (nonlinear control design)

    Practical Control Systems pcs id.12

  • 7/25/2019 Ident 001122

    4/7

    Nonlinear least squares

    f() =N

    i=12i() =()

    T() f() =2()T()

    H() =2()T() +N

    i=1

    22i()i()

    Approximation of the Hessian:

    H():=2()T()

    Gauss-Newton method: k+1=k H1(k)f(k)

    Levenberg-Marquardt method: k+1=kI+ H(k)

    1

    f(k)

    Practical Control Systems pcs id.13

    lsqnonlin

    Syntax: x=lsqnonlin(fun,x0,lb,ub,options) with

    fun : m-file function returninge and its Jacobiane(optional)[e,J]=fun(x)

    e=...

    % Compute Jacobian if required.

    if ( nargout > 1 )

    J=...

    end;

    x0 : initial starting point

    lb, ub : lower and upper bounds for x (optional)

    options : options structure (optional)

    Practical Control Systems pcs id.14

    Most important options:

    LargeScale : use a large-scale algorithm (on) or medium-scale

    algorithm (off).

    Display : controls display of (intermediate) values. Possible values:

    off, iter, and final

    Jacobian : indicates whether Jacobian is defined by user

    MaxIter : maximum number of iterations allowed

    TolFun, TolX : termination tolerance on the function value and on x

    LevenbergMarquardt : Choose Levenberg-Marquardt over

    Gauss-Newton algorithm (default: on)

    Practical Control Systems pcs id.15

    Example of lsqnonlin

    Note: Illustrative example, not related to identification

    minx

    eTe with e(x) =

    10(x2x

    2

    1) (1x1)

    T

    Define m-file:

    function [e,J]=fun_rosenbrock_e(x)

    e=[10*(x(2)-x(1)2) (1-x(1))];

    if ( nargout > 1 )

    J=[-20*x(1) -1;

    10 0];

    end;

    Practical Control Systems pcs id.16

  • 7/25/2019 Ident 001122

    5/7

    Perform optimization:

    x0=[2 2];

    % Select medium-scale, Gauss-Newton, and

    % Jacobian provided by user

    options=optimset(LargeScale,off,...

    LevenbergMarquardt,off,...

    Jacobian,on);

    x=lsqnonlin(fun_rosenbrock_e,x0,[],[],options)

    Practical Control Systems pcs id.17

    Identification of 1st order models

    step response

    y(t)K(1 exp((tL)/))

    y

    tL

    slope =K/

    0.63K

    K

    Practical Control Systems pcs id.18

    2nd order models

    0

    0

    a1

    a2

    t t +T

    y0

    y

    envelopeet

    =2

    T

    = 1

    2lna1

    a2

    Practical Control Systems pcs id.19

    ARX, OE, and ARMAX models

    Model:

    y(k) =G(q,)u(k) +H(q,)e(k)

    withe zero-mean white noise sequence

    Optimal one-step ahead prediction:

    Given{u(k)}N1k=1

    ,{y(k)}N1k=1

    and model(G(q,),H(q,)), determine

    bestestimate ofy(k): y(k,|k1)

    Prediction error:(k,) =y(k)y(k,|k1)

    Practical Control Systems pcs id.20

  • 7/25/2019 Ident 001122

    6/7

    Prediction error

    OE: y(k) =G(q,)u(k) +e(k)

    y(k,|k1) =G(q,)u(k), (k,) =y(k)G(q,)u(k)

    ARX: A(q)y(k) =B(q)u(k) +e(k)

    y(k) =a1y(k1) anay(kna)

    +b0u(kL) + +bnbu(kLnb) +e(k)

    y(k,|k1) =a1y(k1) +bnbu(kLnb)

    (k,) =y(k) +a1y(k1) + +anay(kna)

    b0u(kL) bnbu(kLnb)

    linearin parametersai,bi!

    Practical Control Systems pcs id.21

    Solving optimization analytically?

    Necessary condition for minimum ofJN():

    JN() =0

    When(k,)is linear in parameter vector(ARX!):

    (k,) =y(k)(k)T

    necessary condition becomes:

    JN() =

    1

    N

    N

    k=1

    2 (k,)(k,)

    = 1

    N

    N

    k=1

    2(k)y(k)(k)T

    =0

    Practical Control Systems pcs id.22

    These are well-known Normal Equations:

    N

    k=1

    (k)y(k) = Nk=1

    (k)(k)T

    solve linear equation to obtain

    Practical Control Systems pcs id.23

    Nonlinear versus linear models

    Nonlinear models

    + general

    + based on physical models

    + relation with physical system

    - nonlinear optimization local minima, time-consuming

    Practical Control Systems pcs id.24

  • 7/25/2019 Ident 001122

    7/7

    Linear models

    + often very effective

    + intuitive behavior (in particular for 1st & 2nd order models)

    + identification is fast process

    + many control design methods for linear models

    - black-boxrelation with physical system?

    - linear not general

    Practical Control Systems pcs id.25