System Identification Toolbox User's Guide

2y ago
34 Views
2 Downloads
1.51 MB
274 Pages
Last View : 28d ago
Last Download : 3m ago
Upload by : Laura Ramon
Transcription

System IdentificationToolboxFor Use with MATLAB Lennart LjungComputationVisualizationProgrammingUser’s Guide

How to Contact The MathWorks: 508-647-7000Phone508-647-7001FaxThe MathWorks, Inc.24 Prime Park WayNatick, MA 01760-1500Mailhttp://www.mathworks.comWebAnonymous FTP serverNewsgroupFAX works.cominfo@mathworks.comTechnical supportProduct enhancement suggestionsBug reportsDocumentation error reportsSubscribing user registrationOrder status, license renewals, passcodesSales, pricing, and general informationSystem Identification Toolbox User’s Guide COPYRIGHT 1988 - 1997 by The MathWorks, Inc. All Rights Reserved.The software described in this document is furnished under a license agreement. The software may be usedor copied only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc.U.S. GOVERNMENT: If Licensee is acquiring the Programs on behalf of any unit or agency of the U.S.Government, the following shall apply: (a) For units of the Department of Defense: the Government shallhave only the rights specified in the license under which the commercial computer software or commercialsoftware documentation was obtained, as set forth in subparagraph (a) of the Rights in CommercialComputer Software or Commercial Software Documentation Clause at DFARS 227.7202-3, therefore therights set forth herein shall apply; and (b) For any other unit or agency: NOTICE: Notwithstanding anyother lease or license agreement that may pertain to, or accompany the delivery of, the computer softwareand accompanying documentation, the rights of the Government regarding its use, reproduction, and disclosure are as set forth in Clause 52.227-19 (c)(2) of the FAR.MATLAB, Simulink, Handle Graphics, and Real-Time Workshop are registered trademarks and Stateflowand Target Language Compiler are trademarks of The MathWorks, Inc.Other product or brand names are trademarks or registered trademarks of their respective holders.Printing History: April 1988July 1991May 1995August 1995First printingSecond printingThird printingReprint

ContentsThe System Identification Problem1What is System Identification? . . . . . . . . . . . . . . . . . . . . . . . 1-2How is that done? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2How do you know if the model is any good? . . . . . . . . . . . . . . 1-2Can the quality of the model be tested in other ways? . . . . . 1-2What models are most common? . . . . . . . . . . . . . . . . . . . . . . 1-2Do you have to assume a model of a particular type? . . . . . . 1-2What does the System Identification Toolbox contain? . . . . 1-2Isn’t it a big limitation to work only with linear models? . . . 1-3How do I get started? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3Is this really all there is to System Identification? . . . . . . . . 1-3The Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5The Basic Dynamic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6Variants of Model Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . 1-6How to Interpret the Noise Source . . . . . . . . . . . . . . . . . . . . . . . 1-7Terms to Characterize the Model Properties . . . . . . . . . . . . . . . 1-9Impulse Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9Step Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9Frequency Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9Zeros and Poles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9Model Unstable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13Feedback in Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13Noise Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13Model Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14Additional Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14Nonlinear Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14Still Problems? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14Fit Between Simulated and Measured Output . . . . . . . . . . 1-15Residual Analysis Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15Pole Zero Cancellations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15What Model Structures Should be Tested? . . . . . . . . . . . . . 1-15Multivariable Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16Available Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16Working with Subsets of the Input Output Channels . . . . 1-17Some Practical Advice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17iv

Reading More About System Identification . . . . . . . . . . . . . . . 1-19The Graphical User Interface2vContentsThe Model and Data Boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2The Working Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3The Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3The Validation Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4The Work Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4Management Aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4Workspace Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5Help Texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6Data Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7Getting Data into the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8Taking a Look at the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10Preprocessing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10Detrending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10Selecting Data Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11Prefiltering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11Resampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11Quickstart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12Checklist for Data Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12Simulating Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12The Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14Direct Estimation of the Impulse Response . . . . . . . . . . . . . . . 2-14Direct Estimation of the Frequency Response . . . . . . . . . . . . . 2-15Estimation of Parametric Models . . . . . . . . . . . . . . . . . . . . . . . 2-17Estimation Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18Resulting Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19How to Know Which Structure and Method to Use . . . . . . . 2-19ARX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20The Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20Entering the Order Parameters . . . . . . . . . . . . . . . . . . . . . . 2-20Estimating Many Models Simultaneously . . . . . . . . . . . . . . 2-20Estimation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21Multi-Output Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21

