Description of the Model of a Linear System Object

Description


•

A System object provides a unified representation of a linear system model. The following model types are supported: transfer function (TF), zeropolegain (ZPK), coefficients (Coeff), statespace (SS), diffequation (DE). and aeequation (AE).

•

The object is represented as a module. The exports of the module depend on the model type. The following sections describe each type.



System Types



FrequencyBased Models


The model types TF, Coeff, and ZPK are frequencybased and use transfer functions to express the relationships between inputs and outputs.
•

The transfer functions must correspond to rational polynomials of the frequency variable.

•

The rational polynomials must have real coefficients; symbolic values are considered real.

•

The rational polynomials need not be proper, the degree of the numerator may be greater than that of the denominator; however, improper transfer functions cannot be converted to the timebased models (SS and DE).


TransferFunction Model (TF)


•

The TF model expresses the transfer function between a given input and output as an explicit rational polynomial of the frequency variable.

•

For a continuoustime model, the frequency variable is the name assigned to the complexfreqvar variable of the DynamicSystems[SystemOptions] command; its default value is s. The rational polynomial $\frac{3s}{bs\+{s}^{2}\+a}$ is a typical example.

•

For a discretetime model, the frequency variable is the name assigned to the discretefreqvar variable of the DynamicSystems[SystemOptions] command; its default value is z. The rational polynomial $\frac{1}{\mathrm{\pi}{z}^{2}+4}$ is a typical example.



ZeroPoleGain Model (ZPK)


•

The ZPK model expresses the transfer function between a given input and output as a list of zeros (roots of the numerator), a list of poles (roots of the denominator), and a scaling factor. An empty list corresponds to the unit polynomial, $1$.

•

As an example, the transfer function corresponding to the rational polynomial $\frac{3\left(s1\right)}{\left(s2\right)\left(s\+3\right)}$ is represented in the ZPK model as the lists $\left[1\right]$, $\left[2\,3\right]$ and the scaling factor $3$. The same lists and scaling factor correspond to a discrete model with rational polynomial $\frac{3\left(z1\right)}{\left(z2\right)\left(z\+3\right)}$.



Coefficient Model (Coeff)


•

The Coeff model expresses the transfer function between a given input and output as a list of the coefficients of the numerator and a list of the coefficients of the denominator of the rational polynomial. The first element in a list is the coefficient of the highestorder term of the corresponding polynomial. Element i in a list of n elements is the coefficient of the ni order term. An empty list corresponds to the zero polynomial, $0$.

•

As an example, the transfer function corresponding to the rational polynomial $\frac{{z}^{2}\+2z1}{{z}^{3}\+z}$ can be represented as the lists $\left[1\,2\,1\right]$ and $\left[1\,0\,1\,0\right]$.




TimeBased Models


The model types SS and DE are timebased and use diffequations to express the relationships between inputs and outputs.

StateSpace Model (SS)


•

The SS model uses four Matrices, $A$, $B$, $C$, and $\mathrm{D}$, to represent the diffequations.

•

For a continuoustime model, the corresponding differential equations are x'(t) = A . x(t) + B . u(t) and y(t) = C . x(t) + D . u(t), where u(t), y(t), and x(t) are the input, output, and state vectors, respectively, and t is the independent time variable.

•

For a discretetime model, the corresponding difference equations are x(q+1) = A . x(q) + B . u(q) and y(q) = C . x(q) + D . u(q), where u(q), y(q), and x(q) are the input, output, and state vectors, respectively, and q is the independent discrete time variable.

•

The Matrices must be independent of the time variable.



DiffEquation Model (DE)


•

The DE model uses equations to explicitly represent the differential/difference equations.

•

For a continuoustime model, the equations are differential equations in terms of the continuous time variable, which is the name assigned to the continuoustimevar variable of the DynamicSystems[SystemOptions] command; its default is t.

•

For a discretetime model, the equations are difference equations in terms of the discrete time variable, which is the name assigned to the discretetimevar variable of the DynamicSystems[SystemOptions] command; its default is q.



AlgEquation Model (AE)


•

The AE model creates an algebraic model from a system of algebraic equations.

•

For a continuoustime model, the equations are algebraic equations in terms of the continuous time variable, which is the name assigned to the continuoustimevar variable of the DynamicSystems[SystemOptions] command; its default is t.

•

For a discretetime model, the equations are algebraic equations in terms of the discrete time variable, which is the name assigned to the discretetimevar variable of the DynamicSystems[SystemOptions] command; its default is q.





Module Exports



Exports Common to All System Types


