compute the system resulting from multiplying each input of a system object by a coefficient - Maple Help

Home : Support : Online Help : Science and Engineering : Dynamic Systems : System Manipulation Tools : DynamicSystems/ScaleInputs

DynamicSystems[ScaleInputs] - compute the system resulting from multiplying each input of a system object by a coefficient

 Calling Sequence ScaleInputs(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 ScaleInputs command

Description

 • The ScaleInputs command creates a system that scales the inputs of sys by the coefficients in the coefficients list.
 • The type of the system object ScaleInputs 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 ScaleInputs 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 input of sys1:

 > $\mathrm{ci}:=\left[\mathrm{k1}\right]$
 ${\mathrm{ci}}{:=}\left[{\mathrm{k1}}\right]$ (2)

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

 > $\mathrm{sys1a}:=\mathrm{ScaleInputs}\left(\mathrm{sys1},\mathrm{ci},\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}\\ {\mathrm{k1}}\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$ (3)
 > $\mathrm{sys1b}:=\mathrm{ScaleInputs}\left(\mathrm{sys1},\mathrm{ci},\mathrm{outputtype}=\mathrm{coeff}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys1b}\right)$
 $\left[\begin{array}{l}{\mathbf{Coefficients}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{num}}}_{{1}{,}{1}}{=}\left[{\mathrm{k1}}{,}{0}\right]\\ {{\mathrm{den}}}_{{1}{,}{1}}{=}\left[{1}{,}{5}{,}{7}{,}{6}\right]\end{array}\right$ (4)

Discrete multiple-input multiple-output (MIMO) case 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 the inputs of sys2:

 > $\mathrm{cf}:=\left[a,0.5\right]$
 ${\mathrm{cf}}{:=}\left[{a}{,}{0.5}\right]$ (7)
 > $\mathrm{sys2a}:=\mathrm{ScaleInputs}\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}{}{a}{}{z}{-}{24}{}{a}}{{{z}}^{{2}}{-}{5}{}{z}{+}{4}}\\ {{\mathrm{tf}}}_{{2}{,}{1}}{=}\frac{{33}{}{a}{}{z}{+}{12}{}{a}}{{{z}}^{{2}}{-}{5}{}{z}{+}{4}}\\ {{\mathrm{tf}}}_{{1}{,}{2}}{=}\frac{{0.5000000000}{}{{z}}^{{2}}{+}{33.}{}{z}{-}{56.}}{{{z}}^{{2}}{-}{5.}{}{z}{+}{4.}}\\ {{\mathrm{tf}}}_{{2}{,}{2}}{=}\frac{{23.50000000}{}{z}{-}{46.}}{{{z}}^{{2}}{-}{5.}{}{z}{+}{4.}}\end{array}\right$ (8)