Documentation

# idss

State-space model with identifiable parameters

## Description

sys = idss(A,B,C,D) creates a state-space model with identifiable parameters. A, B, C, and D are the initial values of the state-space matrices. By default, sys is discrete-time model with unspecified sample time and no state disturbance element.

sys = idss(A,B,C,D,K) creates a state-space model with a disturbance element given by the matrix K.

sys = idss(A,B,C,D,K,x0) creates a state-space model with initial state values given by the vector x0.

sys = idss(A,B,C,D,K,x0,Ts) creates a state-space model with sample time Ts. Use Ts = 0 to create a continuous-time model.

sys = idss(___,Name,Value) creates a state-space model using additional options specified by one or more Name,Value pair arguments.

sys = idss(sys0) converts any dynamic system model, sys0, to idss model form.

sys = idss(sys0,'split') converts sys0 to idss model form, and treats the last Ny input channels of sys0 as noise channels in the returned model. sys0 must be a numeric (non-identified) tf, zpk, or ss model object. Also, sys0 must have at least as many inputs as outputs.

## Object Description

An idss model represents a system as a continuous-time or discrete-time state-space model with identifiable (estimable) coefficients.

A state-space model of a system with input vector u, output vector y, and disturbance e takes the following form in continuous time:

$\begin{array}{c}\frac{dx\left(t\right)}{dt}=Ax\left(t\right)+Bu\left(t\right)+Ke\left(t\right)\\ y\left(t\right)=Cx\left(t\right)+Du\left(t\right)+e\left(t\right).\end{array}$

In discrete time, the state-space model takes the form:

$\begin{array}{c}x\left[k+1\right]=Ax\left[k\right]+Bu\left[k\right]+Ke\left[k\right]\\ y\left[k\right]=Cx\left[k\right]+Du\left[k\right]+e\left[k\right].\end{array}$

For idss models, the elements of the state-space matrices A, B, C, and D can be estimable parameters. The elements of the state disturbance K can also be estimable parameters. The idss model stores the values of these matrix elements in the A, B, C, D, and K properties of the model.

There are three ways to obtain an idss model.

• Estimate the idss model based on input-output measurements of a system, using n4sid or ssest. These estimation commands estimate the values of the estimable elements of the state-space matrices. The estimated values are stored in the A, B, C, D, and K properties of the resulting idss model. The Report property of the resulting model stores information about the estimation, such as handling of initial state values and options used in estimation.

When you obtain an idss model by estimation, you can extract estimated coefficients and their uncertainties from the model using commands such as idssdata, getpar, or getcov.

• Create an idss model using the idss command.

You can create an idss model to configure an initial parameterization for estimation of a state-space model to fit measured response data. When you do so, you can specify constraints on one or more of the state-space matrix elements. For example, you can fix the values of some elements, or specify minimum or maximum values for the free elements. You can then use the configured model as an input argument to an estimation command (n4sid or ssest) to estimate parameter values with those constraints.

• Convert an existing dynamic system model to an idss model using the idss command.

To configure an idss model in a desired form, such as a companion or modal form, use state transformation commands such as canon and ss2ss.

## Examples

collapse all

Create a 4th-order SISO state-space model with identifiable parameters. Initialize the initial state values to 0.1 for all entries. Set the sample time to 0.1 s as well.

A = blkdiag([-0.1 0.4; -0.4 -0.1],[-1 5; -5 -1]);
B = [1; zeros(3,1)];
C = [1 0 1 0];
D = 0;
K = zeros(4,1);
x0 = [0.1,0.1,0.1,0.1];
Ts = 0.1;

sys = idss(A,B,C,D,K,x0,Ts);

sys is a 4th-order, SISO idss model. The number of states and input-output dimensions are determined by the dimensions of the state-space matrices. By default, all entries in the matrices A, B, C, D, and K are identifiable parameters.

You can use sys to specify an initial parameterization for state-space model estimation with ssest or n4sid.

Create a 4th-order SISO state-space model with identifiable parameters. Name the input and output channels of the model, and specify minutes for the model time units.

You can use Name,Value pair arguments to specify additional model properties on model creation.

A = blkdiag([-0.1 0.4; -0.4 -0.1],[-1 5; -5 -1]);
B = [1; zeros(3,1)];
C = [1 0 1 0];
D = 0;

sys = idss(A,B,C,D,'InputName','Drive','TimeUnit','minutes');

To change or specify most attributes of an existing model, you can use dot notation. For example:

sys.OutputName = 'Torque';

Configure an idss model so that it has no state disturbance element and only the non-zero entries of the A matrix are estimable. Additionally, fix the values of the B matrix.

