Sei sulla pagina 1di 3

ss :: Functions (Control System Toolbox)

jar:file:///C:/Program%20Files/MATLAB/R2008a/help/toolbox/control/...

Control System Toolbox


Provide feedback about this page

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

Syntax
ss sys = ss(a,b,c,d) sys = ss(a,b,c,d,Ts) sys = ss(d) sys = ss(a,b,c,d,ltisys) sys_ss = ss(sys)

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: a is an Nx-by-Nx real- or complex-valued matrix. b is an Nx-by-Nu real- or complex-valued matrix. c is an Ny-by-Nx real- or complex-valued matrix. d is an Ny-by-Nu real- or complex-valued matrix. The output sys is an SS model that stores the model data (see "State-Space Models" on page 2-14). If simply set d to the scalar 0 (zero), regardless of the dimension. sys = ss(a,b,c,d,Ts) creates the discrete-time model , you can

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 sys = ss([],[],[],d) 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. 'PropertyName',PropertyValue Each pair specifies a particular LTI property of the model, for example, the input names or some notes on the model history. See set and the example below for details. Note that sys = ss(a,b,c,d,'Property1',Value1,...,'PropertyN',ValueN) is equivalent to the sequence of commands. and is equivalent to

1 of 3

07/05/2013 21:25

ss :: Functions (Control System Toolbox)

jar:file:///C:/Program%20Files/MATLAB/R2008a/help/toolbox/control/...

sys = ss(a,b,c,d) set(sys,'Property1',Value1,...,'PropertyN',ValueN)

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)) .

Algorithm
In the case of TF to SS model conversion, ss(sys_tf) returns a modified version of the controllable canonical form. It uses an algorithm similar to tf2ss, but further rescales the state vector to compress the numerical range in state matrix A and to improve numerics in subsequent computations. In the case of ZPK to SS conversion, ss(sys_zpk) uses direct form II structures as defined in signal processing texts. See "Discrete-Time Signal Processing" by Oppenheim and Schafer for details. For example, in the following code, A and sys.a differ by a diagonal state transformation: n=[1 1]; d=[1 1 10]; [A,B,C,D]=tf2ss(n,d); sys=ss(tf(n,d)); A A = -1 1 sys.a ans = -1 2 -5 0 -10 0

See the balance or ssbal documentation for details.

Examples
Example 1
The command sys = ss(A,B,C,D,0.05,'statename',{'position' 'velocity'},... 'inputname','force',... 'notes','Created 10/15/96') 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

2 of 3

07/05/2013 21:25

ss :: Functions (Control System Toolbox)

jar:file:///C:/Program%20Files/MATLAB/R2008a/help/toolbox/control/...

by typing H = [tf([1 1],[1 3 3 2]) ; tf([1 0 3],[1 1 1])]; sys = ss(H); size(sys) State-space model with 2 outputs, 1 input, and 5 states. 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 sys = ss(H,'min'); size(sys) State-space model with 2 outputs, 1 input, and 3 states. 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, frd, get, set, ssdata, tf, zpk
Provide feedback about this page

sminreal

ss2ss

1984-2008 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments

3 of 3

07/05/2013 21:25

Potrebbero piacerti anche