[. . . ] System Identification ToolboxTM 7 User's Guide
Lennart Ljung
How to Contact MathWorks
Web Newsgroup www. mathworks. com/contact_TS. html Technical Support
www. mathworks. com comp. soft-sys. matlab suggest@mathworks. com bugs@mathworks. com doc@mathworks. com service@mathworks. com info@mathworks. com
Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information
508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site. System Identification ToolboxTM User's Guide © COPYRIGHT 19882010 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. [. . . ] However, to be consistent with the idss object property name, this example uses A, B, and C instead of F, G, and H.
A = [0 1;0 -1]; B = [0;0. 25]; C = eye(2); D = [0;0]; K = zeros(2, 2); x0 = [0;0];
2 Construct the continuous-time state-space model object:
m = idss(A, B, C, D, K, x0, 'Ts', 0);
3-99
3
Linear Model Identification
3 Specify the parameter values in the structure matrices that you do not
want to estimate:
m. As = [0 1;0 NaN]; m. Bs = [0;NaN]; m. Cs = m. c; m. Ds = m. d; m. Ks = m. k; m. x0s = [NaN;0] m. NoiseVariance = [0. 01 0; 0 0. 1];
4 Estimate the model structure:
m = pem(data, m)
where data is name of the iddata object containing time-domain or frequency-domain data. The iterative search for a minimum is initialized by the parameters in the nominal model m. The continuous-time model is sampled using the same sampling interval as the data.
5 To simulate this system using the sampling interval T = 0. 1 for input u
and the noise realization e, use the following commands:
e = randn(300, 2); u = idinput(300); simdat = iddata([], [u e], 'Ts', 0. 1); y = sim(m, simdat)
The continuous system is automatically sampled using Ts=0. 1. If you discover that the motor was not initially at rest, you can estimate x2(0) by setting the second element of the x0s structure matrix to NaN, as follows:
m_new = pem(data, m, 'x0s', [NaN;NaN])
How to Estimate the State-Space Equivalent of ARMAX and OE Models
You can estimate the equivalent of ARMAX and output-error (OE) multiple-output models using state-space model structures. For the ARMAX
3-100
Identifying State-Space Models
case, specify to estimate the K matrix for the state-space model. Tip You can use a state-space model with K = 0 (Output-Error (OE) form) for initializing a Hammerstein-Wiener estimation at the command line. See "Using Linear Model for Hammerstein-Wiener Estimation" on page 4-64. For more information about ARMAX and OE models, see "Identifying Input-Output Polynomial Models" on page 3-39.
Options for Frequency-Weighing Focus
You can specify how the estimation algorithm weighs the fit at various frequencies. This information supports the estimation procedures "How to Estimate State-Space Models in the GUI" on page 3-84 and "How to Estimate State-Space Models at the Command Line" on page 3-87. Set Focus to one of the following options: · Prediction -- Uses the inverse of the noise model H to weigh the relative importance of how closely to fit the data in various frequency ranges. Corresponds to minimizing one-step-ahead prediction, which typically favors the fit over a short time interval. · Simulation -- Uses the input spectrum to weigh the relative importance of the fit in a specific frequency range. Does not use the noise model to weigh the relative importance of how closely to fit the data in various frequency ranges. For more information about model stability, see "Unstable Models" on page 8-66. · Filter -- Specify a custom filter to open the Estimation Focus dialog box, where you can enter a filter, as described in "Simple Passband Filter" on page 2-113 or "Defining a Custom Filter" on page 2-114. This prefiltering
3-101
3
Linear Model Identification
applies only for estimating the dynamics from input to output. Specify the focus as an argument in the model-estimation command using the same options as in the GUI. For example, use this command to emphasize the fit between the 5 and 8 rad/s:
pem(data, 4, 'Focus', [5 8])
Options for Initial States
If you estimate state-space models using the iterative estimation algorithm pem, you must specify how the algorithm treats initial states. This information supports the estimation procedures "How to Estimate State-Space Models in the GUI" on page 3-84 and "How to Estimate State-Space Models at the Command Line" on page 3-87. Set Initial state to one of the following options: · Auto -- Automatically chooses Zero, Estimate, or Backcast based on the estimation data. If initial states have negligible effect on the prediction errors, the initial states are set to zero to optimize algorithm performance. · Estimate -- Treats the initial states as an unknown vector of parameters and estimates these states from the data. [. . . ] For more information about noise channels, see "Subreferencing Measured and Noise Models" on page 3-121. Tip When you import data into the System Identification Tool GUI, it is helpful to assign meaningful channel names in the Import Data dialog box. For more information about importing data, see "Importing Data into the GUI" on page 2-14.
11-18
Working with Plots in the System Identification Tool GUI
Grid and Line Styles in Plots
There are several Style options that are common to all plot types. These include the following: · "Grid Lines" on page 11-19 · "Solid or Dashed Lines" on page 11-19
Grid Lines
To toggle showing or hiding grid lines, select Style > Grid.
Solid or Dashed Lines
To display currently visible lines as a combination of solid, dashed, dotted, and dash-dotted line style, select Style > Separate linestyles. [. . . ]