ARMAX, Output-Error and Box-Jenkins Models . . . . . . . . . . .The General Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The Special Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Entering the Model Structure . . . . . . . . . . . . . . . . . . . . . . . .Estimation Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .State-Space Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The Model Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Entering Black-Box State-Space Model Structures . . . . . . .Estimating Many Models Simultaneously . . . . . . . . . . . . . .Estimation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .User Defined Model Structures . . . . . . . . . . . . . . . . . . . . . . . . .State-Space Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Any Model Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Views and Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The Plot Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Frequency Response and Disturbance Spectra . . . . . . . . . . . .Transient Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Poles and Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Compare Measured and Model Output . . . . . . . . . . . . . . . . . . .Residual Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Text Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Present . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Modify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Further Analysis in the MATLAB Workspace . . . . . . . . . . . . .Mouse Buttons and Hotkeys . . . . . . . . . . . . . . . . . . . . . . . . . . .The Main ident Window . . . . . . . . . . . . . . . . . . . . . . . . . . . .Plot Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Troubleshooting in Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Layout Questions and idprefs.mat . . . . . . . . . . . . . . . . . . . . . .Customized Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Import from and Export to Workspace . . . . . . . . . . . . . . . . . . .What Cannot be Done Using the GUI . . . . . . . . . . . . . . . . . . i

Tutorial3viiContentsImpulse Responses, Frequency Functions, and Spectra . . . . . . 3-8Polynomial Representation of Transfer Functions . . . . . . . . . 3-10State-Space Representation of Transfer Functions . . . . . . . . . 3-13Continuous-Time State-Space Models . . . . . . . . . . . . . . . . . . . 3-14Estimating Impulse Responses . . . . . . . . . . . . . . . . . . . . . . . . . 3-15Estimating Spectra and Frequency Functions . . . . . . . . . . . . . 3-16Estimating Parametric Models . . . . . . . . . . . . . . . . . . . . . . . . . 3-17Subspace Methods for Estimating State-Space Models . . . . . . 3-18Data Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19Correlation Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20Spectral Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20ARX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22AR Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23General Polynomial Black-Box Models . . . . . . . . . . . . . . . . . . . 3-23State-Space Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25Optional Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26Polynomial Black-Box Models . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29Multivariable ARX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30State-Space Models with Free Parameters . . . . . . . . . . . . . . . 3-33Discrete-Time Innovations Form . . . . . . . . . . . . . . . . . . . . . 3-33System Dynamics Expressed in Continuous Time . . . . . . . 3-33The Black-Box, Discrete-Time Case . . . . . . . . . . . . . . . . . . . 3-34State-Space Models with Coupled Parameters . . . . . . . . . . . . 3-36State-Space Structures: Initial Values andNumerical Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-37Some Examples of User-Defined Model Structures . . . . . . . . . 3-38Theta Format: th . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-40Frequency Function Format: ff . . . . . . . . . . . . . . . . . . . . . . . . . 3-41Zero-Pole Format: zp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-43State-Space Format: ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-43Transfer Function Format: tf . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44Polynomial Format: poly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-45The ARX Format: arx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-45Transformations Between Discrete and Continuous Models . 3-46Continuous-Time Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46Discrete-Time Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-47Simulation and Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-47

Comparing Different Structures . . . . . . . . . . . . . . . . . . . . . . . .Checking Pole-Zero Cancellations . . . . . . . . . . . . . . . . . . . . . . .Residual Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Noise-Free Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Assessing the Model Uncertainty . . . . . . . . . . . . . . . . . . . . . . .Comparing Different Models . . . . . . . . . . . . . . . . . . . . . . . . . . .Conditioning of the Prediction Error Gradient . . . . . . . . . . . .Selecting Model Structures for Multivariable Systems . . . . . .Offset Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Outliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Filtering Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Feedback in Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Delays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The Basic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Choosing an Adaptation Mechanism and Gain . . . . . . . . . . . .Available Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Segmentation of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Time Series Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The Sampling Interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Out of Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Memory-Speed Trade-Offs . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Regularization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Local Minima . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Initial Parameter Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Linear Regression Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Spectrum Normalization and the Sampling Interval . . . . . . .Interpretation of the Loss Function . . . . . . . . . . . . . . . . . . . . .Enumeration of Estimated Parameters . . . . . . . . . . . . . . . . . .Complex-Valued Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Strange Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43-753-773-783-793-79Command Reference4viii

ixContents

1The System IdentificationProblemBasic Questions About System Identification . . . . . . . . . . . 1-2Common Terms Used in System Identification . . . . . . . . . . 1-4Basic Information About Dynamic Models . . . . . . . . . . . . . . 1-5The Basic Steps of System Identification . . . . . . . . . . . . . . 1-10A Startup Identification Procedure . . . . . . . . . . . . . . . . . . . 1-12Reading More About System Identification. . . . . . . . . . . . . 1-18

