ss __ Functions (Control System Toolbox™)
-
Upload
flavianopb -
Category
Documents
-
view
216 -
download
0
Transcript of ss __ Functions (Control System Toolbox™)
-
7/27/2019 ss __ Functions (Control System Toolbox)
1/3
Functions (Control System Toolbox) jar:file:///C:/Program%20Files/MATLAB/R2008a/help/toolbox/
07/05/20
Control System Toolbox
Provide feedback about this page
ssSpecify 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, l t i sys)sys_ss = ss( sys)
Description
ss is used to create real- or complex-valued state-space models (SS objects) or to convert transfer function orzero-pole-gain models to state space.
Creation o f 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 , you cansimply set d to the scalar0 (zero), regardless of the dimension.
sys = ss( a, b, c, d, Ts) creates the discrete-time model
with sample timeTs (in seconds). SetTs = - 1 orTs = [ ] to leave the sample time unspecified.
sys = ss( d) specifies a static gain matrix and is equivalent to
sys = ss( [ ] , [ ] , [ ] , d)
sys = ss( a, b, c, d, l t i sys) creates a state-space model with generic LTI properties inherited from the LTI modell t i sys (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.
' Proper t yName' , Proper t yVal ue
Each pair specifies a particular LTI property of the model, for example, the input names or some notes on the modelhistory. See set and the example below for details. Note that
sys = ss(a, b, c, d, ' Pr oper t y1' , Val ue1, . . . , ' Pr oper t yN' , Val ueN)
is equivalent to the sequence of commands.
-
7/27/2019 ss __ Functions (Control System Toolbox)
2/3
Functions (Control System Toolbox) jar:file:///C:/Program%20Files/MATLAB/R2008a/help/toolbox/
07/05/20
sys = ss( a, b, c, d)set ( sys, ' Pr oper t y1' , Val ue1, . . . , ' Pr oper t yN' , Val ueN)
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 equivalentstate-space model (SS object). This operation is known as state-space realization.
sys_ss = ss( sys, ' mi ni mal ' ) produces a state-space realization with no uncontrollable or unobservable states.This is equivalent to sys_ss = mi nr eal ( ss( sys) ) .
Algori thm
In the case of TF to SS model conversion, ss( sys_t f ) returns a modified version of the controllable canonical form. Ituses an algorithm similar to t f 2ss, but further rescales the state vector to compress the numerical range in state matrixA 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] =t f 2ss( n, d) ;sys=ss(t f ( n, d) ) ;A
A =
- 1 - 101 0
sys. a
ans =- 1 - 52 0
See the bal ance orssbal documentation for details.
Examples
Example 1
The command
sys = ss(A, B, C, D, 0. 05, ' st at ename' , {' posi t i on' ' vel oci t y' }, . . .' i nputname' , ' f orce' , . . .' not es' , ' Cr eat ed 10/ 15/ 96' )
creates a discrete-time model with matrices and sample time 0.05 second. This model has two states
labeled posi t i on and vel oc i ty , and one input labeled f orce (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
-
7/27/2019 ss __ Functions (Control System Toolbox)
3/3
Functions (Control System Toolbox) jar:file:///C:/Program%20Files/MATLAB/R2008a/help/toolbox/
07/05/20
by typing
H = [ t f ( [ 1 1] , [ 1 3 3 2] ) ; t f ( [ 1 0 3] , [ 1 1 1] ) ] ;sys = ss( H) ;si ze( sys)St ate- space model wi t h 2 out put s, 1 i nput , and 5 st ates.
Note that the number of states is equal to the cumulative order of the SISO entries ofH(s).
To obtain a minimal realization ofH(s), type
sys = ss( H, ' mi n' ) ;s i ze( sys)St ate- space model wi t h 2 out put s, 1 i nput , and 3 st ates.
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 , f r d, get , set , ssdat a, t f, zpk
Provide feedback about this page
sminreal ss2ss
1984-2008 The MathWorks, Inc. Terms of UsePatentsTrademarksAcknowledgments