Next: systime, Previous: numerical, Up: Control Theory

— Function File: [`n`, `m`, `p`] = **abcddim** (`a, b, c, d`)

Check for compatibility of the dimensions of the matrices defining the linear system [A, B, C, D] corresponding to

dx/dt = a x + b u y = c x + d uor a similar discrete-time system.

If the matrices are compatibly dimensioned, then

`abcddim`

returns

n- The number of system states.
m- The number of system inputs.
p- The number of system outputs.
Otherwise

`abcddim`

returnsn=m=p= −1.Note: n = 0 (pure gain block) is returned without warning.

— Function File: **ctrb** (`sys, b`)

— Function File:**ctrb** (`a, b`)

— Function File:

Build controllability matrix:

2 n-1 Qs = [ B AB A B ... A B ]of a system data structure or the pair (

a,b).

ctrbforms the controllability matrix. The numerical properties ofis_controllableare much better for controllability tests.

— Function File: **h2norm** (`sys`)

Computes the H-2 norm of a system data structure (continuous time only).

Reference: Doyle, Glover, Khargonekar, Francis, State-Space Solutions to Standard H-2 and H-infinity Control Problems, IEEE TAC August 1989.

— Function File: [`g`, `gmin`, `gmax`] = **hinfnorm** (`sys, tol, gmin, gmax, ptol`)

Computes the H-infinity norm of a system data structure.

Inputs

sys- system data structure
tol- H-infinity norm search tolerance (default: 0.001)
gmin- minimum value for norm search (default: 1e-9)
gmax- maximum value for norm search (default: 1e+9)
ptol- pole tolerance:

- if sys is continuous, poles with |real(pole))| < ptol*||H|| (
His appropriate Hamiltonian) are considered to be on the imaginary axis.- if sys is discrete, poles with |abs(pole)-1| < ptol*||[s1,s2]|| (appropriate symplectic pencil) are considered to be on the unit circle.
- Default value: 1e-9

Outputs

g- Computed gain, within
tolof actual gain.gis returned as Inf if the system is unstable.gmingmax- Actual system gain lies in the interval [
gmin,gmax].References: Doyle, Glover, Khargonekar, Francis, State-space solutions to standard H-2 and H-infinity control problems, IEEE TAC August 1989; Iglesias and Glover, State-Space approach to discrete-time H-infinity control, Int. J. Control, vol 54, no. 5, 1991; Zhou, Doyle, Glover, Robust and Optimal Control, Prentice-Hall, 1996.

— Function File: **obsv** (`sys, c`)

— Function File:**obsv** (`a, c`)

— Function File:

Build observability matrix:

| C | | CA | Qb = | CA^2 | | ... | | CA^(n-1) |of a system data structure or the pair (

a,c).The numerical properties of

is_observableare much better for observability tests.

— Function File: [`zer`, `pol`] = **pzmap** (`sys`)

Plots the zeros and poles of a system in the complex plane.

Input

sys- System data structure.

Outputs

polzer- if omitted, the poles and zeros are plotted on the screen. otherwise,
polandzerare returned as the system poles and zeros (seesys2zpfor a preferable function call).

— Function File: `retval` = **is_abcd** (`a, b, c, d`)

Returns

retval= 1 if the dimensions ofa,b,c,dare compatible, otherwiseretval= 0 with an appropriate diagnostic message printed to the screen. The matricesb,c, ordmay be omitted.

— Function File: [`retval`, `u`] = **is_controllable** (`sys, tol`)

— Function File: [`retval`, `u`] = **is_controllable** (`a, b, tol`)

