DynamicSystems
StateSpace
create a state-space system object
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
StateSpace(opts)
StateSpace(sys, opts)
StateSpace(tf, opts)
StateSpace(z, p, k, opts)
StateSpace(num, den, opts)
StateSpace(a, b, c, d, opts)
StateSpace(de, invars, outvars, opts)
sys
-
System; system object
tf
algebraic or Matrix(algebraic); transfer function
z
list(algebraic) or Matrix(list(algebraic)); zeros
p
list(algebraic) or Matrix(list(algebraic)); poles
k
algebraic or Matrix(algebraic); gain(s)
num
list(algebraic) or Matrix (list(algebraic)); numerator coefficients
den
list(algebraic) or Matrix (list(algebraic)); denominator coefficients
a
Matrix; state-space matrix A
b
Matrix; state-space matrix B
c
Matrix; state-space matrix C
d
Matrix; state-space matrix D
de
equation or list(equation); diff-equations
invars
name, anyfunc(name) or list of same; input variables
outvars
name, anyfunc(name) or list of same; output variables
opts
(optional) equation(s) of the form option = value; specify options for the StateSpace command
The opts arguments are optional arguments of the form option = value, where option is one of the names listed below. These arguments correspond to keyword parameters; the left side of an equation is the keyword and the right side is the value. Each keyword parameter has a default value that is assigned if the parameter is not passed.
The following paragraphs describe each of the keyword parameters. The first line of each paragraph specifies the format of the argument: the left side is the keyword and the right side specifies the type of the value. If the type is truefalse, then passing just the keyword is equivalent to passing keyword = true.
discrete = truefalse
Specifies whether the system is discrete (true) or continuous (false). The default value is assigned by DynamicSystems[SystemOptions].
conjugate = truefalse
If true and the z and p (and k) parameters are used, then the conjugate of any complex zero or pole is added to the respective list. For example, if conjugate = true then z=1,1+I is equivalent to z=1,1+I,1−I. The default value is assigned by DynamicSystems[SystemOptions].
sampletime = realcons
The sampling time of the system. The default value is assigned by DynamicSystems[SystemOptions].
systemname = string
The name of the system. The default is the empty string.
inputvariable = list of name or function(name)
The names of the inputs to the system. A name, say u, is converted to a function u(t), where t is the independent variable of the system, See DynamicSystems/SystemObject. The default value is assigned by DynamicSystems[SystemOptions].
outputvariable = list of name or function(name)
The names of the outputs of the system. A name, say y, is converted to a function y(t), where t is the independent variable of the system, see DynamicSystems[SystemObject]. The default value is assigned by DynamicSystems[SystemOptions].
statevariable = list of name or function(name)
The names of the states of the system. A name, say x, is converted to a function x(t), where t is the independent variable of the system, see DynamicSystems[SystemObject]. The default value is assigned by DynamicSystems[SystemOptions].
parameters = list or set of name=complexcons
Specifies values for symbolic parameters. These are used in operations that require numeric evaluation, such as plotting.
form = ControlCanon, ObserveCanon, or Minimal
Specify the form of the state-space matrices. This option is not available when the input is a state-space system or differential equations. The default is ControlCanon.
Symbolic Matrix Options
These options are for creating a state-space system with symbolic matrices.
usesymbols = true or false
True means create symbolic matrices, using the symbols option to specify the base-name for each matrix. The size of the matrices is computed from numinputs, numoutputs, and numstates, or, if specified, inputvariable, outputvariable, statevariable. This option is used only if a system is not otherwise specified, using the positional parameters. The default is false.
numinputs = nonnegint
Used with usesymbols option to specify the number of inputs.
numoutputs = nonnegint
Used with usesymbols option to specify the number of outputs.
numstates = nonnegint
Used with usesymbols option to specify the number of states.
symbols = list of four symbols
Used with the usesymbols option to specify the base symbolic names of the four matrices, A,B,C,D. The default is [a,b,c,d].
Random Test Matrix Options
These options are for creating a stable state-space system with random test matrices.
randomtest = true or false
True means create random test matrices, using the genbound option to specify the generator for the random matrices. The size of the matrices is computed from numinputs, numoutputs, and numstates, or, if specified, inputvariable, outputvariable, statevariable. This option is used only if a system is not otherwise specified, using the positional parameters. The default is false.
Used with randomtest option to specify the number of inputs.
Used with randomtest option to specify the number of outputs.
Used with randomtest option to specify the number of states.
genbound = positive
Used with the randomtest option to specify the random number generator's bounds used by RandomMatrix. All random matrices, except state matrix a, will be generated with random numbers in the -genbound..genbound range. If genbound is specified as integer, the random numbers will be integers. To ensure the system is stable, the diagonal entries of state matrix a are modified such that all eigenvalues are stable. The rest of the matrix a entries are contained in the -genbound..genbound range. The default value of genbound is 1.0 (float). Hence, by default, the random matrices will have float entries.
The StateSpace command creates a state-space (SS) system object. The time-domain behavior of the object is modeled by four state-space Matrices, A, B, C, and D, that describe the input, output, and state equations.
The input can be specified as one of several representations: transfer function (TF), zero-pole-gain (ZPK), coefficients (Coeff), state-space (SS), or diff-equations (DE).
If no input is provided, a unity-gain SS system is created.
The optional parameter sys is a system object; it is converted to the SS representation. All options are ignored.
The optional parameter tf is the transfer function of a TF system. For a single-input/single-output system, tf is a rational function (ratpoly). For a multi-input/multi-output system, tf is a Matrix of rational functions. The indeterminate of the polynomials depends on whether the system is continuous or discrete; a continuous system typically uses s while a discrete system typically uses z as the indeterminate. The actual names are assigned by DynamicSystems[SystemOptions].
The optional parameters z, p, and k are the zeros, poles, and gain, respectively, of a ZPK system. For a single-input/single-output system, z and p are lists and k is an algebraic expression. For a multi-input/multi-output system, z and p are Matrices of lists and k is a Matrix of algebraic expressions.
The optional parameters num and den are the coefficients of the numerator and denominator, respectively, of a Coeff system. For a single-input/single-output system, num and den are lists, the first element being the coefficient of the highest order term. For a multi-input/multi-output system, num and den are Matrices of lists.
The optional parameters a, b, c, and d are the four state-space matrices, A, B, C, and D, respectively, of an SS system.
The optional parameter de is the difference/differential equation(s) of a DE system. A list is used to specify more than one equation.
The parameters invars and outvars specify the input and output variables of difference/differential equations. They are not required, but if either is not specified then the corresponding keyword parameter inputvariable or outputvariable must be assigned. If both positional and keyword parameters are specified, the keyword parameter take precedence.
with⁡DynamicSystems:
sys1≔StateSpace⁡
sys1≔State Spacecontinuous1 output(s); 1 input(s); 0 state(s)inputvariable=u1⁡toutputvariable=y1⁡tstatevariable=
PrintSystem⁡sys1
State Spacecontinuous1 output(s); 1 input(s); 0 state(s)inputvariable=u1⁡toutputvariable=y1⁡tstatevariable=a=b=c=d=1
sys2≔StateSpace⁡ss3+5⁢s2+7⁢s+6:
PrintSystem⁡sys2
State Spacecontinuous1 output(s); 1 input(s); 3 state(s)inputvariable=u1⁡toutputvariable=y1⁡tstatevariable=x1⁡t,x2⁡t,x3⁡ta=010001−6−7−5b=001c=010d=0
sys3≔StateSpace⁡1,2,1,2,3:
PrintSystem⁡sys3
State Spacecontinuous1 output(s); 1 input(s); 2 state(s)inputvariable=u1⁡toutputvariable=y1⁡tstatevariable=x1⁡t,x2⁡ta=01−3−2b=01c=21d=0
sys4≔StateSpace⁡,−5+1⁢I,−5−1⁢I,1:
PrintSystem⁡sys4
State Spacecontinuous1 output(s); 1 input(s); 2 state(s)inputvariable=u1⁡toutputvariable=y1⁡tstatevariable=x1⁡t,x2⁡ta=01−26−10b=01c=10d=0
ss_a≔Matrix⁡1,2,0,4
ss_a≔1204
ss_b≔Matrix⁡3,7,9,6
ss_b≔3796
ss_c≔Matrix⁡5,6,5,2
ss_c≔5652
ss_d≔Matrix⁡0,0,0,0
ss_d≔0000
sys5≔StateSpace⁡ss_a,ss_b,ss_c,ss_d,discrete,sampletime=0.001,systemname=Example discrete MIMO system:
PrintSystem⁡sys5
State Spacediscrete; sampletime = .1e-2systemname=Example discrete MIMO system2 output(s); 2 input(s); 2 state(s)inputvariable=u1⁡q,u2⁡qoutputvariable=y1⁡q,y2⁡qstatevariable=x1⁡q,x2⁡qa=1204b=3796c=5652d=0000
Create a system with symbolic matrices.
sys6≔StateSpace⁡usesymbols,numinputs=2,numoutputs=3,numstates=4
sys6≔State Spacecontinuous3 output(s); 2 input(s); 4 state(s)inputvariable=u1⁡t,u2⁡toutputvariable=y1⁡t,y2⁡t,y3⁡tstatevariable=x1⁡t,x2⁡t,x3⁡t,x4⁡t
PrintSystem⁡sys6
State Spacecontinuous3 output(s); 2 input(s); 4 state(s)inputvariable=u1⁡t,u2⁡toutputvariable=y1⁡t,y2⁡t,y3⁡tstatevariable=x1⁡t,x2⁡t,x3⁡t,x4⁡ta=a1,1a1,2a1,3a1,4a2,1a2,2a2,3a2,4a3,1a3,2a3,3a3,4a4,1a4,2a4,3a4,4b=b1,1b1,2b2,1b2,2b3,1b3,2b4,1b4,2c=c1,1c1,2c1,3c1,4c2,1c2,2c2,3c2,4c3,1c3,2c3,3c3,4d=d1,1d1,2d2,1d2,2d3,1d3,2
Create a random test state-space system
sys7≔StateSpace⁡randomtest,numstates=6,numinputs=3,numoutputs=2,genbound=5:
PrintSystem⁡sys7
State Spacecontinuous2 output(s); 3 input(s); 6 state(s)inputvariable=u1⁡t,u2⁡t,u3⁡toutputvariable=y1⁡t,y2⁡tstatevariable=x1⁡t,x2⁡t,x3⁡t,x4⁡t,x5⁡t,x6⁡ta=−1211−4−405−70−5−3−1−40−14−2−12−3−41−8−23−5−203−11−21−1−5−24−13b=3−5511−1−25−32−32−53−3−2−25c=1−15−2−43−54−3−1−3−5d=−3405−42
eigs≔evalf⁡LinearAlgebra:-Eigenvalues⁡sys7:-a
eigs≔−13.16245939+5.027249293⁢I−11.28053239+2.099451111⁢I−0.07172170047−16.04229473−11.28053239−2.099451111⁢I−13.16245939−5.027249293⁢I
sys8≔StateSpace⁡randomtest,numstates=2,numinputs=1,numoutputs=1,genbound=5.0:
PrintSystem⁡sys8
eigs≔LinearAlgebra:-Eigenvalues⁡sys8:-a
eigs≔−6.64809571040089+0.⁢I−0.0340992302854792+0.⁢I
The DynamicSystems[StateSpace] command was updated in Maple 18.
The parameters, usesymbols, numinputs, numoutputs, numstates, symbols, randomtest and genbound options were introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
DynamicSystems[Coefficients]
DynamicSystems[DiffEquation]
DynamicSystems[SystemObject]
DynamicSystems[SystemOptions]
DynamicSystems[TransferFunction]
DynamicSystems[ZeroPoleGain]
Download Help Document