ident toolbox matlab

Upload: paolo-rossi

Post on 07-Aug-2018

387 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/20/2019 Ident Toolbox Matlab

    1/368

    Computation

    Visualization

    Programming

    U ser’s G uide

    Lennar t L jung 

    S yst em Ident ifica t ionToolboxFor Use with MATLAB

    ®

    Version 5

  • 8/20/2019 Ident Toolbox Matlab

    2/368

    How to Contact The M athW orks:

    508-647-7000 P hone

    508-647-7001 Fa x

    The Ma thWorks, Inc. Ma il

    3 Apple Hill D rive

    Natick, MA 01760-2098

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

    f t p. ma t hwo r k s . c o m Anonymous FTP server

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

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

    s u g g e s t @ma t h wo r k s . c o m Product enhancement suggestions

    bug s @ma t hwor ks . com B ug reports

    d oc@ma t hwor ks . com Document a tion error reportss u b s c r i b e @ma t h wo r k s . c o m Subscribing user registration

    s e r v i c e @ma t h wo r k s . c o m Order sta tus, license renewa ls, pa sscodes

    i n f o @ma t h wo r k s . c o m Sales, pricing, and general information

    System I denti f icati on Toolbox User’s Guid e 

    © C OP YRIG HT 1988 - 2000 by The Ma th Works, In c.The sof tware d escr ibed in th i s d ocument i s f urn ished und er a l icense agreement . The sof tware may be used

    or cop ied only under the te rms of t he l icense agreement . N o par t of th i s manual may be photocop ied or repro-duced in a ny form w ithout prior wr itten consent from The Mat hWorks, Inc.

    FE D E RAL AC QUIS ITION: This prov is ion appl ie s to a l l acqui si t ions of the Program and D ocumenta t ion byor for the federal government of the U nited Sta tes. By accepting delivery of the Program, t he governmenthereby agrees that this softwa re qualif ies as " commercial" computer softw are w ithin the meaning of FARPa rt 12.212, DFARS Pa rt 227.7202-1, DFARS Pa rt 227.7202-3, DFARS Pa rt 252.227-7013, and DFARS Pa rt252.227-7014. The terms and condi t ions of The MathWorks, Inc . Softwa re License Agreement shal l perta into the government’s use and disclosure of the Program an d Documenta tion, and sha ll supersede anyconf li ct ing con t r ac tua l te rms or cond it ions . I f th i s l icense f a i ls to mee t the government ’s minimum need s oris inconsistent in an y respect w ith federal procurement law , the government a grees to return the P rograman d Documenta tion, unused, to Math Works.

    MATL AB , S imul ink , S t a te f low, Hand le Graph ics , and Rea l -TimeWorkshop are reg is tered t r ad emarks , andTarget La nguage Compiler is a tra demark of The Mat hWorks, Inc.

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

    P rint ing H ist ory: April 1988 First print ingJ uly 1991 Second print ingMa y 1995 Third pr int ingNovember 2000 Fourth printing for Version 5.0 (Release 12)

  • 8/20/2019 Ident Toolbox Matlab

    3/368

    i

    Contents

    Preface

    Using This Guide  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   xi

    Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . .   xii

    Related Products  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  xiii

    About the Author  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  xv

    1

    The System Identification Problem

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

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

    The S igna ls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   1-6

    The B a sic Dyna mic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   1-7

    Varia nt s of Model Descriptions . . . . . . . . . . . . . . . . . . . . . . . . .   1-7How to Int erpret the Noise Source . . . . . . . . . . . . . . . . . . . . . . .   1-8

    Terms to Cha ra cterize th e Model Pr operties . . . . . . . . . . . . . .   1-10

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

    A Startup Identification Procedure . . . . . . . . . . . . . . . . . . . .   1-14

    St ep 1: Looking at th e Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . .   1-14

    St ep 2: G etting a Feel for th e Difficulties . . . . . . . . . . . . . . . .   1-14

    St ep 3: Exa mining t he Difficulties . . . . . . . . . . . . . . . . . . . . . .   1-15

    St ep 4: Fine Tuning Orders and Disturba nce Str uctures . . . .   1-16

    Multiva ria ble Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   1-18

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

  • 8/20/2019 Ident Toolbox Matlab

    4/368

    ii   Contents 

    2

    The Graphical User Interface

    The Model an d Da ta B oards . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

    The Working D a ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-3

    The Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-3

    The Validat ion D a ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-4

    The Work Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-4

    Man a gement Aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4

    Workspa ce Va ria bles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-5

    Help Texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-6

    Handling Data  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-7G ett ing Input-Output Da ta into the GU I . . . . . . . . . . . . . . . . . . 2-8

    Ta king a Look a t t he Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-10

    P reprocessing Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11

    Checklist for Da ta Ha ndling . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13

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

    Estimating Models  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-15

    The B a sics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-15

    Direct Est ima tion of the Im pulse Response . . . . . . . . . . . . . . . 2-15

    Direct E st ima tion of the Frequency Response . . . . . . . . . . . . .  2-16

    Est ima tion of Pa ra metric Models . . . . . . . . . . . . . . . . . . . . . . . 2-17

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

    ARMAX, Output-Er ror a nd B ox-J enkins Models . . . . . . . . . . .  2-23

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

    U ser Defined Model Str uctures . . . . . . . . . . . . . . . . . . . . . . . . .  2-26

    Examining Models  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-28

    View s a nd Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-28

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

    Frequency Response an d Disturba nce Spectra . . . . . . . . . . . .  2-30

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

    P oles a nd Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-31

    Compar e Mea sured a nd Model Output . . . . . . . . . . . . . . . . . . .  2-32

    Residual Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-32

    Text In forma tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-33

    LTI Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-34

    Furt her Analysis in t he MATLAB Workspa ce . . . . . . . . . . . . .  2-34

  • 8/20/2019 Ident Toolbox Matlab

    5/368

    iii

    Some Further GUI Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-35

    Mouse B utt ons an d Hotkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35

    Troubleshooting in P lots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-36

    La yout Questions a nd idprefs.mat . . . . . . . . . . . . . . . . . . . . . .  2-36Cust omized P lots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2-37

    Wha t C an not be Done Using the G UI . . . . . . . . . . . . . . . . . . .  2-37

    3

    Tutorial

    The Toolbox Commands  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-3

    An Introductory Example to Command Mode . . . . . . . . . . . .  3-5

    The System Identification Problem  . . . . . . . . . . . . . . . . . . . . .  3-9

    Impulse Responses, Frequency Functions, an d Spectra . . . . . .  3-9P olynomial Representat ion of Tra nsfer Functions . . . . . . . . .  3-11

    Sta te-Space Representat ion of Tra nsfer Functions . . . . . . . . .  3-13

    Continu ous-Time St a te-Spa ce Models . . . . . . . . . . . . . . . . . . .  3-14

    Est ima ting I mpulse Responses . . . . . . . . . . . . . . . . . . . . . . . . .  3-15

    Estima ting Spectra an d Frequency Functions . . . . . . . . . . . . .  3-15

    Estima ting P ar am etric Models . . . . . . . . . . . . . . . . . . . . . . . . .  3-16

    Subspace Methods for E st imat ing St at e-Space Models . . . . . .  3-17

    Data Representation and Nonparametric

    Model Estimation  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-18

    Da ta Representa tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18

    Correlat ion Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19

    Spectr a l Ana lysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-19

    More on the Da ta Representa t ion in iddata . . . . . . . . . . . . . . . 3-21

    Parametric Model Estimation  . . . . . . . . . . . . . . . . . . . . . . . . .  3-25

    ARX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-26

    AR Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-26

    G eneral P olynomia l B lack-B ox Models . . . . . . . . . . . . . . . . . . .  3-27

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

    Optiona l Va ria bles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-30

  • 8/20/2019 Ident Toolbox Matlab

    6/368

    iv   Contents 

    Defining Model Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-35

    P olynomia l B lack-B ox Models: The idpoly Model . . . . . . . . . .  3-36

    Multivar iable ARX Models: The ida rx Model . . . . . . . . . . . . . .  3-37

    B lack-B ox St a te-Spa ce Models: the idss Model . . . . . . . . . . . .  3-39Str uctured St at e-Space Models w ith F ree Pa ra meters:

    th e idss Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-42

    Sta te-Space Models w ith C oupled P ar am eters:

    th e idgrey Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-44

    Sta te-Space Structures: Init ia l Values a nd Numerical

    Deriva tives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-47

    Examining Models  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-49

    P a ra metric Models: idmodel a nd its children . . . . . . . . . . . . . .  3-49

    Frequency Function Format : the idfrd model . . . . . . . . . . . . .  3-55

    G ra phs of Model Pr operties . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-56

    Tran sforma tions to Other Model Representa t ions . . . . . . . . .  3-59

    Discrete an d Cont inuous Time Models . . . . . . . . . . . . . . . . . . .  3-60

    Model Structure Selection and Validation . . . . . . . . . . . . . .  3-63Compar ing Different St ructures . . . . . . . . . . . . . . . . . . . . . . . .  3-63

    Impulse Response to Determine Dela ys . . . . . . . . . . . . . . . . . . 3-66

    Checking P ole-Zero Ca ncellat ions . . . . . . . . . . . . . . . . . . . . . . .  3-66

    Residual Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-66

    Model Err or Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-67

    Noise-Free Simula tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-68

    Assessing th e Model Un certa inty . . . . . . . . . . . . . . . . . . . . . . . 3-68

    Compar ing Different Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-70

    Select ing Model St ructures for Mult ivariable Systems . . . . . .  3-70

    Dealing with Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-74

    Offset L evels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-74

    Outliers and B ad D ata ; Mult i-Experiment Dat a . . . . . . . . . . .  3-74

    Missing Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-75

    Filtering D a ta : Focus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-75Feedback in Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-76

    Delay s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-77

  • 8/20/2019 Ident Toolbox Matlab

    7/368

    v

    Recursive Parameter Estimation  . . . . . . . . . . . . . . . . . . . . . .  3-78

    The B a sic Algorith m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-78

    Choosing an Adaptat ion Mecha nism an d Ga in . . . . . . . . . . . . 3-79

    Availa ble Algorith ms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-81Segment at ion of Dat a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-83

    Some Special Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-85

    Time Ser ies Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-85

    P eriodic Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-87

    Connections B etw een the Cont rol Syst em Toolbox an d

    th e Syst em Ident ificat ion Toolbox . . . . . . . . . . . . . . . . . . . . . . .  3-87

    Memory - Speed Tra de-Offs . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-89

    Local Minim a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-90

    Init ial P a ra meter Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-90

    Init ial S ta te . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-91

    The Est ima ted P ar am eter Covaria nce Matr ix . . . . . . . . . . . . .  3-92

    No Covaria nce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-92

    nk a nd I nputD elay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-93

    Linea r Regression Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-94Spectrum Normaliza t ion a nd the Sa mpling Interva l . . . . . . .  3-94

    Int erpreta tion of the Loss Function . . . . . . . . . . . . . . . . . . . . .  3-97

    Enumera t ion of Est imat ed Pa ra meters . . . . . . . . . . . . . . . . . . 3-98

    Complex-Valued Da ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-98

    St ra nge Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3-99

    4

    Command Reference

    a ic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-9

    Algorith m P roperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10

    a r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-17

    a rma x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-20

    a rx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-23

    a rxda ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25

    a rxst ruc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-26

    bj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-28

    bode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-31

    compa re . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-34

  • 8/20/2019 Ident Toolbox Matlab

    8/368

    vi   Contents 

    covf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-36

    cra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-37

    c2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-39

    detr end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-40d2c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-41

    Est ima tionInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-43

    etfe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-45

    ffplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-47

    freqr esp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-48

    fpe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-50

    get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-51

    ida rx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-52

    iddat a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-55

    ident . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-61

    idfilt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-62

    idfrd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-64

    idgrey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-70

    idinput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-75

    idmodel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-78idmodred . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-86

    idpoly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-87

    idss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-92

    impulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-98

    init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-101

    iva r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-102

    ivstr uc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-103

    ivx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-105iv4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-106

    LTI comma nds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-107

    merge (iddat a ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-108

    merge (idmodel) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-110

    midprefs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-111

    misda ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-112

    nksh ift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-113noisecnv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-114

    nud erst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-116

    nyq uist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-117

    n4sid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-120

    oe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-123

    pe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-125

  • 8/20/2019 Ident Toolbox Matlab

    9/368

    vii

    pem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-126

    plot (idda ta ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-130

    plot (idmodel) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-131

    polyda ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-133predict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-134

    present . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-136

    pzma p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-137

    ra rma x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-139

    ra rx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-141

    rbj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-145

    resam ple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-147

    resid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-148

    roe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-150

    rpem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-152

    rplr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-154

    segmen t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-155

    selstr uc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-158

    set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-160

    setpn a me . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-161sim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-162

    simsd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-164

    size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-165

    spa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-167

    ss, t f, zpk, frd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-170

    ssda ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-172

    st ep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-174

    st ruc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-177t imesta mp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-178

    tfda ta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-179

    view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-181

    zpkdat a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4-183

  • 8/20/2019 Ident Toolbox Matlab

    10/368

    viii   Contents 

  • 8/20/2019 Ident Toolbox Matlab

    11/368

    Preface

    What Is the System Identification Toolbox? . . . . . . . x

    Using This Guide . . . . . . . . . . . . . . . . . . . xi

    Typographical Conventions  . . . . . . . . . . . . . .xii

    Related Products . . . . . . . . . . . . . . . . . . x ii i

    About the Author . . . . . . . . . . . . . . . . . . .xv

  • 8/20/2019 Ident Toolbox Matlab

    12/368

    Preface

    x

    What Is the System Identification Toolbox?The System Identification Toolbox is for building accurate, simplified

    models of complex systems from noisy time-series data.

    It provides tools for creatin g ma thema tical models of dyna mic syst ems

    ba sed on observed input /output d a ta . The toolbox feat ures a flexible

    g ra p hi ca l u ser i nt er fa ce t ha t a i ds i n t he or ga n i za t i on of d a t a a nd m od el s.

    The identificat ion techniques provided w ith th is toolbox are useful for

    appl ica t ions rang ing f rom cont rol system des ign and s igna l process ing tot ime-series an alysis a nd vibrat ion a na lysis.

  • 8/20/2019 Ident Toolbox Matlab

    13/368

    U sing This G uide

    xi

    Using This GuideSys tem Ident i fi ca t ion is abou t bui ld ing ma themat ica l models of dynamic

    s ys t em s b a sed on m ea s u red d a t a . S om e k now l ed ge a b ou t s uch m od el s i s

    therefore necessa ry for success fu l use of the toolbox .The topic is t rea ted

    in several pla ces in Cha pter 3, “Tutoria l” a nd there is a w ide ran ge of

    textbooks a vaila ble for int roductory a nd in-depth st udies. For basic use

    of the t oolbox, it is s ufficient t o ha ve quite superficial in sights a bout

    dyna mic models. For r eview of basic knowledge, see “How do I getsta rt ed?” on pa ge 1-3.

    If you are a beginner, browse thr ough Chapter 2, “The Graphical User

    Interface” a nd try out a couple of the dat a sets t ha t come with t he

    toolbox . Use the graphica l user in ter f ace (GU I) and check out the bui lt -in

    help functions to understa nd w ha t you a re doing.

  • 8/20/2019 Ident Toolbox Matlab

    14/368

    Preface

    xii

    Typographical ConventionsWe use some or a ll of these conventions in our ma nua ls.

    Item Convention to Use Example

    Exa mple code Monos pa c e  font To a ssign the va lue 5 to A,

    enter

    A = 5

    Function na mes/synt a x Monos pa c e  font The c os  funct ion finds t he

    cosine of each a rra y element .

    Syntax line example is

    MLGe t Va r ML_va r _na me

    Keys   Boldface wi th an ini t ia l

    capital letter

    P ress the Return key.

    Literal strings (in synta x

    descriptions in Reference

    chapters)

    Monospace bol d for

    literals.

    f = f r e q s pa c e ( n, ' whol e' )

    Mathemat ica l

    expressions

    Variables in i ta l i cs 

    Fun ctions, operat ors, a nd

    const a n t s in s t a nda r d t ex t.

    This vector represents the

    polynomial

    p  = x 2 + 2x  + 3

    MATLAB outpu t Monos pa c e font MATLAB responds w ith

    A =

    5

    Menu names, menu items, an d

    controls

    Boldface wi th an ini t ia l

    capital letter

    Ch oose the File menu.

    New terms   I ta l ics  An ar ray  is an orderedcollection of informa tion.

    Str ing variables (from a fi nite

    list)

    Monos pac e i t al i c s  s y s c = d 2c ( s y s d , ' met hod ' )

  • 8/20/2019 Ident Toolbox Matlab

    15/368

    Related Products

    xiii

    Related ProductsThe MathWorks provides severa l products tha t are especia l ly relevant to

    the kinds of ta sks you can perform w ith t he Syst em Identification

    Toolbox. In part icular , the Systems Ident if ica t ion Toolbox r equi r es these

    products:

    • MATLAB ®

    For more informa tion a bout an y of these products, see either:

    • The onl ine documenta t ion for tha t product , i f i t i s ins t a l led or i f you are

    reading t he documentat ion from th e CD

    • The Ma th Works Web site, a t h t t p: //www. ma t hwo r ks . c o m; see the

    “products” section

    Note The products listed below complement the functiona lity of theSystem Identification toolbox.

    Product Description

    Simulink® Interactive, graphical environment for modeling, simulating, and

    prototyping dynamic systems

    Control System Toolbox Tool for modeling, ana lyzing, and designing control systems using

    class ica l and m odern t echniq ues

    Da ta Acquisi t ion Toolbox MATLAB funct ions for d irect access to l ive, measured da t a f rom

    MATLAB

    Fina ncial Time Series

    Toolbox

    Tool for a na lyzing t ime series data in the fi na ncial m ar kets

    F in a ncia l Toolbox MATL AB fun ct ion s for q ua nt it a tive fi n a ncia l m odelin g a nd a na lyt ic

    prototyping

    Fuzzy Logic Toolbox Tool t o help mas ter fuzzy log ic t echniques and the ir appl ica t ion to

    practical control problems

  • 8/20/2019 Ident Toolbox Matlab

    16/368

    Preface

    xiv

    -Analysis and Synthesis

    Toolbox

    Computa t ional a lgorithms for t he structured singular value, µ,appl icab le to robus tness and per formance ana lys is for systems wi th

    modeling a nd par am eter uncertaint ies

    Neura l Network Toolbox Comprehensive environment for neura l network research, design,

    a nd simula tion w ithin MATLAB

    O pt im iz a t ion Tool box Tool f or g ener a l a nd l a rg e-s ca l e opt im iz a t ion of non li nea r pr ob lem s,as well as for l inear programming, qua drat ic program ming,

    nonlinear least squa res, a nd solving nonlinear equat ions

    Robust Control Toolbox Tools for modeling, ana lysis, and design of “ robust ” mult ivar iable

    feedba ck cont rol systems using H ∞ techniques

    Signa l P rocessing

    Toolbox

    Tool for a lgorithm development, signa l an d linear syst em an a lysis,

    a nd time-series da ta modeling

    S t a t is tics Toolbox Tool for a n a ly zin g h is tor ica l da t a , mod elin g s ys tem s, dev elopin g

    sta t ist ical a lgorithms, and learning a nd teaching stat ist ics

    Product Description

  • 8/20/2019 Ident Toolbox Matlab

    17/368

    About the A uthor

    xv

    About the AuthorLenna rt L jung received his P hD in Automat ic Contr ol from Lund

    Ins t itu te of Technology in 1974. S ince 1976 he is Pro fessor of the cha i r of

    Automa t ic Cont rol in Linkoping, Sweden, and is current ly Director of the

    Center for th e “Informa tion S ystems for In dustrial Control and

    S u per vis ion ” (I S I S ). H e ha s hel d v is it ing pos it ions a t S t a n for d a nd M IT

    a nd ha s w r i tt en s ev er a l b ook s on S y st em I d en t if ica t i on a nd E s t im a t ion .

    H e is a n I E E E F ellow , a n I F AC Ad vis or , a m em ber of t h e R oy a l S w ed is h

    Academy of Sciences (KVA) a nd of th e Roya l Sw edish Aca demy of

    En gineering S ciences (IVA), a nd ha s r eceived h onora ry doctora tes from

    the B alt ic Sta te Technical U niversity in S t P etersburg, and from

    Uppsala University .

  • 8/20/2019 Ident Toolbox Matlab

    18/368

    Preface

    xvi

    1

  • 8/20/2019 Ident Toolbox Matlab

    19/368

    1

    The Syst 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-6The Signa ls . . . . . . . . . . . . . . . . . . . . . 1-6

    The Ba sic Dyna mic Model . . . . . . . . . . . . . . . 1-7

    Var iant s of Model Descript ions . . . . . . . . . . . . . 1-7

    How to Int erpret the Noise Source . . . . . . . . . . . . 1-8

    Terms to Cha racterize the Model P ropert ies . . . . . . . 1-10

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

    A Startup Identification Procedure   . . . . . . . . . 1-14Step 1: Looking at the Da ta . . . . . . . . . . . . . . 1-14

    Step 2: G ett ing a Feel for the Diff icult ies . . . . . . . . . 1-14

    Step 3: Exa mining the Diff icult ies . . . . . . . . . . . . 1-15

    Step 4: Fine Tuning Orders an d Disturban ce St ructures . . . 1-16

    Mult ivar iable Systems . . . . . . . . . . . . . . . . 1-18

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

    1

  • 8/20/2019 Ident Toolbox Matlab

    20/368

    1 The System Identification Problem

    1-2

    Basic Questions About System IdentificationW ha t is System Ide ntifica tion?

    System Identif icat ion a llows you t o build ma thema tical models of a dyn am ic

    system based on measured data .

    How is that done?

    Essentially by a djust ing para meters within a given model until i ts output

    coincides as w ell as possible with th e measured output.

    How do you know i f the model is any good?

    A good test is to ta ke a close look a t th e model’s output compar ed to th e

    measured one on a dat a set tha t w asn ’t used for th e f it (“Validat ion D at a”).

    Can the qual i ty of the m odel be tested in other w a ys?

    I t i s a l so v a lu a bl e t o look a t w ha t t he m od el cou ld n ’t r epr od uce i n t he d a t a (“ t heresiduals”). This should not be correlated w ith oth er a vaila ble informa tion,

    such as th e system's input.

    W hat models are most common?

    The t echniq ues a pply t o very general models. Most common models a re

    d if ference equa t ions descr ipt ions , such as ARX and ARMAX models, a s well a s

    a ll types of linear sta te-space models.

    Do you ha ve to a ssume a mod el of a p a rt icular type?

    For paramet r ic models, you have to speci fy the s t ructure. This cou ld be as easy

    a s just selecting a single integer, the model order, or ma y involve severa l

    choices .I f y ou ju st a s s um e t ha t t he s ys t em i s l inea r , y ou ca n d ir ect ly es t im a t e

    its impulse or step response using Correlat ion Analysis or it s frequency

    response using S pectra l Ana lysis. This a llows useful compa risons w ith oth er

    estimated models.

    W ha t does the System Ide ntifica tion Toolbox conta in?

    It conta ins a ll the common techniques to adjust par a meters in a ll kinds of

    linear m odels. It a lso allow s you to exam ine the models’ properties, and t o

    check if they a re a ny good, as w ell as to preprocess a nd polish t he meas ured

    d a t a .

  • 8/20/2019 Ident Toolbox Matlab

    21/368

    Basic Q uestions About System Identification

    1-3

    Isn’t i t a big l imitat ion to work only with l inear models?No, actually not. Many common model nonlinearities are such that themeasured dat a should be nonlinearly t ran sformed (like squa ring a voltage

    in pu t if y ou t h in k t h a t it ’s t h e pow er t h a t is t h e s tim uli). U s e ph ys ica l in sig ht

    a b ou t t he s ys t em y ou a r e m od eli ng a nd t r y ou t s uch t r a nsf or m a t ions on m od els

    tha t a re linear in the new va riables, an d you will cover a lot !

    How do I get star ted?

    If you are a beginner, browse thr ough Chapter 2, “The Graphical UserInterface.” Then t ry out a couple of the dat a sets t ha t come w ith t he toolbox.

    Use the graphica l user in ter face(GU I)a nd check out the bui lt -in help funct ions

    to understa nd wh at you are doing.

    Is this really all there is to System Identification?

    Act ua lly , t h er e is a h ug e a m ou nt w r it t en on t h e s ubject . E xper ien ce w it h r ea l

    d a t a is t h e d riv in g for ce t o u nd er st a n d m or e. I t is im por t a nt t o r em em ber t h a t

    a ny estim a ted model, no ma tt er how good it looks on your screen, ha s onlypicked up a simple reflection of reality . Sur prisingly often, however, th is is

    sufficient for ra tional d ecision ma king.

    1

  • 8/20/2019 Ident Toolbox Matlab

    22/368

    1 The System Identification Problem

    1-4

    Common Terms Used in System IdentificationThis section defines some of th e terms th a t a re frequently used in Sy stem

    Identification:

    • EstimationData is t he da t a set t ha t is used t o fit a m odel t o da t a . I n t he G U I

    this is the same as the Working Data.

    • Validation Data is the dat a set t ha t is used for model valida tion purposes.

    This includes simulat ing th e model for th ese da ta a nd computing t he

    residuals from the model w hen a pplied to th ese da ta .

    • Model Viewsa r e v a r iou s w a y s of i ns pect ing t he pr oper t ies of a m od el . They

    include looking a t zeros an d poles, tra nsient a nd frequency response, an d

    similar things.

    • Data Views a re var ious w a ys of inspecting properties of data sets. A most

    common a nd useful thing is just t o plot th e data a nd scrutinize it .

    So-called out l i ers  could be detected then. These are unreliable

    measurements, perha ps arising from failures in the mea surementequipment. The frequency contents of th e dat a signa ls, in terms of

    periodogram s or spectra l estima tes, is also most r evea ling to study.

    • Model Sets or Model Structures ar e families of models wit h a djustable

    parameters. Parameter Estimation a m ou nt s t o f ind ing t he “ bes t ” v a lu es of

    th ese par a meters. The Syst em Identification problem amounts t o finding

    both a good model structure a nd good numerical va lues of its para meters.

    • Parametric IdentificationMethodsa re techniques to est ima te parametersin given model structures. Ba sica lly it is a ma tt er of finding (by numerical

    sear ch) th ose numerical values of th e pa ra meters th a t give the best

    a greement betw een the model’s (simula ted or predicted) output a nd t he

    meas ured one.

    • Nonparametric Identification Methods ar e techniq ues to estima te model

    behavior without necessarily using a given parametrized model set.

    Typica l nonpar a metric meth ods include Correlation analysis, wh ich

    estima tes a system’s impulse response, an d Spectral analysis, wh ichestima tes a system’s frequency response.

  • 8/20/2019 Ident Toolbox Matlab

    23/368

    C om m on Term s Used in System Identification

    1-5

    • Model Validation is the process of gaining confidence in a model.

    Essent ia lly th is i s achieved by “ twist ing and turning” the model to scru t in ize

    a l l a s pect s of i t. O f pa r t icu la r i mpor t a nce i s t he m od el ’s a b il it y t o r epr od uce

    t h e beh a vior of t h e Va l id a t ion D a t a s et s. Th us it is im por t a nt t o in spect t h e

    properties of th e residuals from t he model when a pplied to the Valida tion

    D a t a .

    1 The System Identification Problem

  • 8/20/2019 Ident Toolbox Matlab

    24/368

    1 The System Identification Problem

    1-6

    Basic Information About Dynamic ModelsSystem Identification is about building Dynamic Models. Some knowledge

    abou t such models i s therefore necessa ry for success fu l use of the toolbox . The

    t opic is t r ea t e d i n s ev er a l pl a ces in Chapter 3, “Tutoria l .” Als o, t h er e is a w id e

    ra nge of textbooks a vaila ble for introductory a nd in-depth stud ies. For ba sic

    use of the t oolbox, it is sufficient to ha ve quite su perficia l insight s a bout

    dyn a mic models. This section describes such a ba sic level of know ledge.

    The SignalsModels describe relationships betw een measur ed signa ls. It is convenient t o

    distinguish between input s igna ls and output signa ls. The outputs a re th en

    par tly determined by the inputs. Think for exam ple of a n a irplane w here the

    input s would be the d if fe rent cont rol surfaces , a i lerons , e leva tors , and the l ike,

    w hile the output s would be the airpla ne’s orient a tion an d position. In most

    ca s es , t he ou t pu t s a r e a l so a f fect ed b y m or e s ig na ls t ha n t he m ea s u red i npu t s.

    In t he airpla ne exam ple it w ould be w ind gusts a nd tur bulence effects. Such‘‘unmeasured inputs ’’ wi l l be ca l led disturbance s igna ls or noise. I f w e d en ot e

    input s , ou tpu t s , and d is turbances by u, y, a n d e, respect ively , the rela t ionship

    can be depicted in th e follow ing figure.

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

    All t h es e s ig na ls a r e fu nct ion s of t im e, a n d t h e v a lu e of t h e in pu t a t t im e t will

    be denoted by u(t) . Often, in the ident i f ica t ion context , only discrete-t ime pointsare considered , s ince the measurement equipment typica l ly records the signa ls

    just at discrete-time instants, often equally spread in time with a sampling

    interval of T  t ime units . The modeling problem is th en t o describe how t he

    three signals relate to each other.

    B i I f ti A b tD i M d l

  • 8/20/2019 Ident Toolbox Matlab

    25/368

    Basic Inform ation A bout D ynam ic M odels

    1-7

    The Basic Dynamic ModelThe bas ic rela t ionship is the linear differenceequation. An exa m pl e of s ucha n equa tion is the follow ing one.

    S u ch a r el a t ions hi p t ell s u s, f or exa m pl e, how t o com pu t e t he ou t pu t y(t) if t he

    input is known a nd th e disturba nce can be ignored:

    Th e ou tpu t a t t im e t is t h us com pu ted a s a lin ea r com bin a t ion of pa s t ou tpu ts

    an d past inputs. I t follows, for example, tha t t he output a t t ime t  depends on

    the input signa l at man y previous t ime insta nts. This is wha t t he word

    dynamic refers to. The ident i fi ca t ion prob lem is then to use measurements of

    u  a nd y  to figure out:

    • The coefficients in this equation (i.e., -1.5, 0.7, etc.).

    • How m a ny dela yed outputs t o use in th e description (tw o in th e exam ple:

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

    • The timedelay in t he syst em is (2T in t he ex a m ple: y ou s ee f rom t he s econd

    equat ion tha t i t t akes 2T  t ime units before a chang e in u  w ill affect y ).

    • How ma ny delay ed inputs to use (tw o in the example: u(t-2T)  a nd u(t-3T) ).

    The number of delayed inputs a nd outputs a re usua lly referred to a s the

    model order(s).

    Variants of Model DescriptionsThe model g iven above is ca l led an ARXmodel. Th er e a r e a h a n dfu l o f va r ia n t s

    of th is model known a s Output-Error (OE) models, ARMAX models, FIR

    models, an d Box-J enkins (B J ) models. These ar e described lat er on in t he

    m a n ua l . At a ba s ic level it is s ufficien t t o t h in k of t h em a s v a ria n t s of t h e AR X

    model a llow ing a lso a chara cterization of the properties of the distur ban ces e .

    Linear state-spacemodels a r e a l so ea s y t o w or k w i t h. The es sen t ia l s t ru ct u rev a r ia b le i s ju st a s ca l a r : t he m od el or der . Th is g iv es ju st one k nob t o t u rn w hen

    sear ching for a suita ble model description. See below.

    General linear models can be described symbolically by

    y= G u + H e 

    y t ( ) 1.5 y t T –( )– 0.7 y t  2T –( )+ 0.9u t  2T –( ) 0.5u t  3T –( )+=   ARX ( )

    y t ( ) 1.5 y t T –( ) 0.7 y t  2T –( )– 0.9u t  2T –( ) 0.5u t  3T –( )+ +=

    1 The System Identification Problem

  • 8/20/2019 Ident Toolbox Matlab

    26/368

    1 y

    1-8

    wh ich say s tha t th e measured output y(t)  is a sum of one contribution th a t

    comes f rom the measured input u(t) a nd one con t r ib ut ion t ha t com es f rom t he

    noise H e . The symbol G  then denotes th e dyna mic properties of the syst em,

    t h a t is , h ow t h e ou tpu t is for med fr om t h e in pu t. F or lin ea r s ys tem s it is ca lled

    t he transfer function f rom input to ou tpu t . The symbol H r ef er s t o t he nois eproperties, an d is called the disturbance model. It describes how t hedisturba nces a t th e output a re formed from some sta nda rdized noise source

    e(t) .

    State-space models a re common r epresenta tions of dyna mical models. Theydescr ibe the same type of l inea r d if ference rela t ionship between the input s and

    the outputs as in the ARX model, but they a re rearra nged so that only one

    delay is used in t he expressions. To achieve th is, some extra var iables, the

    state variables, ar e introduced. They a re not mea sured, but can be

    reconstructed from t he mea sured input-output da ta . This is especially useful

    when there are several output signals, i.e., when y(t)  is a vector. Cha pter 3,

    “Tutorial”, gives more deta ils about t his. For ba sic use of th e toolbox it is

    sufficient t o know th at the order of the sta te-space model relates t o thenumber of delay ed inputs an d outputs used in the corresponding linear

    difference equation. The state-space representation 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 t he vector of sta te va ria bles. The model order is the d imension of

    th is vector . The mat r ix K determines the d is turbance proper t ies . Not ice tha t i f

    K = 0 , th en th e noise source e(t )  a ffects only th e output, a nd no specific modelof the noise properties is built . This corresponds t o H = 1  in the general

    d es cr ipt ion a b ov e, a nd i s u su a lly r ef er r ed t o a s a n Out put-Er ror model . Not ice

    a lso tha t D = 0 mean s th a t t here is no direct influence from u(t)  t o y(t) . Thu s

    t h e effect of t h e in pu t on t h e ou tpu t a l l pa s ses v ia x(t) a n d w i ll t h us be d ela y ed

    a t lea s t one s a m ple. The f ir st v a lu e of t he s t a t e v a r ia b le v ect or x(0) reflects the

    initia l conditions for the syst em at th e beginning of the da ta record. When

    dea l ing wi th models in s t a t e-space form, a t ypica l opt ion is whether to est ima te

    D , K , and x(0) or to let them be zero.

    How to Interpret the Noise SourceI n m a ny ca s es of s ys t em i den t if ica t i on , t he ef fect s of t he noi se on t he ou t pu t a r e

    insignificant compared to those of the input. With good signal-to-noise ratios

    (SNR ), it is less import an t t o have a n a ccura te distur ban ce model.

    Basic Inform ation A boutD ynam ic M odels

  • 8/20/2019 Ident Toolbox Matlab

    27/368

    Basic Inform ation A bout D ynam ic M odels

    1-9

    Nev er t hel es s i t is i mpor t a n t t o u nd er s ta nd t he r ole of t he d is t ur ba nces a nd t he

    noise source e(t ) , wh ether it a ppea rs in t he ARX model or in t he general

    descriptions given above.

    There ar e three aspects of the distur ban ces tha t sh ould be stressed:

    • Un derstanding w hite noise

    • Int erpreting th e noise source

    • U sing th e noise source w hen w orking with t he model

    These a spects a re discussed one by one.

    How can w e understa nd w hite noise? From a forma l point of view, th e noise

    source e w i ll nor m a lly be r eg a r ded a s whi te noise . Th is m ea n s t h a t it is en t ir ely

    unpredicta ble. In other w ords, it is impossible to guess the va lue of e(t )  n o

    ma tter how a ccurat ely we ha ve measured past dat a up to t ime t -1.

    How can we interpret the noise source? The ac tua l d is tu rbance cont r ibut ion to

    the output, H e , ha s real significance. It cont a ins a ll the influences on th emeasured y , known an d unknown, tha t a re not conta ined in the input u . I t

    expla in s a n d ca pt ur es t h e fa ct t h a t ev en if a n exper im en t is r epea t ed w i th t h e

    same input, the output signal will typically be somewhat different. However,

    the noise source e  need not ha ve a physica l significa nce. In t he airpla ne

    example mentioned earlier, the disturba nce effects are w ind gusts a nd

    turbu lence . Descr ibing these as a r i s ing f rom a whi te noise source v ia a t rans fer

    function H , is just a convenient w a y of capturing t heir cha ra cter.

    How ca n w e dea l wit h th e noise source w hen using t he model? If the model isu sed ju st f or s im ul a t ion , i. e. , t he r es pons es t o v a r iou s inpu t s a r e t o b e s t ud ied ,

    then the d is turbance model plays no immedia te role. S ince the noise source e(t ) 

    for new dat a will be unknown, it is ta ken as zero in th e simulat ions, so as to

    study th e effect of th e input a lone (a noise-free simulat ion). Making a nother

    simula t ion with e being a rb it r a ry whi te noise wi ll revea l how rel iab le the resu lt

    of th e simulation is, but it w ill not give a more accurat e simulat ion result for

    t h e a ct ua l s ys tem ’s r es pon se. I t is a d iffer en t t h in g w h en t h e m od el is u sed for

    prediction: P redicting fut ure outputs from inputs a nd previously mea suredou tpu t s , means tha t a l so fu ture d is turbance cont r ibut ions have to be pred icted.

    A known, or estima ted, correlation str ucture (w hich really is the distur ban ce

    model) for the d isturba nces, will a llow predictions of future dist urba nces,

    based on th e previously mea sured values.

    1 The System Identification Problem

  • 8/20/2019 Ident Toolbox Matlab

    28/368

    1-10

    The need a nd us e of th e noise model ca n be summ a rized a s follows:

    • I t is , in m os t ca s es , r eq uir ed t o obt a in a bet t er es tim a t e for t h e d yn a m ics , G .

    • It indica tes how reliable noise-free simulations a re.

    • It is required for reliable predictions a nd st ocha stic control design.

    Terms to Characterize the Model PropertiesThe proper t ies of an input -ou tpu t rela t ionship l ike the ARX model fol low from

    the numer ica l va lues of the coef ficient s , and the number of delays used. This i show e ver a f a ir ly im pl ici t w a y of t a l king a b ou t t he m od el pr oper t ies . I nst ea d a

    number of different t erms a re used in practice:

    Impulse Response

    The impulse response of a dyna mical model is the output sign a l tha t r esults

    w hen th e input is an impulse, i.e., u(t)  is zero for all values of t  except t=0 ,

    where u(0)= 1. I t can be computed as in the equa t ion fol lowing (ARX), by let t ing

    t  be equa l to 0, 1, 2, .. . an d ta king y(-T )=y(-2T)= 0 an d u(0)= 1.

    Step Response

    The step response is th e output signa l tha t r esults from a step input, i.e., u(t) 

    is zero for n egat ive values of t  a nd equa l to one for positive values of t . The

    impulse and step responses t ogeth er a re called th e model’s transient

    response.

    Frequency Response

    The frequency response of a linear dyna mic model describes how the m odel

    rea cts t o sinusoidal inputs. If w e let t he input u(t) be a sinusoid of a cert a in

    frequency, then th e output y(t) w ill also be a sinusoid of this frequency. The

    a m pl it u de a nd t he pha s e (r el a t iv e t o t he inpu t ) w il l how e ver b e d if fer en t . Th is

    frequency response is most often depicted by tw o plots; one tha t sh ows t he

    a m pl it u de cha ng e a s a f unct ion of t he s inus oi d’s f req u ency a nd one t ha t s how s

    th e phase shift a s function of frequency. This is known a s a B ode plot.

    Basic Inform ation A bout D ynam ic M odels

  • 8/20/2019 Ident Toolbox Matlab

    29/368

    1-11

    Zeros and Poles

    The z er os a nd t he pol es a r e eq u iv a len t w a y s of d es cr ib ing t he coef fi cien t s of a

    linear difference equation like the ARX model. The poles relate to the

    “output-side” an d t he zeros relat e to th e “input-side” of th is equa tion. The

    number of poles (zeros) is equa l to th e number of sam pling interva ls betw een

    th e most a nd least delayed output (input). In t he ARX exam ple in th e

    beginning of this section, there a re consequent ly tw o poles an d one zero.

    1 The System Identification Problem

  • 8/20/2019 Ident Toolbox Matlab

    30/368

    1-12

    The Basic Steps of System IdentificationThe S y st em I d en t if ica t i on pr ob lem is t o es t im a t e a m od el of a s ys t em b a sed on

    ob ser ved inpu t -ou t pu t d a t a . S ev er a l w a y s t o d es cr ib e a s ys t em a nd t o es t im a t e

    such descr ipt ions exist . This sect ion gives a brief account of the most importan t

    approaches.

    The procedure to determine a model of a dyna mical syst em from observed

    input-output da ta involves three basic ingredient s:

    • The input-output data

    • A set of cand idat e models (th e model structure)

    • A criterion t o select a part icular model in th e set, based on th e informa tion

    in the data (the identification method)

    The identification process a mounts to repeatedly selecting a model structure,

    computing t he best model in the str ucture, and eva luat ing th is model’s

    properties to see if th ey a re sa tisfa ctory. The cycle ca n be itemized a s follows:

    1 Design a n experiment an d collect input-output da ta from th e process t o be

    identified.

    2 Exam ine the dat a . P olish it so as to remove trends an d outliers, and select

    useful portions of the origina l dat a . Possibly apply filtering t o enha nce

    important frequency ra nges.

    3 S el ect a nd d ef ine a m od el s t ru ct u re (a s et of ca nd id a t e s ys t em d es cr ipt ions )w ithin w hich a model is to be found.

    4 Compute the best m odel in th e model structur e according to the

    input-output da ta a nd a given criterion of fit .

    5 Exa mine t he obtain ed model’s properties

    6 If t he model is good enough, th en stop; otherw ise go ba ck to St ep 3 to tr y

    a nother model set. Possibly also try other estima tion methods (St ep 4) or

    w ork further on th e input-output da ta (St eps 1 a nd 2).

    The System Identification Toolbox offers several functions for each of these

    steps.

    The Basic Steps of System Identification

  • 8/20/2019 Ident Toolbox Matlab

    31/368

    1-13

    For St ep 2 there are routines to plot da ta , filter da ta , and r emove trends in

    dat a , a s well as to resample an d reconstruct missing data .

    For S tep 3 the Sys tem Ident i fi ca t ion Toolbox of fers a va r iet y of nonparamet r ic

    models, a s well a s a l l the most common black-box input -ou tpu t and s t a t e-space

    str uctures, and a lso genera l ta ilor-ma de linea r sta te-space models in discrete

    a nd cont inuous time.

    For S tep 4 genera l pred ict ion error (maximum likel ihood) methods , a s well a s

    instr umenta l varia ble meth ods and sub-space methods are offered for

    parametric models, while basic correlation and spectral analysis methods areused for nonpar a metric model structures.

    To exam ine models in St ep 5, ma ny fun ctions a llow th e computa tion a nd

    pr es en t a t ion of f req u ency f unct ions a nd pol es a nd z er os , a s w e ll a s s im u la t i on

    a nd prediction using th e model. Functions a re a lso included for

    tra nsforma tions betw een continuous-time a nd discrete-time model

    descr ip t ions and to forma t s tha t a re used in other MATLAB toolboxes , l ike the

    Control System Toolbox and the Signal Processing Toolbox.

    1 The System Identification Problem

  • 8/20/2019 Ident Toolbox Matlab

    32/368

    1-14

    A Startup Identification ProcedureThere a re no sta nda rd a nd secure routes t o good models in Syst em

    Ident i fi ca t ion . G iven the number of possibi li t ies , i t i s easy to get confused abou t

    w ha t t o d o, w ha t m od el s t ru ct u res t o t es t , a nd s o on . This s ect ion d es cr ib es one

    route tha t often works well, but there ar e no gua ra nt ees. The steps refer to

    f unct ions w i t h in t he G U I , b ut y ou ca n a l so g o t hr ou gh t hem in com m a nd m od e.

    For th e basic comman ds, see Cha pter 4, “Comma nd Reference.”

    Step 1: Looking at the DataP lot t he dat a . L ook at them carefully. Try t o see the dyna mics w ith your own

    eyes. Can you see th e effects in t he outputs of the chan ges in the input? Ca n

    you see nonlinear effects, like different responses at different levels, or

    d if fer en t r es ponses t o a s t ep u p a nd a s t ep d ow n? Ar e t her e por t ions of t he d a t a

    th a t a ppea r to be “messy” or carry n o informat ion. U se this insight t o select

    portions of th e dat a for estima tion an d valida tion purposes.

    Do physical levels play a role in your model? If not, detrend t he da ta by

    removing thei r mean va lues . The models wi ll then descr ibe how changes in the

    input give cha nges in output, but not expla in th e actua l levels of the signa ls.

    This is the norma l situa tion.

    The d ef a ul t s it u a t ion , w i t h g ood d a t a , is t ha t y ou d et r end b y r em ov ing m ea ns ,

    a nd t hen select t he first ha lf or so of the da ta record for estima tion purposes,

    an d use the remaining dat a for va lidat ion. This is wha t ha ppens when you

    apply Quickstart und er t he pop-up menu Preprocess in the main identwindow.

    Step 2: Getting a Feel for the DifficultiesApply Quickstart und er pop-up men u Estimate in the main ident w indow.

    This w ill compute and display t he spectra l an alysis est imat e and the

    cor r ela t i on a na l ys is es t im a t e, a s w e ll a s a f ou rt h or d er AR X m od el w i t h a d ela y

    es t im a t ed f rom t he cor r ela t i on a na l y sis a nd a d ef a ul t or d er s t a t e-s pa ce m od el

    computed by n4s i d . Th is g iv es t h r ee plot s . L ook a t t he a g r eem ent b et w een t he:

    • Spectra l Ana lysis estima te a nd t he ARX an d sta te-space models’ frequency

    functions

    • Correlat ion Ana lysis estimat e and t he ARX and st a te-space models’

    tra nsient responses

    A Startup Identification Procedure

  • 8/20/2019 Ident Toolbox Matlab

    33/368

    1-15

    • Measured Validation Data output and the ARX and state-space models’

    simulated outputs

    If th ese agreements a re reasona ble, the problem is not so difficult , a nd a

    relatively simple linear model will do a good job. Some fine tuning of model

    orders, and n oise models ha ve to be ma de an d you ca n proceed to Step 4.

    Otherw ise go to St ep 3.

    Step 3: Examining the DifficultiesTher e m a y b e s ev er a l r ea s ons w hy t he com pa r is ons in S t ep 2 d id not look g ood .

    This section discusses the most common ones, a nd h ow t hey can be ha ndled.

    Model Unstable

    The ARX or sta te-space model ma y t urn out to be unst a ble, but could st ill be

    useful for cont rol purposes . Change to a 5- or 10-s tep ahead pred ict ion instead

    of simulat ion in th e Model Output View.

    Feedba ck in Da ta

    If t here is feedba ck from the output t o the input, due to some regulat or, then

    the spect ra l and correla t ions ana lys is es t ima tes a re not rel iab le. D iscrepancies

    between these es t ima tes and the ARX and s t a te-space models can therefore be

    disregar ded in th is case. In t he Model Residuals View of the par am etric

    models, feedback in da ta ca n a lso be visible as correla tion between residua ls

    an d input for negat ive lags.

    Disturba nce M odel

    If t he sta te-space model is clearly bett er th a n t he ARX model at reproducing

    the measured output , this is a n indicat ion t ha t t he disturbances ha ve a

    substa nt ial influence, an d it w ill be necessar y to model them car efully.

    M o d e l O r d e r

    If a fourt h order model does not give a good Model Output plot, tr y eighth

    order. If the fit clea rly improves, it follow s th a t h igher order models will be

    required, but t ha t linea r models could be sufficient.

    Ad ditional Inputs

    I f t h e Model Output f it ha s not s ig ni fica n t ly i mpr ov ed b y t he t es t s s o f a r , t h ink

    over t he physics of th e applica tion. Are th ere more signa ls th a t h a ve been, or

    1 The System Identification Problem

  • 8/20/2019 Ident Toolbox Matlab

    34/368

    1-16

    cou ld be, measured tha t might in fluence the ou tpu t? I f so, include these among

    th e inputs an d try a ga in a fourth order ARX model from a ll the inputs. (Notetha t t he inputs need not a t a ll be control signals, anyt hing measura ble,

    including distur ban ces, should be treat ed as inputs).

    N onlinea r Effects

    I f t he f it b et w e en m ea s u red a nd m od el ou t pu t i s s t il l b a d, cons id er t he phy si cs

    of t he a p pli ca t i on . Ar e t her e non li nea r ef fect s i n t he s ys t em ? I n t ha t ca s e, f or m

    the nonlinearit ies from the measured dat a a nd a dd those tra nsformed

    m ea s ur em ent s a s ex tr a inpu t s. Th is cou ld b e a s s im pl e a s f or m ing t he pr od uct

    of volta ge and current m easur ements, if you realize tha t it is the electr ica l

    pow er t h a t is t h e d rivin g s tim ulu s in , s a y, a h ea t in g pr oces s, a n d t em per a t ur e

    is th e output. This is of course a pplica tion dependent. It does not ta ke very

    much work, however, to form a number of a dditional inputs by rea sonable

    nonlinear t ra nsforma tions of the measur ed ones, an d just t est if inclusion of

    th em improves the fit .

    Still Proble m s?

    I f n on e of t h es e t es ts lea d s t o a m od el t h a t is a b le t o r epr od uce t h e Va lid a tion

    Da ta reas onably w ell, the conclusion might be tha t a sufficiently good model

    ca n n ot be pr od uced fr om t h e d a t a . Th er e m a y be m a n y r ea s on s for t h is . I t m a y

    b e t ha t t he s ys t em ha s s om e q u it e com pli ca t e d non li nea r i ti es , w h i ch ca nnot b e

    rea l ized on physica l grounds. In such cases , nonlinear , b lack-box models could

    b e a s olu t ion . Am ong t he m os t u sed m od el s of t h is cha r a ct er a r e t he Ar t if icia l

    Neural Networks (ANN).

    Another importa nt reason is tha t the da ta simply do not conta in sufficient

    information, e.g., due to bad signal to noise ratios, large and nonstationary

    disturba nces, va rying sys tem properties, etc.

    Otherw ise, use the insight s of w hich inputs to use and w hich model orders to

    expect a nd pr oceed to S tep 4.

    Step 4: Fine Tuning Orders and DisturbanceStructuresFor real da ta th ere is no such th ing a s a “correct model structure.” However,

    d if ferent s t ructures can g ive qu it e d if fe rent model qua l it y . The only wa y to f ind

    th is out is to try out a n umber of different str uctures and compa re the

    A Startup Identification Procedure

  • 8/20/2019 Ident Toolbox Matlab

    35/368

    1-17

    properties of the obtain ed models. There a re a few t hings to look for in th ese

    comparisons.

    Fit Between Simulated a nd M ea sured O utput

    Keep th e Model Output View open a nd look a t t he fit betw een t he model’s

    s im ul a t ed ou t pu t a nd t he m ea s u red one f or t he Va l id a t ion D a t a . F or m a ll y, y ou

    could pick tha t m odel, for w hich this n umber is th e highest. In practice, it is

    b et t er t o b e m or e pr a g ma t i c, a nd a l so t a k e in t o a ccou n t t he m od el com pl ex it y ,

    an d w hether the importa nt feat ures of the output response ar e captured.

    Residual Analysis Test

    You should requ ire of a good model tha t the cross correla t ion funct ion between

    residuals a nd input does not go significa nt ly outside the confidence region.

    Otherwise there is something in th e residuals th at originate from the input ,

    a nd ha s not been properly ta ken ca re of by the model. A clear pea k at lag k 

    s how s t ha t t he ef fect f rom inpu t u(t-k) on y(t) i s not correct ly descr ibed . A ru le

    of th umb is tha t a slow ly vary ing cross correlation function outside the

    conf idence reg ion is an indica t ion of too few poles , whi le sha rper peaks indica te

    too few zeros or w rong delays.

    Pole Zero Cancellat ions

    If th e pole-zero plot (including confiden ce interva ls) indicat es pole-zero

    cancellat ions in th e dyna mics, this suggest s tha t lower order models ca n be

    used. In par ticular, if it tur ns out th a t t he orders of ARX models ha ve to be

    incr ea s ed t o g et a g ood f it , b ut t ha t pole-z er o ca ncel la t i ons a r e ind ica t e d, t henthe ext ra poles a re jus t in t roduced to descr ibe the noise . Then t ry ARMAX, OE,

    or B J model structures with a n A or F polynomial of an order equa l to tha t of

    the number of noncanceled poles.

    W ha t M ode l Structures Should be Tested?

    Well, you ca n spend a ny a mount of time t o check out a very la rge num ber of

    str uctures. It often ta kes just a few seconds to compute a nd evalua te a m odel

    in a certain st ructure, so tha t you should have a generous a t t i tude to thetesting . However, experience shows t ha t w hen th e basic properties of th e

    syst em’s beha vior h a ve been picked up, it is not m uch use to fine tune orders

    in a bsurdum just t o press th e fit by fra ctions of percents.

    ManyARX models: Th er e is a v er y ch ea p w a y of t es tin g m a n y AR X s tr uct ur es

    simultaneously. Enter in th e Orders text field man y combina tions of orders,

    1 The System Identification Problem

  • 8/20/2019 Ident Toolbox Matlab

    36/368

    1-18

    u si ng t he col on (“ :” ) not a t i on . You ca n a l so pr es s t he Order Selection button.

    When you select Estimate, models for a ll combinat ions (easily severa lhund reds) a re computed a nd t heir (prediction error) fit to Validat ion D a ta is

    s how n i n a s pecia l pl ot . B y cli ck ing in t h is plot t he b es t m od els w i t h a ny chos en

    nu mb er of pa r a m et er s w i ll be i ns er t ed in t o t he M od el B o a r d, a nd ev a lu a t ed a s

    desired.

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

    sta t e-space models , est imated using n4s i d . When a g ood or d er ha s b een f ou nd,

    tr y the P EM estima tion method, which often improves on th e accura cy.

    ARMAX, OE , and BJ models: Once you have a feel for suita ble delay s a nd

    d yna m ics or der s , i f i s of ten u sef ul t o t r y ou t AR MAX, O E , a nd /or B J w i t h t hes e

    orders and test some dif ferent orders for the d is turbance t rans fer funct ions (C

    a nd D ). Especially for poorly damped syst ems, the OE st ructure is suita ble.

    There is a quite extensive literat ure on order a nd st ructure selection, a nd

    a nyone w ho would like to know more should consult th e references.

    Multivariable SystemsSystems w ith ma ny input signa ls an d/or ma ny output signals a re called

    mul t i va r iab le . Such systems are of t en more cha l leng ing to model . In par t icu la r

    syst ems w ith severa l outputs could be difficult . A basic reason for th e

    difficulties is tha t t he couplings between several inputs a nd outputs lead t o

    more complex models . The structures involved are r icher and more parameters

    w ill be required to obtain a good fit .

    Avai lab le Models

    The Syst em Identification Toolbox as w ell a s the G U I ha ndle general, linear

    mult ivar iable models . All ear l ier ment ioned models are supported in the single

    output , mult iple input case. For mult ip le outputs , ARX models and sta te-space

    models a re covered. Mult i-output ARMAX a nd OE models a re covered via

    sta t e-space representa t ions: ARMAX corresponds to est imat ing the K-mat r ix,

    w h i le O E cor r es pond s t o f ix ing K t o z er o. (Thes e a r e pop-u p opt ions in t he G U I

    model order editor.)

    G enerally speaking, it is preferable to work with sta te-space models in the

    mult iva r iab le case , s ince the model s t ructure complex it y i s eas ier to dea l wi th .

    It is essent ially just a ma tt er of choosing th e model order.

    A Startup Identification Procedure

  • 8/20/2019 Ident Toolbox Matlab

    37/368

    1-19

    W ork ing w ith Subsets of the Input-O utput Cha nnels

    I n t he pr oces s of id en t if ying g ood m od el s of a s ys t em , it is of t en u sef ul t o s el ect

    subsets of the input a nd output chan nels. Pa rtia l models of the system’s

    behavior w ill then be constructed. It might not, for exam ple, be clear if a ll

    meas ured inputs ha ve a significa nt influence on t he outputs . Tha t is most

    ea s il y t es t ed by r em ov ing a n i npu t cha nnel f rom t he d a t a , b ui ld ing a m od el f or

    how t he output(s) depends on th e remain ing input cha nnels, a nd checking if

    th ere is a significa nt d eteriora tion in the model output’s fit to the measur ed

    one. See also th e discussion under S tep 3 a bove.

    Generally speaking, the fit gets better when more inputs are included and

    often gets w orse when more outputs a re included. To understa nd t he lat ter

    f a ct , y ou s hou ld r ea l iz e t ha t a m od el t ha t ha s t o expla i n t he b eha v ior of s ev er a l

    ou tpu ts h a s a t ou gh er job t h a n on e t h a t ju st m us t a ccou nt for a s in gle ou tpu t.

    If y ou ha ve difficulties obtainin g good models for a multi-output syst em, it

    m ig ht be w is e t o m od el on e ou tpu t a t a t im e, t o fin d ou t w h ich a r e t h e d ifficu lt

    ones to ha ndle.

    M od el s t ha t a r e ju st t o b e u sed f or s im ul a t ions cou ld v er y w e ll b e b uil t u p f rom

    sing le-ou tpu t models, for one ou tpu t a t a t ime. However, models for pred ict ion

    a nd con t r ol w i ll b e a b le t o pr od uce b et t er r es ul ts if cons t ru ct ed f or a l l ou t pu t s

    s im ul ta neou sly . Th is f oll ow s f rom t he f a ct t ha t k now i ng t he s et of a l l pr ev iou s

    ou t pu t cha nnels g iv es a b et t er b a sis f or pr ed ict ion , t ha n ju st k now i ng t he pa s t

    outputs in one cha nnel. Also, for sy stems, w here th e different outputs r eflect

    similar dynamics, using several outputs simultaneously will help estimating

    the dyna mics.

    Some Practica l Ad vice

    B o th t he G U I a nd com m a nd l ine oper a t ion w i ll d o u sef ul b ook keepi ng f or y ou ,

    ha ndling different cha nnels. You could follow th e steps of this a genda :

    • Import da ta an d create a da ta set with a ll input and output channels of

    interest. D o the necessar y preprocessing of this set in terms of detrending,

    etc. , and th en select a Validat ion Da ta set with all cha nnels.

    • Then s el ect a Wor ki ng D a t a s et w i t h a l l cha nnel s, a nd es t im a t e s t a t e-s pa ce

    models of d i fferent orders using n4s i d f or t hes e d a t a . E x a m ine t he r es ul ti ng

    model primar ily using the Model Output view .

    • If it is difficult t o get a good fit in a ll output chann els or you w ould like to

    investigate how important the different input channels are, construct new 

    1 The System Identification Problem

  • 8/20/2019 Ident Toolbox Matlab

    38/368

    1-20

    da t a set s us ing subset s of the or ig ina l inpu t/ou tpu t channels . Use the pop-up

    menu Preprocess > Select Channels for th is. Don’t cha nge th e Va lidat ionDa ta . The G U I w ill keep tra ck of the input a nd output cha nnels. I t w ill “do

    the right thing” w hen evaluat ing th e cha nnel-restricted models using the

    Validat ion Da ta . It might also be a ppropriat e to see if improvements in t he

    fit a re obta ined for va rious model types, built for one output a t a time.

    • If y ou decide for a multi-output model, it is often ea siest t o use sta te-space

    models . Use n4s i d a s a pr im ar y t ool a nd t ry out pe m w h en a g ood or der h a s

    been found.

    Reading M ore About System Identification

  • 8/20/2019 Ident Toolbox Matlab

    39/368

    1-21

    Reading More About System Identification

    There is substa nt ial litera tur e on S ystem I dentifica tion. The follow ing

    textbook deals w ith ident ifica tion methods from a simila r perspective a s th is

    toolbox, a nd also describes m ethods for phy sica l modeling:

    • Ljung L. and T. Gla d. M odeli ng of Dynam ic Systems, P rentice Hall ,

    En glewood C liffs, N.J . 1994.

    For more deta ils about the a lgorith ms a nd th eories of identificat ion:

    • Ljung L. System I dent if icati on - Th eory for t he U ser , Pr entice Ha ll, U pper

    Sa ddle River, N.J . 2nd edition, 1999.

    • Söderström T. an d P . Stoica . System I dent if icati on , Pr entice Hall

    Int erna tiona l, London. 1989.

    For more about system an d signals:

    • Oppenheim J . a nd A.S. Willsky. Si gnal s and Systems, P rentice Hall ,

    En glewood C liffs, N.J . 1985.

    The follow ing t extbook dea ls w ith th e underlying n umerical techniques for

    para meter est imat ion:

    • Dennis , J .E . J r . and R.B. S chnabel. N um eri cal M ethods for U nconstrain ed 

    Opt imi zat ion and N onl i near Equat ions , Pr entice Ha ll, En glewood Cliffs,

    N.J . 1983.

    1 The System Identification Problem

  • 8/20/2019 Ident Toolbox Matlab

    40/368

    1-22

    2

  • 8/20/2019 Ident Toolbox Matlab

    41/368

    The G ra phica l U serInterface

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

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

    Estimating Models   . . . . . . . . . . . . . . . . . 2-15

    Examining Models   . . . . . . . . . . . . . . . . . 2-28

    Some Further GUI Topics  . . . . . . . . . . . . . . 2-35

    2 The G raphical U ser Interface

  • 8/20/2019 Ident Toolbox Matlab

    42/368

    2-2

    The Big Picture

    The S yst em Id entifica tion Toolbox provides a gra phica l user interfa ce (G U I) .

    The G U I covers m ost of the t oolbox’s functions a nd gives ea sy a ccess to a ll

    varia bles tha t a re created during a session. I t is sta rted by typing

    i d ent

    in t he MATLAB comma nd w indow.

    Figure 2-1: The Main ident Information Window

    The Model and Data BoardsS y st em I d en t if ica t i on i s a b ou t d a t a a nd m od els a nd cr ea t i ng m od el s f rom d a t a .

    The ma in informat ion a nd commun ica tion window  ident, is t herefore

    dominat ed by two ta bles:

    • A ta ble over a vaila ble da ta sets, each represent ed by an icon

    • A table over creat ed models, each r epresented by an icon

    The Big Picture

  • 8/20/2019 Ident Toolbox Matlab

    43/368

    2-3

    Thes e t a b les w i ll b e r ef er r ed t o a s t he M odel Board a n d t he Data Board in t h is

    cha pter. You enter data sets into the Dat a B oar d by

    • Opening ea rlier sa ved sessions.

    • Importing th em from t he MATLAB w orkspa ce.

    • Crea ting t hem by detrending, filtering, selecting subset s, etc., of an other

    da ta set in the Da ta B oard .

    Imports a re ha ndled under t he pop-up menu Data wh ile creat ion of new dat a

    sets is h a ndled under t he pop-up menu Preprocess. “Handling Data ” onpage 2-7 deals w ith th is in more detail .

    The models ar e entered into the summa ry board by

    • Opening ea rlier sa ved sessions.

    • Importing th em from t he MATLAB w orkspa ce.

    • Est imat ing them from dat a .

    Imports a re ha ndled under t he pop-up menu Models, wh ile a ll the differentes t ima t ion schemes are reached under the pop-up menu Estimate. More abou t

    this in “Est ima ting Models” on page 2-15.

    The Dat a a nd Model B oar ds can be rearra nged by dragging an d dropping.

    More boards open a utoma tically w hen necessa ry or wh en asked for (under

    menu Options).

    The Working DataAll data sets and models are creat ed from th e Working Da ta set . This is the

    dat a t ha t is given in the center of the ident window. To change the Working

    D a t a set dr a g a n d dr op a n y d at a s et fr om t he D a t a B oa r d on t he Wor kin g D a t a

    icon.

    The Views

    B elow th e Da ta an d Model Boards a re buttons for different views. Thesecont rol wha t a spects of the da ta sets a nd models you w ould like to exa mine,

    a nd a re described in more deta il in “Handling Data ” on page 2-7 and in

    “Exa mining Models” on pa ge 2-28. To select a da ta set or a model, so th a t its

    propert ies a re displa yed, click on its icon. A selected object is ma rked by a

    th icker line in th e icon. To deselect, click a ga in. An a rbitra ry n umber of dat a /

    2 The G raphical U ser Interface

  • 8/20/2019 Ident Toolbox Matlab

    44/368

    2-4

    model objects can be examined s imulta neously. To ha ve more informat ion

    about an object, double-click (or right-click or Ctrl-click) on its icon.

    The Validation DataThe t w o model views Model Output a nd Model Residuals illustrate model

    properties wh en applied to the Valida tion Da ta set. This is the set ma rked in

    th e box below t hese tw o views. To chang e the Va lidat ion Da ta , drag a nd drop

    any da ta set f rom the Data B oard on the Val ida t ion Da ta icon.

    It is good and common pra ctice in ident ifica tion to eva luat e an est ima tedmodel’s properties using a “fresh” dat a set , tha t is, one tha t w a s not used for

    th e estima tion. It is thus good ad vice to let the Validat ion Da ta be different

    from the Working Da ta , but t hey should of course be compa tible with th ese.

    The Work FlowYou s t a r t by i mpor t ing d a t a (u nder pop-u p m enu Data); y ou exa m in e t h e d a t a

    s et u sin g t h e Data Views. You pr oba b ly r em ov e t h e m ea n s fr om t h e d a t a a n dselect subset s of da t a for est ima t ion and va l ida t ion purposes us ing the i t ems inthe pop-up menu Preprocess. You t hen con t inue t o es t im a t e m od els , u si ng t he

    possibilities und er t he pop-up menu Estimate, perha ps first doing a

    quicksta rt. You exam ine the obtained models with r espect t o your fa vorite

    a spects using t he different Model Views. The ba sic idea is th a t a ny checked

    view sh ows t he properties of all selected models a t a ny t ime. This function is

    “live” so models and views can be checked in an d out a t w ill in a n online

    fa shion. You select/deselect a model by clicking on it s icon.

    In spired by the informat ion you ga in from the plots, you cont inue to try out

    different model structures (model orders) until you find a model you a re

    sat isfied with.

    Management AspectsDiary: It is easy to forget w ha t y ou have been doing. B y double-clicking on a

    d a t a /m od el i con , a com plet e d ia r y w i ll b e g iv en of how t h is object w a s cr ea t e d,a l ong w i t h ot her k ey i nf or m a t ion . At t h is poin t y ou ca n a l so a d d com m ent s a nd

    chan ge the n a me of the object a nd it s color.

    Layout:To ha v e a g ood ov er view of t he cr ea t e d m od els a nd d a t a s et s , it is g ood

    pract ice to try rearr an ging the icons by dra gging and dropping. In th is wa y

    models correspond ing to a par t icu la r da t a set can be grouped together, et c. You

    The Big Picture

  • 8/20/2019 Ident Toolbox Matlab

    45/368

    2-5

    ca n a l so open new b oa r d s (Optionsmenu Extramodel/databoards) to fur ther

    rea r range the icons . These can be dragged ac ross the screen between d if ferentw indows. The extra boa rds a re also equipped with notepads for your

    comments.

    Sessions: The Model an d Da ta B oar ds with all models and da ta sets together

    w ith t heir diaries can be saved (under menu item File) at an y point , and

    reloa ded la ter. This is th e count erpart of save/loa d w orkspa ce in th e

    command-driven MATLAB. The four most recent sessions are l is ted under File

    for immediat e open.

    Cleanliness: The b oa r d s w i ll hol d a n a r b it r a r y num ber of m od el s a nd d a t a s et s

    (by creating clones of the board w hen necessary). It is however a dvisable to

    clear (delete) models an d dat a set s tha t no longer a re of interest. Do tha t by

    dra gging th e object t o the Trash Can. (Double-clicking on the trash can will

    open it up, and it s cont ents can be retrieved.) Em pty th e ca n if you run into

    memory problems.

    Window Culture: Dialog and plot w indows a re best ma na ged by the G U I’s

    c l os e  function (submenu it em under File menu , or select Close, or check/uncheck the correspond ing View box). I t i s genera l ly not su it ab le to iconi fy the

    windows – the G U I’s han dling an d window man agement system is usually a

    better a lternat ive.

    Workspace VariablesTh e m od els a n d d a t a s et s cr ea t ed w i th in t h e G U I a r e n or ma l ly n ot a v a ila b le in

    th e MATLAB w orkspa ce. Indeed, the w orkspa ce is not a t a ll lit tered wit hvaria bles during th e sessions w ith t he G U I. The varia bles can h owever be

    exported at a ny t ime to the workspace, by dra gging a nd dropping th e object

    icon on t he To Workspaceb ox . They w i ll t hen ca r r y t he na m e in t he w or ks pa ce

    th a t ma rked the object icon a t t he time of export. You can w ork with t he

    v a r ia b les in t he w or ks pa ce, u sing a ny M ATL AB com m a nds , a nd t hen per ha ps

    import modified versions ba ck into the G U I. Note tha t m odels a nd da ta are

    export ed a s t he t oolbox’s objects i dmode l , i d f r d , and i d d a t a . For how to

    ex t ract in forma t ion and work wi th these object s , see Chapter 3, “Tutoria l ”, a nd“Model Conversions” on pa ge 4-5 of the “Comma nd Reference “cha pter.

    The G U I ’s na m es of d a t a s et s a nd m od els a r e s ug ges t ed b y d efa u lt pr oced ur es .

    N or ma lly , y ou ca n en t er a n y ot h er n a m e of y ou r ch oice a t t h e t im e of cr ea t ion

    of the va r iab le. Names can be changed (a f t er double-cl ick ing on the