Specifies the name of the system. This is used to identify the system. It has no effect on any of the operations.
Specifies the number of inputs of the system.
Specifies the number of outputs of the system.
Specifies the number of states of the system. In representations that do not define states, such as transfer functions, this property is ignored.
Specifies whether the system is discrete or continuous. If true the system is discrete, if false it is continuous.
Specifies the sampling time (in seconds) of a discrete system. This property is ignored if the system is continuous.
•

inputlist = list(algebraic)

Specifies a list of the input variables. Each variable is specified as a function of t; for example, u(t).
•

outputlist = list(algebraic)

Specifies a list of the output variables. Each variable is specified as a function of t; for example, y(t).
•

statelist = list(algebraic)

Specifies a list of the state variables. Each variable is specified as a function of t; for example, x(t).


Exports for a TransferFunction System


Specifies the transfer functions of the system. Cell [i,j] contains the transfer function from input j to output i. The number of rows of the Matrix equals the number of outputs and the number of columns equals the number of inputs.
The transfer functions of a continuous system are rational polynomials in s. The transfer functions of a discrete system are rational polynomials in z. The global variables s and z correspond to the values of complexfreqvar and discretefreqvar in DynamicSystems[SystemOptions].


Exports for a ZeroPoleGain System


•

z = Matrix(list(algebraic))

Specifies the zeros of the transfer functions of the system. Cell [i,j] contains the list of zeros of the transfer function from input j to output i. The number of rows of the Matrix equals the number of outputs and the number of columns equals the number of inputs.
•

p = Matrix(list(algebraic))

Specifies the poles of the transfer functions of the system. Cell [i,j] contains the list of poles of the transfer function from input j to output i. The number of rows of the Matrix equals the number of outputs and the number of columns equals the number of inputs.
Specifies the scaling factors of the transfer functions of the system. Cell [i,j] contains the scaling factor of the transfer function from input j to output i. The number of rows of the Matrix equals the number of outputs and the number of columns equals the number of inputs.


Exports for Coefficient System


•

num = Matrix(list(algebraic))

Specifies the coefficients of the numerators of the transfer functions of the system. Cell [i,j] contains the list of coefficients, the highestorder term first, for the transfer function from input j to output i. The number of rows of the Matrix equals the number of outputs and the number of columns equals the number of inputs.
•

den = Matrix(list(algebraic))

Specifies the coefficients of the denominators of the transfer functions of the system. Cell [i,j] contains the list of coefficients, the highestorder term first, for the transfer function from input j to output i. The number of rows of the Matrix equals the number of outputs and the number of columns equals the number of inputs.


Exports for StateSpace System


Specifies the A (state) matrix of a statespace representation. The number of rows and columns equals the number of states.
Specifies the B (input) matrix of a statespace representation. The number of rows equals the number of states and the number of columns equals the number of inputs.
Specifies the C (output) matrix of a statespace representation. The number of rows equals the number of outputs and the number of columns equals the number of states.
Specifies the D (directthrough) matrix of a statespace representation. The number of rows equals the number of outputs and the number of columns equals the number of inputs.


Exports for DiffEquation System


Specifies the differential or difference equations. A continuous system uses differential equations with t as the time variable; for example, diff(y(t), t, t) = diff(y(t), t) + u(t). A discrete system uses difference equations with q as the discrete time variable; for example, y(q+1) = y(q)  u(q). The global variables t and q correspond, respectively, to the values of continuoustimevar and discretetimevar in DynamicSystems[SystemOptions].


Exports for Algebraic Equation System


Specifies the algebraic equations. A continuous system uses algebraic equations with t as the time variable; A discrete system uses difference equations with q as the discrete time variable; The global variables t and q correspond, respectively, to the values of continuoustimevar and discretetimevar in DynamicSystems[SystemOptions].



Examples


>

$\mathrm{with}\left(\mathrm{DynamicSystems}\right)\:$

Create a transfer function system.
>

$\mathrm{sys}:=\mathrm{TransferFunction}\left(\frac{1}{{s}^{2}\+3s\+5}\right)\:$

>

$\mathrm{PrintSystem}\left(\mathrm{sys}\right)$

$\left[\begin{array}{l}{\mathbf{Transfer\; Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1\; output(s);\; 1\; input(s)}}\\ {\mathrm{inputvariable}}{\=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{\=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{\=}\frac{{1}}{{{s}}^{{2}}{+}{3}{}{s}{+}{5}}\end{array}\right.$
 (1) 
Access the rational polynomial of the system.
>

${\mathrm{sys}:\mathrm{tf}}_{1\,1}$

$\frac{{1}}{{{s}}^{{2}}{\+}{3}{}{s}{\+}{5}}$
 (2) 

