Skip to Main Content Skip to Search
Product Documentation

Creating Model Structures at the Command Line

About System Identification Toolbox Model Objects

Objects are instances of model classes. Each class is a blueprint that defines the following information about your model:

This toolbox includes nine classes for representing models. For example, idpoly represents linear input-output polynomial models, and idss represents linear state-space models. For a complete list of available model objects, see Commands for Constructing Model Structures.

Model properties define how a model object stores information. Model objects store information about a model, including the mathematical form of a model, names of input and output channels, units, names and values of estimated parameters, parameter uncertainties, algorithm specifications, and estimation information. For example, the idpoly model class has a property called InputName for storing one or more input channel names. Different model objects have different properties.

The allowed operations on an object are called methods. In the System Identification Toolbox product, some methods have the same name but apply to multiple model objects. For example, the method bode creates a bode plot for all linear model objects. However, other methods are unique to a specific model object. For example, the estimation method canon is unique to the state-space model object idss.

Every class has a special method for creating objects of that class, called the constructor. Using a constructor creates an instance of the corresponding class or instantiates the object. The constructor name is the same as the class name. For example, idpoly is both the name of the class representing linear black-box polynomial models and the name of the constructor for instantiating the model object.

For a tutorial about estimating models at the command line, see Tutorial – Identifying Linear Models Using the Command Line in System Identification Toolbox Getting Started Guide.

When to Construct a Model Structure Independently of Estimation

You use model constructors to create a model object at the command line by specifying all required model properties explicitly.

You must construct the model object independently of estimation when you want to:

In most cases, you can use the estimation commands to both construct and estimate the model—without having to construct the model object independently. For example, the estimation command tfest create a transfer function model using data and some information on the order of the model - the number of poles and zeros. For information about how to both construct and estimate models with a single command, see Model Estimation Commands.

In case of grey-box models, you must always construct the model object first and then estimate the parameters of the ordinary differential or difference equation. For more information, see ODE Parameter Estimation (Grey-Box Modeling).

Commands for Constructing Model Structures

The following table summarizes the model constructors available in the System Identification Toolbox product for representing various types of models.

After model estimation, you can recognize the corresponding model objects in the MATLAB Workspace browser by their class names. The name of the constructor matches the name of the object it creates.

For information about how to both construct and estimate models with a single command, see Model Estimation Commands.

Summary of Model Constructors

Model ConstructorResulting Model Class
idfrdNonparametric frequency-response model.
idprocContinuous-time, low-order transfer functions (process models).
idpoly

Linear input-output polynomial models:

  • ARX

  • ARMAX

  • Output-Error

  • Box-Jenkins

idss

Linear state-space models.

idtf

Linear transfer function models.

idgreyLinear ordinary differential or difference equations (grey-box models). You write a function that translates user parameters to state-space matrices. Can also be viewed as state-space models with user-specified parameterization.
idnlgreyNonlinear ordinary differential or difference equation (grey-box models). You write a function or MEX-file to represent the governing equations.
idnlarxNonlinear ARX models, which define the predicted output as a nonlinear function of past inputs and outputs.
idnlhwNonlinear Hammerstein-Wiener models, which include a linear dynamic system with nonlinear static transformations of inputs and outputs.

For more information about when to use these commands, see When to Construct a Model Structure Independently of Estimation.

Model Properties

Categories of Model Properties

The way a model object stores information is defined by the properties of the corresponding model class.

Each model object has properties for storing information that are relevant only to that specific model type. The idtf, idgrey, idpoly, idproc, and idss model objects are based on the idlti superclass and inherit all idlti properties.

Similarly, the nonlinear models idnlarx, idnlhw, and idnlgrey are based on the idnlmodel superclass and inherit all idnlmodel properties.

In general, all model objects have properties that belong to the following categories:

For information about getting help on object properties, see .

Viewing Model Properties and Estimated Parameters

To view all the properties and values of any model object, use the get command. For example, type the following at the prompt to load sample data, compute an ARX model, and list the model properties:

load iddata8
m_arx=arx(z8,[4 3 2 3 0 0 0]);
get(m_arx)

To access a specific property, use dot notation. For example, to view the A matrix containing the estimated parameters in the previous model, type the following command:

m_arx.a
ans =
    1.0000   -0.8441   -0.1539    0.2278    0.1239

To access the uncertainty information for a model, use getpvec and polydata.

For example, use:

[a,~,~,~,~,da] = polydata(m_arx)

Here, a represents the value of the A polynomial and its 1 stduncertainty.

Property names are not case sensitive. You do not need to type the entire property name if the first few letters uniquely identify the property.

To change property values for an existing model object, use the set command or dot notation. For example, to change the input delays for all three input channels to [1 1 1], type the following at the prompt:

set(m_arx,'InputDelay',[1 1 1])

or equivalently

m_arx.InputDelay = [1 1 1]

Some model properties, such as Report, are configured like structures. To access the fields of Report, use the following syntax:

model.Report.PropertyName

where PropertyName represents any of the Report fields.

See Also

Validate 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 structure and order, or try another identification algorithm. For more information about validating and troubleshooting models, see Validating Models After Estimation.

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS