Dynamic Systems - Maple Help

Home : Support : Online Help : System : Information : Updates : Maple 18 : Dynamic Systems

 Dynamic Systems

Maple provides a series of control systems design tools that give you the ability to work analytically with linear time-invariant dynamic systems. The DynamicSystems package is a collection of procedures for creating, manipulating, simulating, and plotting linear time-invariant systems models. Maple 18 includes several updates to existing commands as well as new commands:

 • Updated options for all system constructors, the StateSpace command, and the ToDiscrete command.
 • New commands for interconnecting systems, working with discrete systems, and computing norms and covariance matrices.
 > $\mathrm{with}\left(\mathrm{DynamicSystems}\right):$

Parameters Option

All system constructors, such as TransferFunction and DiffEquation, now accept a parameters option that consists of a list of equations specifying the parameter names and corresponding values. These parameters are used by procedures that require numeric values, for example, the plot routines. Most procedures that require numeric systems also provide a parameters option that can override the parameters assigned to the system.

 > $\mathrm{sys}:=\mathrm{TransferFunction}\left(\frac{A}{s+\mathrm{ω}},\mathrm{parameters}=\left[A=1,\mathrm{ω}=2\right]\right):$
 > $\mathrm{MagnitudePlot}\left(\mathrm{sys}\right)$

Here, the parameters option of the plot procedure overrides the parameter A in the object:

 > $\mathrm{MagnitudePlot}\left(\mathrm{sys},\mathrm{parameters}=\left[A=100\right]\right)$

StateSpace Options

Random Systems

The StateSpace constructor accepts new options such as randomtest and genbound which are useful for generating random stable state-space systems.

 > $\mathrm{ss1}:=\mathrm{StateSpace}\left('\mathrm{randomtest}','\mathrm{numstates}'=3,'\mathrm{numinputs}'=2,'\mathrm{numoutputs}'=1,'\mathrm{genbound}'=5.\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{ss1}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 2 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right){,}{\mathrm{u2}}{}\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}{-}{4.424931645657024}& {-}{4.024595950005905}& {-}{3.7301318370649392}\\ {0.46881519204983846}& {-}{7.676407537745905}& {4.057919370756192}\\ {-}{2.215017811329516}& {4.133758561390193}& {-}{5.85276313606821}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{cc}{3.00280468888800200}& {4.70592781760615608}\\ {-0.146243512771587980}& {-3.42386918322451717}\\ {4.57166948242945637}& {4.64888535199276554}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{4.15735525189067090}& {-0.782387173737250308}& {-3.58113661372784664}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{cc}{4.59492426392903042}& {2.92207329559554374}\end{array}\right]\end{array}\right$ (2.1.1)

Symbolic Systems

The StateSpace constructor also accepts the usesymbols keyword option, which can be used to construct state matrices with symbolic elements.

 > $\mathrm{ss2}:=\mathrm{StateSpace}\left('\mathrm{numstates}'=3,'\mathrm{numinputs}'=2,'\mathrm{numoutputs}'=1,'\mathrm{usesymbols}'\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{ss2}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 2 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right){,}{\mathrm{u2}}{}\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}{{a}}_{{1}{,}{1}}& {{a}}_{{1}{,}{2}}& {{a}}_{{1}{,}{3}}\\ {{a}}_{{2}{,}{1}}& {{a}}_{{2}{,}{2}}& {{a}}_{{2}{,}{3}}\\ {{a}}_{{3}{,}{1}}& {{a}}_{{3}{,}{2}}& {{a}}_{{3}{,}{3}}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{cc}{{b}}_{{1}{,}{1}}& {{b}}_{{1}{,}{2}}\\ {{b}}_{{2}{,}{1}}& {{b}}_{{2}{,}{2}}\\ {{b}}_{{3}{,}{1}}& {{b}}_{{3}{,}{2}}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{{c}}_{{1}{,}{1}}& {{c}}_{{1}{,}{2}}& {{c}}_{{1}{,}{3}}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{cc}{{d}}_{{1}{,}{1}}& {{d}}_{{1}{,}{2}}\end{array}\right]\end{array}\right$ (2.2.1)
 ToDiscrete Methods A new method for discretization, first-order hold (foh), has been added to the ToDiscrete command. Like the zero-order hold method, this method can be applied to state-space, transfer-function, and coefficient system types.

Connection Commands

A number of new commands for interconnecting systems have been added:

 • AppendConnect: Create the equivalent system representation of two or more system objects combined by appending their inputs and outputs.
 • FeedbackConnect: Create the equivalent system representation of one or two system objects with positive or negative feedback connection.
 • ParallelConnect: Create the equivalent system representation of two or more system objects connected in parallel.
 • SeriesConnect: Create the equivalent system representation of two or more system objects connected in series.
 > $\mathrm{sys1}:=\mathrm{StateSpace}\left(\mathrm{usesymbols},\mathrm{numstates}=2,\mathrm{numinputs}=1,\mathrm{numoutputs}=1,\mathrm{symbols}=\left[\mathrm{A1},\mathrm{B1},\mathrm{C1},\mathrm{D1}\right]\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); 2 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)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cc}{{\mathrm{A1}}}_{{1}{,}{1}}& {{\mathrm{A1}}}_{{1}{,}{2}}\\ {{\mathrm{A1}}}_{{2}{,}{1}}& {{\mathrm{A1}}}_{{2}{,}{2}}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{{\mathrm{B1}}}_{{1}{,}{1}}\\ {{\mathrm{B1}}}_{{2}{,}{1}}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cc}{{\mathrm{C1}}}_{{1}{,}{1}}& {{\mathrm{C1}}}_{{1}{,}{2}}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{{\mathrm{D1}}}_{{1}{,}{1}}\end{array}\right]\end{array}\right$ (4.1)
 > $\mathrm{sys2}:=\mathrm{StateSpace}\left(\mathrm{usesymbols},\mathrm{numstates}=2,\mathrm{numinputs}=1,\mathrm{numoutputs}=1,\mathrm{symbols}=\left[\mathrm{A2},\mathrm{B2},\mathrm{C2},\mathrm{D2}\right]\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys2}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right); 2 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)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cc}{{\mathrm{A2}}}_{{1}{,}{1}}& {{\mathrm{A2}}}_{{1}{,}{2}}\\ {{\mathrm{A2}}}_{{2}{,}{1}}& {{\mathrm{A2}}}_{{2}{,}{2}}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{{\mathrm{B2}}}_{{1}{,}{1}}\\ {{\mathrm{B2}}}_{{2}{,}{1}}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cc}{{\mathrm{C2}}}_{{1}{,}{1}}& {{\mathrm{C2}}}_{{1}{,}{2}}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{{\mathrm{D2}}}_{{1}{,}{1}}\end{array}\right]\end{array}\right$ (4.2)
 > $\mathrm{sys_series}:=\mathrm{SeriesConnect}\left(\left[\mathrm{sys1},\mathrm{sys2}\right]\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys_series}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right); 4 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){,}{\mathrm{x4}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cccc}{{\mathrm{A1}}}_{{1}{,}{1}}& {{\mathrm{A1}}}_{{1}{,}{2}}& {0}& {0}\\ {{\mathrm{A1}}}_{{2}{,}{1}}& {{\mathrm{A1}}}_{{2}{,}{2}}& {0}& {0}\\ {{\mathrm{B2}}}_{{1}{,}{1}}{}{{\mathrm{C1}}}_{{1}{,}{1}}& {{\mathrm{B2}}}_{{1}{,}{1}}{}{{\mathrm{C1}}}_{{1}{,}{2}}& {{\mathrm{A2}}}_{{1}{,}{1}}& {{\mathrm{A2}}}_{{1}{,}{2}}\\ {{\mathrm{B2}}}_{{2}{,}{1}}{}{{\mathrm{C1}}}_{{1}{,}{1}}& {{\mathrm{B2}}}_{{2}{,}{1}}{}{{\mathrm{C1}}}_{{1}{,}{2}}& {{\mathrm{A2}}}_{{2}{,}{1}}& {{\mathrm{A2}}}_{{2}{,}{2}}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{{\mathrm{B1}}}_{{1}{,}{1}}\\ {{\mathrm{B1}}}_{{2}{,}{1}}\\ {{\mathrm{B2}}}_{{1}{,}{1}}{}{{\mathrm{D1}}}_{{1}{,}{1}}\\ {{\mathrm{B2}}}_{{2}{,}{1}}{}{{\mathrm{D1}}}_{{1}{,}{1}}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cccc}{{\mathrm{D2}}}_{{1}{,}{1}}{}{{\mathrm{C1}}}_{{1}{,}{1}}& {{\mathrm{D2}}}_{{1}{,}{1}}{}{{\mathrm{C1}}}_{{1}{,}{2}}& {{\mathrm{C2}}}_{{1}{,}{1}}& {{\mathrm{C2}}}_{{1}{,}{2}}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{{\mathrm{D2}}}_{{1}{,}{1}}{}{{\mathrm{D1}}}_{{1}{,}{1}}\end{array}\right]\end{array}\right$ (4.3)
 > $\mathrm{sys_parallel}:=\mathrm{ParallelConnect}\left(\left[\mathrm{sys1},\mathrm{sys2}\right]\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys_parallel}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right); 4 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){,}{\mathrm{x4}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cccc}{{\mathrm{A1}}}_{{1}{,}{1}}& {{\mathrm{A1}}}_{{1}{,}{2}}& {0}& {0}\\ {{\mathrm{A1}}}_{{2}{,}{1}}& {{\mathrm{A1}}}_{{2}{,}{2}}& {0}& {0}\\ {0}& {0}& {{\mathrm{A2}}}_{{1}{,}{1}}& {{\mathrm{A2}}}_{{1}{,}{2}}\\ {0}& {0}& {{\mathrm{A2}}}_{{2}{,}{1}}& {{\mathrm{A2}}}_{{2}{,}{2}}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{{\mathrm{B1}}}_{{1}{,}{1}}\\ {{\mathrm{B1}}}_{{2}{,}{1}}\\ {{\mathrm{B2}}}_{{1}{,}{1}}\\ {{\mathrm{B2}}}_{{2}{,}{1}}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cccc}{{\mathrm{C1}}}_{{1}{,}{1}}& {{\mathrm{C1}}}_{{1}{,}{2}}& {{\mathrm{C2}}}_{{1}{,}{1}}& {{\mathrm{C2}}}_{{1}{,}{2}}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{{\mathrm{D1}}}_{{1}{,}{1}}{+}{{\mathrm{D2}}}_{{1}{,}{1}}\end{array}\right]\end{array}\right$ (4.4)

