 ScaleOutputs - Maple Help

DynamicSystems

 ScaleOutputs
 compute the system resulting from multiplying each output of a system object by a coefficient Calling Sequence ScaleOutputs(sys, coefficients, opts) Parameters

 sys - System; system object coefficients - list; list of numeric or symbolic coefficients opts - (optional) equation(s) of the form option = value; specify options for the ScaleOutputs command Options

 • outputtype = tf, coeff, zpk, ss, or de
 Specifies the subtype of the returned system object.  The default return type is based on the type of the system objects specified in the systems parameter. See the Description section for more details on the return type.
 • parameters = set(name = complexcons) or list(name = complexcons)
 Specifies numeric values for parameters in sys. These values override those specified by the parameters field of the system object, which in turn override the settings in in SystemOptions(parameters). The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the expressions that define the model. No checking is done during the substitution to determine whether the substituted value is valid. For example, a complex value can be substituted for the coefficient of a polynomial. If the complex value had been originally assigned to the model at creation, a warning would be generated. Description

 • The ScaleOutputs command  creates a system that scales the outputs of sys by the coefficients in the coefficients list.
 • The type of the system object ScaleOutputs returns is determined by the type of the system object specified in the sys parameter unless an option is specified.
 • If the sys parameter is an algebraic equation (ae) and no option is specified, the ScaleOutputs command returns a system object in state space form by default. If the algebraic equation system does not have a state space representation, an error is returned. For details on algebraic equation object support by the DynamicSystems package, see DynamicSystems[AlgEquation]. Examples

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

Continuous single-input single-output (SISO) system example

 > $\mathrm{sys1}≔\mathrm{StateSpace}\left(\frac{s}{{s}^{3}+5{s}^{2}+7s+6}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys1}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x3}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{ccc}{0}& {1}& {0}\\ {0}& {0}& {1}\\ {-6}& {-7}& {-5}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{0}\\ {0}\\ {1}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{0}& {1}& {0}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{0}\end{array}\right]\end{array}\right$ (1)

In this example, the list of coefficients contains a symbolic coefficient to be multiplied by the single output of sys1:

 > $\mathrm{co}≔\left[\mathrm{k1}\right]$
 ${\mathrm{co}}{≔}\left[{\mathrm{k1}}\right]$ (2)

Create the new system, assigning a default value for the symbolic coefficient.

 > $\mathrm{sys1a}≔\mathrm{ScaleOutputs}\left(\mathrm{sys1},\mathrm{co},\mathrm{parameters}=\left[\mathrm{k1}=1\right]\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys1a}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x3}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{ccc}{0}& {1}& {0}\\ {0}& {0}& {1}\\ {-6}& {-7}& {-5}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{0}\\ {0}\\ {1}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{0}& \frac{{1}}{{\mathrm{k1}}}& {0}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{0}\end{array}\right]\end{array}\right$ (3)
 > $\mathrm{sys1b}≔\mathrm{ScaleOutputs}\left(\mathrm{sys1},\mathrm{co},\mathrm{outputtype}=\mathrm{de}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys1b}\right)$
 $\left[\begin{array}{l}{\mathbf{Diff. Equation}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right)\right]\\ {\mathrm{de}}{=}{{}\begin{array}{l}{[}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{x1}}{}\left({t}\right){=}{\mathrm{x2}}{}\left({t}\right){,}\\ {}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{x2}}{}\left({t}\right){=}{\mathrm{x3}}{}\left({t}\right){,}\\ {}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{x3}}{}\left({t}\right){=}{-}{6}{}{\mathrm{x1}}{}\left({t}\right){-}{7}{}{\mathrm{x2}}{}\left({t}\right){-}{5}{}{\mathrm{x3}}{}\left({t}\right){+}{\mathrm{u1}}{}\left({t}\right){,}\\ {}{\mathrm{y1}}{}\left({t}\right){=}\frac{{\mathrm{x2}}{}\left({t}\right)}{{\mathrm{k1}}}{]}\end{array}\end{array}\right$ (4)

