【实例简介】教材,系统辨识工具箱pdf
一本非常详细的教材
【实例截图】
【核心代码】
How to Contact The MathWorks:
www.mathworks.com
Web
comp.soft-sys.matlab
Newsgroup
support@mathworks.com Technical support
suggest@mathworks.com Product enhancement suggestions
bugs@mathworks.com Bug reports
doc@mathworks.com Documentation error reports
service@mathworks.com Order status, license renewals, passcodes
info@mathworks.com Sales, pricing, and general information
508-647-7000 Phone
508-647-7001 Fax
The MathWorks, Inc. Mail
3 Apple Hill Drive
Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site.
System Identification Toolbox User’s Guide
COPYRIGHT 1988 - 2002 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used
or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro
duced in any form without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by
or for the federal government of the United States. By accepting delivery of the Program, the government
hereby agrees that this software qualifies as "commercial" computer software within the meaning of FAR
Part 12.212, DFARS Part 227.7202-1, DFARS Part 227.7202-3, DFARS Part 252.227-7013, and DFARS Part
252.227-7014. The terms and conditions of The MathWorks, Inc. Software License Agreement shall pertain
to the government’s use and disclosure of the Program and Documentation, and shall supersede any
conflicting contractual terms or conditions. If this license fails to meet the government’s minimum needs or
is inconsistent in any respect with federal procurement law, the government agrees to return the Program
and Documentation, unused, to MathWorks.
MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are registered trademarks, and
TargetBox is a trademark of The MathWorks, Inc.
Other product or brand names are trademarks or registered trademarks of their respective holders.
Printing History: April 1988 First printing
July 1991 Second printing
May 1995 Third printing
November 2000 Fourth printing Revised for Version 5.0 (Release 12)
April 2001 Fifth printing
July 2002 Online only Version 5.0.2 (Release 13)Contents
Preface
What Is the System Identification Toolbox? . . . . . . . . . . . . . viii
Using This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
Related Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
The System Identification Problem
1
Basic Questions About System Identification . . . . . . . . . . . . 1-2
Common Terms Used in System Identification . . . . . . . . . . 1-4
Basic Information About Dynamic Models . . . . . . . . . . . . . . 1-6
The Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
The Basic Dynamic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Variants of Model Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
How to Interpret the Noise Source . . . . . . . . . . . . . . . . . . . . . . . 1-8
Terms to Characterize the Model Properties . . . . . . . . . . . . . . 1-10
The Basic Steps of System Identification . . . . . . . . . . . . . . . 1-12
A Startup Identification Procedure . . . . . . . . . . . . . . . . . . . . 1-14
Step 1: Looking at the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14
Step 2: Getting a Feel for the Difficulties . . . . . . . . . . . . . . . . 1-14
iii
Contents
Step 3: Examining the Difficulties . . . . . . . . . . . . . . . . . . . . . . 1-15
Step 4: Fine Tuning Orders and Disturbance Structures . . . . 1-16
Multivariable Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18
Reading More About System Identification . . . . . . . . . . . . . 1-21
2
The Graphical User Interface
The Big Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
The Model and Data Boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
The Working Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
The Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
The Validation Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
The Work Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Management Aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Workspace Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Help Texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
Handling Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Data Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Getting Input-Output Data into the GUI . . . . . . . . . . . . . . . . . . 2-8
Taking a Look at the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Preprocessing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Checklist for Data Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Simulating Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Estimating Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
The Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Direct Estimation of the Impulse Response . . . . . . . . . . . . . . . 2-15
Direct Estimation of the Frequency Response . . . . . . . . . . . . . 2-16
Estimation of Parametric Models . . . . . . . . . . . . . . . . . . . . . . . 2-17
ARX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
ARMAX, Output-Error and Box-Jenkins Models . . . . . . . . . . . 2-23
State-Space Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
User Defined Model Structures . . . . . . . . . . . . . . . . . . . . . . . . . 2-26Examining Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28
Views and Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28
The Plot Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29
Frequency Response and Disturbance Spectra . . . . . . . . . . . . 2-30
Transient Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30
Poles and Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
Compare Measured and Model Output . . . . . . . . . . . . . . . . . . . 2-31
Residual Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
Text Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-33
LTI Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-33
Further Analysis in the MATLAB Workspace . . . . . . . . . . . . . 2-34
Some Further GUI Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35
Mouse Buttons and Hotkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35
Troubleshooting in Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36
Layout Questions and idprefs.mat . . . . . . . . . . . . . . . . . . . . . . 2-36
Customized Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-37
What Cannot be Done Using the GUI . . . . . . . . . . . . . . . . . . . 2-37
Tutorial
3
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
The Toolbox Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
An Introductory Example to Command Mode . . . . . . . . . . . . 3-5
The System Identification Problem . . . . . . . . . . . . . . . . . . . . . 3-9
Impulse Responses, Frequency Functions, and Spectra . . . . . . 3-9
Polynomial Representation of Transfer Functions . . . . . . . . . 3-11
State-Space Representation of Transfer Functions . . . . . . . . . 3-13
Continuous-Time State-Space Models . . . . . . . . . . . . . . . . . . . 3-14
Estimating Impulse Responses . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Estimating Spectra and Frequency Functions . . . . . . . . . . . . . 3-15
Estimating Parametric Models . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
Subspace Methods for Estimating State-Space Models . . . . . . 3-17
iiiiv
Contents
Data Representation and
Nonparametric Model Estimation . . . . . . . . . . . . . . . . . . . . . 3-19
Data Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
Correlation Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
Spectral Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
More on the Data Representation in iddata . . . . . . . . . . . . . . . 3-22
Parametric Model Estimation . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
ARX Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27
AR Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27
General Polynomial Black-Box Models . . . . . . . . . . . . . . . . . . . 3-28
State-Space Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30
Optional Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-31
Defining Model Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-37
Polynomial Black-Box Models: The idpoly Model . . . . . . . . . . 3-38
Multivariable ARX Models: The idarx Model . . . . . . . . . . . . . . 3-39
Black-Box State-Space Models: the idss Model . . . . . . . . . . . . 3-41
Structured State-Space Models with Free Parameters:
the idss Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44
State-Space Models with Coupled Parameters:
the idgrey Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46
State-Space Structures: Initial Values and
Numerical Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-49
Examining Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-51
Parametric Models: idmodel and its children . . . . . . . . . . . . . . 3-51
Frequency Function Format: the idfrd model . . . . . . . . . . . . . 3-57
Graphs of Model Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-58
Transformations to Other Model Representations . . . . . . . . . 3-61
Discrete and Continuous Time Models . . . . . . . . . . . . . . . . . . . 3-62
Model Structure Selection and Validation . . . . . . . . . . . . . . 3-65
Comparing Different Structures . . . . . . . . . . . . . . . . . . . . . . . . 3-65
Impulse Response to Determine Delays . . . . . . . . . . . . . . . . . . 3-68
Checking Pole-Zero Cancellations . . . . . . . . . . . . . . . . . . . . . . . 3-68
Residual Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-68
Model Error Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-69
Noise-Free Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-70
Assessing the Model Uncertainty . . . . . . . . . . . . . . . . . . . . . . . 3-70Comparing Different Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-72
Selecting Model Structures for Multivariable Systems . . . . . . 3-72
Dealing with Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-76
Offset Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-76
Outliers and Bad Data; Multi-Experiment Data . . . . . . . . . . . 3-76
Missing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-77
Filtering Data: Focus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-77
Feedback in Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-78
Delays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-79
Recursive Parameter Estimation . . . . . . . . . . . . . . . . . . . . . . 3-80
The Basic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-80
Choosing an Adaptation Mechanism and Gain . . . . . . . . . . . . 3-81
Available Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-83
Segmentation of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-85
Some Special Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-87
Time Series Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-87
Periodic Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-89
Connections Between the Control System Toolbox and the
System Identification Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . 3-89
Memory/Speed Trade-Offs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-91
Local Minima . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-92
Initial Parameter Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-92
Initial State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-93
The Estimated Parameter Covariance Matrix . . . . . . . . . . . . . 3-94
No Covariance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-94
nk and InputDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-95
Linear Regression Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-96
Spectrum Normalization and the Sampling Interval . . . . . . . 3-96
Interpretation of the Loss Function . . . . . . . . . . . . . . . . . . . . . 3-99
Enumeration of Estimated Parameters . . . . . . . . . . . . . . . . . 3-100
Complex-Valued Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-100
Strange Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-101
vvi
Contents
4
Function Reference
Functions — By Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Help Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
The Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Simulation and Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Data Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Nonparametric Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Parameter Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Model Structure Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Manipulating Model Structures . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Model Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Model Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Model Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Assessing Model Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Model Structure Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Recursive Parameter Estimation . . . . . . . . . . . . . . . . . . . . . . . . 4-8
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
网友评论
我要评论