System Identification Toolbox    
idgrey

Package a greybox model structure defined by a user-written M-file into an idgrey model.

Syntax

Description

The function idgrey is used to create arbitrarily parameterized state-space models as idgrey objects.

MfileName is the name of an M-file that defines how the state-space matrices depend on the parameters to be estimated. The format of this M-file is given by

and is further discussed below.

ParameterVector is a column vector of the nominal/initial parameters. Its length must be equal to the number of free parameters in the model (that is, the argument pars in the example below).

The argument CDmfile describes how the user-written M-file handles continuous/discrete-time model. It takes the following values:

The argument FileArgument corresponds to the auxiliary argument Auxarg in the user-written M-file. It can be used to handle several variants of the model structure, without having to edit the M-file. If it is not used, enter FileArgument = []. (Default).

Ts denotes the sampling interval of the model. Its default value is Ts = 0, that is, a continuous-time model.

The idgrey object is a child of idmodel. Therefore any idmodel properties can be set as property name/property value pairs in the idgrey command. They can of course also be set by the command set, or by subassignment, like

There are also two properties, DisturbanceModel and InitialState that can be used to affect the parameterizations of K and X0, thus overriding the outputs from the M-file. See below.

idgrey Properties

To summarize, the properties of idgrey are the following ones:

In addition, any idgrey object also has all the properties of idmodel. See Algorithm Properties and the reference page for idmodel.

Note that all properties can be set/get either by these commands or by subscripts. Autofill applies to all properties and values, and are case insensitive.

For a complete list of property values, use get(m). To see possible value assignments, use set(m). See also idprops and idgrey.

M-File Details

The model structure corresponds to the general linear state-space structure

Here is the time derivative for a continuous time model and for a discrete time model.

The matrices in this time-discrete model can be parameterized in an arbitrary way by the vector . Write the format for the M-file as follows.

Here the vector pars contains the parameters , and the output arguments A, B, C, D, K, and x0 are the matrices in the model description that correspond to this value of the parameters and this value of the sampling interval T.

T is the sampling interval, and Auxarg is any variable of auxiliary variables with which you want to work. (In that way you can change certain constants and other aspects in the model structure without having to edit the M-file.) Note that the two arguments T and Auxarg must be included in the function head of the M-file, even if they are not utilized within the M-file.

Section State-Space Models with Coupled Parameters: the idgrey Model of the "Tutorial" contains several examples of typical M-files that define model structures.

A comment about CDmfile: If a continuous time model is sought, it is of course most easy to let the mfile deliver just the continuous time model, i.e., have CDmfile = 'c', and rely upon the toolbox's routines for the proper sampling. Similarly, if the underlying parameterization is indeed discrete time, it is natural to deliver the discrete time model matrices, and let CDmfile = 'd'. If the underlying parameterization is continuous, but you prefer for some reason to do your own sampling inside the mfile, in accordance with the value of T, then it is preferable to let your mfile deliver the continuous time model when called with T = 0, that is, the alternative CMmfile = 'cd'. This will avoid sampling, and then transforming back (using d2c) to find the continuous time model.

Examples

Use the M-file 'mynoise' given in Example 3.4: Parametrized Disturbance Models in the of the "Tutorial" to obtain a physical parametrization of the Kalman gain.


  idfrd idinput