Compute observability staircase form

`[Abar,Bbar,Cbar,T,k] = obsvf(A,B,C) `

obsvf(A,B,C,tol)

If the observability matrix of `(A,C)`

has
rank *r* ≤ *n*, where *n* is
the size of `A`

, then there exists a similarity transformation
such that

$$\overline{A}=TA{T}^{T}\text{,}\overline{B}=TB,\text{}\overline{C}=C{T}^{T}$$

where *T* is unitary and the transformed system
has a *staircase* form with the unobservable modes,
if any, in the upper left corner.

$$\overline{A}=\left[\begin{array}{cc}{A}_{no}& {A}_{12}\\ 0& {A}_{o}\end{array}\right],\text{}\overline{B}=\left[\begin{array}{c}{B}_{no}\\ {B}_{o}\end{array}\right],\text{}\overline{C}=\left[0\text{}{C}_{o}\right]$$

where (*C _{o}*,

`[Abar,Bbar,Cbar,T,k] = obsvf(A,B,C) `

decomposes the state-space system with matrices `A`

, `B`

,
and `C`

into the observability staircase form `Abar`

, `Bbar`

,
and `Cbar`

, as described above. `T`

is
the similarity transformation matrix and `k`

is a
vector of length *n*, where *n* is
the number of states in `A`

. Each entry of `k`

represents
the number of observable states factored out during each step of the
transformation matrix calculation [1].
The number of nonzero elements in `k`

indicates how
many iterations were necessary to calculate `T`

,
and `sum(k)`

is the number of states in *A _{o}*,
the observable portion of

`Abar`

.`obsvf(A,B,C,tol) `

uses
the tolerance `tol`

when calculating the observable/unobservable
subspaces. When the tolerance is not specified, it defaults to `10*n*norm(a,1)*eps`

.

Form the observability staircase form of

A = 1 1 4 -2 B = 1 -1 1 -1 C = 1 0 0 1

by typing

[Abar,Bbar,Cbar,T,k] = obsvf(A,B,C) Abar = 1 1 4 -2 Bbar = 1 1 1 -1 Cbar = 1 0 0 1 T = 1 0 0 1 k = 2 0

`obsvf`

implements the Staircase Algorithm
of [1] by calling `ctrbf`

and
using duality.

[1] Rosenbrock, M.M., *State-Space
and Multivariable Theory*, John Wiley, 1970.