ToContinuous and Resample Commands

The ToContinuous command converts discrete systems to continuous systems using a specified conversion method.

 > $\mathrm{sysd}:=\mathrm{TransferFunction}\left(\frac{1}{z+a},\mathrm{discrete},\mathrm{parameters}=\left[a=3\right]\right):$
 > $\mathrm{sysc1}:=\mathrm{ToContinuous}\left(\mathrm{sysd},\mathrm{method}=\mathrm{forward}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sysc1}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\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{tf}}}_{{1}{,}{1}}{=}\frac{{1}}{{s}{+}{1}{+}{a}}\end{array}\right$ (5.1)
 > $\mathrm{sysc2}:=\mathrm{ToContinuous}\left(\mathrm{sysd},\mathrm{method}=\mathrm{prewarp}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sysc2}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\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{tf}}}_{{1}{,}{1}}{=}\frac{{s}{-}{2.}}{{a}{}{s}{-}{s}{-}{2.}{}{a}{-}{2.}}\end{array}\right$ (5.2)

The Resample command resamples a discrete system with a new sampling time.

 > $\mathrm{sysd2}:=\mathrm{Resample}\left(\mathrm{sysd},2,\mathrm{method}=\mathrm{prewarp}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sysd2}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{discrete; sampletime = 2}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({z}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({z}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{z}{+}{3.}}{{a}{}{z}{+}{3.}{}{z}{+}{3.}{}{a}{+}{1}}\end{array}\right$ (5.3)

Norms and Noise Analysis

The NormH2 and NormHinf  commands compute the $\mathrm{H__2}$ and $\mathrm{H__∞}$ norms, respectively, of a system.

 > $\mathrm{sys}:=\mathrm{TransferFunction}\left(\frac{1}{{\left(s+1\right)}^{2}}\right):$
 > $\mathrm{NormH2}\left(\mathrm{sys}\right)$
 ${0.500000000000000}$ (6.1)
 > $\mathrm{NormHinf}\left(\mathrm{sys}\right)$
 ${1.000001000}$ (6.2)

The Covariance command computes the output covariance Matrix with the inputs driven by white Gaussian noise.

 > $\mathrm{Covariance}\left(\mathrm{sys},⟨⟨1⟩⟩\right)$
 $\left[\begin{array}{c}{0.250000000000000}\end{array}\right]$ (6.3)