# State-Space Models

State-space models with free, canonical, and structured parameterizations; equivalent ARMAX and output-error (OE) models

State-space models are models that use state variables to describe a system by a set of first-order differential or difference equations, rather than by one or more nth-order differential or difference equations. State variables x(t) can be reconstructed from the measured input/output data, but are not themselves measured during an experiment.

The state-space model structure is a good choice for quick estimation because it requires you to specify only one input, the model order n. The model order is an integer equal to the dimension of x(t) and relates to, but is not necessarily equal to, the number of delayed inputs and outputs used in the corresponding linear difference equation.

Defining a parameterized state-space model in continuous time is often easier than in discrete time because physical laws are most often described in terms of differential equations. In continuous time, the state-space description has the following form:

`$\begin{array}{l}\stackrel{˙}{x}\left(t\right)=Fx\left(t\right)+Gu\left(t\right)+\stackrel{˜}{K}w\left(t\right)\\ y\left(t\right)=Hx\left(t\right)+Du\left(t\right)+w\left(t\right)\\ x\left(0\right)=x0\end{array}$`

The matrices F, G, H, and D contain elements with physical significance—for example, material constants. K contains the disturbance matrix. x0 specifies the initial states.

You can estimate a continuous-time state-space model using both time-domain and frequency-domain data.

The discrete-time state-space model structure is often written in the innovations form, which describes noise:

`$\begin{array}{l}x\left(kT+T\right)=Ax\left(kT\right)+Bu\left(kT\right)+Ke\left(kT\right)\\ y\left(kT\right)=Cx\left(kT\right)+Du\left(kT\right)+e\left(kT\right)\\ x\left(0\right)=x0\end{array}$`

Here, T is the sample time, u(kT) is the input at the time instant kT, and y(kT) is the output at the time instant kT.

You cannot estimate a discrete-time state-space model using continuous-time frequency-domain data.

## Apps

 System Identification Identify models of dynamic systems from measured data

 Estimate State-Space Model Estimate state-space model using time or frequency data in the Live Editor

## Functions

expand all

 `idss` State-space model with identifiable parameters `ssest` Estimate state-space model using time-domain or frequency-domain data `ssregest` Estimate state-space model by reduction of regularized ARX model `n4sid` Estimate state-space model using subspace method with time-domain or frequency-domain data `pem` Prediction error minimization for refining linear and nonlinear models
 `delayest` Estimate time delay (dead time) from data `findstates` Estimate initial states of model `ssform` Quick configuration of state-space model structure `init` Set or randomize initial parameter values `idpar` Create parameter for initial states and input level estimation
 `idssdata` State-space data of identified system `getpvec` Obtain model parameters and associated uncertainty data `setpvec` Modify values of model parameters `getpar` Obtain attributes such as values and bounds of linear model parameters `setpar` Set attributes such as values and bounds of linear model parameters
 `ssestOptions` Option set for `ssest` `ssregestOptions` Option set for `ssregest` `n4sidOptions` Option set for `n4sid` `findstatesOptions` Option set for `findstates`

## Topics

### State-Space Model Basics

What Are State-Space Models?

State-space models are models that use state variables to describe a system by a set of first-order differential or difference equations, rather than by one or more nth-order differential or difference equations.

State-Space Model Estimation Methods

Choose between noniterative subspace methods, iterative methods that use prediction error minimization algorithm, and noniterative methods.

Estimate State-Space Model With Order Selection

Select a model order for a state-space model structure in the app and at the command line.

Canonical State-Space Realizations

Modal, companion, observable and controllable canonical state-space models.

Data Supported by State-Space Models

You can use time-domain and frequency-domain data that is real or complex and has single or multiple outputs.

### Estimate State-Space Models

Estimate State-Space Models in System Identification App

Use the app to specify model configuration options and estimation options for model estimation.

Estimate State-Space Models at the Command Line

Perform black-box or structured estimation.

Estimate State-Space Models with Canonical Parameterization

Canonical parameterization represents a state-space system in a reduced parameter form where many elements of A, B and C matrices are fixed to zeros and ones.

Estimate State-Space Equivalent of ARMAX and OE Models

This example shows how to estimate ARMAX and OE-form models using the state-space estimation approach.

Estimate State-Space Models with Free-Parameterization

Free Parameterization is the default; the estimation routines adjust all the parameters of the state-space matrices.

Use State-Space Estimation to Reduce Model Order

Reduce the order of a Simulink® model by linearizing the model and estimating a lower order model that retains model dynamics.

### Structured Estimation, Innovations Form

Estimate State-Space Models with Structured Parameterization

Structured parameterization lets you exclude specific parameters from estimation by setting these parameters to specific values.

Identifying State-Space Models with Separate Process and Measurement Noise Descriptions

An identified linear model is used to simulate and predict system outputs for given input and noise signals.

### Set State-Space model Options

Supported State-Space Parameterizations

System Identification Toolbox™ software supports various parameterization combinations that determine which parameters are estimated and which parameters remain fixed to specific values.

Specifying Initial States for Iterative Estimation Algorithms

When you estimate state-space models, you can specify how the algorithm treats initial states.

## Support Get trial now