You can configure individual parameters of an idss model to specify constraints for state-space model estimation with ssest or n4sid.

Create an idss model.

A = blkdiag([-0.1 0.4; -0.4 -0.1],[-1 5; -5 -1]);
B = [1; zeros(3,1)];
C = [1 0 1 0];
D = 0;
K = zeros(4,1);
x0 = [0.1,0.1,0.1,0.1];

sys = idss(A,B,C,D,K,x0,0);

Setting all entries of K = 0 creates an idss model with no state disturbance element.

Use the Structure property of the model to fix the values of some of the parameters.

sys.Structure.A.Free = (A~=0);
sys.Structure.B.Free = false;
sys.Structure.K.Free = false;

The entries in sys.Structure.A.Free determine whether the corresponding entries in sys.A are free (identifiable) or fixed. The first line sets sys.Structure.A.Free to a logical matrix that is true wherever A is non-zero, and false everywhere else. Doing so fixes the value of the zero entries in sys.A.

The remaining lines fix all the values in sys.B and sys.K to the values you specified when you created the model.

Create an array of state-space models.

There are several ways to create arrays of state-space models:

• Direct array construction using $n$-dimensional state-space arrays

• Array-building by indexed assignment

• Array-building using the stack command

• Sampling an identified model using the rsample command

Create an array by providing $n$-dimensional arrays as an input argument to idss, instead of 2-dimensional matrices.

A = rand(2,2,3,4);
sysarr = idss(A,[2;1],[1 1],0);

When you provide a multi-dimensional array to idss in place of one of the state-space matrices, the first two dimensions specify the numbers of states, inputs, or outputs of each model in the array. The remaining dimensions specify the dimensions of the array itself. A is a 2-by-2-by-3-by-4 array. Therefore, sysarr is a 3-by-4 array of idss models. Each model in sysarr has two states, specified by the first two dimensions of A. Further, each model in sysarr has the same B, C, and D values.

Create an array by indexed assignment.

sysarr = idss(zeros(1,1,2));
sysarr(:,:,1) = idss([4 -3; -2 0],[2;1],[1 1],0);
sysarr(:,:,2) = idss(rand(2),rand(2,1),rand(1,2),1);

The first command preallocates the array. The first two dimensions of the array are the I/O dimensions of each model in the array. Therefore, sysarr is a 2-element vector of SISO models.

The remaining commands assign an idss model to each position in sysarr. Each model in an array must have the same I/O dimensions.

Add another model to sysarr using stack.

stack is an alternative to building an array by indexing.

sysarr = stack(1,sysarr,idss([1 -2; -4 9],[0;-1],[1 1],0));

This command adds another idss model along the first array dimension of sysarr. sysarr is now a 3-by-1 array of SISO idss models

## Input Arguments

 A,B,C,D Initial values of the state-space matrices. For a system with Ny outputs, Nu inputs, and Nx states, specify initial values of the state-space matrix elements as follows: A — Nx-by-Nx matrix.B — Nx-by-Nu matrix.C — Ny-by-Nx matrix.D — Ny-by-Nu matrix. Use NaN for any matrix element whose initial value is not known. K Initial value of the state disturbance matrix. Specify K as an Nx-by-Ny matrix. Use NaN for any matrix element whose initial value is not known. Default: Nx-by-Ny zero matrix. x0 Initial state values. Specify the initial condition as a column vector of Nx values. Default: Nx column vector of zeros. Ts Sample time. For continuous-time models, Ts = 0. For discrete-time models, Ts is a positive scalar representing the sampling period expressed in the unit specified by the TimeUnit property of the model. To denote a discrete-time model with unspecified sample time, set Ts = -1. Default: –1 (discrete-time model with unspecified sample time) sys0 Dynamic system. Any dynamic system to convert to an idss model: When sys0 is an identified model, its estimated parameter covariance is lost during conversion. If you want to translate the estimated parameter covariance during the conversion, use translatecov.When sys0 is a numeric (non-identified) model, the state-space data of sys0 define the A, B, C, and D matrices of the converted model. The disturbance matrix K is fixed to zero. The NoiseVariance value defaults to eye(Ny), where Ny is the number of outputs of sys. For the syntax sys = idss(sys0,'split'), sys0 must be a numeric (non-identified) tf, zpk, or ss model object. Also, sys0 must have at least as many inputs as outputs. Finally, the subsystem sys0(:,Ny+1:Ny+Nu) must contain a non-zero feedthrough term (the subsystem must be biproper).

### Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Use Name,Value arguments to specify additional properties of idss models during model creation. For example, idss(A,B,C,D,'InputName','Voltage') creates an idss model with the InputName property set to Voltage.

## Properties

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

idss object properties include: