toolbox ident matlab

904
System Identification Toolbox™ User's Guide Lennart Ljung R2015a

Upload: linabautistachinchilla

Post on 18-Aug-2015

521 views

Category:

Documents


17 download

DESCRIPTION

matlab

TRANSCRIPT

System Identification ToolboxUser's GuideLennart LjungR2015aHow to Contact MathWorksLatest news:www.mathworks.comSales and services:www.mathworks.com/sales_and_servicesUser community:www.mathworks.com/matlabcentralTechnical support:www.mathworks.com/support/contact_usPhone: 508-647-7000The MathWorks, Inc.3 Apple Hill DriveNatick, MA 01760-2098System Identification Toolbox User's Guide COPYRIGHT 19882015 by The MathWorks, Inc.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 orreproduced in any form without prior written consent from The MathWorks, Inc.FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentationby, for, or through the federal government of the United States. By accepting delivery of the Programor Documentation, the government hereby agrees that this software or documentation qualifies ascommercial computer software or commercial computer software documentation as such terms are usedor defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms andconditions of this Agreement and only those rights specified in this Agreement, shall pertain to andgovern the use, modification, reproduction, release, performance, display, and disclosure of the Programand Documentation by the federal government (or other entity acquiring for or through the federalgovernment) and shall supersede any conflicting contractual terms or conditions. If this License failsto meet the government's needs or is inconsistent in any respect with federal procurement law, thegovernment agrees to return the Program and Documentation, unused, to The MathWorks, Inc.TrademarksMATLAB and Simulink are registered trademarks of The MathWorks, Inc. Seewww.mathworks.com/trademarks for a list of additional trademarks. Other product or brandnames may be trademarks or registered trademarks of their respective holders.PatentsMathWorks products are protected by one or more U.S. patents. Please seewww.mathworks.com/patents for more information.Revision HistoryApril 1988 First printingJuly 1991 Second printingMay 1995 Third printingNovember 2000 Fourth printing Revised for Version 5.0 (Release 12)April 2001 Fifth printingJuly 2002 Online only Revised for Version 5.0.2 (Release 13)June 2004 Sixth printing Revised for Version 6.0.1 (Release 14)March 2005 Online only Revised for Version 6.1.1 (Release 14SP2)September 2005 Seventh printing Revised for Version 6.1.2 (Release 14SP3)March 2006 Online only Revised for Version 6.1.3 (Release 2006a)September 2006 Online only Revised for Version 6.2 (Release 2006b)March 2007 Online only Revised for Version 7.0 (Release 2007a)September 2007 Online only Revised for Version 7.1 (Release 2007b)March 2008 Online only Revised for Version 7.2 (Release 2008a)October 2008 Online only Revised for Version 7.2.1 (Release 2008b)March 2009 Online only Revised for Version 7.3 (Release 2009a)September 2009 Online only Revised for Version 7.3.1 (Release 2009b)March 2010 Online only Revised for Version 7.4 (Release 2010a)September 2010 Online only Revised for Version 7.4.1 (Release 2010b)April 2011 Online only Revised for Version 7.4.2 (Release 2011a)September 2011 Online only Revised for Version 7.4.3 (Release 2011b)March 2012 Online only Revised for Version 8.0 (Release 2012a)September 2012 Online only Revised for Version 8.1 (Release 2012b)March 2013 Online only Revised for Version 8.2 (Release 2013a)September 2013 Online only Revised for Version 8.3 (Release 2013b)March 2014 Online only Revised for Version 9.0 (Release 2014a)October 2014 Online only Revised for Version 9.1 (Release 2014b)March 2015 Online only Revised for Version 9.2 (Release 2015a)vContentsChoosing Your System Identification Approach1Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2WhatAreModelObjects? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3Model Objects Represent Linear Systems . . . . . . . . . . . . . . . 1-3AboutModelData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3TypesofModelObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5DynamicSystemModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7NumericModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9Numeric Linear Time Invariant (LTI) Models . . . . . . . . . . . . 1-9IdentifiedLTIModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9Identified Nonlinear Models . . . . . . . . . . . . . . . . . . . . . . . . 1-10About Identified Linear Models . . . . . . . . . . . . . . . . . . . . . . . 1-11WhatareIDLTIModels? . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11Measured and Noise Component Parameterizations . . . . . . 1-12LinearModelEstimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15LinearModelStructures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18About System Identification Toolbox Model Objects . . . . . . . 1-18When to Construct a Model Structure Independently ofEstimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19Commands for Constructing Linear Model Structures . . . . . 1-19ModelProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20SeeAlso . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-22AvailableLinearModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-23EstimationReport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-26What Is an Estimation Report? . . . . . . . . . . . . . . . . . . . . . . 1-26vi ContentsAccessEstimationReport . . . . . . . . . . . . . . . . . . . . . . . . . . 1-27Compare Estimated Models Using Estimation Report . . . . . 1-28Analyze and Refine Estimation Results Using EstimationReport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-29Imposing Constraints on Model Parameter Values . . . . . . . 1-31Recommended Model Estimation Sequence . . . . . . . . . . . . . 1-33Supported Models for Time- and Frequency-Domain Data . 1-35Supported Models for Time-Domain Data . . . . . . . . . . . . . . 1-35Supported Models for Frequency-Domain Data . . . . . . . . . . 1-36SeeAlso . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-37Supported Continuous- and Discrete-Time Models . . . . . . . 1-38Model Estimation Commands . . . . . . . . . . . . . . . . . . . . . . . . . 1-40Modeling Multiple-Output Systems . . . . . . . . . . . . . . . . . . . . 1-41About Modeling Multiple-Output Systems . . . . . . . . . . . . . . 1-41Modeling Multiple Outputs Directly . . . . . . . . . . . . . . . . . . 1-42Modeling Multiple Outputs as a Combination of Single-OutputModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-42Improving Multiple-Output Estimation Results by WeighingOutputs During Estimation . . . . . . . . . . . . . . . . . . . . . . . 1-42Regularized Estimates of Model Parameters . . . . . . . . . . . . 1-44WhatIsRegularization? . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-44When to Use Regularization . . . . . . . . . . . . . . . . . . . . . . . . 1-47Choosing Regularization Constants . . . . . . . . . . . . . . . . . . . 1-49Estimate Regularized ARX Model Using System IdentificationApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-52Data Import and Processing2SupportedData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3Ways to Obtain Identification Data . . . . . . . . . . . . . . . . . . . . . 2-5viiWays to Prepare Data for System Identification . . . . . . . . . . 2-6Requirements on Data Sampling . . . . . . . . . . . . . . . . . . . . . . . 2-8Representing Data in MATLAB Workspace . . . . . . . . . . . . . . 2-9Time-Domain Data Representation . . . . . . . . . . . . . . . . . . . . 2-9Time-Series Data Representation . . . . . . . . . . . . . . . . . . . . 2-10Frequency-Domain Data Representation . . . . . . . . . . . . . . . 2-11Import Time-Domain Data into the App . . . . . . . . . . . . . . . . 2-16Import Frequency-Domain Data into the App . . . . . . . . . . . 2-19Importing Frequency-Domain Input/Output Signals into theApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19Importing Frequency-Response Data into the App . . . . . . . . 2-21Import Data Objects into the App . . . . . . . . . . . . . . . . . . . . . 2-25Specifying the Data Sample Time . . . . . . . . . . . . . . . . . . . . . 2-28Specify Estimation and Validation Data in the App . . . . . . 2-30Preprocess Data Using Quick Start . . . . . . . . . . . . . . . . . . . . 2-32Create Data Sets from a Subset of Signal Channels . . . . . . 2-33Create Multiexperiment Data Sets in the App . . . . . . . . . . . 2-35Why Create Multiexperiment Data? . . . . . . . . . . . . . . . . . . 2-35LimitationsonDataSets . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35MergingDataSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35Extracting Specific Experiments from a Multiexperiment DataSet into a New Data Set . . . . . . . . . . . . . . . . . . . . . . . . . 2-39Managing Data in the App . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-42ViewingDataProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-42Renaming Data and Changing Display Color . . . . . . . . . . . 2-43Distinguishing Data Types . . . . . . . . . . . . . . . . . . . . . . . . . 2-46OrganizingDataIcons . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-46DeletingDataSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-47Exporting Data to the MATLAB Workspace . . . . . . . . . . . . 2-48viii ContentsRepresenting Time- and Frequency-Domain Data UsingiddataObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-50iddataConstructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-50iddataProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-52Select Data Channels, I/O Data and Experiments in iddataObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-55Increasing Number of Channels or Data Points of iddataObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-58Create Multiexperiment Data at the Command Line . . . . . 2-60Why Create Multiexperiment Data Sets? . . . . . . . . . . . . . . 2-60LimitationsonDataSets . . . . . . . . . . . . . . . . . . . . . . . . . . 2-60Entering Multiexperiment Data Directly . . . . . . . . . . . . . . . 2-60MergingDataSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-61Adding Experiments to an Existing iddata Object . . . . . . . . 2-61Dealing with Multi-Experiment Data and Merging Models 2-63ManagingiddataObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-78Modifying Time and Frequency Vectors . . . . . . . . . . . . . . . 2-78Naming, Adding, and Removing Data Channels . . . . . . . . . 2-80Subreferencing iddata Objects . . . . . . . . . . . . . . . . . . . . . . . 2-82Concatenating iddata Objects . . . . . . . . . . . . . . . . . . . . . . . 2-82Representing Frequency-Response Data Using idfrdObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-83idfrdConstructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-83idfrdProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-84Select I/O Channels and Data in idfrd Objects . . . . . . . . . . 2-85Adding Input or Output Channels in idfrd Objects . . . . . . . 2-86ManagingidfrdObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-88Operations That Create idfrd Objects . . . . . . . . . . . . . . . . . 2-88AnalyzingDataQuality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-90Is Your Data Ready for Modeling? . . . . . . . . . . . . . . . . . . . 2-90Plotting Data in the App Versus at the Command Line . . . . 2-91How to Plot Data in the App . . . . . . . . . . . . . . . . . . . . . . . . 2-91How to Plot Data at the Command Line . . . . . . . . . . . . . . . 2-96How to Analyze Data Using the advice Command . . . . . . . . 2-98Selecting Subsets of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-100Why Select Subsets of Data? . . . . . . . . . . . . . . . . . . . . . . . 2-100Extract Subsets of Data Using the App . . . . . . . . . . . . . . . 2-100ixExtract Subsets of Data at the Command Line . . . . . . . . . 2-102Handling Missing Data and Outliers . . . . . . . . . . . . . . . . . . 2-104HandlingMissingData . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-104HandlingOutliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-105Extract and Model Specific Data Segments . . . . . . . . . . . . 2-106SeeAlso . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-107Handling Offsets and Trends in Data . . . . . . . . . . . . . . . . . 2-108WhentoDetrendData . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-108Alternatives for Detrending Data in App or at the Command-Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-109Next Steps After Detrending . . . . . . . . . . . . . . . . . . . . . . . 2-110How to Detrend Data Using the App . . . . . . . . . . . . . . . . . . 2-111How to Detrend Data at the Command Line . . . . . . . . . . . 2-112Detrending Steady-State Data . . . . . . . . . . . . . . . . . . . . . . 2-112Detrending Transient Data . . . . . . . . . . . . . . . . . . . . . . . . 2-112SeeAlso . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-113ResamplingData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-114WhatIsResampling? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-114Resampling Data Without Aliasing Effects . . . . . . . . . . . . 2-115SeeAlso . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-119Resampling Data Using the App . . . . . . . . . . . . . . . . . . . . . 2-120Resampling Data at the Command Line . . . . . . . . . . . . . . . 2-121FilteringData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-123SupportedFilters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-123Choosing to Prefilter Your Data . . . . . . . . . . . . . . . . . . . . 2-123SeeAlso . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-124How to Filter Data Using the App . . . . . . . . . . . . . . . . . . . . 2-125Filtering Time-Domain Data in the App . . . . . . . . . . . . . . 2-125Filtering Frequency-Domain or Frequency-Response Data intheApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-126How to Filter Data at the Command Line . . . . . . . . . . . . . 2-128SimplePassbandFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-128Defining a Custom Filter . . . . . . . . . . . . . . . . . . . . . . . . . . 2-129x ContentsCausal and Noncausal Filters . . . . . . . . . . . . . . . . . . . . . . 2-130Generate Data Using Simulation . . . . . . . . . . . . . . . . . . . . . 2-131Commands for Generating Data Using Simulation . . . . . . 2-131Create Periodic Input Data . . . . . . . . . . . . . . . . . . . . . . . . 2-132Generate Output Data Using Simulation . . . . . . . . . . . . . 2-134Simulating Data Using Other MathWorks Products . . . . . 2-136Manipulating Complex-Valued Data . . . . . . . . . . . . . . . . . . 2-137Supported Operations for Complex Data . . . . . . . . . . . . . . 2-137Processing Complex iddata Signals at the Command Line . 2-137Transform Data3Supported Data Transformations . . . . . . . . . . . . . . . . . . . . . . 3-2Transform Time-Domain Data in the App . . . . . . . . . . . . . . . 3-3Transform Frequency-Domain Data in the App . . . . . . . . . . 3-5Transform Frequency-Response Data in the App . . . . . . . . . 3-7Transforming Between Time and Frequency-Domain Data 3-10Transforming Between Frequency-Domain and Frequency-ResponseData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11Linear Model Identification4Black-BoxModeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2Selecting Black-Box Model Structure and Order . . . . . . . . . . 4-2When to Use Nonlinear Model Structures? . . . . . . . . . . . . . . 4-3Black-Box Estimation Example . . . . . . . . . . . . . . . . . . . . . . . 4-4xiIdentifying Frequency-Response Models . . . . . . . . . . . . . . . . 4-7What Is a Frequency-Response Model? . . . . . . . . . . . . . . . . . 4-7Data Supported by Frequency-Response Models . . . . . . . . . . 4-7Estimate Frequency-Response Models in the App . . . . . . . . . 4-8Estimate Frequency-Response Models at the Command Line . 4-9Selecting the Method for Computing Spectral Models . . . . . 4-10Controlling Frequency Resolution of Spectral Models . . . . . 4-11SpectrumNormalization . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12Identifying Impulse-Response Models . . . . . . . . . . . . . . . . . 4-15What Is Time-Domain Correlation Analysis? . . . . . . . . . . . . 4-15Data Supported by Correlation Analysis . . . . . . . . . . . . . . . 4-15Estimate Impulse-Response Models Using SystemIdentificationApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16Estimate Impulse-Response Models at the Command Line . 4-17Compute Response Values . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18Identify Delay Using Transient-Response Plots . . . . . . . . . . 4-18Correlation Analysis Algorithm . . . . . . . . . . . . . . . . . . . . . . 4-20Identifying Process Models . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23WhatIsaProcessModel? . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23Data Supported by Process Models . . . . . . . . . . . . . . . . . . . 4-24Estimate Process Models Using the App . . . . . . . . . . . . . . . 4-24Estimate Process Models at the Command Line . . . . . . . . . 4-28Process Model Structure Specification . . . . . . . . . . . . . . . . . 4-35Estimating Multiple-Input, Multi-Output Process Models . . 4-36Disturbance Model Structure for Process Models . . . . . . . . . 4-36Assigning Estimation Weightings . . . . . . . . . . . . . . . . . . . . 4-37Specifying Initial Conditions for Iterative EstimationAlgorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38Identifying Input-Output Polynomial Models . . . . . . . . . . . 4-40What Are Polynomial Models? . . . . . . . . . . . . . . . . . . . . . . . 4-40Data Supported by Polynomial Models . . . . . . . . . . . . . . . . 4-45Preliminary Step Estimating Model Orders and InputDelays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-46Estimate Polynomial Models in the App . . . . . . . . . . . . . . . 4-54Estimate Polynomial Models at the Command Line . . . . . . . 4-58Polynomial Sizes and Orders of Multi-Output PolynomialModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-61Assigning Estimation Weightings . . . . . . . . . . . . . . . . . . . . 4-65Specifying Initial States for Iterative Estimation Algorithms 4-65Polynomial Model Estimation Algorithms . . . . . . . . . . . . . . 4-66Estimate Models Using armax . . . . . . . . . . . . . . . . . . . . . . 4-67xii ContentsRefining Linear Parametric Models . . . . . . . . . . . . . . . . . . . 4-70WhentoRefineModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-70What You Specify to Refine a Model . . . . . . . . . . . . . . . . . . 4-70Refine Linear Parametric Models Using System IdentificationApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-70Refine Linear Parametric Models at the Command Line . . . 4-72Refine ARMAX Model with Initial Parameter Guesses atCommandLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-73Refine Initial ARMAX Model at Command Line . . . . . . . . . 4-75Extracting Numerical Model Data . . . . . . . . . . . . . . . . . . . . . 4-77Transforming Between Discrete-Time and Continuous-TimeRepresentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-80Why Transform Between Continuous and Discrete Time? . . 4-80Using the c2d, d2c, and d2d Commands . . . . . . . . . . . . . . . 4-80Specifying Intersample Behavior . . . . . . . . . . . . . . . . . . . . . 4-82Effects on the Noise Model . . . . . . . . . . . . . . . . . . . . . . . . . 4-82Continuous-Discrete Conversion Methods . . . . . . . . . . . . . . 4-84Choosing a Conversion Method . . . . . . . . . . . . . . . . . . . . . . 4-84Zero-OrderHold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-85First-OrderHold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-86Impulse-Invariant Mapping . . . . . . . . . . . . . . . . . . . . . . . . . 4-87TustinApproximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-88Zero-Pole Matching Equivalents . . . . . . . . . . . . . . . . . . . . . 4-92Effect of Input Intersample Behavior on Continuous-TimeModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-94Transforming Between Linear Model Representations . . . 4-98SubreferencingModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-100WhatIsSubreferencing? . . . . . . . . . . . . . . . . . . . . . . . . . . 4-100Limitation on Supported Models . . . . . . . . . . . . . . . . . . . . 4-100Subreferencing Specific Measured Channels . . . . . . . . . . . 4-100Separation of Measured and Noise Components of Models . 4-101Treating Noise Channels as Measured Inputs . . . . . . . . . . 4-102ConcatenatingModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-104About Concatenating Models . . . . . . . . . . . . . . . . . . . . . . . 4-104xiiiLimitation on Supported Models . . . . . . . . . . . . . . . . . . . . 4-104Horizontal Concatenation of Model Objects . . . . . . . . . . . . 4-105Vertical Concatenation of Model Objects . . . . . . . . . . . . . . 4-105Concatenating Noise Spectrum Data of idfrd Objects . . . . . 4-106SeeAlso . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-107MergingModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-108Building and Estimating Process Models Using SystemIdentification Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . 4-109Determining Model Order and Delay . . . . . . . . . . . . . . . . . 4-135Model Structure Selection: Determining Model Order andInputDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-136Frequency Domain Identification: Estimating Models UsingFrequency Domain Data . . . . . . . . . . . . . . . . . . . . . . . . . . 4-152Building Structured and User-Defined Models Using SystemIdentification Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . 4-178Identifying State-Space Models5What Are State-Space Models? . . . . . . . . . . . . . . . . . . . . . . . . . 5-2Definition of State-Space Models . . . . . . . . . . . . . . . . . . . . . . 5-2Continuous-Time Representation . . . . . . . . . . . . . . . . . . . . . 5-2Discrete-Time Representation . . . . . . . . . . . . . . . . . . . . . . . . 5-3Relationship Between Continuous-Time and Discrete-TimeStateMatrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3State-Space Representation of Transfer Functions . . . . . . . . 5-4Data Supported by State-Space Models . . . . . . . . . . . . . . . . . 5-5Supported State-Space Parameterizations . . . . . . . . . . . . . . . 5-6Estimate State-Space Model With Order Selection . . . . . . . . 5-7Estimate Model With Selected Order in the App . . . . . . . . . . 5-7Estimate Model With Selected Order at the Command Line 5-10xiv ContentsUsing the Model Order Selection Window . . . . . . . . . . . . . . 5-10Estimate State-Space Models in System Identification App 5-12Estimate State-Space Models at the Command Line . . . . . . 5-21Black Box vs. Structured State-Space Model Estimation . . . 5-21Estimating State-Space Models Using ssest, ssregest andn4sid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22Choosing the Structure of A, B, C Matrices . . . . . . . . . . . . . 5-23Choosing Between Continuous-Time and Discrete-TimeRepresentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23Choosing to Estimate D, K, and X0 Matrices . . . . . . . . . . . . 5-24Estimate State-Space Models with Free-Parameterization . 5-27Estimate State-Space Models with CanonicalParameterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28What Is Canonical Parameterization? . . . . . . . . . . . . . . . . . 5-28Estimating Canonical State-Space Models . . . . . . . . . . . . . . 5-28Estimate State-Space Models with StructuredParameterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30What Is Structured Parameterization? . . . . . . . . . . . . . . . . 5-30Specify the State-Space Model Structure . . . . . . . . . . . . . . . 5-30Are Grey-Box Models Similar to State-Space Models withStructured Parameterization? . . . . . . . . . . . . . . . . . . . . . 5-32Estimate Structured Discrete-Time State-Space Models . . . 5-33Estimate Structured Continuous-Time State-Space Models . 5-34Estimate the State-Space Equivalent of ARMAX and OEModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-37Assigning Estimation Weightings . . . . . . . . . . . . . . . . . . . . . 5-39Specifying Initial States for Iterative EstimationAlgorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-40State-Space Model Estimation Methods . . . . . . . . . . . . . . . . 5-41References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-41xvIdentifying Transfer Function Models6What are Transfer Function Models? . . . . . . . . . . . . . . . . . . . 6-2Definition of Transfer Function Models . . . . . . . . . . . . . . . . . 6-2Continuous-Time Representation . . . . . . . . . . . . . . . . . . . . . 6-2Discrete-Time Representation . . . . . . . . . . . . . . . . . . . . . . . . 6-2Delays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3Data Supported by Transfer Function Models . . . . . . . . . . . . 6-4How to Estimate Transfer Function Models in the SystemIdentificationApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5How to Estimate Transfer Function Models at the CommandLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12Transfer Function Structure Specification . . . . . . . . . . . . . 6-13Estimate Transfer Function Models by Specifying Number ofPoles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14Estimate Transfer Function Models with Transport Delay toFit Given Frequency-Response Data . . . . . . . . . . . . . . . . . 6-15Estimate Transfer Function Models With Prior Knowledge ofModel Structure and Constraints . . . . . . . . . . . . . . . . . . . 6-16Estimate Transfer Function Models with Unknown TransportDelays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18Estimate Transfer Functions with Delays . . . . . . . . . . . . . . 6-20Specifying Initial Conditions for Iterative EstimationAlgorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21xvi ContentsNonlinear Black-Box Model Identification7About Identified Nonlinear Models . . . . . . . . . . . . . . . . . . . . . 7-2What Are Nonlinear Models? . . . . . . . . . . . . . . . . . . . . . . . . 7-2When to Fit Nonlinear Models . . . . . . . . . . . . . . . . . . . . . . . 7-2Nonlinear Model Estimation . . . . . . . . . . . . . . . . . . . . . . . . . 7-4Nonlinear Model Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7About System Identification Toolbox Model Objects . . . . . . . 7-7When to Construct a Model Structure Independently ofEstimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8Commands for Constructing Nonlinear Model Structures . . . 7-8ModelProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9Available Nonlinear Models . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12NonlinearARXModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12Hammerstein-Wiener Models . . . . . . . . . . . . . . . . . . . . . . . 7-13Nonlinear Grey-Box Models . . . . . . . . . . . . . . . . . . . . . . . . 7-13Preparing Data for Nonlinear Identification . . . . . . . . . . . . 7-15Identifying Nonlinear ARX Models . . . . . . . . . . . . . . . . . . . . 7-16Nonlinear ARX Model Extends the Linear ARX Structure . . 7-16Structure of Nonlinear ARX Models . . . . . . . . . . . . . . . . . . 7-17Nonlinearity Estimators for Nonlinear ARX Models . . . . . . 7-18Ways to Configure Nonlinear ARX Estimation . . . . . . . . . . 7-20How to Estimate Nonlinear ARX Models in the SystemIdentificationApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23How to Estimate Nonlinear ARX Models at the CommandLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26Using Linear Model for Nonlinear ARX Estimation . . . . . . . 7-36Estimate Nonlinear ARX Models Using Linear ARX Models 7-38Validating Nonlinear ARX Models . . . . . . . . . . . . . . . . . . . 7-42Using Nonlinear ARX Models . . . . . . . . . . . . . . . . . . . . . . . 7-47How the Software Computes Nonlinear ARX Model Output . 7-48Low-Level Simulation and Prediction of Sigmoid Network . . 7-49Identifying Hammerstein-Wiener Models . . . . . . . . . . . . . . . 7-56Applications of Hammerstein-Wiener Models . . . . . . . . . . . 7-56Structure of Hammerstein-Wiener Models . . . . . . . . . . . . . 7-57Nonlinearity Estimators for Hammerstein-Wiener Models . 7-58xviiWays to Configure Hammerstein-Wiener Estimation . . . . . . 7-60Estimation Options for Hammerstein-Wiener Models . . . . . 7-61How to Estimate Hammerstein-Wiener Models in the SystemIdentificationApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-62How to Estimate Hammerstein-Wiener Models at theCommandLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-64Using Linear Model for Hammerstein-Wiener Estimation . . 7-71Estimate Hammerstein-Wiener Models Using Linear OEModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-73Validating Hammerstein-Wiener Models . . . . . . . . . . . . . . . 7-76Using Hammerstein-Wiener Models . . . . . . . . . . . . . . . . . . 7-82How the Software Computes Hammerstein-Wiener ModelOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-83Low-level Simulation of Hammerstein-Wiener Model . . . . . 7-85Linear Approximation of Nonlinear Black-Box Models . . . 7-87Why Compute a Linear Approximation of a NonlinearModel? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-87Choosing Your Linear Approximation Approach . . . . . . . . . 7-87Linear Approximation of Nonlinear Black-Box Models for aGivenInput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-87Tangent Linearization of Nonlinear Black-Box Models . . . . 7-88Computing Operating Points for Nonlinear Black-BoxModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-89ODE Parameter Estimation (Grey-Box Modeling)8Supported Grey-Box Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2Data Supported by Grey-Box Models . . . . . . . . . . . . . . . . . . . 8-3Choosing idgrey or idnlgrey Model Object . . . . . . . . . . . . . . . 8-4Estimating Linear Grey-Box Models . . . . . . . . . . . . . . . . . . . . 8-6Specifying the Linear Grey-Box Model Structure . . . . . . . . . . 8-6Create Function to Represent a Grey-Box Model . . . . . . . . . . 8-7Estimate Continuous-Time Grey-Box Model for HeatDiffusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9xviii ContentsEstimate Discrete-Time Grey-Box Model with ParameterizedDisturbance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-12Estimating Nonlinear Grey-Box Models . . . . . . . . . . . . . . . . 8-15Specifying the Nonlinear Grey-Box Model Structure . . . . . . 8-15Constructing the idnlgrey Object . . . . . . . . . . . . . . . . . . . . . 8-17Using nlgreyest to Estimate Nonlinear Grey-Box Models . 8-17Nonlinear Grey-Box Model Properties and EstimationOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-18Represent Nonlinear Dynamics Using MATLAB File for Grey-BoxEstimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20After Estimating Grey-Box Models . . . . . . . . . . . . . . . . . . . . 8-38Estimating Coefficients of ODEs to Fit Given Solution . . . . 8-39Estimate Model Using Zero/Pole/Gain Parameters . . . . . . . 8-46Creating IDNLGREY Model Files . . . . . . . . . . . . . . . . . . . . . 8-52Time Series Identification9What Are Time-Series Models? . . . . . . . . . . . . . . . . . . . . . . . . 9-2Preparing Time-Series Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3Estimate Time-Series Power Spectra . . . . . . . . . . . . . . . . . . . 9-4How to Estimate Time-Series Power Spectra Using the App . 9-4How to Estimate Time-Series Power Spectra at the CommandLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5Estimate AR and ARMA Models . . . . . . . . . . . . . . . . . . . . . . . 9-7Definition of AR and ARMA Models . . . . . . . . . . . . . . . . . . . 9-7Estimating Polynomial Time-Series Models in the App . . . . . 9-7Estimating AR and ARMA Models at the Command Line . . 9-10Estimate State-Space Time-Series Models . . . . . . . . . . . . . . 9-11Definition of State-Space Time-Series Model . . . . . . . . . . . . 9-11Estimating State-Space Models at the Command Line . . . . 9-11xixIdentify Time-Series Models at Command Line . . . . . . . . . . 9-12Estimate Nonlinear Models for Time-Series Data . . . . . . . . 9-14EstimateARIMAModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15Spectrum Estimation Using Complex Data - Marple's TestCase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-18Analyzing Time-Series Models . . . . . . . . . . . . . . . . . . . . . . . . 9-28Recursive Model Identification10What Is Recursive Estimation? . . . . . . . . . . . . . . . . . . . . . . . 10-2Data Supported for Recursive Estimation . . . . . . . . . . . . . . 10-3Algorithms for Recursive Estimation . . . . . . . . . . . . . . . . . . 10-4Types of Recursive Estimation Algorithms . . . . . . . . . . . . . 10-4General Form of Recursive Estimation Algorithm . . . . . . . . 10-4KalmanFilterAlgorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5Forgetting Factor Algorithm . . . . . . . . . . . . . . . . . . . . . . . . 10-7Unnormalized and Normalized Gradient Algorithms . . . . . . 10-9DataSegmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11Recursive Estimation and Data Segmentation Techniques inSystem Identification Toolbox . . . . . . . . . . . . . . . . . . . 10-12Online Estimation11What Is Online Estimation? . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3How Online Estimation Differs from Offline Estimation . . 11-4xx ContentsPreprocess Online Estimation Data . . . . . . . . . . . . . . . . . . . 11-6Validate Online Estimation Results . . . . . . . . . . . . . . . . . . . 11-7Troubleshooting Online Estimation . . . . . . . . . . . . . . . . . . . 11-9CheckModelStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9CheckModelOrder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10Preprocess Estimation Data . . . . . . . . . . . . . . . . . . . . . . . 11-10Check Initial Guess for Parameter Values . . . . . . . . . . . . . 11-10Check Estimation Settings . . . . . . . . . . . . . . . . . . . . . . . . 11-10Generate Online Estimation Code . . . . . . . . . . . . . . . . . . . . 11-12Recursive Algorithms for Online Estimation . . . . . . . . . . . 11-14General Form of Recursive Estimation . . . . . . . . . . . . . . . 11-14Types of Recursive Estimation Algorithms . . . . . . . . . . . . 11-15Online Recursive Least Squares Estimation . . . . . . . . . . . 11-19Online ARMAX Polynomial Model Estimation . . . . . . . . . . 11-30State Estimation Using Time-Varying Kalman Filter . . . . 11-46Model Analysis12Validating Models After Estimation . . . . . . . . . . . . . . . . . . . 12-2WaystoValidateModels . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2DataforModelValidation . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3SupportedModelPlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3Definition of Confidence Interval for Specific Model Plots . . 12-4Plot Models in the System Identification App . . . . . . . . . . . 12-6Simulating and Predicting Model Output . . . . . . . . . . . . . . 12-8Why Simulate or Predict Model Output . . . . . . . . . . . . . . . 12-8Definition: Simulation and Prediction . . . . . . . . . . . . . . . . . 12-9Simulation and Prediction in the App . . . . . . . . . . . . . . . . 12-11Simulation and Prediction at the Command Line . . . . . . . 12-15Compare Simulated Output with Measured Data . . . . . . . 12-17xxiSimulate Model Output with Noise . . . . . . . . . . . . . . . . . . 12-18Simulate a Continuous-Time State-Space Model . . . . . . . . 12-19Predict Using Time-Series Model . . . . . . . . . . . . . . . . . . . 12-20ResidualAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-23What Is Residual Analysis? . . . . . . . . . . . . . . . . . . . . . . . . 12-23SupportedModelTypes . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-24What Residual Plots Show for Different Data Domains . . . 12-24Displaying the Confidence Interval . . . . . . . . . . . . . . . . . . 12-25How to Plot Residuals Using the App . . . . . . . . . . . . . . . . 12-26How to Plot Residuals at the Command Line . . . . . . . . . . 12-27Examine Model Residuals . . . . . . . . . . . . . . . . . . . . . . . . . 12-27Impulse and Step Response Plots . . . . . . . . . . . . . . . . . . . . 12-31SupportedModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-31How Transient Response Helps to Validate Models . . . . . . 12-31What Does a Transient Response Plot Show? . . . . . . . . . . 12-32Displaying the Confidence Interval . . . . . . . . . . . . . . . . . . 12-33Plot Impulse and Step Response Using the SystemIdentificationApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-35Plot Impulse and Step Response at the Command Line . . 12-37Frequency Response Plots . . . . . . . . . . . . . . . . . . . . . . . . . . 12-39What Is Frequency Response? . . . . . . . . . . . . . . . . . . . . . . 12-39How Frequency Response Helps to Validate Models . . . . . 12-40What Does a Frequency-Response Plot Show? . . . . . . . . . . 12-40Displaying the Confidence Interval . . . . . . . . . . . . . . . . . . 12-41Plot Bode Plots Using the System Identification App . . . . 12-43Plot Bode and Nyquist Plots at the Command Line . . . . . 12-45NoiseSpectrumPlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-47SupportedModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-47What Does a Noise Spectrum Plot Show? . . . . . . . . . . . . . 12-47Displaying the Confidence Interval . . . . . . . . . . . . . . . . . . 12-48Plot the Noise Spectrum Using the System IdentificationApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-50Plot the Noise Spectrum at the Command Line . . . . . . . . . 12-53xxii ContentsPoleandZeroPlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-55SupportedModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-55What Does a Pole-Zero Plot Show? . . . . . . . . . . . . . . . . . . 12-55Reducing Model Order Using Pole-Zero Plots . . . . . . . . . . 12-57Displaying the Confidence Interval . . . . . . . . . . . . . . . . . . 12-57Model Poles and Zeros Using the System IdentificationApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-59Plot Poles and Zeros at the Command Line . . . . . . . . . . . . 12-61Analyzing MIMO Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-62Overview of Analyzing MIMO Models . . . . . . . . . . . . . . . . 12-62ArraySelector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-63I/O Grouping for MIMO Models . . . . . . . . . . . . . . . . . . . . 12-65SelectingI/OPairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-66Customizing Response Plots Using the Response PlotsPropertyEditor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-68Opening the Property Editor . . . . . . . . . . . . . . . . . . . . . . . 12-68Overview of Response Plots Property Editor . . . . . . . . . . . 12-69LabelsPane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-71LimitsPane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-71UnitsPane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-72StylePane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-77OptionsPane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-78Editing Subplots Using the Property Editor . . . . . . . . . . . 12-79Akaike's Criteria for Model Validation . . . . . . . . . . . . . . . . 12-81DefinitionofFPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-81ComputingFPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-82DefinitionofAIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-82ComputingAIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-83Computing Model Uncertainty . . . . . . . . . . . . . . . . . . . . . . . 12-84Why Analyze Model Uncertainty? . . . . . . . . . . . . . . . . . . . 12-84What Is Model Covariance? . . . . . . . . . . . . . . . . . . . . . . . . 12-84Types of Model Uncertainty Information . . . . . . . . . . . . . . 12-85TroubleshootingModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-87About Troubleshooting Models . . . . . . . . . . . . . . . . . . . . . 12-87Model Order Is Too High or Too Low . . . . . . . . . . . . . . . . 12-87Substantial Noise in the System . . . . . . . . . . . . . . . . . . . . 12-88xxiiiUnstableModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-88MissingInputVariables . . . . . . . . . . . . . . . . . . . . . . . . . . 12-89SystemNonlinearities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-90Nonlinearity Estimator Produces a Poor Fit . . . . . . . . . . . 12-90Next Steps After Getting an Accurate Model . . . . . . . . . . . 12-92Setting Toolbox Preferences13Toolbox Preferences Editor . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2Overview of the Toolbox Preferences Editor . . . . . . . . . . . . 13-2Opening the Toolbox Preferences Editor . . . . . . . . . . . . . . . 13-2UnitsPane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4StylePane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-7OptionsPane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-8SISOToolPane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-9Control Design Applications14Using Identified Models for Control Design Applications . . 14-2How Control System Toolbox Software Works with IdentifiedModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-2Using balred to Reduce Model Order . . . . . . . . . . . . . . . . . . 14-2Compensator Design Using Control System ToolboxSoftware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-3Converting Models to LTI Objects . . . . . . . . . . . . . . . . . . . . 14-3Viewing Model Response Using the Linear SystemAnalyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-4CombiningModelObjects . . . . . . . . . . . . . . . . . . . . . . . . . . 14-5xxiv ContentsCreate and Plot Identified Models Using Control SystemToolboxSoftware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-6System Identification Toolbox Blocks15Using System Identification Toolbox Blocks in SimulinkModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2PreparingData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-3Identifying Linear Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-4Simulating Identified Model Output in Simulink . . . . . . . . 15-5When to Use Simulation Blocks . . . . . . . . . . . . . . . . . . . . . 15-5Summary of Simulation Blocks . . . . . . . . . . . . . . . . . . . . . . 15-5Specifying Initial Conditions for Simulation . . . . . . . . . . . . 15-6Simulate Identified Model Using Simulink Software . . . . . 15-8System Identification App16Steps for Using the System Identification App . . . . . . . . . . 16-2Working with System Identification App . . . . . . . . . . . . . . . 16-3Starting and Managing Sessions . . . . . . . . . . . . . . . . . . . . . 16-3ManagingModels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-7WorkingwithPlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-11Customizing the System Identification App . . . . . . . . . . . . 16-151Choosing Your System IdentificationApproach Acknowledgments on page 1-2 What Are Model Objects? on page 1-3 Types of Model Objects on page 1-5 Dynamic System Models on page 1-7 Numeric Models on page 1-9 About Identified Linear Models on page 1-11 Linear Model Structures on page 1-18 Available Linear Models on page 1-23 Estimation Report on page 1-26 Imposing Constraints on Model Parameter Values on page 1-31 Recommended Model Estimation Sequence on page 1-33 Supported Models for Time- and Frequency-Domain Data on page 1-35 Supported Continuous- and Discrete-Time Models on page 1-38 Model Estimation Commands on page 1-40 Modeling Multiple-Output Systems on page 1-41 Regularized Estimates of Model Parameters on page 1-44 Estimate Regularized ARX Model Using System Identification App on page 1-521 Choosing Your System Identification Approach1-2AcknowledgmentsSystem Identification Toolbox software is developed in association with the followingleading researchers in the system identification field:Lennart Ljung. Professor Lennart Ljung is with the Department of ElectricalEngineering at Linkping University in Sweden. He is a recognized leader in systemidentification and has published numerous papers and books in this area.Qinghua Zhang. Dr. Qinghua Zhang is a researcher at Institut National deRecherche en Informatique et en Automatique (INRIA) and at Institut de Rechercheen Informatique et Systmes Alatoires (IRISA), both in Rennes, France. He conductsresearch in the areas of nonlinear system identification, fault diagnosis, and signalprocessing with applications in the fields of energy, automotive, and biomedical systems.Peter Lindskog. Dr. Peter Lindskog is employed by NIRA Dynamics AB, Sweden. Heconducts research in the areas of system identification, signal processing, and automaticcontrol with a focus on vehicle industry applications.Anatoli Juditsky. Professor Anatoli Juditsky is with the Laboratoire Jean Kuntzmannat the Universit Joseph Fourier, Grenoble, France. He conducts research in the areas ofnonparametric statistics, system identification, and stochastic optimization. What Are Model Objects?1-3What Are Model Objects?In this section...Model Objects Represent Linear Systems on page 1-3About Model Data on page 1-3Model Objects Represent Linear SystemsIn Control System Toolbox, System Identification Toolbox, and Robust ControlToolbox software, you represent linear systems as model objects. In SystemIdentification Toolbox, you also represent nonlinear models as model objects. Modelobjects are specialized data containers that encapsulate model data and other attributesin a structured way. Model objects allow you to manipulate linear systems as singleentities rather than keeping track of multiple data vectors, matrices, or cell arrays.Model objects can represent single-input, single-output (SISO) systems or multiple-input,multiple-output (MIMO) systems. You can represent both continuous- and discrete-timelinear systems.The main families of model objects are: Numeric Models Basic representation of linear systems with fixed numericalcoefficients. This family also includes identified models that have coefficientsestimated with System Identification Toolbox software. Generalized Models Representations that combine numeric coefficientswith tunable or uncertain coefficients. Generalized models support tasks such asparameter studies or compensator tuning using Robust Control Toolbox tuningcommands.About Model DataThe data encapsulated in your model object depends on the model type you use. Forexample: Transfer functions store the numerator and denominator coefficients State-space models store the A, B, C, and D matrices that describe the dynamics ofthe system PID controller models store the proportional, integral, and derivative gains1 Choosing Your System Identification Approach1-4Other model attributes stored as model data include time units, names for the modelinputs or outputs, and time delays.Note: All model objects are MATLAB objects, but working with them does not requirea background in object-oriented programming. To learn more about objects and objectsyntax, see Classes in the MATLAB Language in the MATLAB documentation.More About Types of Model Objects on page 1-5 Types of Model Objects1-5Types of Model ObjectsThe following diagram illustrates the relationships between the types of model objectsin Control System Toolbox, Robust Control Toolbox, and System Identification Toolboxsoftware. Model types that begin with id require System Identification Toolbox software.Model types that begin with u require Robust Control Toolbox software. All other modeltypes are available with Control System Toolbox software.Analysis Point BlockAnalysisPointThe diagram illustrates the following two overlapping broad classifications of modelobject types:1 Choosing Your System Identification Approach1-6 Dynamic System Models vs. Static Models In general, Dynamic System Modelsrepresent systems that have internal dynamics, while Static Models represent staticinput/output relationships. Numeric Models vs. Generalized Models Numeric Models are the basicnumeric representation of linear systems with fixed coefficients. Generalized Modelsrepresent systems with tunable or uncertain components.More About What Are Model Objects? on page 1-3 Dynamic System Models on page 1-7 Numeric Models on page 1-9 Dynamic System Models1-7Dynamic System ModelsDynamic System Models generally represent systems that have internal dynamics ormemory of past states (such as integrators).Most commands for analyzing linear systems, such as bode, margin, andlinearSystemAnalyzer, work on most Dynamic System Model objects. ForGeneralized Models, analysis commands use the current value of tunable parameters andthe nominal value of uncertain parameters.The following table lists the Dynamic System Models.Model Family Model TypestfzpkssfrdpidNumeric LTI models Basic numericrepresentation of linear systemspidstdidtfidssidfrdidgreyidpolyIdentified LTI models Representationsof linear systems with tunable coefficients,whose values can be identified usingmeasured input/output data.idprocidnlarxidnlhwIdentified nonlinear models Representations of nonlinear systems withtunable coefficients, whose values can beidentified using input/output data. Limitedsupport for commands that analyze linearsystems.idnlgreygenssgenfrdGeneralized LTI models Representationsof systems that include tunable oruncertain coefficientsuss1 Choosing Your System Identification Approach1-8Model Family Model Typesufrdltiblock.gainltiblock.tfltiblock.ssltiblock.pidltiblock.pid2ultidynudynDynamic Control Design Blocks Tunable, uncertain, or switch componentsfor constructing models of control systemsAnalysisPointMore About Numeric Linear Time Invariant (LTI) Models on page 1-9 Identified LTI Models on page 1-9 Identified Nonlinear Models on page 1-10 Numeric Models1-9Numeric ModelsNumeric Linear Time Invariant (LTI) ModelsNumeric LTI models are the basic numeric representation of linear systems orcomponents of linear systems. Use numeric LTI models for modeling dynamiccomponents, such as transfer functions or state-space models, whose coefficients arefixed, numeric values. You can use numeric LTI models for linear analysis or controldesign tasks.The following table summarizes the available types of numeric LTI models.Model Type Descriptiontf Transfer function model in polynomial formzpk Transfer function model in zero-pole-gain (factorized) formss State-space modelfrd Frequency response data modelpid Parallel-form PID controllerpidstd Standard-form PID controllerIdentified LTI ModelsIdentified LTI Models represent linear systems with coefficients that are identifiedusing measured input/output data. You can specify initial values and constraints for theestimation of the coefficients.The following table summarizes the available types of identified LTI models.Model Type Descriptionidtf Transfer function model in polynomial form, withidentifiable parametersidss State-space model, with identifiable parametersidpoly Polynomial input-output model, with identifiableparameters1 Choosing Your System Identification Approach1-10Model Type Descriptionidproc Continuous-time process model, with identifiableparametersidfrd Frequency-response model, with identifiable parametersidgrey Linear ODE (grey-box) model, with identifiable parametersIdentified Nonlinear ModelsIdentified Nonlinear Models represent nonlinear systems with coefficients that areidentified using measured input/output data. You can specify initial values andconstraints for the estimation of the coefficients.The following table summarizes the available types of identified nonlinear models.Model Type Descriptionidnlarx Nonlinear ARX model, with identifiableparametersidnlgrey Nonlinear ODE (grey-box) model, withidentifiable parametersidnlhw Hammerstein-Wiener model, withidentifiable parameters About Identified Linear Models1-11About Identified Linear ModelsIn this section...What are IDLTI Models? on page 1-11Measured and Noise Component Parameterizations on page 1-12Linear Model Estimation on page 1-15What are IDLTI Models?System Identification Toolbox software uses objects to represent a variety of linearand nonlinear model structures. These linear model objects are collectively known asIdentified Linear Time-Invariant (IDLTI) models.IDLTI models contain two distinct dynamic components: Measured component Describes the relationship between the measured inputsand the measured output (G) Noise component Describes the relationship between the disturbances at theoutput and the measured output (H)Models that only have the noise component H are called time-series or signal models.Typically, you create such models using time-series data that consist of one or moreoutputs y(t) with no corresponding input.The total output is the sum of the contributions from the measured inputs and thedisturbances: y = G u + H e, where u represents the measured inputs and e thedisturbance. e(t) is modeled as zero-mean Gaussian white noise with variance . Thefollowing figure illustrates an IDLTI model.euyGHIDLTI1 Choosing Your System Identification Approach1-12When you simulate an IDLTI model, you study the effect of input u(t) (and possiblyinitial conditions) on the output y(t). The noise e(t) is not considered. However, withfinite-horizon prediction of the output, both the measured and the noise components ofthe model contribute towards computation of the (predicted) response.uH1-Hy_measuredy_predictedG-1-1One-step ahead prediction model corresponding to a linear identified model (y = Gu+He)Measured and Noise Component ParameterizationsThe various linear model structures provide different ways of parameterizing thetransfer functions G and H. When you construct an IDLTI model or estimate a modeldirectly using input-output data, you can configure the structure of both G and H, asdescribed in the following table:Model Type Transfer Functions G and H Configuration MethodState spacemodel(idss)Represents an identified state-spacemodel structure, governed by theequations: x Ax Bu Key Cx Du e= + += + +where the transfer function betweenthe measured input u and outputy isGs CsI A B D ( ) ( ) = - +-1 andthe noise transfer function isHs CsI A K I ( ) ( ) = - +-1.Construction: Use idss to create a model,specifying values of state-space matricesA, B, C, D and K as input arguments(using NaNs to denote unknown entries).Estimation: Use ssest or n4sid,specifying name-value pairs for variousconfigurations, such as, canonicalparameterization of the measureddynamics ('Form'/'canonical'),denoting absence of feedthrough by fixingD to zero ('Feedthrough'/false), andabsence of noise dynamics by fixing K tozero ('DisturbanceModel'/'none'). About Identified Linear Models1-13Model Type Transfer Functions G and H Configuration MethodPolynomialmodel(idpoly)Represents a polynomial model suchas ARX, ARMAX and BJ. An ARMAXmodel, for example, uses the input-outputequation Ay(t) = Bu(t)+Ce(t), so thatthe measured transfer function G isGs A B ( )=-1, while the noise transferfunction isHs A C ( ) =-1.The ARMAX model is a specialconfiguration of the general polynomialmodel whose governing equation is:AytBFu tCDet ( ) () () = +The autoregressive component, A, iscommon between the measured and noisecomponents. The polynomials B and Fconstitute the measured component whilethe polynomials C and D constitute thenoise component.Construction: Use idpoly to create amodel using values of active polynomialsas input arguments. For example, tocreate an Output-Error model which usesG = B/F as the measured component andhas a trivial noise component (H = 1).enter:y = idpoly([],B,[],[],F)Estimation: Use the armax, arx, or bj,specifying the orders of the polynomialsas input arguments. For example, bjrequires you to specify the orders of theB, C, D, and F polynomials to construct amodel with governing equationytBFutCDet () () () = +Transferfunctionmodel(idtf)Represents an identified transfer functionmodel, which has no dynamic elementsto model noise behavior. This object usesthe trivial noise model H(s) = I. Thegoverning equation isytnumdenu t et () () () = +Construction: Use idtf to createa model, specifying values of thenumerator and denominator coefficientsas input arguments. The numeratorand denominator vectors constitute themeasured component G = num(s)/den(s). The noise component is fixed to H= 1.Estimation: Use tfest, specifying thenumber of poles and zeros of the measuredcomponent G.1 Choosing Your System Identification Approach1-14Model Type Transfer Functions G and H Configuration MethodProcessmodel(idproc)Represents a process model, whichprovides options to represent the noisedynamics as either first- or second-order ARMA process (that is, H(s)=C(s)/A(s), where C(s) and A(s) aremonic polynomials of equal degree). Themeasured component, G(s), is representedby a transfer function expressed in pole-zero form.For process (and grey-box) models,the noise component is often treatedas an on-demand extension to anotherwise measured component-centricrepresentation. For these models, youcan add a noise component by using theDisturbanceModel estimation option.For example:model = procest(data,'P1D')estimates a model whose equation is:ys KT se us esppsTd( )( )( ) ( ). =++-111To add a second order noise component tothe model, use:Options = procestOptions(DisturbanceModel, ARMA1);model = procest(data, P1D, Options);This model has the equation:ys KT se usc sdsesppsTd( )( )( ) ( ) =++++-1111111where the coefficients c1 and d1parameterize the noise component of themodel. If you are constructing a processmodel using the idproc command, specifythe structure of the measured componentusing the Type input argument and thenoise component by using the NoiseTFname-value pair. For example,model=idproc('P1','Kp',1,'Tp1',1,'NoiseTF',struct('num',[1 0.1],'den',[1 0.5])) About Identified Linear Models1-15Model Type Transfer Functions G and H Configuration Methodcreates the process model y(s) = 1/(s+1)u(s) + (s + 0.1)/(s + 0.5) e(s)Sometimes, fixing coefficients or specifying bounds on the parameters are not sufficient.For example, you may have unrelated parameter dependencies in the model orparameters may be a function of a different set of parameters that you want to identifyexclusively. For example, in a mass-spring-damper system, the A and B parametersboth depend on the mass of the system. To achieve such parameterization of linearmodels, you can use grey-box modeling where you establish the link between the actualparameters and model coefficients by writing an ODE file. To learn more, see Grey-BoxModel Estimation.Linear Model EstimationYou typically use estimation to create models in System Identification Toolbox. Youexecute one of the estimation commands, specifying as input arguments the measureddata, along with other inputs necessary to define the structure of a model. To illustrate,the following example uses the state-space estimation command, ssest, to create a statespace model. The first input argument data specifies the measured input-output data.The second input argument specifies the order of the model.sys = ssest(data, 4)The estimation function treats the noise variable e(t) as prediction error theresidual portion of the output that cannot be attributed to the measured inputs. Allestimation algorithms work to minimize a weighted norm of e(t) over the span ofavailable measurements. The weighting function is defined by the nature of the noisetransfer function H and the focus of estimation, such as simulation or prediction errorminimization. Black Box (Cold Start) Estimation on page 1-15 Structured Estimations on page 1-16 Estimation Options on page 1-17Black Box (Cold Start) EstimationIn a black-box estimation, you only have to specify the order to configure the structure ofthe model.1 Choosing Your System Identification Approach1-16sys = estimator(data, orders) where estimator is the name of an estimation command to use for the desired modeltype.For example, you use tfest to estimate transfer function models, arx for ARX-structurepolynomial models, and procest for process models.The first argument, data, is time- or frequency domain data represented as an iddataor idfrd object. The second argument, orders, represents one or more numbers whosedefinitions depends upon the model type: For transfer functions, orders refers to the number of poles and zeros. For state-space models, orders is a scalar that refers to the number of states. For process models, orders is a string denoting the structural elements of a processmodel, such as, the number of poles and presence of delay and integrator.When working with the app, you specify the orders in the appropriate edit fields ofcorresponding model estimation dialogs.Structured EstimationsIn some situations, you want to configure the structure of the desired model more closelythan what is achieved by simply specifying the orders. In such cases, you construct atemplate model and configure its properties. You then pass that template model as aninput argument to the estimation commands in place of orders.To illustrate, the following example assigns initial guess values to the numerator and thedenominator polynomials of a transfer function model, imposes minimum and maximumbounds on their estimated values, and then passes the object to the estimator function.% Initial guess for numeratornum = [1 2]den = [1 2 1 1]% Initial guess for the denominator sys = idtf(num, den);% Set min bound on den coefficients to 0.1sys.Structure.den.Minimum = [1 0.1 0.1 0.1]; sysEstimated = tfest(data, sys); The estimation algorithm uses the provided initial guesses to kick-start the estimationand delivers a model that respects the specified bounds. About Identified Linear Models1-17You can use such a model template to also configure auxiliary model properties suchas input/output names and units. If the values of some of the models parameters areinitially unknown, you can use NaNs for them in the template.Estimation OptionsThere are many options associated with a models estimation algorithm thatconfigure the estimation objective function, initial conditions and numerical searchalgorithm, among other things. For every estimation command, estimator, thereis a corresponding option command named estimatorOptions. To specify optionsfor a particular estimator command, such as tfest, use the options command thatcorresponds to the estimation command, in this case, tfestOptions. The optionscommand returns an options set that you then pass as an input argument to thecorresponding estimation command.For example, to estimate an Output-Error structure polynomial model, you use oe.To specify simulation as the focus and lsqnonlin as the search method, you useoeOptions:load iddata1 z1Options = oeOptions('Focus','simulation','SearchMethod','lsqnonlin');sys= oe(z1,[2 2 1],Options);Information about the options used to create an estimated model is stored in theOptionsUsed field of the models Report property. For more information, seeEstimation Report on page 1-26.More About Types of Model Objects on page 1-5 Available Linear Models on page 1-23 About Identified Nonlinear Models1 Choosing Your System Identification Approach1-18Linear Model StructuresIn this section...About System Identification Toolbox Model Objects on page 1-18When to Construct a Model Structure Independently of Estimation on page 1-19Commands for Constructing Linear Model Structures on page 1-19Model Properties on page 1-20See Also on page 1-22About System Identification Toolbox Model ObjectsObjects are instances of model classes. Each class is a blueprint that defines the followinginformation about your model: How the object stores data Which operations you can perform on the objectThis toolbox includes nine classes for representing models. For example, idss representslinear state-space models and idnlarx represents nonlinear ARX models. For acomplete list of available model objects, see Available Linear Models on page 1-23and Available Nonlinear Models.Model properties define how a model object stores information. Model objects storeinformation about a model, such as the mathematical form of a model, names of inputand output channels, units, names and values of estimated parameters, parameteruncertainties, and estimation report. For example, an idss model has an InputNameproperty for storing one or more input channel names.The allowed operations on an object are called methods. In System Identification Toolboxsoftware, some methods have the same name but apply to multiple model objects. Forexample, step creates a step response plot for all dynamic system objects. However,other methods are unique to a specific model object. For example, canon is unique tostate-space idss models and linearize to nonlinear black-box models.Every class has a special method, called the constructor, for creating objects of that class.Using a constructor creates an instance of the corresponding class or instantiates theobject. The constructor name is the same as the class name. For example, idss and Linear Model Structures1-19idnlarx are both the name of the class and the name of the constructor for instantiatingthe linear state-space models and nonlinear ARX models, respectively.When to Construct a Model Structure Independently of EstimationYou use model constructors to create a model object at the command line by specifying allrequired model properties explicitly.You must construct the model object independently of estimation when you want to: Simulate or analyze the effect of model parameters on its response, independent ofestimation. Specify an initial guess for specific model parameter values before estimation. Youcan specify bounds on parameter values, or set up the auxiliary model informationin advance, or both. Auxiliary model information includes specifying input/outputnames, units, notes, user data, and so on.In most cases, you can use the estimation commands to both construct and estimatethe modelwithout having to construct the model object independently. For example,the estimation command tfest creates a transfer function model using data and thenumber of poles and zeros of the model. Similarly, nlarx creates a nonlinear ARX modelusing data and model orders and delays that define the regressor configuration. Forinformation about how to both construct and estimate models with a single command, seeModel Estimation Commands on page 1-40.In case of grey-box models, you must always construct the model object first and thenestimate the parameters of the ordinary differential or difference equation.Commands for Constructing Linear Model StructuresThe following table summarizes the model constructors available in the SystemIdentification Toolbox product for representing various types of linear models.After model estimation, you can recognize the corresponding model objects in theMATLAB Workspace browser by their class names. The name of the constructor matchesthe name of the object it creates.For information about how to both construct and estimate models with a singlecommand, see Model Estimation Commands on page 1-40.1 Choosing Your System Identification Approach1-20Summary of Model ConstructorsModel Constructor Resulting Model Classidfrd Nonparametric frequency-response model.idproc Continuous-time, low-order transfer functions (processmodels).idpoly Linear input-output polynomial models: ARX ARMAX Output-Error Box-Jenkinsidss Linear state-space models.idtf Linear transfer function models.idgrey Linear ordinary differential or difference equations(grey-box models). You write a function that translatesuser parameters to state-space matrices. Can alsobe viewed as state-space models with user-specifiedparameterization.For more information about when to use these commands, see When to Construct aModel Structure Independently of Estimation on page 1-19.Model Properties Categories of Model Properties on page 1-20 Viewing Model Properties and Estimated Parameters on page 1-21Categories of Model PropertiesThe way a model object stores information is defined by the properties of thecorresponding model class.Each model object has properties for storing information that are relevant only to thatspecific model type. The idtf, idgrey, idpoly, idproc, and idss model objects arebased on the idlti superclass and inherit all idlti properties.In general, all model objects have properties that belong to the following categories: Linear Model Structures1-21 Names of input and output channels, such as InputName and OutputName Sample time of the model, such as Ts Units for time or frequency Model order and mathematical structure (for example, ODE or nonlinearities) Properties that store estimation results (Report) User comments, such as Notes and UserdataFor information about getting help on object properties, see the model reference pages.Viewing Model Properties and Estimated ParametersThe following table summarizes the commands for viewing and changing model propertyvalues. Property names are not case sensitive. You do not need to type the entireproperty name if the first few letters uniquely identify the property.Task Command ExampleView all modelproperties andtheir valuesget Load sample data, compute an ARX model, andlist the model properties:load iddata8m_arx=arx(z8,[4 3 2 3 0 0 0]);get(m_arx)Use dot notation View the A matrix containing the estimatedparameters in the previous model:m_arx.aAccess a specificmodel propertyFor properties, such asReport, that are configuredlike structures, use dotnotation of the formmodel.PropertyName.FieldName.FieldName is the name ofany field of the property.View the method used in ARX model estimation:m_arx.Report.MethodChange modelproperty valuesdot notation Change the input delays for all three inputchannels to [1 1 1] for an ARX model:m_arx.InputDelay = [1 1 1]1 Choosing Your System Identification Approach1-22Task Command ExampleAccess modelparameter valuesand uncertaintyinformationUse getpar, getpvec andgetcovSee Also: polydata,idssdata, tfdata,zpkdata View a table of all parameter attributes:getpar(m_arx) View the A polynomial and 1 standarduncertainty of an ARX model:[a,~,~,~,~,da] = polydata(m_arx)Set modelproperty valuesand uncertaintyinformationUse setpar, setpvec andsetcov Set default parameter labels:m_arx = setpar(m_arx,'label','default') Set parameter covariance data:m_arx = setcov(m_arx,cov)Get number ofparametersUse nparams Get the number of parameters:nparams(sys)See AlsoValidate each model directly after estimation to help fine-tune your modeling strategy.When you do not achieve a satisfactory model, you can try a different model structureand order, or try another identification algorithm. For more information about validatingand troubleshooting models, see Validating Models After Estimation. Available Linear Models1-23Available Linear ModelsA linear model is often sufficient to accurately describe the system dynamics and, inmost cases, you should first try to fit linear models. Available linear structures includetransfer functions and state-space models, summarized in the following table.Model Type Usage Learn MoreTransfer function (idtf) Use this structure torepresent transferfunctions:ynumdenu e = +where num and den arepolynomials of arbitrarylengths. You can specifyinitial guesses for, andestimate, num, den, andtransport delays.Transfer Function ModelsProcess model (idproc) Use this structure torepresent process modelsthat are low order transferfunctions expressed in pole-zero form. They includeintegrator, delay, zero, andup to 3 poles.Process ModelsState-space model (idss) Use this structure torepresent known state-space structures and black-box structures. You canfix certain parameters toknown values and estimatethe remaining parameters.You can also prescribeminimum/maximumbounds on the valuesof the free parameters.State-Space Models1 Choosing Your System Identification Approach1-24Model Type Usage Learn MoreIf you need to specifyparameter dependenciesor parameterize the state-space matrices using yourown parameters, use a grey-box model.Polynomial models(idpoly)Use to represent lineartransfer functions basedon the general form input-output polynomial form:AyBFuCDe = +where A, B, C, D and Fare polynomials withcoefficients that the toolboxestimates from data.Typically, you beginmodeling using simplerforms of this generalizedstructure (such asARX:Ay Bu e = +andOE:yBFu e = + ) and, ifnecessary, increase themodel complexity.Input-Output PolynomialModels Available Linear Models1-25Model Type Usage Learn MoreGrey-box model (idgrey) Use to represent arbitraryparameterizations ofstate-space models. Forexample, you can use thisstructure to represent yourordinary differential ordifference equation (ODE)and to define parameterdependencies.Linear Grey-Box ModelsMore About Linear Model Structures on page 1-18 About Identified Linear Models on page 1-111 Choosing Your System Identification Approach1-26Estimation ReportIn this section...What Is an Estimation Report? on page 1-26Access Estimation Report on page 1-27Compare Estimated Models Using Estimation Report on page 1-28Analyze and Refine Estimation Results Using Estimation Report on page 1-29What Is an Estimation Report?The estimation report contains information about the results and options used for amodel estimation. This report is stored in the estimated models Report property. Theexact contents of the report depend on the estimator function you use to obtain themodel.Specifically, the estimation report has the following information: Status of the model whether the model is constructed or estimated How the initial conditions are handled during estimation Termination conditions for iterative estimation algorithms Final prediction error (FPE), percent fit to estimation data, and mean-square error(MSE) Type and properties of the estimation data All estimated quantities parameter values, initial states for state-space and grey-box models, and their covariances The option set used for configuring the estimation algorithmTo learn more about the report produced for a specific estimator, see the correspondingreference page.You can use the report to: Keep an estimation log, such as the data, default and other settings used, andestimated results such as parameter values, initial conditions, and fit. See AccessEstimation Report on page 1-27. Compare options or results of separate estimations. See Compare Estimated ModelsUsing Estimation Report on page 1-28. Estimation Report1-27 Configure another estimation using the previously specified options. See and Analyzeand Refine Estimation Results Using Estimation Report on page 1-29.Access Estimation ReportThis example shows how to access the estimation report.The estimation report keeps a log of information such as the data used, default and othersettings used, and estimated results such as parameter values, initial conditions, and fit.After you estimate a model, use dot notation to access the estimation report. Forexample:load iddata1 z1;np = 2;sys = tfest(z1,np);sys_report = sys.ReportStatus: 'Estimated using TFEST with Focus = "simulation"'Method: 'TFEST'InitMethod: 'IV'N4Weight: 'Not applicable' N4Horizon: 'Not applicable'InitialCondition: 'estimate' Fit: [1x1 struct]Parameters: [1x1 struct] OptionsUsed: [1x1 idoptions.tfest] RandState: []DataUsed: [1x1 struct] Termination: [1x1 struct]Explore the options used during the estimation.sys.Report.OptionsUsedOption set for the tfest command:InitMethod: 'iv'InitOption: [1x1 struct]InitialCondition: 'auto' Focus: 'simulation'EstCovar: 11 Choosing Your System Identification Approach1-28 Display: 'off' InputOffset: []OutputOffset: []Regularization: [1x1 struct]SearchMethod: 'auto'SearchOption: [1x1 idoptions.search.identsolver]OutputWeight: []Advanced: [1x1 struct]View the fit of the transfer function model with the estimation data.sys.Report.Fitans = FitPercent: 70.7720 FPE: 1.7238 LossFcn: 1.6575 MSE: 1.6575Compare Estimated Models Using Estimation ReportThis example shows how to compare multiple estimated models using the estimationreport.Load estimation data.load iddata1 z1;Estimate a transfer function model.np = 2;sys_tf = tfest(z1,np);Estimate a state-space model.sys_ss = ssest(z1,2);Estimate an ARX model.sys_arx = arx(z1, [2 2 1]); Estimation Report1-29Compare the percentage fit of the estimated models to the estimation data.fit_tf = sys_tf.Report.Fit.FitPercentfit_ss = sys_ss.Report.Fit.FitPercentfit_arx = sys_arx.Report.Fit.FitPercentfit_tf = 70.7720fit_ss = 76.3808fit_arx = 68.7220The comparison shows that the state-space model provides the best percent fit to thedata.Analyze and Refine Estimation Results Using Estimation ReportThis example shows how to analyze an estimation and configure another estimationusing the estimation report.Estimate a state-space model that minimizes the 1-step ahead prediction error.load(fullfile(matlabroot,'toolbox','ident','iddemos','data','mrdamper.mat'));z = iddata(F,V,Ts);opt = ssestOptions;opt.Focus = 'prediction';opt.Display = 'on';sys1 = ssest(z,2,opt);sys1 has good 1-step prediction ability as indicated by >90% fit of the prediction resultsto the data.Use compare(z,sys1) to check the model's ability to simulate the measured output Fusing the input V. The model's simulated response has only 45% fit to the data.1 Choosing Your System Identification Approach1-30Perform another estimation where you retain the original options used for sys1 exceptthat you change the focus to minimize the simulation error.Fetch the options used by sys1 stored in its Report property. This approach is usefulwhen you have saved the estimated model but not the correspoding option set used forthe estimation.opt2 = sys1.Report.OptionsUsed;Change the focus to simulation and re-estimate the model.opt2.Focus = 'simulation';sys2 = ssest(z,sys1,opt2);Compare the simulated response to the estimation data using compare(z,sys1,sys2).The fit improves to 53%.More About About Identified Linear Models on page 1-11 About Identified Nonlinear Models Imposing Constraints on Model Parameter Values1-31Imposing Constraints on Model Parameter ValuesAll identified linear (IDLTI) models, except idfrd, contain a Structure property. TheStructure property contains the adjustable entities (parameters) of the model. Eachparameter has attributes such as value, minimum/maximum bounds, and free/fixedstatus that allow you to constrain them to desired values or a range of values duringestimation. You use the Structure property to impose constraints on the values ofvarious model parameters.The Structure property contains the essential parameters that define the structure of agiven model: For identified transfer functions, includes the numerator, denominator and delayparameters For polynomial models, includes the list of active polynomials For state-space models, includes the list of state-space matricesFor information about other model types, see the model reference pages.For example, the following example constructs an idtf model, specifying values for thenum and den parameters:num = [1 2];den = [1 2 2];sys = idtf(num,den)You can update the value of the num and den properties after you create the object asfollows:new_den = [1 1 10];sys.den = new_den;To fix the denominator to the value you specified (treat its coefficients as fixedparameters), use the Structure property of the object as follows:sys.Structure.den.Value = new_den;sys.Structure.den.Free = false(1,3);For a transfer function model, the num, den, and ioDelay model properties are simplypointers to the Value attribute of the corresponding parameter in the Structureproperty.1 Choosing Your System Identification Approach1-32IDTF Model Propertiesdouble vectorscalarValue:Info:Minimum:Maximum:Free:Scale:Parametersdouble vectorscalarscalar.numioDelayStructureInputDelayTsdennum:den:ioDelay:.....Value:Info:Minimum:Maximum:Free:Scale:Value:Info:Minimum:Maximum:Free:Scale:double vectordouble vectordouble vectorlogical vectordouble vectorstructSimilar relationships exist for other model structures. For example, the a property of astate-space model contains the double value of the state matrix. It is an alias to the Aparameter value stored in Structure.a.Value. Recommended Model Estimation Sequence1-33Recommended Model Estimation SequenceSystem identification is an iterative process, where you identify models with differentstructures from data and compare model performance. You start by estimating theparameters of simple model structures. If the model performance is poor, you graduallyincrease the complexity of the model structure. Ultimately, you choose the simplestmodel that best describes the dynamics of your system.Another reason to start with simple model structures is that higher-order models arenot always more accurate. Increasing model complexity increases the uncertainties inparameter estimates and typically requires more data (which is common in the case ofnonlinear models).Note: Model structure is not the only factor that determines model accuracy. If yourmodel is poor, you might need to preprocess your data by removing outliers or filteringnoise. For more information, see Ways to Prepare Data for System Identification.Estimate impulse-response and frequency-response models first to gain insight intothe system dynamics and assess whether a linear model is sufficient. Then, estimateparametric models in the following order:1 Transfer function, ARX polynomial and state-space models provide the simpleststructures. Estimation of ARX and state-space models let you determine the modelorders.In the System Identification app. Choose to estimate the Transfer functionmodels, ARX polynomial models and the state-space model using the n4sid method.At the command line. Use the tfest, arx, and the n4sid commands,respectively.For more information, see Input-Output Polynomial Models and State-SpaceModels.2 ARMAX and BJ polynomial models provide more complex structures and requireiterative estimation. Try several model orders and keep the model orders as low aspossible.In the System Identification app. Select to estimate the BJ and ARMAXpolynomial models.1 Choosing Your System Identification Approach1-34At the command line. Use the bj or armax commands.For more information, see Identifying Input-Output Polynomial Models.3 Nonlinear ARX or Hammerstein-Wiener models provide nonlinear structures. Formore information, see Nonlinear Model Identification.For general information about choosing you model strategy, see System IdentificationOverview. For information about validating models, see Validating Models AfterEstimation. Supported Models for Time- and Frequency-Domain Data1-35Supported Models for Time- and Frequency-Domain DataIn this section...Supported Models for Time-Domain Data on page 1-35Supported Models for Frequency-Domain Data on page 1-36See Also on page 1-37Supported Models for Time-Domain DataContinuous-Time ModelsYou can directly estimate the following types of continuous-time models: Transfer function models. Process models. State-space models.You can also use d2c to convert an estimated discrete-time model into a continuous-timemodel.Discrete-Time ModelsYou can estimate all linear and nonlinear models supported by the System IdentificationToolbox product as discrete-time models, except process models, which are defined only incontinuous-time..ODEs (Grey-Box Models)You can estimate both continuous-time and discrete-time models from time-domain datafor linear and nonlinear differential and difference equations.Nonlinear ModelsYou can estimate discrete-time Hammerstein-Wiener and nonlinear ARX models fromtime-domain data.You can also estimate nonlinear grey-box models from time-domain data. SeeEstimating Nonlinear Grey-Box Models on page 8-15.1 Choosing Your System Identification Approach1-36Supported Models for Frequency-Domain DataThere are two types of frequency-domain data: Frequency response data Frequency domain input/output signals which are Fourier Transforms of thecorresponding time domain signals.The data is considered continuous-time if its sample time (Ts) is 0, and is considereddiscrete-time if the sample time is nonzero.Continuous-Time ModelsYou can estimate the following types of continuous-time models directly: Transfer function models using continuous- or discrete-time data. Process models using continuous- or discrete-time data. Input-output polynomial models of output-error structure using continuous time data. State-space models using continuous- or discrete-time data.From continuous-time frequency-domain data, you can only estimate continuous-timemodels.You can also use d2c to convert an estimated discrete-time model into a continuous-timemodel.Discrete-Time ModelsYou can estimate all linear model types supported by the System Identification Toolboxproduct as discrete-time models, except process models, which are defined in continuous-time only. For estimation of discrete-time models, you must use discrete-time data.The noise component of a model cannot be estimated using frequency domain data, withthe exception of ARX models. Thus, the K matrix of an identified state-space model, thenoise component, is zero. An identified polynomial model has output-error (OE) or ARXstructure; BJ/ARMAX or other polynomial structure with nontrivial values of C or Dpolynomials cannot be estimated.ODEs (Grey-Box Models)For linear grey-box models, you can estimate both continuous-time and discrete-timemodels from frequency-domain data. The noise component of the model, the K matrix,cannot be estimated using frequency domain data; it remains fixed to 0. Supported Models for Time- and Frequency-Domain Data1-37Nonlinear grey-box models are supported only for time-domain data.Nonlinear Black-Box ModelsNonlinear black box (nonlinear ARX and Hammerstein-Wiener models) cannot beestimated using frequency domain data.See AlsoSupported Continuous- and Discrete-Time Models on page 1-381 Choosing Your System Identification Approach1-38Supported Continuous- and Discrete-Time ModelsFor linear and nonlinear ODEs (grey-box models), you can specify any ordinarydifferential or difference equation to represent your continuous-time or discrete-timemodel in state-space form, respectively. In the linear case, both time-domain andfrequency-domain data are supported. In the nonlinear case, only time-do