1The System Identification Problem1. Basic Questions About System IdentificationWhat is System Identification?System Identification allows you to build mathematical models of a dynamicsystem based on measured data.How is that done?Essentially by adjusting parameters within a given model until its outputcoincides as well as possible with the measured output.How do you know if the model is any good?A good test is to take a close look at the model’s output compared to themeasured one on a data set that wasn’t used for the fit (“Validation Data”).Can the quality of the model be tested in other ways?It is also valuable to look at what the model couldn’t reproduce in the data (“theresiduals”). This should not be correlated with other available information,such as the system's input.What models are most common?The techniques apply to very general models. Most common models aredifference equations descriptions, such as ARX and ARMAX models, as well asall types of linear state-space models.Do you have to assume a model of a particular type?For parametric models, you have to specify the structure. However, if you justassume that the system is linear, you can directly estimate its impulse or stepresponse using Correlation Analysis or its frequency response using SpectralAnalysis. This allows useful comparisons with other estimated models.What does the System Identification Toolbox contain?It contains all the common techniques to adjust parameters in all kinds oflinear models. It also allows you to examine the models’ properties, and tocheck if they are any good, as well as to preprocess and polish the measureddata.1-2

Isn’t it a big limitation to work only with linear models?No, actually not. Most common model nonlinearities are such that themeasured data should be nonlinearly transformed (like squaring a voltageinput if you think that it’s the power that is the stimuli). Use physical insightabout the system you are modeling and try out such transformations on modelsthat are linear in the new variables, and you will cover a lot!How do I get started?If you are a beginner, browse through Chapter and then try out a couple of thedata sets that come with the toolbox. Use the graphical user interface (GUI)and check out the built-in help functions to understand what you are doing.Is this really all there is to System Identification?Actually, there is a huge amount written on the subject. Experience with realdata is the driving force to understand more. It is important to remember thatany estimated model, no matter how good it looks on

The System Identification Problem 1-2 1. Basic Questions About System Identification What is System Identification? System Identification allows you to build mathematical models of a dynamic system based on measured data. How is

Related Documents:

Model-Based Calibration Toolbox 13, 21, 23, 24, 27 500 600 Control System Design and Analysis Control System Toolbox 200 200 System Identification Toolbox 200 200 Fuzzy Logic Toolbox 200 200 Robust Control Toolbox 4 200 200 Model Predictive Control Toolbox 4 200 23200 Aerospace Toolbox 200 200 Signal Processing and Communications

Neural Network Based System Identification Toolbox User’s Guide 1-1 1 Tutorial The present toolbox: “Neural Network Based System Identification Toolbox”, contains a large number of functions for training and evaluation of multilayer perceptron type neural networks. The

System Identification Toolbox 7 User’s Guide Lennart Ljung. How to Contact The MathWorks www.mathworks.com Web . System Identification Toolbox software is developed in association with the following leading researchers in the system identification field: Lennart Ljung.

and to review all NIH Toolbox measures as they relate to the needs of young children. NIH TOOLBOX APP Released in 2015, the NIH Toolbox iPad app takes advantage of portable technology and advanced software to provide users with a exible and easy-to-use NIH Toolbox test administration and data collection system. App

The toolbox is designed to work with both resting state scans and block designs. Installing the toolbox: 1. download conn.zip, unzip the file. 2. add ./conn/ directory to matlab path To start the toolbox: On the matlab prompt, type : conn (make sure your matlab path include the path to the connectivity toolbox)

System Identification Toolbox provided by The Math- Works, Inc [9]. This paper gives a brief overview of the entire collection of toolbox functions. 1. Introduction Inferring models of dynamic systems from a set of experi- mental data is a task which relates to a variety of areas. Technical as well as non-technical. If the system to be

Hillslope Delineation Toolbox User Manual – ArcGIS 10 jr 10-04818-000 hillslope toolbox user guide -arcgis 10 Herrera Environmental Consultants 4 March 30, 2012 7. Click on the icon to open ArcToolbox. 8. Right-click anywhere in the empty white space in ArcToolbox and select Add Toolbox. 9.

dimensional structure of a protein, RNA species, or DNA regulatory element (e.g. a promoter) can provide clues to the way in which they function but proof that the correct mechanism has been elucid-ated requires the analysis of mutants that have amino acid or nucleotide changes at key residues (see Box 8.2). Classically, mutants are generated by treating the test organism with chemical or .