Discrete multiple-input multiple-output (MIMO) system example

 > $\mathrm{ss_a}≔\mathrm{Matrix}\left(\left[\left[1,2\right],\left[0,4\right]\right]\right):$
 > $\mathrm{ss_b}≔\mathrm{Matrix}\left(\left[\left[3,7\right],\left[9,6\right]\right]\right):$
 > $\mathrm{ss_c}≔\mathrm{Matrix}\left(\left[\left[5,6\right],\left[5,2\right]\right]\right):$
 > $\mathrm{ss_d}≔\mathrm{Matrix}\left(\left[\left[0,1\right],\left[0,0\right]\right]\right):$
 > $\mathrm{sys2}≔\mathrm{StateSpace}\left(\mathrm{ss_a},\mathrm{ss_b},\mathrm{ss_c},\mathrm{ss_d},\mathrm{discrete},\mathrm{sampletime}=0.001\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys2}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{discrete; sampletime = .1e-2}}\\ {\mathrm{2 output\left(s\right); 2 input\left(s\right); 2 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({q}\right){,}{\mathrm{u2}}{}\left({q}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({q}\right){,}{\mathrm{y2}}{}\left({q}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({q}\right){,}{\mathrm{x2}}{}\left({q}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cc}{1}& {2}\\ {0}& {4}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{cc}{3}& {7}\\ {9}& {6}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cc}{5}& {6}\\ {5}& {2}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{cc}{0}& {1}\\ {0}& {0}\end{array}\right]\end{array}\right$ (5)
 > $\mathrm{PrintSystem}\left(\mathrm{TransferFunction}\left(\mathrm{sys2}\right)\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{discrete; sampletime = .1e-2}}\\ {\mathrm{2 output\left(s\right); 2 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({z}\right){,}{\mathrm{u2}}{}\left({z}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({z}\right){,}{\mathrm{y2}}{}\left({z}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{69}{}{z}{-}{24}}{{{z}}^{{2}}{-}{5}{}{z}{+}{4}}\\ {{\mathrm{tf}}}_{{2}{,}{1}}{=}\frac{{33}{}{z}{+}{12}}{{{z}}^{{2}}{-}{5}{}{z}{+}{4}}\\ {{\mathrm{tf}}}_{{1}{,}{2}}{=}\frac{{{z}}^{{2}}{+}{66}{}{z}{-}{112}}{{{z}}^{{2}}{-}{5}{}{z}{+}{4}}\\ {{\mathrm{tf}}}_{{2}{,}{2}}{=}\frac{{47}{}{z}{-}{92}}{{{z}}^{{2}}{-}{5}{}{z}{+}{4}}\end{array}\right$ (6)

The list of coefficients for this example contains a symbolic coefficient and a numeric coefficient to be multiplied by sys2 inputs u1 and u2 respectively:

 > $\mathrm{cf}≔\left[a,\frac{1}{2}\right]$
 ${\mathrm{cf}}{≔}\left[{a}{,}\frac{{1}}{{2}}\right]$ (7)
 > $\mathrm{sys2a}≔\mathrm{ScaleOutputs}\left(\mathrm{sys2},\mathrm{cf},\mathrm{outputtype}=\mathrm{tf}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys2a}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{discrete; sampletime = .1e-2}}\\ {\mathrm{2 output\left(s\right); 2 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({z}\right){,}{\mathrm{u2}}{}\left({z}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({z}\right){,}{\mathrm{y2}}{}\left({z}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{69}{}{z}{-}{24}}{{a}{}{{z}}^{{2}}{-}{5}{}{a}{}{z}{+}{4}{}{a}}\\ {{\mathrm{tf}}}_{{2}{,}{1}}{=}\frac{{66}{}{z}{+}{24}}{{{z}}^{{2}}{-}{5}{}{z}{+}{4}}\\ {{\mathrm{tf}}}_{{1}{,}{2}}{=}\frac{{{z}}^{{2}}{+}{66}{}{z}{-}{112}}{{a}{}{{z}}^{{2}}{-}{5}{}{a}{}{z}{+}{4}{}{a}}\\ {{\mathrm{tf}}}_{{2}{,}{2}}{=}\frac{{94}{}{z}{-}{184}}{{{z}}^{{2}}{-}{5}{}{z}{+}{4}}\end{array}\right$ (8) Compatibility

 • The DynamicSystems[ScaleOutputs] command was introduced in Maple 17.