Function Reference    
ss

Specify state-space models or convert an LTI model to state space

Syntax

Description

ss is used to create real- or complex-valued state-space models (SS objects) or to convert transfer function or zero-pole-gain models to state space.

Creation of State-Space Models

sys = ss(a,b,c,d) creates the continuous-time state-space model

For a model with Nx states, Ny outputs, and Nu inputs:

The output sys is an SS model that stores the model data (see "State-Space Models" on page 2-14). If , you can simply set d to the scalar 0 (zero), regardless of the dimension.

sys = ss(a,b,c,d,Ts) creates the discrete-time model

with sample time Ts (in seconds). Set Ts = -1 or Ts = [] to leave the sample time unspecified.

sys = ss(d) specifies a static gain matrix and is equivalent to

sys = ss(a,b,c,d,ltisys) creates a state-space model with generic LTI properties inherited from the LTI model ltisys (including the sample time). See "Generic Properties" on page 2-26 for an overview of generic LTI properties.

See "Building LTI Arrays" on page 4-12 for information on how to build arrays of state-space models.

Any of the previous syntaxes can be followed by property name/property value pairs.

Each pair specifies a particular LTI property of the model, for example, the input names or some notes on the model history. See the set entry and the example below for details. Note that

is equivalent to the sequence of commands.

Conversion to State Space

sys_ss = ss(sys) converts an arbitrary TF or ZPK model sys to state space. The output sys_ss is an equivalent state-space model (SS object). This operation is known as state-space realization.

sys_ss = ss(sys,'minimal') produces a state-space realization with no uncontrollable or unobservable states. This is equivalent to sys_ss = minreal(ss(sys)).

Examples

Example 1

The command

creates a discrete-time model with matrices and sample time 0.05 second. This model has two states labeled position and velocity, and one input labeled force (the dimensions of should be consistent with these numbers of states and inputs). Finally, a note is attached with the date of creation of the model.

Example 2

Compute a state-space realization of the transfer function

by typing

Note that the number of states is equal to the cumulative order of the SISO entries of H(s).

To obtain a minimal realization of H(s), type

The resulting state-space model order has order three, the minimum number of states needed to represent H(s). This can be seen directly by factoring H(s) as the product of a first order system with a second order one.

See Also
dss         Specify descriptor state-space models.

frd         Specify FRD models or convert to an FRD.

get         Get properties of LTI models.

set         Set properties of LTI models.

ssdata      Retrieve the matrices of state-space model.

tf          Specify transfer functions or convert to TF.

zpk         Specify zero-pole-gain models or convert to ZPK.


  sminreal ss2ss