— Function File: [

Logical check for system controllability.

Inputs

sys- system data structure
abnbyn,nbymmatrices, respectivelytol- optional roundoff paramter. default value:
`10*eps`

Outputs

retval- Logical flag; returns true (1) if the system
sysor the pair (a,b) is controllable, whichever was passed as input arguments.uuis an orthogonal basis of the controllable subspace.

MethodControllability is determined by applying Arnoldi iteration with complete re-orthogonalization to obtain an orthogonal basis of the Krylov subspacespan ([b,a*b,...,a^{n-1}*b]).The Arnoldi iteration is executed with

`krylov`

if the system has a single input; otherwise a block Arnoldi iteration is performed with`krylovb`

.

— Function File: `retval` = **is_detectable** (`a, c, tol, dflg`)

— Function File:`retval` = **is_detectable** (`sys, tol`)

— Function File:

Test for detactability (observability of unstable modes) of (

a,c).Returns 1 if the system

aor the pair (a,c) is detectable, 0 if not, and -1 if the system has unobservable modes at the imaginary axis (unit circle for discrete-time systems).

Seeis_stabilizablefor detailed description of arguments and computational method.

— Function File: [`retval`, `dgkf_struct` ] = **is_dgkf** (`asys, nu, ny, tol `)

Determine whether a continuous time state space system meets assumptions of DGKF algorithm. Partitions system into:

[dx/dt] [A | Bw Bu ][w] [ z ] = [Cz | Dzw Dzu ][u] [ y ] [Cy | Dyw Dyu ]or similar discrete-time system. If necessary, orthogonal transformations

qw,qzand nonsingular transformationsru,ryare applied to respective vectorsw,z,u,yin order to satisfy DGKF assumptions. Loop shifting is used ifdyublock is nonzero.

Inputs

asys- system data structure
nu- number of controlled inputs
ny- number of measured outputs
tol- threshold for 0; default: 200*
`eps`

.Outputs

retval- true(1) if system passes check, false(0) otherwise
dgkf_struct- data structure of
is_dgkfresults. Entries:

nwnz- dimensions of
w,za- system A matrix
bw- (
nxnw)qw-transformed disturbance input matrixbu- (
nxnu)ru-transformed controlled input matrix;B = [Bw Bu]

cz- (
nzxn) Qz-transformed error output matrixcy- (
nyxn)ry-transformed measured output matrixC = [Cz; Cy]

dzudyw- off-diagonal blocks of transformed system D matrix that enter
z,yfromu,wrespectivelyru- controlled input transformation matrix
ry- observed output transformation matrix
dyu_nz- nonzero if the
dyublock is nonzero.dyu- untransformed
dyublockdflg- nonzero if the system is discrete-time
`is_dgkf`

exits with an error if the system is mixed discrete/continuous.

References

[1]- Doyle, Glover, Khargonekar, Francis, State Space Solutions to Standard H-2 and H-infinity Control Problems, IEEE TAC August 1989.
[2]- Maciejowksi, J.M., Multivariable Feedback Design, Addison-Wesley, 1989.

— Function File: `digital` = **is_digital** (`sys, eflg`)

Return nonzero if system is digital.

Inputs

sys- System data structure.
eflg- When equal to 0 (default value), exits with an error if the system is mixed (continuous and discrete components); when equal to 1, print a warning if the system is mixed (continuous and discrete); when equal to 2, operate silently.

OutputExits with an error if

digital- When equal to 0, the system is purely continuous; when equal to 1, the system is purely discrete; when equal to -1, the system is mixed continuous and discrete.
sysis a mixed (continuous and discrete) system.

— Function File: [`retval`, `u`] = **is_observable** (`a, c, tol`)

— Function File: [`retval`, `u`] = **is_observable** (`sys, tol`)

— Function File: [

Logical check for system observability.

Default: tol =

`tol = 10*norm(a,'fro')*eps`

Returns 1 if the system

sysor the pair (a,c) is observable, 0 if not.See

is_controllablefor detailed description of arguments and default values.

— Function File: **is_siso** (`sys`)

Returns nonzero if the system data structure

sysis single-input, single-output.

— Function File: `retval` = **is_stabilizable** (`sys, tol`)

— Function File:`retval` = **is_stabilizable** (`a, b, tol, dflg`)

— Function File:

Logical check for system stabilizability (i.e., all unstable modes are controllable). Returns 1 if the system is stabilizable, 0 if the the system is not stabilizable, -1 if the system has non stabilizable modes at the imaginary axis (unit circle for discrete-time systems.

Test for stabilizability is performed via Hautus Lemma. If

dflg!=0 assume that discrete-time matrices (a,b) are supplied.

— Function File: **is_stable** (`a, tol, dflg`)

— Function File:**is_stable** (`sys, tol`)

— Function File:

Returns 1 if the matrix

aor the systemsysis stable, or 0 if not.

Inputs

tol- is a roundoff parameter, set to 200*
`eps`

if omitted.dflg- Digital system flag (not required for system data structure):

dflg`!= 0`

- stable if eig(a) is in the unit circle
dflg`== 0`

- stable if eig(a) is in the open LHP (default)