DynamicSystems - Maple Programming Help

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

DynamicSystems

 Grammians
 compute the controllability and observability grammians

 Calling Sequence Grammians( sys, opts )

Parameters

 sys - System(ss); state-space System object opts - (optional) equation(s) of the form option = value; specify options for the Grammians command

Options

 • checkstability = truefalse
 True means check whether the system is stable; if it is not stable, an error occurs. False means skip the check. The default is true.
 • output = C or O or list of these names
 Specifies the returned values. If equal to C, then the controllability grammian is returned. If equal to O, then the observability grammian is returned. If a list of these names, then the output is a list/sequence (see returnlist) with each C replaced with the controllability grammian and each O replaced with the observability grammian. The default is [C,O].
 • returnlist = truefalse
 True means return a list; false means return an expression sequence. The default is false.

Description

 • The Grammians command computes the grammians of sys, a state-space system.
 • Depending on the value of the output option, either the controllability grammian, the observability grammian, or both, is computed.
 • For a grammian to exist, the system must be stable. For a continuous-time system, all eigenvalues, $\mathrm{\lambda }$, of A must lie in the open left-half plane: $\Re \left(\mathrm{\lambda }\right)<0$. For a discrete-time system, all eigenvalues, $\mathrm{\lambda }$, of A must lie in the open unit-circle: $\left|\mathrm{\lambda }\right|<1$. If sys is not stable, an error occurs, unless the option checkstability is false.
 • A grammian is the positive-definite matrix X that solves the appropriate Lyapunov equation.

Controllability Grammian

 • For a continuous system, the Lyapunov equation is $A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}X+X\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{A}^{T}=-B\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{B}^{T}$.
 • For a discrete system, the Lyapunov equation is $A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}X\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{A}^{T}-X=-B\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{B}^{T}$.

Observability Grammian

 • For a continuous system, the Lyapunov equation is ${A}^{T}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}X+X\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}A=-{C}^{T}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}C$.
 • For a discrete system, the Lyapunov equation is ${A}^{T}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}X\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}A-X=-{C}^{T}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}C$.

Examples

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

Assign a state-space system.

 > $\mathrm{aSys}≔\mathrm{StateSpace}\left(⟨⟨-5,3⟩|⟨3,-4⟩⟩,⟨⟨2,3⟩⟩,⟨⟨1,0⟩|⟨0,1⟩⟩,⟨⟨0,0⟩⟩\right):$

Compute its controllability grammian.

 > $\mathrm{Cg}≔\mathrm{Grammians}\left(\mathrm{aSys},\mathrm{output}=C\right)$
 ${\mathrm{Cg}}{≔}\left[\begin{array}{cc}{1.68181818181818}& {2.13636363636364}\\ {2.13636363636364}& {2.72727272727273}\end{array}\right]$ (1)

Verify that Cg meets the Lyapunov equation (b^+ is the transpose of b, see LinearAlgebra[Transpose]).

 > $\mathbf{use}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{aSys}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}a\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{Cg}+\mathrm{Cg}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}a=-b\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{b}^{\mathrm{%T}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end use}$
 $\left[\begin{array}{cc}{-}{4.00000000000000}& {-}{6.00000000000000}\\ {-}{6.00000000000000}& {-}{9.00000000000001}\end{array}\right]{=}\left[\begin{array}{rr}{-}{4}& {-}{6}\\ {-}{6}& {-}{9}\end{array}\right]$ (2)