System Ident

download System Ident

of 274

Transcript of System Ident

  • 8/13/2019 System Ident

    1/274

    Computation

    Visualization

    Programming

    U sers G uide

    Lennar t L jung

    S yst em Ident ifica t ionToolboxFor Use with MATLAB

  • 8/13/2019 System Ident

    2/274

    How to Contact The Ma thW orks:

    508-647-7000 P hone

    508-647-7001 F a x

    The Ma t hWorks, Inc. Ma il

    24 P rime P ark Wa y

    Na t ick, MA 01760-1500

    h t t p : //www. ma t h wo r k s . c o m Web

    f t p. ma t hwo r ks . c om Anonym ous FTP server

    c o mp. s o f t - s y s . ma t l a b Newsgroup

    s u pp or t @ma t h wo r k s . c o m Technical support

    s u gg e s t @ma t h wo r k s . c o m P roduct enha ncement suggestions

    b u g s @ma t h wo r k s . c o m B ug reports

    d o c @ma t h wo r k s . c o m Documenta tion error reportss u bs c r i b e @ma t h wo r k s . c o m Subscribing user registra tion

    s e r v i c e @ma t h wo r k s . c o m Order sta tus, l icense renewa ls , passcodes

    i n f o @ma t h wo r k s . c o m Sa les, pricing, a nd general informa tion

    System Id enti f icati on T oolbox U ser s Gui de

    C OP YRIG HT 1988 - 1997 by The Ma thWorks, I nc. All Rights Reserved.The softwa re described in this document is furnished under a license agreement . The softw a re may be used

    or copied only under t he terms of the license a greement. No par t of this m an ual m ay be photocopied or repro-duced in a ny form w ithout prior wr itten consent from The Mat hWorks, Inc.

    U .S. GOVERNME NT: If Licensee is acquiring the P rograms on beha lf of an y unit or agency of the U.S.G overnment, the following sha ll apply: (a ) For units of the Depart ment of Defense: the G overnment sha llhave only the rights specified in the license under which the commercial computer software or commercialsoftwa re documenta tion wa s obtained, as set forth in subpara graph (a) of the Rights in CommercialComputer Softw are or C ommercial S oftwar e Documenta tion Cla use at DFARS 227.7202-3, therefore th erights set forth herein shall apply; and (b) For any other unit or agency: NOTIC E: Notwith sta nding anyother lease or l icense agreement tha t ma y pertain to, or a ccompa ny the delivery of, the computer softwa rea nd a ccompan ying documenta tion, the rights of the G overnment regarding its use, reproduction, and disclo-sure a re a s set forth in C lause 52.227-19 (c)(2) of the FAR.

    MATLAB, Simulink, Ha ndle Gra phics, a nd Real-Time Workshop ar e registered tra demarks a nd S ta teflowa nd Target L a nguage C ompiler a re tra demarks of The Math Works, Inc.

    Other product or bra nd na mes are t radema rks or registered tr adema rks of their respective holders.

    P r in tin g H is tor y: Apr il 1988 F irs t pr in t in gJ u ly 1991 S econd pr in t ingMa y 1995 Third pr in t ingAug ust 1995 R epr in t

  • 8/13/2019 System Ident

    3/274

  • 8/13/2019 System Ident

    4/274

    v Contents

    Reading More About System Identification . . . . . . . . . . . . . . . 1-19

    2

    The Graphical User Interface

    The Model an d D a t a B oar ds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

    The Workin g D a ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3

    The View s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3

    The Va lida tion D a t a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4

    The Work F low . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4Ma na gemen t Aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4

    Workspa ce Varia bles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5

    Help Text s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6

    Da ta Representa tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7

    G ett ing D a t a into t he G U I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8

    Ta king a Look at th e Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10

    P reprocessing D a ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10

    Det ren ding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10

    Selecting D a t a Ra nges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11

    P refilt ering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11

    Resa mplin g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11

    Quickst a rt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12

    Ch ecklist for Da ta Ha ndling . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12

    Simula ting D a ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12

    The B a sics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14Direct E stima tion of the Impulse Response . . . . . . . . . . . . . . . 2-14

    Direct E stima tion of the Freq uency Response . . . . . . . . . . . . . 2-15

    Est ima t ion of P a ra met ric Models . . . . . . . . . . . . . . . . . . . . . . . 2-17

    E st ima t ion Meth od . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18

    Resu lt ing M odels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19

    How to Know Which S tructure a nd Meth od to U se . . . . . . . 2-19

    ARX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20

    The S t ruct ure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20

    E nter ing th e Order P a ra met ers . . . . . . . . . . . . . . . . . . . . . . 2-20

    Est imat ing Man y Models Simulta neously . . . . . . . . . . . . . . 2-20

    E st ima t ion Meth ods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21

    Mult i-Out put Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21

  • 8/13/2019 System Ident

    5/274

    vi

    ARMAX, Out put-Er ror a nd B ox-J enkins Models . . . . . . . . . . . 2-22

    The G enera l St ruct ure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22

    The S pecial C a ses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22

    E nter ing t he Model St ructur e . . . . . . . . . . . . . . . . . . . . . . . . 2-23E st ima t ion Meth od . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23

    St a te-Spa ce Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24

    The M odel St ruct ure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24

    Ent ering B lack-B ox S ta te-Spa ce Model St ructures . . . . . . . 2-24

    Est imat ing Man y Models Simulta neously . . . . . . . . . . . . . . 2-24

    E st ima t ion Meth ods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25

    U ser D efined Model St ructur es . . . . . . . . . . . . . . . . . . . . . . . . . 2-25

    St a te-Spa ce S tru ctures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25

    Any Model S tr uctur e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26

    Views a nd M odels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27

    The P lot Window s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28

    File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28

    Option s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28

    S ty le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29

    C ha nn el . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29H elp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29

    Freq uency Response an d Distu rba nce Spectr a . . . . . . . . . . . . 2-29

    Tra nsien t R esponse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29

    P oles an d Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30

    Compa re Mea sured a nd M odel Out put . . . . . . . . . . . . . . . . . . . 2-30

    Residu a l Ana lysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31

    Text I nform a tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32

    P resen t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32Modi fy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32

    Furt her Ana lysis in th e MATLAB Workspa ce . . . . . . . . . . . . . 2-32

    Mouse Bu t tons a nd H otkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-34

    The M a in iden t Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-34

    P lot Window s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-34

    Troublesh ooting in P lots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35

    La yout Quest ions an d idprefs.ma t . . . . . . . . . . . . . . . . . . . . . . 2-35Cu st omized P lots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36

    Import from a nd E xport to Workspace . . . . . . . . . . . . . . . . . . . 2-36

    Wha t C a nnot be Done Usin g th e GU I . . . . . . . . . . . . . . . . . . . 2-37

  • 8/13/2019 System Ident

    6/274

    vii Contents

    3

    Tutorial

    Impulse Responses, Frequen cy Fun ctions, an d Spectra . . . . . . 3-8

    P olynomial Representa tion of Tra nsfer Funct ions . . . . . . . . . 3-10

    St a te-Spa ce Representa t ion of Tra nsfer Fun ctions . . . . . . . . . 3-13

    Cont inuous -Time S ta te-S pa ce Models . . . . . . . . . . . . . . . . . . . 3-14

    Est ima t ing Im pulse Responses . . . . . . . . . . . . . . . . . . . . . . . . . 3-15

    Est imat ing Spectra a nd Frequ ency Functions . . . . . . . . . . . . . 3-16

    Est ima t ing P a ra met ric Models . . . . . . . . . . . . . . . . . . . . . . . . . 3-17

    Subs pace Methods for Est ima ting S ta te-Spa ce Models . . . . . . 3-18

    Da ta Representa tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19

    Corr ela tion Ana lysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20Spectr a l Analy sis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20

    ARX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22

    AR Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23

    G enera l P olynomial B lack-B ox Models . . . . . . . . . . . . . . . . . . . 3-23

    St a te-Spa ce Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25

    Optiona l Var ia bles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26

    P olynomia l B la ck-B ox Models . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29

    Mult iva ria ble ARX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30

    St at e-Spa ce Models with F ree P ar am eters . . . . . . . . . . . . . . . 3-33

    Discret e-Time In nova tions F orm . . . . . . . . . . . . . . . . . . . . . 3-33

    Sy st em Dyna mics Expressed in Continuous Time . . . . . . . 3-33

    The B la ck-B ox, Discret e-Time C a se . . . . . . . . . . . . . . . . . . . 3-34

    St at e-Spa ce Models with C oupled Pa ra meters . . . . . . . . . . . . 3-36

    St at e-Spa ce S tructures: Init ial Va lues an d

    Num erica l Der iva tiv es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-37Some E xa mples of U ser-Defined Model St ructur es . . . . . . . . . 3-38

    Thet a Form a t: t h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-40

    Freq uency Fun ction F orma t: ff . . . . . . . . . . . . . . . . . . . . . . . . . 3-41

    Zero-P ole Forma t : zp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-43

    St a te-Spa ce Forma t: ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-43

    Tra nsfer Fu nction Forma t: t f . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44

    P olynomia l Form a t: poly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-45

    The ARX F orma t: a rx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-45Tra nsforma tions B etween Discrete a nd Continuous Models . 3-46

    C ontin uous-Time M odels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46

    Discret e-Time Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46

    Tra nsform a tion s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-47

    Simula tion a nd P rediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-47

  • 8/13/2019 System Ident

    7/274

    viii

    Compa ring D ifferent St ructures . . . . . . . . . . . . . . . . . . . . . . . . 3-49

    Ch ecking P ole-Zero Ca ncella tions . . . . . . . . . . . . . . . . . . . . . . . 3-51

    Residu a l Ana lysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52

    Noise-Fr ee Sim ula tion s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-53Assessing th e Model Uncerta int y . . . . . . . . . . . . . . . . . . . . . . . 3-53

    Com pa ring Differ ent Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-54

    Conditioning of the P rediction Error G rad ient . . . . . . . . . . . . 3-55

    Selectin g Model S tru ctures for Multiva riable Sy stems . . . . . . 3-55

    Offset Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-58

    Out liers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-58

    Filt ering Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-58

    Feedb a ck in D a ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-59

    Dela ys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-59

    The B a sic Algorit hm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-61

    Choosing an Adapta tion Mechanism a nd G a in . . . . . . . . . . . . 3-62

    Availa ble Algorit hm s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-65

    Segm ent a tion of Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-67

    Time S eries Modelin g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-68

    The S a mpling In ter va l . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-70Out of Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-71

    Memory -S peed Tra de-Offs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-72

    Regu la riza t ion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-72

    Local M inim a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-73

    Init ia l P a ra meter Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-73

    Linea r Reg ression M odels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-74

    Spectrum Norma liza tion an d the Sam pling Interva l . . . . . . . 3-75

    Int erpreta tion of the Loss Fu nction . . . . . . . . . . . . . . . . . . . . . 3-77Enu merat ion of Estima ted P a ram eters . . . . . . . . . . . . . . . . . . 3-78

    Com plex-Valued Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-79

    St ra ng e Result s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-79

    4Command Reference

  • 8/13/2019 System Ident

    8/274

    ix Contents

  • 8/13/2019 System Ident

    9/274

    1

    The S ys t em Ident ifica t ionProblem

    Basic Questions About System Identification . . . . . . . . . . . 1-2

    Common Terms Used in System Identification . . . . . . . . . . 1-4

    Basic Information About Dynamic Models . . . . . . . . . . . . . . 1-5

    The Basic Steps of System Identification . . . . . . . . . . . . . . 1-10

    A Startup Identification Procedure . . . . . . . . . . . . . . . . . . . 1-12

    Reading More About System Identification. . . . . . . . . . . . . 1-18

  • 8/13/2019 System Ident

    10/274

    1 The System Identification Problem

    1-2

    1. Basic Questions About System IdentificationWhat is System Identification?

    Sy stem Ident i f ication al lows y ou to build ma thema tical models of a dyna micsys tem based on measured dat a .

    How is that done?

    Essentia l ly by adjusting pa ram eters within a given model unti l i ts outputcoincides as w ell as possible wit h t he mea sured output.

    How do you know if the model is any good?

    A good test is t o take a close look at th e models output compa red to t hemeasured one on a da ta set tha t w asn t used for the f i t (Validation Da ta ).

    Can the quality of the model be tested in other ways?

    I t is also valua ble to look at w hat the model couldnt r eproduce in the d at a (theresidua ls). This should not be correlat ed wit h other a va ilable informa tion,such a s the syst em's input.

    What models are most common?

    The techniqu es apply t o very gener a l models. Most common m odels aredifference equa tions descriptions, such a s ARX a nd ARMAX models, as w ell asa ll types of linea r st a te-space models.

    Do you have to assume a model of a particular type?

    For pa ra metr ic models, you ha ve to specify the str ucture. How ever, if you justas sume tha t t he system is l inea r , you ca n directly estima te i ts impulse or stepresponse using C orrelat ion Ana lysis or its frequency response using S pectr a lAnalysis. This allows useful comparisons with other estimated models.

    What does the System Identification Toolbox contain?

    I t conta ins a l l the common t echniques to a djust pa ra meters in a l l kinds oflinear m odels. It a lso a llow s you to exa mine th e models propert ies, a nd t ocheck i f they are a ny g ood, as w ell as to preprocess a nd polish th e measuredd a t a .

  • 8/13/2019 System Ident

    11/274

    1-3

    Isnt it a big limitation to work only with linear models?No, actually not. Most common model nonlinear i t ies are such th at themeasured da ta should be nonlinearly t ran sformed (l ike squa ring a volta geinput i f you th ink tha t i t s the power t ha t is t he stimuli). Use physica l insighta bout t he system you are modeling an d try out such tra nsforma tions on modelsth at a re l inear in t he new var iables, and y ou wil l cover a lot !

    How do I get started?

    I f you are a beginner, browse t hrough Chapter a nd t hen try out a couple of theda ta sets tha t come with t he toolbox. Use the gra phical user interface (G U I)a nd check out the buil t-in help functions to understa nd w ha t y ou a re doing.

    Is this really all there is to System Identification?

    Actua lly, there is a huge a mount w rit ten on t he subject . E xperience with realda ta is th e driving force to understa nd more. I t is importa nt t o remember tha ta ny est imat ed model, no ma tt er how good i t looks on y our screen, has only

    picked up a simple reflection of realit y. S urprisingly often, h owever, th is issufficient for rational decision making.

  • 8/13/2019 System Ident

    12/274

    1 The System Identification Problem

    1-4

    2. Common Terms Used in System IdentificationThis section defines some of the terms t ha t are frequently used in S ystemIdenti f ication.

    Estimation Datai s the da ta set tha t i s used to f it a model to da ta . In theGU I th is is the same as the Working Data.

    Validation Datais the da ta set tha t is used for model va l idation purposes.This includes simulat ing th e model for t hese dat a a nd computing t he

    residua ls from t he model wh en applied to these data . Model Viewsar e var ious wa ys of inspecting t he propert ies of a m odel. They

    include looking a t zeros and poles, tra nsient a nd frequen cy response, a ndsimilar t hings.

    Data Viewsa re various wa ys of inspecting properties of dat a sets . A mostcommon and useful thing is just t o plot the da ta and scrutinize i t .So-called out l ierscould be detected t hen. These a re unr eliablemeasurements , perha ps ar is ing from fa i lures in the measurement

    equipment. The frequency content s of the da ta s ignals , in terms ofperiodograms or spectra l estimat es, is also most r evealing t o study.

    Model Setsor Model Structuresa re families of models with a djusta bleparameters . Parameter Estimationa mounts to f inding t he best va luesof these para meters . The S ystem Identi f ica tion problem a mounts to f indingboth a good model s tructure a nd good numerical va lues of its pa ra meters .

    Parametric Identification Methods ar e techniques to estima te

    para meters in given model structures. B asical ly i t is a m at ter of finding (bynumerica l search) those numerical va lues of the para meters t ha t give thebest agr eement betw een the m odel s (simulat ed or predicted) output a nd t hemeasured one.

    Nonparametric Identification Methodsare t echniques to estima temodel behavior wit hout necessari ly using a given para metrized model set .Typica l nonpara metr ic meth ods include Correlation analysis, w hichestimat es a systems impulse response, a nd Spectral analysis, w hich

    estimat es a systems frequency response. Model Validationis t he process of ga ining confidence in a model.

    Essentia l ly t his is achieved by tw isting an d tur ning the model to scrutinizea ll aspects of it . Of part icula r importa nce is the models a bilit y to reproducethe beha vior of the Validat ion D at a sets . Thus i t is importan t t o inspect theproperties of t he residua ls from t he model w hen a pplied to the Valida tionD a t a .

  • 8/13/2019 System Ident

    13/274

    1-5

    3. Basic Information About Dynamic ModelsSyst em Identi f ica tion is about building Dynamic Models. Some knowledgea bout s uch models is th erefore n ecessa ry for successful use of th e t oolbox.Thetopic is trea ted in s everal pla ces in t he Chap ter a nd there is a w ide range oftext books a va ilable for intr oduct ory an d in-depth st udies. For basic use of th etoolbox, it is sufficient t o ha ve quite superficial insight s a bout dyn a mic models.This section describes such a basic level of knowledge.

    The SignalsModels describe relationships betw een measur ed signals. It is convenient todistinguish betw een inputs ignals and outputs igna ls . The outputs a re th enpart ly determined by the inputs . Think for exam ple of a n a irpla ne w here theinputs w ould be th e different control surfa ces, a ilerons, eleva t ors, a nd t he like,wh ile the outputs w ould be the a irplan es orienta tion an d posit ion. In mostcases, the outputs ar e also af fected by more signals tha n t he measured inputs .

    In t he airplane example it w ould be wind gusts a nd turbulence ef fects . Suchunm easur ed input s will be called disturbances igna ls or noise. I f w e denoteinputs , outputs , a nd disturba nces by u, y, and e, respectively, th e relat ionshipcan be depicted in th e follow ing figure.

    Figure 1-1: Input Signals u, Output Signals y, and Disturbances e

    All these signa ls are functions of t ime, and t he value of the input a t t ime tw ill

    be denoted by u(t). Often, in t he ident ifica tion cont ext, only discrete-time pointsa re considered, since th e mea suremen t equipment t ypica lly records the signa lsjust a t discrete-time insta nts , often equa lly spread in t ime with asampling intervalof Ttime u nits. The modeling problem is t hen t o describehow th e three signa ls relat e to ea ch other .

    y

    e

    u

  • 8/13/2019 System Ident

    14/274

    1 The System Identification Problem

    1-6

    The Basic Dynamic ModelThe ba sic rela tionship is th e linear difference equation. An exa mple of sucha n equa tion is the following one.

    y( t)-1.5y( t - T)+ 0 .7 y(t -2T)= 0 . 9u(t-2 T)+ 0 .5u( t-3 T)+ e(t) (A R X)

    Su ch a relat ionship tells us, for exam ple, how t o compute t he output y(t)if theinput is known a nd th e disturban ce ca n be ignored:

    y( t)= 1 . 5y(t -T)-0.7y(t -2T)+ 0 .9u(t-2 T)+ 0 .5u( t-3 T)

    The output a t t ime tis thus computed a s a l inea r combinat ion of past output sa nd past inputs . I t fol low s, for example, th at th e output a t t ime tdepends onthe input s ignal a t many previous t ime ins tant s . This i s what the w orddynamicrefers to. The identificat ion problem is then to use mea surement s ofua n d yto figure out

    The coefficient s in t his eq ua tion (i.e., -1.5, 0.7, etc.)

    How ma ny d elayed outputs to use in the description (two in t he example:

    y( t - T)a n d y ( t - 2 T ))

    The time delayin the system is (2Tin t he exam ple: you see from t he second

    equat ion tha t i t ta kes 2Tt ime un its before a change in uwill a ffect y) and

    How ma ny delay ed inputs t o use (tw o in th e exa mple: u(t-2T)and u(t-3T))

    Variants of Model Descriptions

    The model given a bove is called a n ARX model. There a re a ha ndful ofva riant s of this model known a s Output-Error(OE) models, ARMAXmodels,FIRmodels , an d Box-J enkins (B J ) models. These ar e described later on inth e man ual . At a ba sic level it is suff icient to th ink of them a s varia nts of theARX model al lowing also a chara cteriza tion of the properties of thedisturbances e.

    General linear modelscan be described sym bolically by

    y = G u + H e w hich says th a t the measured output y(t)is a sum of one contr ibution tha tcomes from th e measu red input u(t)a nd one contr ibution t ha t comes from thenoiseHe. The sy mbolGthen denotes the dyna mic properties of the system, tha tis , how the output is formed from t he input. For l inea r systems i t is ca l led t hetr a nsfer function from input to output. The symbolHrefers to t he noise

  • 8/13/2019 System Ident

    15/274

    1-7

    properties , a nd is cal led the n oise model . I t d escribes how th e disturba nces a tthe output are formed from some standardized noise source e(t).

    State-space modelsa re common represent a t ions of dyna mical models. Theydescribe the sa me ty pe of l inear dif ference relat ionship between t he inputs a ndth e outputs a s in the ARX model, but they a re rearra nged so tha t only onedelay is used in th e expressions. To achieve this, some extra va ria bles, thestate variables, a re introduced. They a re not mea sured, but can bereconst ructed from th e measur ed input-output da t a . This is especia lly useful

    wh en there ar e several output s igna ls , i.e. , when y(t)is a vector. Chapter givesmore detai ls a bout th is . For ba sic use of the toolbox i t is suff icient to know th atthe orderof the sta te-space model relat es to the number of dela yed inputs a ndoutput s used in t he corresponding linea r difference equa t ion. The sta t e-spa cerepresenta t ion looks like

    x( t+ 1 )= A x( t)+ B u(t)+K e(t)

    y( t)= C x( t)+ D u( t)+ e( t)

    Here x(t)is th e vector of s ta te va riables. The ma tr ix K determines the noisepropert ies. Notice tha t if K = 0, th en th e noise source e(t)a f fects only th eoutput, and no specific model of the noise properties is built. This correspondst o H = 1in the genera l description a bove, and is usua lly referred to as a nOutpu t-Er ror model. Notice also tha t D = 0 means t ha t t here is no directinfluence from u(t)t o y(t). Thus t he effect of the input on t he output a ll pa ssesvia x(t)a nd w ill thus be delayed a t least one sample. The f irst va lue of the sta tevariable vector x(0)ref lects the init ia l conditions for t he system a t the

    beginning of the da ta record. When dea ling w ith m odels in sta te-space form, atypical option is w hether t o estima te D, K, and x(0) or to let t hem be zero.

    How to Interpret the Noise SourceIn ma ny ca ses of system identi fica tion, the ef fects of the noise on the output ar einsignificant compa red t o those of th e input. With g ood signa l-to-noise rat ios(SN R), it is less importa nt t o hav e an a ccura t e noise model. Nevertheless it isimporta nt to understa nd t he role of the noise an d th e noise sourcee(t), whetherit a ppears in t he ARX model or in t he genera l descriptions given a bove.

    There a re th ree aspects of th e noise tha t sh ould be stressed:

    understa nding wh ite noise

    inter preting t he noise source

    using th e noise source when w orking w ith t he model

  • 8/13/2019 System Ident

    16/274

    1 The System Identification Problem

    1-8

    These a spects a re discussed one by one.H ow can w e understa nd w hite noise? From a forma l point of view, t he noisesource e(t)w ill normally be regarded as wh it e noise. This means t ha t i t isent irely unpredict a ble. In oth er words, it is impossible to guess the va lue of e(t)no mat t er how accura tely we ha ve measured pas t da ta up to t ime t-1.

    H ow can w e interpret th e noise source? The a ctua l noise contr ibution to t heoutput, H e(t), ha s rea l s ignifica nce. I t conta ins a l l the inf luences on the

    measured y, known a nd unknown, th at are not conta ined in the input u. I texplains a nd captures th e fa ct tha t even i f a n experiment is repeated w ith th esa me input, th e output s ignal w il l ty pica l ly be somew ha t dif ferent . However,th e noise source e(t)need not ha ve a physical s ignifican ce. In t he airplaneexample mentioned earl ier , th e noise ef fects ar e w ind gusts an d t urbulence.Describing these a s a r is ing from a w hite noise source via a tra nsfer function H,is just a convenient w a y of ca pturing their chara cter .

    H ow can w e deal with the n oise source w hen using the model? I f the m odel is

    used just for simulat ion, i .e. , the responses to various inputs a re to be studied,th en the n oise model play s no immedia t e role. Since the noise source e(t)fornew da ta wil l be unknown, i t is taken a s zero in the simula tions, so as t o studyth e effect of th e input a lone (a n oise-free simulat ion). Ma king a noth ers imula t ion w i th e(t)being arbitra ry w hite noise wil l reveal how reliable theresult of the simula tion is , but i t wil l not give a m ore a ccurate simulat ion resultfor the actua l systems response.

    The need a nd use of the noise model can be sum ma rized a s follows:

    I t is , in most cases, required to obta in a bett er estimat e for t he dyna mics, G.

    It indicates how reliable noise-free simulations are.

    It is req uired for reliable predictions a nd st ocha st ic cont rol design.

  • 8/13/2019 System Ident

    17/274

    1-9

    Terms to Characterize the Model PropertiesThe properties of an input -output relat ionship like th e ARX model follow fr omth e numerical va lues of the coefficient s, an d th e number of dela ys used. This ishowever a fa ir ly implici t w ay of ta lking a bout t he model properties. Instea d anumber of different terms are used in practice:

    Impulse Response

    The impulse response of a dy na mica l model is the output s igna l tha t results

    wh en the input is an impulse, i.e., u(t)is zero for a ll values of texcept t =0,where u(0)=1. It can be computed a s in t he equa t ion follow ing (ARX), by lett ingtbe equ a l to 0, 1, 2, . . . and ta king y(-T)=y(-2T)=0 and u(0)=1.

    Step Response

    The step response is the output sign a l tha t result s from a st ep input, i .e. , u(t)is zero for nega tive va lues ofta nd equa l to one for positive va lues of t. Theimpulse an d step responses togeth er a re ca lled the models transientresponse.

    Frequency Response

    The frequen cy response of a linea r dyn a mic model describes how t he modelreacts t o s inusoida l inputs . I f w e let t he inputu(t) be a sinusoid of a certa infrequency, th en the output y(t) w ill also be a sinu soid of th is frequency. Thea mplitude a nd t he pha se (relat ive t o the input ) w ill how ever be different. This

    frequency response is most often depicted by t w o plots ; one tha t sh ows th ea mplitude chang e as a function of the sinusoids frequency a nd one tha t showsth e pha se shift a s function of frequency. This is know n a s a B ode plot.

    Zeros and Poles

    The zeros an d th e poles ar e equiva lent w a ys of describing th e coefficients of alinear difference equa t ion like th e ARX model. The poles rela te t o theoutput -side an d t he zeros relat e to the input -side of th is equa t ion. The

    num ber of poles (zeros) is equa l to number of sam pling interva ls betw een themost a nd lea st delay ed output (input). In the ARX exa mple in t he beginning ofth is section, ther e ar e consequent ly tw o poles an d one zero.

  • 8/13/2019 System Ident

    18/274

    1 The System Identification Problem

    1-10

    4. The Basic Steps of System IdentificationThe S ystem I denti f ica tion problem is t o estima te a model of a system b ased onobserved input-output da ta . Several wa ys to describe a system a nd t o estima tesuch descript ions exist. This section gives a brief account of th e most importa ntapproaches.

    The procedure to determ ine a m odel of a dy na mical syst em from observedinput-output da ta involves three basic ingredients :

    The input-output da ta

    A set of ca ndida te models (th e model st ructure)

    A criterion to select a par ticula r model in th e set , based on the informa t ion

    in the da ta (the identi f ica tion method)

    The identificat ion process am ounts t o repeat edly selecting a model str ucture,computing the best m odel in the st ructure, and eva luating this m odel s

    propert ies to see if they a re sa tisfa ctory. The cycle ca n be itemized a s follow s:

    1 D esign an experiment a nd collect input -output da ta from the process to be

    identified.

    2 Exa mine the da ta . P olish it so as to remove trends a nd outl iers , select u sefulportions of the original da ta , and a pply f i lter ing t o enha nce importa ntfrequency ra nges.

    3 S elect an d define a m odel str ucture (a set of ca ndida te syst em descriptions)w ithin w hich a model is to be found.

    4 Compute th e best model in t he model stru cture a ccording t o theinput-output da ta an d a given cri ter ion of fi t .

    5 Examine the obtained models properties

    6 If t he model is good enough, then st op; otherw ise go ba ck to S tep 3 to try

    a nother model set . P ossibly a lso try other estimat ion m ethods (St ep 4) orw ork furth er on the input-output da ta (St eps 1 and 2).

    The S yst em Id ent ifica t ion Toolbox offers severa l functions for ea ch of thesesteps.

  • 8/13/2019 System Ident

    19/274

    1-11

    For St ep 2 there a re routines to plot da ta , f il ter da ta , and r emove trends ind a t a .

    For St ep 3 the Sys tem I denti f icat ion Toolbox offers a var iety of nonpara metricmodels, a s well as a ll the most common bla ck-box input-output a nd st a t e-spa cestructures, a nd a lso general ta i lor-ma de l inear st a te-space models in discretea nd continuous t ime.

    For S tep 4 genera l prediction error (ma ximum likelihood) met hods as w ell as

    instrumenta l varia ble methods an d sub-space methods a re offered forpara metric models, w hile bas ic correlat ion a nd spectra l an alysis methods a reused for nonpara metric model s tr uctures.

    To examine models in St ep 5, ma ny functions a l low t he computa tion an dpresenta tion of frequency functions a nd poles an d zeros, as w ell as s imula tiona nd prediction using th e model. Functions a re a lso included fortransformations between continuous-time and discrete-time modeldescriptions a nd to forma ts t ha t a re used in other MATLAB toolboxes, like the

    Cont rol Syst em Toolbox a nd t he S igna l P rocessing Toolbox.

  • 8/13/2019 System Ident

    20/274

    1 The System Identification Problem

    1-12

    5. A Startup Identification ProcedureThere ar e no sta nda rd a nd secure routes t o good m odels in S ystemIdent ifica tion. G iven the num ber of possibilities, it is easy t o get confused aboutw ha t t o do, wh a t m odel st ructures t o test , and so on. This section describes oneroute tha t of ten w orks well , but t here are no gua ra ntees. The steps refer t ofunctions within th e GU I, but you ca6n a lso go through them in comman dmode. See Chapter for the basic commands.

    Step 1 Looking at the DataP lot t he dat a . Look at them carefully. Try to see the dyna mics with y our owneyes. Can you see the ef fects in the outputs of the changes in t he input? Canyou see nonlinear effects , like different r esponses a t d ifferent levels, ordif ferent responses to a s tep up an d a step down? Are there portions of the da tath at appear t o be messy or car ry no informa tion. Use this insight t o selectportions of the da ta for estimat ion a nd va lida tion purposes.

    Do physica l levels play a r ole in your model? I f not , detrend th e dat a byremoving t heir mean va lues. The models w ill then describe how changes in t heinput give changes in output, but not expla in th e actua l levels of the signa ls .This is the n ormal s i tua tion.

    The defa ult s i tua tion, with good da ta , is tha t you detrend by removing means,a nd t hen select the f irst ha lf or so of the da ta record for estima tion purposes,a nd use the rema ining dat a for val idat ion. This is wha t ha ppens wh en you

    apply Quickstartun der t he pop-up menu Preprocessin the ma in identwindow.

    Step 2 Getting a Feel for the DifficultiesApply Quickstart under pop-up menu Estimatein the main identw indow.This wil l compute a nd displa y the spectra l ana lysis estima te a nd t hecorrelat ion a na lysis estima te, as w ell as a fourth order ARX model with a delay

  • 8/13/2019 System Ident

    21/274

    1-13

    estimat ed from th e correlat ion a na lysis and a default order sta te-space modelcomput ed by n 4s i d . This gives three plots . Look at th e agr eement between t he

    Spectra l Ana lysis estima te a nd t he ARX an d st at e-space models frequency

    functions

    Correlation Analysis estimat e an d t he ARX a nd st at e-space models

    tra nsient responses

    Measured Validat ion Da ta output a nd th e ARX an d sta te-space models

    s imulated outputsI f th ese a greement s a re reasonable, the problem is not so diff icult , a nd arelat ively simple linea r model will do a good job. Some fine tun ing of modelorders, and noise models hav e to be ma de a nd you can proceed to St ep 4.Otherw ise go to St ep 3.

    Step 3 Examining the DifficultiesThere ma y be several rea sons w hy t he compa risons in St ep 2 did not look good.

    This section discusses t he most common ones, and h ow t hey can be ha ndled:

    Model Unstable

    The ARX or st a te-space model ma y t urn out to be unsta ble, but could st ill beuseful for cont rol purposes. Cha nge t o a 5- or 10-st ep ah ead prediction inst eadof simulat ion in the Model Output View.

    Feedback in Data

    I f th ere is feedback from t he output t o the input, due to some regulator , thenth e spectra l and correlat ions a na lysis estima tes a re not rel iable. Discrepanciesbetween t hese estima tes a nd t he ARX a nd sta te-space models ca n t herefore bedisrega rded in this case. In t he Model Residuals Viewof the par a metricmodels , feedback in da ta can also be visible as correlat ion betw een r esidualsa nd input for negat ive lags.

    Noise ModelI f th e sta te-space model is clearly better t ha n t he ARX model at reproducingthe measured output , th is i s an indica t ion tha t t he d is turbances ha ve asubsta ntia l inf luence, an d i t wil l be necessary to model them carefully.

  • 8/13/2019 System Ident

    22/274

    1 The System Identification Problem

    1-14

    Model OrderIf a fourth order model does not give a good Model Outputplot , t ry eighthorder. If the fit clea rly improves, it follows t ha t hig her order models will berequir ed, but th a t linea r models could be sufficient.

    Additional Inputs

    I f the Model Outputf i t ha s not s ignif icant ly improved by the t ests so far ,th ink over the physics of the a pplica tion. Are th ere more signa ls tha t ha ve

    been, or could be, measu red th a t m ight influence th e output ? If so, includeth ese am ong the inputs and t ry a gain a fourth order ARX model from all theinputs . (Note tha t t he inputs need not a t a l l be control signals , a nyt hingmeasura ble, including disturba nces, should be trea ted a s inputs).

    Nonlinear Effects

    I f t he f it between mea sured an d model output is s t i ll bad, consider the physicsof the a pplicat ion. Are th ere nonlinear ef fects in the system? In tha t ca se, form

    th e nonlinear i t ies from t he mea sured da ta . This could be a s s imple as formingth e product of volta ge and current m easurements , i f you realize tha t i t is theelectr ical pow er tha t is t he driving stimulus in, say, a hea ting process, andtempera tur e is th e output . This is of course applica tion dependent . It does notta ke very much w ork, however, to form a number of addit ional inputs byreasona ble nonlinear t ran sforma tions of the measured ones, an d just t est i finclusion of them im proves the fit.

    Still Problems?I f none of th ese tests leads to a model tha t is a ble to reproduce th e ValidationDa ta reasonably w ell, the conclusion might be tha t a suff iciently good modelcannot be produced from t he da ta . There ma y be ma ny reasons for t his . Themost importa nt one is tha t t he da ta s imply do not conta in suff icientinforma tion, e.g., due to ba d signal t o noise rat ios , large an d nonstat iona rydisturba nces, varying system properties , etc . The reason ma y a lso be tha t t hesystem h a s some quite complicat ed nonlinear i t ies, wh ich cann ot be realized on

    physical ground s. In such cases, nonlinea r, black box models could be asolution. Among th e most used models of this chara cter a re the ArtificialNeura l Netw orks (ANN).

    Otherw ise, use the insights of w hich inputs t o use and wh ich model orders toexpect a nd pr oceed to Step 4.

  • 8/13/2019 System Ident

    23/274

    1-15

    Step 4 Fine Tuning Orders and Noise StructuresFor real da ta there is no such t hing a s a correct model s tructure. However,dif ferent s tructures can give quite dif ferent model qua lity . The only w ay to f indth is out is to try out a number of dif ferent s t ructures an d compar e thepropert ies of the obta ined models. There a re a few t hings t o look for in t hesecomparisons:

    Fit Between Simulated and Measured Output

    Keep the Model Output Viewopen a nd look a t the f i t betw een t he modelssimulated output an d the measured one for the Validation Da ta . Forma lly, youcould pick tha t m odel, for wh ich this number is th e lowest . In pra ctice, it isbetter t o be more pragma tic , and a lso take into a ccount the model complexity,a nd w hether th e importa nt feat ures of the output response are captured.

    Residual Analysis Test

    You should req uire of a good model, tha t t he cross correla tion function betw een

    residua ls an d input does not go significa nt ly outside th e confidence region. Aclear peak a t l ag kshows th at the ef fect from input u(t-k)on y(t)is not properlydescribed. A rule of thum b is th a t a slowly va rying cross correlat ion functionoutside th e confidence region is a n indicat ion of too few poles, wh ile sha rperpeaks indica te too few zeros or w rong delays.

    Pole Zero Cancellations

    If t he pole-zero plot (including confiden ce int erva ls) ind icat es pole-zeroca ncella t ions in th e dyna mics, this suggests t hat lower order models can beused. In part icular , i f i t t urns out th a t t he orders of ARX models ha ve to beincreased t o get a good fit, but th a t pole-zero ca ncella t ions a re indica ted, th enth e extra poles a re just int roduced to describe the n oise. Then t ry ARMAX, OE,or BJ model s tructures with a n A or F polynomial of an order equa l to tha t ofth e number of nonca nceled poles.

    What Model Structures Should be Tested?

    Well, you can spend a ny a mount of t ime t o check out a very larg e number ofstructures. I t often t akes just a few seconds to compute a nd eva luate a modelin a certain st ructure, so tha t you should have a generous at t i tude to thetesting. H owever, experience shows t ha t w hen the basic properties of thesyst ems beha vior have been picked up, it is not m uch use to fine tune ordersin a bsurdum just t o press th e f it by fra ctions of percents .

  • 8/13/2019 System Ident

    24/274

    1 The System Identification Problem

    1-16

    Many ARX models: There is a very cheap w ay of testing ma ny ARX structuressimultan eously. Enter in the Orders text field ma ny combina t ions of orders,using t he colon (:) nota tion. When y ou select Estimate, models for a llcombina t ions (ea sily severa l hundreds) are comput ed an d th eir (predict ionerror) f i t to Validat ion D a ta is shown in a special plot . B y cl icking in t his plotth e best models with a ny chosen number of para meters w ill be inserted into theModel Board, an d evaluat ed as desired.

    Many State-space models: A simila r feat ure is a lso ava ilable for bla ck-box

    st a te-space models, estima ted using n4s i d . When a good order ha s been found,try the P EM estima tion method, which of ten improves on the accura cy.

    ARMAX, OE , and BJ models: Once you ha ve a feel for suitable dela ys a nddyn a mics orders, if is often useful to tr y out ARMAX, OE , an d/or BJ wit h th eseorders a nd t est some dif ferent orders for t he noise tra nsfer functions (C a nd D).Especial ly for poorly da mped systems, the OE structure is suita ble.

    There is a quite extensive l itera ture on order a nd structure selection, an d

    a nyone w ho would like to know more should consult t he references.

    Multivariable SystemsSy stems wit h ma ny input s ignals an d/or many output s ignals are cal ledmul t i va r iab le. Such systems ar e of ten more challenging t o model . In part icularsyst ems w ith severa l out puts could be difficult. A ba sic rea son for th edif ficult ies is tha t the couplings betw een several inputs a nd outputs lead t omore complex models. The str uctures involved are richer a nd more pa ra metersw il l be required to obta in a good f i t .

    Available Models

    The Sy stem I denti f icat ion Toolbox a s w ell as t he G U I ha ndles genera l , linearmult iva riable models. All ea rlier mentioned models are supported in the singleoutput , multiple input case. For multiple out puts ARX models an d sta te-spa cemodels ar e covered. Multi-out put ARMAX and OE m odels a re covered via

    state-space representations: ARMAX corresponds to estimating the K-matrix,w hile OE corresponds to fixing K to zero. (These a re pop-up opt ions in th e G U Imodel order editor.)

    G enerally spea king, i t is preferable to work w ith sta te-space models in themultiva riable case, s ince the m odel s tructure complexity is easier to dea l w ith.I t is essentia l ly just a ma tt er of choosing the m odel order .

  • 8/13/2019 System Ident

    25/274

    1-17

    Working with Subsets of the Input Output ChannelsIn t he process of ident ifying good models of a syst em, it is often useful to selectsubsets of the input a nd output cha nnels . Pa rtia l models of the syst emsbeha vior will then be constr ucted. It m ight n ot, for exam ple, be clear if a llmeasured input s ha ve a s ignif ica nt inf luence on the outputs . Tha t is mosteasi ly tested by removing an input channel from the da ta , building a model forhow t he output(s) depends on th e rema ining input cha nnels, an d checking ifth ere is a s ignifican t deteriora tion in the m odel output s f i t t o the mea sured

    one. See also th e discussion under Step 3a bove.G enerally spea king, the f it gets bett er when more inputs ar e included an dworse w hen more outputs a re included. To understand the la t t er fact , youshould realize tha t a model th at ha s to expla in the behavior of several outputsha s a tougher job tha n one tha t just must account for a s ingle output. I f youha ve difficulties obta ining good models for a mu lti-output sy st em, it might bewise to m odel one output a t a t ime, to f ind out w hich a re th e dif ficult ones tohandle.

    Models tha t a re just t o be used for simula tions could very w ell be built up fromsingle-output models, for one output a t a t ime. How ever, models for predictiona nd control will be able to produce bett er results if const ructed for all output ssimulta neously. This follows from the fact t ha t know ing th e set of all previousoutput channels gives a better ba sis for prediction, than just know ing the pa stoutputs in one channel.

    Some Practical AdviceThe G U I is part icular ly suited for dealing with multiva riable systems since i tw ill do useful bookkeeping for you, ha ndling d ifferent cha nnels. You couldfollow the steps of this agenda :

    Impor t da ta a nd crea te a da t a set wi th a l l input a nd output channels of

    inter est. Do the necessar y preprocessing of this set in t erms of detren ding,

    pref il ter ing, etc ., and t hen select a Validat ion Da ta set w ith a l l cha nnels .

    Then select a Working Da ta set w ith a l l cha nnels , and estima te sta te-space

    models of different orders using n4s i d for these data . Exam ine th e resulting

    model primar ily using t he Model Outputview.

    If it is difficult t o get a good fit in a ll out put cha nnels or you would like to

    investigat e how importa nt t he dif ferent input cha nnels are, construct new

    da ta sets using subset s of the original input /output cha nnels. U se the pop-up

    menuPreprocess > Select Channelsfor this . Dont cha nge th e Validation

  • 8/13/2019 System Ident

    26/274

    1 The System Identification Problem

    1-18

    Da ta . The GU I w il l keep tra ck of the input a nd output chann el numbers. I twil l do the r ight t hing w hen evalua ting t he channel-restr icted models

    using the Validat ion Da ta . I t m ight a lso be appropriate to see if

    improvements in th e fit a re obta ined for various model ty pes, built for one

    output a t a t ime.

    If you decide for a mu lti-output model, it is often ea siest t o use sta te-space

    models. U se n 4s i d a s a pr imary tool and t ry out pe mwhen a good order ha s

    been found. Note t ha t n 4s i d does not provide confidence inter va ls for th e

    model view s.

  • 8/13/2019 System Ident

    27/274

    Reading M ore About System Identification

    1-19

    Reading More About System IdentificationThere is substantial literature on System Identification. The followingtextbook deals w ith identi f ica tion methods from a simila r perspective a s thistoolbox, an d a lso describes met hods for physical modeling.

    Ljung L. and T. Gla d. Modeling of Dynamic Systems,P rentice H all , Englewood

    C liffs, N.J . 1994.

    For more detai ls a bout the a lgori thm s a nd t heories of ident i f ica tion:

    Ljung L.. System Identification - Theory for the User, P rentice Ha ll, Englewood

    C liffs, N.J . 1987.

    Sderstrm T. an d P . St oica. System Identification, P rentice Ha ll Int ernat iona l ,

    Lon don. 1989.

    For more about system an d signals :

    Oppenheim J . a nd A.S. Willsky. Signals and Systems,P rentice Ha ll , En glewood

    C liffs, N.J . 1985.

    The follow ing text book deals w ith t he underlying nu merical techniq ues forpara meter es t imat ion .

    Dennis , J .E . J r . and R.B. Schnabel .Numerical Methods for Unconstrained

    Optimization and Nonlinear Equations, Pr entice Ha ll , Englew ood Cli f fs, N.J .

    1983.

  • 8/13/2019 System Ident

    28/274

    1 The System Identification Problem

    1-20

    2

  • 8/13/2019 System Ident

    29/274

    2

    The G ra phica l U serInterface

    The Big Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

    Handling Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7

    Estimating Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14

    Examining Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27

    Some Further GUI Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-34

  • 8/13/2019 System Ident

    30/274

    2 The G raphical U ser Interface

    2-2

    1. The Big PictureThe Sy st em Ident ifica tion Toolbox provides a gra phical user interfa ce (G U I) .The G U I covers most of th e toolboxs functions a nd gives ea sy a ccess to allva riables th at a re creat ed during a session. I t is s tar ted by typing

    i d ent

    in the MATLAB comma nd w indow .

    Figure 2-1: The Main ident Information Window

    The Model and Data BoardsSy stem Identi f ica tion is about da ta an d models a nd crea ting models from da ta .The ma in informa tion an d communication w indow ident, is t herefore

    dominated by t w o tables:

    A ta ble over a vaila ble da ta sets , each represented by a n icon.

    A t a ble over crea t ed models, each represent ed by a n icon.

  • 8/13/2019 System Ident

    31/274

    2-3

    These ta bles wil l be referred to a s the Model B oard and t he Da ta B oard inth is cha pter . You enter da t a sets in to the Da ta B oa rd by

    Opening ear lier sa ved sessions.

    Importing them from the MATLAB workspace.

    Crea ting them by detrending, f i l ter ing, selecting s ubsets , etc . , of a notherda ta se t in the Da ta Bo ar d .

    Imports a re ha ndled under th e pop-up menu Data w hile creat ion of new da ta

    sets is ha ndled under t he pop-up menu Preprocess. Ha ndl ing Dat a on pa ge2-7deals with this in more deta i l .

    The models ar e entered into t he summa ry board by

    Opening earlier saved sessions.

    Importing them from the MATLAB workspace.

    Est ima t ing them from dat a .

    Imports a re ha ndled under th e pop-up menu Models, w hile a l l the dif ferentestima t ion schemes are rea ched under the pop-up menu Estimate. More a boutth is in Est ima ting M odels on page 2-14.

    The Dat a a nd Model B oards ca n be rearr a nged by dragging an d dropping.More boards open a utoma tica l ly w hen necessary or when a sked for (undermenu Options).

    The Working DataAll da ta sets an d models are creat ed from th eWorking Da ta set. This is thedat a tha t i s given in the center o f the identw indow. To cha nge t he WorkingDa ta set drag an d drop any da t a set f rom the Da ta B oard on the Working Da taicon.

    The ViewsB elow th e Da ta an d Model B oards a re buttons for dif ferent views. These

    control w ha t aspects of the da ta sets a nd models you would l ike to examine, an da re described in more detail in Ha ndling Da ta on pa ge 2-7 and in ExaminingModels on pa ge 2-27. To select a da ta set or a model, so tha t i t s properties ar edisplay ed, click on its icon. A select ed object is ma rked by a th icker line in t heicon. To deselect, click a ga in. An a rbitr a ry num ber of da ta /model object s can beexamined simultaneously. To have more information about an object,double-click on it s icon.

  • 8/13/2019 System Ident

    32/274

    2 The G raphical U ser Interface

    2-4

    The Validation DataThe t w o model views Model Output a ndModel Residuals i l lustra te m odelproperties when a pplied to the Validat ion D a ta set . This is the set ma rked inth e box below th ese tw o views. To cha nge the Validat ion D a ta , drag a nd dropan y dat a set f rom the Da ta B oard on the Val ida t ion Da ta icon .

    I t is good and common practice in identi fica tion to evaluat e an estimat edmodels properties using a fresh da ta set , tha t is , one tha t w a s not used forth e estima tion. I t is thus good a dvice to let the Validat ion D at a be dif ferent

    from the Working Da ta , but they sh ould of course be compat ible w ith t hese.

    The Work FlowYou sta r t by importing da ta (under pop-up menu Data); you exa mine the dat aset using the Data Views.You probably remove th e means from the dat a an dselect subsets of dat a for estima tion an d va lida tion purposes using the i tems inth e pop-up men u Preprocess. You th en cont inue to estima te models, using t hepossibilities under th e pop-up men u Estimate, perha ps f irst doing a

    quicksta rt . You examine th e obta ined models w ith respect to your favoriteas pects using th e dif ferent Model Views. The ba sic idea is t ha t a ny checkedview sh ows t he propert ies of all select ed models at a ny t ime. This function isl ive so models and view s can be checked in an d out a t wil l in a n onlinefa shion. You select/deselect a model by clicking on it s icon.

    In spired by th e informa tion you gain from the plot s, you cont inue to try outdifferent model stru ctures (model orders) until you find a m odel you a resa t isf ied w i th .

    Management AspectsDiary:It is ea sy to forget w ha t you ha ve been doing. B y double-clicking on ada ta /model icon, a complete diary w ill be given of how t his object w a s creat ed,along w ith other key informa tion. At t his point you can a lso add comment s a ndchange t he na me of the object a nd i t s color .

    Layout:To have a good overview of the creat ed models and da t a set s, it is good

    practice to try rea rra nging the icons by dra gging an d dropping. In t his wa ymodels corresponding t o a part icular da ta set can be grouped together , etc. Youcan a lso open new boa rds (Optionsmenu Extra model/data boards) tofurther r earra nge th e icons. These ca n be dra gged a cross th e screen betweendif ferent w indows. The extra boa rds a re a lso equipped w ith n otepad s for yourcomments.

  • 8/13/2019 System Ident

    33/274

    2-5

    Sessions:The Model an d Da ta B oards w i th a l l models a nd dat a sets t ogetherwit h th eir diar ies ca n be saved (under menu i tem File) a t an y point , andreloaded la ter. This is t he count erpar t of save/loa d w orkspace in thecomma nd-driven MATLAB . The four most r ecent sessions a re listed un der Filefor immediat e open.

    Cleanliness: The boards wil l hold an ar bitra ry number of models an d dat asets (by crea tin g clones of t he board w hen necessary ). It is however ad visableto clear (delete) models an d da ta sets tha t no longer a re of interest . Do tha t by

    dra gging t he object to th e Trash Can. (Double-clicking on t he t ra sh can w illopen it u p, and it s cont ent s can be retr ieved.)

    Window Culture: Dialog a nd plot w indows a re bes t ma na ged by the GU I sc l o s e function (submen u item under Filemenu , or select Close, or check/uncheck the corresponding View box). They m a y a lso beq uitt ed by t he specificw indow syst ems qu it/close function. This does no ha rm, but quit w ill not beproperly a cknowledged by the G U I, a nd t he w indow w ill ha ve to be re-crea tednext t ime it is to be used.

    I t is genera lly not suita ble to iconify the windows the G U Is han dling a ndwindow ma nagement sys tem is usual ly a bet ter a l ternat ive.

    Workspace VariablesThe models a nd da ta sets crea t ed wi th in t he G U I a re normal ly not a va i la ble inth e MATLAB w orkspa ce. Indeed, the w orkspace is not a t a l l li t tered wit hvar iables during t he sessions w ith th e GU I. The va riables ca n however beexported at an y t ime to the w orkspace, by dra gging a nd dropping t he objecticon on th e To Workspace box. They w il l then car ry t he na me in theworkspace tha t m arked t he object icon at th e t ime of export . You can work w ithth e variables in the w orkspace, using any MATLAB commands , a nd thenperhaps import modif ied versions ba ck into th e GU I. Note tha t models have aspecif ic internal s tr ucture and should be dealt w ith using t he MATLAB commands p r e s e n t , t h2f f , t h 2s s , etc. See Model Conv ersions on page 4-5 ofth e "Comma nd Reference" cha pter .

    The G U Is names of data sets a nd models a re suggested by defa ult procedures.Normally, you ca n enter a ny other na me of your choice at the t ime of crea tionof th e var ia ble. Na mes can be cha nged (aft er double-clicking on th e icon) a t a nytime. Un like the workspace situa tion, two GU I objects can carry th e samena me (i.e. , th e sam e string in their icons).

  • 8/13/2019 System Ident

    34/274

    2 The G raphical U ser Interface

    2-6

    The G U I produces a h and ful of global w orkspace varia bles for ma na gementpurposes. They a l l s ta r t wit h t he pref ix XI D.

    NOTE:Do not c l e a r a l l or c l e a r g l o b a l during a G U I session! This would

    mean tha t you lose control over the objects t ha t you have creat ed. The sam e

    disa ster occurs if you do c l g or q ui t the ma in identwin dow. It is however

    sa fe to c l e a r (with out adding a l l or g l o ba l ) th e workspace at an y t ime.

    Help TextsThe G U I conta ins some 100 help texts tha t a re accessible in a nested fash ion,w hen required. The ma inidentw indow conta ins general help topics under t heHelpmenu. This is a lso the ca se for t he va rious plot w indows . In a ddition,every dia log box has a Helppush butt on for current help and ad vice.

  • 8/13/2019 System Ident

    35/274

    2-7

    2. Handling Data

    Data RepresentationIn the S ystem I denti f ica tion Toolbox (SI TB ), s ignals a nd observed da ta arerepresented a s column vectors, e.g. ,

    The entr y in row num ber k, i.e., u(k), w ill then be the signal s va lue at samplingins tant n umber k. I t is genera lly a ssumed in the toolbox tha t da ta ar e sampledat equidis tant sampl ing t imes , and t he sampl ing in terva l Tis supplied a s a

    specific a rgum ent.

    We genera lly denote the input t o a syst em by t he lett er ua nd the output by y.I f the system ha s several input chann els , the input da ta is represented by ama tr ix, where th e columns a re the input s ignals in t he different cha nnels :

    The sam e holds for syst ems w ith several output channels .

    The observed input-output da t a record is represented in the SI TB by a ma tr ix,w here t he first column (s) is th e output, followed by th e input column(s):

    z = [ y u] ;

    When you work w ith th e GU I, you only need to th ink of th ese representat ionissues wh en you insert the da ta set into the summa ry board. The G U I w ill thenhan dle the da ta representa t ion a utomat ica l ly .

    u

    u 1( )

    u 2( )

    u N( )

    =

    u u1 u2 um=

  • 8/13/2019 System Ident

    36/274

    2 The G raphical U ser Interface

    2-8

    Getting Data into the GUIThe informa tion about a da ta set tha t should be supplied to the G U I is asfollows:

    1 The input a nd output s igna ls

    2 The na me you give to the dat a set

    3 The sta r t ing t ime

    4 The sa mpling interva l

    5 Da ta no tes

    NOTE: I tems 3 and 4 are used only to ensure correct t ime a nd frequency sca les

    w hen you plot da ta a nd model cha racterist ics.

    These a re notes for your ow n informa tion a nd bookkeeping tha t w ill follow th edat a an d a l l models crea t ed f rom t hem.

  • 8/13/2019 System Ident

    37/274

    2-9

    As you select t he pop-up men u Dataa nd choose the i tem Import..., a dia logbox will open, w here you can enter th e inform a tion item s 1 - 5, just listed. Thisbox has six fields for you t o fill in:

    Figure 2-2: The Dialog for Importing Data into the GUI

    Input a ndOutput: Enter th e variable names of the input a nd outputrespectively. These should be va ria bles in your MATLAB w orkspace, so youmay ha ve to load some disk files first .

    Actua lly, you ca n enter a ny MATLAB expressions in th ese fields, and t hey w illbe eva luat ed to compute th e input a nd th e output before inserting the da ta intot h e G U I .

    Data name: Enter th e name of the da ta set to be used by the GU I. This nameca n be chan ged la ter on.

    Starting time and Sampling interval: Fill these out for correct time a ndfrequency scales in th e plots.

    Note tha t you can enter any text you wa nt t o accompany the da ta forbookkeeping purposes.

    2

  • 8/13/2019 System Ident

    38/274

    2 The G raphical U ser Interface

    2-10

    Fina lly, select Importt o inser t the da ta in to the GU I . When no more da ta setsa re to be inserted, select Close to close t he dia log box.Reset will empty a l l th efields of the box.

    Taking a Look at the DataThe f ir s t th ing t o do a f ter ha ving inser ted the da ta set in to the Data B oard isto examine i t . B y checking the Data Viewi tem Plot Data, a plot of th e inputa nd output s igna ls wil l be shown for the da ta sets th at ar e selected. You select/

    deselect t he da ta sets by clicking on th em. For multivaria ble data , the dif ferentcombinat ions of input a nd output s igna ls are chosen under menu i temChannelin the plot w indow. U sing the z o o mfunction (dra wing rectan gles withth e lef t m ouse butt on dow n) dif ferent portions of the da ta can be exa mined inmore deta i l.

    To exa mine the freq uency content s of the da ta , check th e Data Viewi temData Spectra. The function is a na logous t o Plot Data, but t he signals spectraa re shown inst ead. B y default t he periodogra ms of the dat a a re shown , i.e. , thea bsolute squa re of the Fourier tra nsforms of the da ta . The plot can be cha ngedto any chosen frequency ran ge and a number of different w a ys of estimat ingspectra, by th eOptions menu i tem in the spectra window.

    The purpose of examining t he da ta in these wa ys is to f ind out i f th ere areportions of the da ta th at a re not suitable for identi f ica tion, i f the informa tioncontent s of the da ta is suita ble in the int eresting frequency regions, and i f theda ta ha ve to be preprocessed in some wa y, before using them for estima tion.

    Preprocessing Data

    Detrending

    Det rending the da ta involves removing the mea n va lues or linear t rends fromth e signa ls (th e means a nd the l inear trends a re then computed a nd removedfrom ea ch signa l individua lly). This fun ction is a ccessed und er t he pop-upmenu Preprocess, by selecting it em Remove Means or Remove Trends.More advanced detrending, such as removing piecewise linear trends orseasonal var iat ions ca nnot be accessed wit hin the G U I. I t is genera llyrecommended tha t you a lwa ys remove a t leas t the mean va lues of the da t abefore the estimat ion pha se, unless physical insight involving a ctual s igna llevels is built int o the models.

  • 8/13/2019 System Ident

    39/274

    2-11

    Selecting Data Ranges

    I t is of ten t he ca se tha t t he wh ole da ta record is not suita ble for identi f ica tion,due to various undesired featu res (missing or ba d da ta , outburst s ofdisturba nces, level cha nges etc.), so tha t only portions of the da ta can be used.In a ny case, i t is ad visable to select one portion of the mea sured da ta forestima t ion purposes a nd a nother portion for va lidat ion purposes. The pop-upmenu i tem Preprocess > Select Range...opens a dialog box, wh ich fa cil i tat esth e selection of dif ferent da ta portions, by t yping in the ra nges, or ma rkingth em by dra wing recta ngles w ith the mouse button down.

    For mul t ivar iable da ta i t i s of ten adva nta geous to s ta r t by w orking w i th jus tsome of the input a nd output s ignals . The menu i tem Preprocess > SelectChannels...a llow s you to select subset s of the inputs a nd out puts. This is donein such a wa y tha t t he input/output numbering rema ins consistent wh en youevalu a te da ta a nd model properties, for models covering different s ubsets of thed a t a .

    PrefilteringB y f i lter ing the input an d output s ignals through a l inea r f i lter (the sa me f il terfor all signa ls) you can focus t he m odels fit t o the sy stem to specific frequencyra nges. This is done by selecting th e pop-up menu item Preprocess > Filter...in the ma in w indow. The dialog is quite a na logous to tha t of selecting da tara nges in th e t ime doma in. You ma rk wit h a recta ngle in t he spectra l plots theintended passba nd or stop band of the f i lter , you select a button t o check i f thef i lter ing ha s the desired ef fect , a nd th en you insert t he f il tered dat a int o the

    GU I s Da ta B oar d .

    P ref il ter ing is a good w ay of removing high frequency noise in the da ta , anda lso a good a l terna tive to detrending (by cutting out low frequencies from thepass ba nd). Depending on the intended model use, you can a lso ma ke sure tha tth e model concentra tes on the importa nt frequency ran ges. For a model tha tw ill be used for cont rol design, for exa mple, th e frequency ba nd a round t heint ended closed-loop band w idth is of special importa nce.

    Resampling

    I f th e dat a t urn out to be sampled too fast , th ey ca n be decima ted, i .e. , everyk-t h va lue is picked, aft er proper prefiltering (a ntia lias filtering ). This isobtained from menu i tem Preprocess > Resample.

    2

  • 8/13/2019 System Ident

    40/274

    2 The G raphical U ser Interface

    2-12

    You can a lso resample at a fast er sampling rat e by interpolat ion, using thesa me comma nd, and giving a r esampling factor less tha n one.

    Quickstart

    The pop-up m enu it em Preprocess > Quickstartperform s th e followingsequence of actions: It opens the Time plot Da t a view , removes the mea ns fromth e signa ls , and i t spli ts these detrended da ta into tw o halves. The f irst one isma de Working Da ta a nd t he second one becomes Va lidation Da ta . All the three

    created da t a sets are inser ted in to the Da ta B oard .

    Checklist for Data Handling

    Inser t da t a in to the GU I s Da ta Bo ar d .

    P lot t he da t a an d examine it car eful ly .

    Typica lly detrend t he dat a by removing mea n va lues.

    P ossibly pref il ter the da ta to enhan ce an d suppress various frequency bands.

    Select portions of the da ta for E stima tion and for Va lidation. Dra g an d drop

    these dat a sets to the corresponding boxes in the GU I.

    Simulating DataThe GU I is intended prima rily for working wit h real da ta sets , and does noti tself provide functions for s imulat ing synt hetic dat a . Tha t ha s to be done incomma nd mode, a nd y ou ca n u se your favorite procedure in S IMULINK , the

    Sign a l P rocessing Toolbox, or a ny oth er toolbox for simulat ion and t hen insertth e simulat ed da ta into the G U I a s described a bove.

    The Sy stem I dent ifica tion Toolbox a lso ha s several comma nds for simulat ion.You should check i d i nput , i d s i m, po l y 2t h , mo d s t r u c , and ms 2 t h in Cha pter 4,"C omman d Reference, " for deta ils. The follow ing exam ple show s how t heARMAX model

    y (t)-1.5y(t-1 )+ 0 . 7 y (t-2 )= u(t-1 )+ 0 . 5u( t-2 )+ e(t)- e( t-1 )+ 0 . 2e(t-2 )

    is simula t ed wi th a b ina ry ra ndom input u :

    mo de l 1 = p ol y 2t h( [ 1 - 1 . 5 0. 7] , [ 0 1 0 . 5] , [ 1 - 1 0 . 2] ) ;

    u = i d i nput ( 400, r b s , [ 0 0. 3] ) ;

    e = r a n dn( 40 0, 1) ;

    y = i ds i m( [ u e ] , mo de l 1) ;

  • 8/13/2019 System Ident

    41/274

    2-13

    The input, u, and t he output , y , ca n now be imported into the G ra phica l UserInt erface a s dat a , a nd th e various estima tion routines can be a pplied to them.B y a lso importing the simulat ion model , mo del 1, into the G U I, i ts propertiesca n be compar ed to t hose of t he dif ferent est imat ed models .

    To simulat e a cont inuous-time st a te-spa ce model:

    y =C x + e

    wit h t he sa me input, a nd a sam pling int erval of 0.1 seconds, do the fol lowingin th e Syst em Iden tificat ion Toolbox:

    A= [ - 1 1; - 0. 5 0] ; B= [ 1; 0. 5] ; C= [ 1 0] ; D= 0; K= [ 0 . 5 ; 0 . 5] ;

    mo de l 2= ms 2 t h ( mo ds t r u c ( A, B, C, D, K) , ' c ' ) ;

    mo de l 2= s e t t ( mo de l 2, 0 . 1) ;

    y = i ds i m( [ u e ] , mo de l 2) ;

    x Ax Bu Ke+ +=

    2

  • 8/13/2019 System Ident

    42/274

    2 The G raphical U ser Interface

    2-14

    3. Estimating Models

    The BasicsEst imat ing models from da ta is the centra l activi ty in the SystemIdenti f ica tion Toolbox. I t is a lso the one tha t of fers the most va riety ofpossibil i t ies a nd t hus is t he most dema nding one for t he user .

    All estima tion routines a re a ccessed from the pop-up menu Estimatein th e

    identw indow. The models a re a lwa ys es t imated us ing the da ta set tha t i scurrently in the Working Data box.

    One can distinguish betw een tw o dif ferent t ypes of estimat ion met hods:

    Direct estima t ion of th e Impulse or the Frequ ency Response of th e system.

    These methods ar e often a lso cal led nonpar a metric estima tion methods, an d

    do not impose any structure a ssumptions about the system, other th an t ha t

    i t is l inear .

    P ara metric methods. A specif ic model s tructure is a ssumed, and thepara meters in this s tructure are estimat ed using da ta . This opens up a lar ge

    var iety of possibilities, corresponding to different w a ys of describing th e

    system. Dominat ing wa ys a re sta te-space and several varia nts of dif ference

    equation descriptions.

    Direct Estimation of the Impulse Response

    A linear sy stem ca n be described by th e impulse response gt, with t he propertyt h a t

    The na me derives from the fa ct tha t i f the input u(t)is a n impulse, i .e., u(t)=1when t=0 and 0 w hen t>0 then the output y(t)w ill be y(t)=gt. For a

    multiva riable system, t he impulse response gkw il l be a p by m ma trix, wh erep is the num ber of outputs a nd m is the num ber of inputs . I ts i-j element thusdescribed th e behav ior of the i-th out put a fter a n impulse in the j-th in put.

    B y choosing menu i tem Estimate > Correlation Model an d t hen selectingEstimatein the dia log window t ha t opens, impulse response coefficients a reestima ted directly from th e input/output da ta using so cal led correlat ion

    y t( ) gku t k( )k 1=

    =

  • 8/13/2019 System Ident

    43/274

    2-15

    analys is. The a ctua l method is described under t he comma nd c r a in theCommand Refer encechapter . An option tha t d etermines the order of aprewhitening f i l ter ca n a lso be set in t he dialog window. I t is not very sensit ivein most cas es, an d th e default choice is oft en good enough. To obt a in th e defa ultchoice w ithout opening the dia log w indow, you can a lso just t ype the lett er c inthe identw indow. This is the hotkeyfor correlat ion a na lysis.

    The resulting impulse response estima te is pla ced in t he Model B oar d, underthe default na me c r a _ d . (The na me ca n be chan ged by double-clicking on t he

    model icon and then t yping in th e desired na me in t he dialog box tha t opens.)The best w a y to exam ine the result is t o select t he Model View TransientResponse. This gives a g ra ph of the estima t ed response. This view offers achoice betw een displaying the I mpulse or t he S tep response. For amultivar iable system, t he dif ferent channels , i .e. , the responses from a certa ininput to a certa in output, a re selected under menu i t em Channel.

    The num ber of lag s for w hich the impulse response is estima ted, i .e. , the length

    of the estima ted response, is determin ed as one of t he options in th e Tra nsientResponse View .

    Direct Estimation of the Frequency ResponseThe frequency response of a linear sy stem is t he Fourier tra nsform of itsimpulse response. This description of the syst em gives considerab leengineering insight into i ts properties . The relat ion betw een input a nd outputis of ten w rit ten

    y( t)=G(z)u( t)+ v( t)

    where Gis the tra nsfer function a nd vis the a dditive dist urba nce. The function

    a s a function of (a ngu lar) frequency is then t he frequency response orfrequency function. Tis th e sam pling interva l . I f you need more deta i ls on t he

    different int erpreta tions of the frequency response, consult See The SystemIdent ifica tion P roblem on pa ge 3-8.in the Tutor ia lor an y t extbook on l inearsystems.

    The syst ems frequency response is directly est ima ted usin g Spectr al Ana lysisby the menu i tem Estimate > Spectral Model, and then selecting t heEstimatebutt on in th e dialog box tha t opens. The result is pla ced on th e Model

    G e iT( )

    2

  • 8/13/2019 System Ident

    44/274

    2 The G raphical U ser Interface

    2-16

    B oard under the defa ult na me s p a _ d . The best w a y t o exa mine it is t o plot itusing the Model View Frequency Response. This view offers a num ber ofdifferent options on how to gra ph th e curves. The frequ encies for wh ich t oestima te t he response can a lso be selected a s a n option und er the Optionsmenu in this Viewwindow .

    The Spectra l Analysis comma nd a lso estima tes t he spectrum of the a dditivedisturbance v(t) in the system description. This estimated disturbancespectrum is exam ined under th e Model Viewi tem Noise Spectrum.

    The Spectra l Ana lysis estima te is stored in the S ITB s f r e q f unc forma t. I f youneed to furth er work with the estima tes, you can export the m odel to theMATLAB w orkspace and retr ieve the responses by t he comma nd g e t f f . Seef r e q f unc a nd g et f f in Cha pter 4, "C ommand Reference, " for moreinforma tion. (A model is export ed by dra gging a nd dr opping it over th e ToWorkspaceicon.)

    Two options tha t a f fect the spectra l ana lysis estima te can be set in the dialog

    box. The most importa nt choice is a numb er, M, (t he size of the lag w indow)th at af fects t he frequency resolution of th e estima tes. Essential ly, thefrequency resolution is about 2 /M ra dia ns/(sa mpling int erva l). The choice ofM is a t ra de-off betw een frequency resolution a nd va ria nce (fluctua tions). Alarge value of M gives good resolution but f luctua ting a nd less rel iableestima tes. The default choice of M is good for syst ems th a t do not ha ve verysha rp resona nces and ma y ha ve to be adjusted for more resona nt systems.

    The opt ions also offer a choice betw een th e Bla ckma n-Tukey w indow ing

    method s pa (w hich is default) an d a method ba sed on sm oothing direct Fouriertransforms, e t f e . e t f e ha s an a dvanta ge for h ighly resonant sys tems, in tha ti t is more ef ficient for large va lues of M. I t how ever ha s th e draw backs tha t i trequires l inearly spaced frequency va lues, does not estima te th e disturban cespectru m, a nd does not provide confidence int erva ls. The a ctua l methods a redescribed in more deta il in Cha pter 4, "Comma nd Reference," under s pa ande t f e . To obta in th e spectra l an a lysis model for t he current sett ings of theoptions, you can just ty pe t he hotkey s in the identwindow.

  • 8/13/2019 System Ident

    45/274

    2-17

    Estimation of Parametric ModelsThe SI TB support s a w ide ran ge of model str uctures for linear syst ems. Theya re al l a ccessed by t he menu i tem Estimate > Parametric Models...in theidentw indow . This opens up a dia log box Parametric Models, w hichconta ins the ba sic dialog for a l l pa ra metric estima tion as shown on thefollowing page

    Figure 2-3: The Dialog Box for Estimating Parametric Models

    The ba sic function of t his box is a s follows:

    As you select Estimate, a model is estim a ted from th e Working Da t a . Thestr ucture of this m odel is defined by th e pop-up menu Structuretogether wi thth e edit box Orders. I t is given a na me, which is wr it ten in th e edit box Name.

    The GU I w ill alwa ys suggest a default m odel nam e in the Namebox, but youca n change i t to an y str ing before selecting the Estimatebutt on. (If you intendto export the m odel later , a void spaces in the na me.)

    2 Th G hi l U I t f

  • 8/13/2019 System Ident

    46/274

    2 The G raphical U ser Interface

    2-18

    The interpret a t ion of the model stru cture informa tion (typically int egers) inthe Orderbox, depends on t he selected Structure in t he pop-up m enu. Thiscovers, t ypica lly, six choices:

    ARX models

    ARMAX model

    Output -Er ror (OE) models

    B ox-J enkins (B J ) models

    State-space models Model str ucture defined by Initia l Model (U ser defined structur es)

    These are dea lt w ith one by one shortly.

    You ca n fill out t he Order box yourself at an y t ime, but for a ssistan ce you ca nselect Order Editor...This w ill open up an other dia log box, depending on thechosen Structure, in w hich t he desired model order a nd st ructure informa tioncan be ent ered in a s impler fashion.

    You can a lso enter a na me of a MATLAB w orkspa ce var iable in the order editbox. This varia ble should then ha ve a va lue tha t is consistent w ith t henecessary orders for the chosen structur e.

    NOTE:For the sta te-space structure a nd t he ARX structure, severa l orders

    a nd combinat ion of orders ca n be ent ered. Then a ll corresponding m odels w ill

    be compar ed and d isplayed in a special dia log window for you to selectsuit a ble ones. This could be a u seful tool to select good model orders. This

    option is described in more deta il la ter in t his section. When it is a va ilable, a

    button Order selectionis visible.

    Estimation Method

    A common a nd general method of estimat ing the par am eters is the predict ionerr or appr oach, where simply the para meters of the model are chosen so tha tth e difference betw een the models (predicted) out put a nd t he mea sured outputis minimized. This met hod is ava ilable for a ll model struct ures. Except for theARX case, the estima tion involves a n i tera tive, numerical sea rch for t he bestfit.

  • 8/13/2019 System Ident

    47/274

    2-19

    To obta in informa tion from an d intera ct wit h t his search, select Iterationcontrol...This a lso gives access t o a num ber of options th a t govern t he sear chprocess. (See a u x v a r in the Cha pter 4, " Comma nd Reference, " .)

    For some m odel structu res (th e ARX model, an d bla ck-box sta te-space models)methods ba sed on correla tion ar e also ava ilable: Inst rumenta l Variable (IV)a nd S ub-space (N4SID ) meth ods. The choice betw een meth ods is ma de in th eParametric Modelsdia log box.

    Resulting ModelsThe estimat ed model is inserted into the G U Is Model B oard. You ca n t henexamine i ts va rious properties a nd compar e th em w ith other models propertiesusing the Model Viewplots . More about t ha t in Exa mining Models on page2-27.

    To ta ke a look a t t he model it self, double-click on th e models icon (midd le/righ tmouse but ton or a lt- double-click). The Data/Model Infow indow t ha t t henopens gives you informa tion about how the model wa s estimat ed. You ca n t hena lso select Present butt on, w hich wil l l is t th e model , an d i ts para meters withes t imat ed s tanda rd devia t ions in the MATLAB comma nd window .

    If you need to w ork furth er with t he model, you ca n export i t by dra gging an ddropping it over t he To Workspaceicon, an d th en apply any MATLAB a n dtoolbox comma nds t o it. (S ee, in pa rticula r, the comma nds t h2s s , t h2t f ,t h 2pa r , and t hd 2t hc in Cha pter 4, "C omman d Reference," .)

    How to Know Which Structure and Method to UseThere is no simple w a y to find out the best m odel str ucture; in fact, for rea lda ta , there is no such th ing a s a best s t ructure. Some routes to f ind good a nda ccepta ble model a re described in A Sta rtup I denti f ication P rocedure on page1-12in t he introductory chapt er . I t is best t o be generous a t this point . I t of tenta kes just a few seconds to estima te a model, and by t he dif ferent va l ida tiontools described in th e next section, you ca n q uickly find out if t he new model isa ny bett er tha n t he ones you ha d before. There is of ten a s ignifica nt a mount of

    work behind the dat a collection, and spending a few extra minutes tr ying outsevera l different s tructures is usually w orth w hile.

    2 The G raphical U ser Interface

  • 8/13/2019 System Ident

    48/274

    2 The G raphical U ser Interface

    2-20

    ARX ModelsThe Structure

    The most used m odel str ucture is th e simple linear difference equa tion

    w hich relates the current output y(t)to a f inite number of pa st outputs y(t-k)

    an d inputs u(t-k).The str ucture is thus entirely defined by the t hree integers n a , n b ,