A state-space realization is an implementation of a given input-output behavior. If a system is modeled by a transfer matrix H(s), then a realization is a set of matrices A, B, C, D such that H ( s ) = C ( s I − A ) − 1 B + D . In other words, if the system has state vector x, the system behavior can be described by the following state equations:
x ˙ = A x + B u y = C x + D u .
There are an infinite number of possible realizations of any system. A minimal realization is any realization in which A has the smallest possible dimension. That is, a given realization A, B, C, D is minimal if there is no other realization A', B', C', D' where A' has smaller dimensions than A.
A state transformation is a rotation of the state vector by an invertible matrix T such that x ^ = T x . State transformation yields an equivalent state-space representation of the system, with
A ^ = T A T − 1 B ^ = T B C ^ = C T − 1 D ^ = D .
Certain minimal realizations known as canonical forms can be useful for some types of dynamic-system theory and analysis. This topic summarizes some of these canonical forms and related transformations.
Modal form is a diagonalized form that separates the system eigenvalues. In modal form, A or (A,E) are block-diagonal. The block size is typically 1-by-1 for real eigenvalues and 2-by-2 for complex eigenvalues. However, if there are repeated eigenvalues or clusters of nearby eigenvalues, the block size can be larger.
For instance, for a system with eigenvalues ( λ 1 , σ ± j ω , λ 2 ) , the modal A matrix is of the form
A m = [ λ 1 0 0 0 0 σ ω 0 0 − ω σ 0 0 0 0 λ 2 ] .
To obtain the modal form, use the modalreal command, [msys,blks] = modalreal(sys) .
When performing system identification using ssest (System Identification Toolbox) , obtain modal form by setting Form to modal .
In companion realizations, the characteristic polynomial of the system appears explicitly in the A matrix. For a SISO system with characteristic polynomial
P ( s ) = s n + α n − 1 s n − 1 + α n − 2 s n − 2 + … + α 1 s + α 0 ,
the corresponding controllable companion form has
A c c o m = [ 0 1 0 0 ⋮ 0 0 0 1 0 ⋮ 0 0 0 0 1 ⋮ 0 … … … … ⋱ … 0 0 0 0 ⋮ 1 − α 0 − α 1 − α 2 − α 3 ⋮ − α n − 1 ] , B c c o m = [ 1 0 ⋮ 0 ] .
For multi-input systems, Accom has the same form, and the first column of Bccom is as shown. This form does not impose a particular structure on the rest of Bccom or on Cccom and Dccom.
The command csys = compreal(H,"c") computes a controllable companion-form realization of H by using the state transformation T = ctrb(H.A,H.B) to put the A matrix into companion form.
When performing system identification using commands such as ssest (System Identification Toolbox) or n4sid (System Identification Toolbox) , obtain companion form by setting Form to companion .
The companion transformation requires that the system be controllable from the first input. The transformation to companion form is based on the controllability matrix, which is almost always numerically singular for mid-range orders. Hence, avoid using it for computation when possible.
A related form is obtained using the observability state transformation T = obsv(H.A,H.B) instead of T = ctrb(H.A,H.B) . This form is the dual (transpose) of controllable companion form, as follows:
A o c o m = A c c o m T B o c o m = C c c o m T C o c o m = B c c o m T D o c o m = D c c o m T .
A o c o m = [ 0 0 0 ⋮ 0 − α 0 1 0 0 ⋮ 0 − α 1 0 1 0 ⋮ 0 − α 2 0 0 1 ⋮ 0 − α 3 … … … ⋱ … … 0 0 0 ⋮ 1 − α n − 1 ] , C o c o m = [ 1 0 … 0 ] .
This form is sometimes known as observability canonical form [1], but it is different from observable canonical form.
The command csys = compreal(H,"o") computes an observable companion-form realization of H by using the state transformation T = ctrb(H.A,H.B) to put the A matrix into companion form.
When performing system identification using commands such as ssest (System Identification Toolbox) or n4sid (System Identification Toolbox) , obtain this form by setting Form to canonical .
For a strictly proper system with the transfer function
H ( s ) = β n − 1 s n − 1 + … + β 1 s + β 0 s n + α n − 1 s n − 1 + … + α 1 s + α 0 + d 0 ,
the controllable canonical form [2] is given by:
A c o n t = [ 0 0 0 ⋮ 0 − α 0 1 0 0 ⋮ 0 − α 1 0 1 0 ⋮ 0 − α 2 0 0 1 ⋮ 0 − α 3 … … … ⋱ … … 0 0 0 ⋮ 1 − α n − 1 ] , B c o n t = [ 0 0 ⋮ 0 1 ] , C c o n t = [ β 0 β 1 … β n − 1 ] , D c o n t = d 0 .
This form is also known as phase-variable canonical form. In this form, the coefficients of the characteristic polynomial appear in the last row of Acont. Controllable canonical form is a minimal realization in which all model states are controllable. Like companion form and observable canonical form, it can be ill-conditioned for computation.
There is no MATLAB ® command for directly computing controllable canonical form. However, if you can obtain the system in the transfer-function form H(s), then you can use the coefficients ɑ0,…,ɑn–1 , β0,…,βn–1 , and d0 to construct the controllable canonical-form matrices in MATLAB. Then, create the system with the ss command..
The observable canonical form of a system is the dual (transpose) of its controllable canonical form. In this form, the characteristic polynomial of the system appears explicitly in the last column of the A matrix. Observable canonical form can be obtained from the controllable canonical form as follows:
A o b s = A c o n t T B o b s = C c o n t T C o b s = B c o n t T D o b s = D c o n t T .
Thus, for the system with transfer function
H ( s ) = β n − 1 s n − 1 + … + β 1 s + β 0 s n + α n − 1 s n − 1 + … + α 1 s + α 0 + d 0 ,
the observable canonical form [2] is given by:
A o b s = [ 0 1 0 0 ⋮ 0 0 0 1 0 ⋮ 0 0 0 0 1 ⋮ 0 … … … … ⋱ … 0 0 0 0 ⋮ 1 − α 0 − α 1 − α 2 − α 3 ⋮ − α n − 1 ] , B o b s = [ β 0 β 1 β 2 ⋮ β n − 1 ] , C o b s = [ 0 0 … 0 1 ] , D o b s = d 0 .
Like the companion form, in this form, the coefficients of the characteristic polynomial appear in the last column of Aobs. Observable canonical form is a minimal realization in which all model states are observable.
As with controllable canonical form, there is no MATLAB command for directly computing observable canonical form. However, if you can obtain the system in the transfer-function form H(s), then you can use the coefficients ɑ0,…,ɑn–1 , β0,…,βn–1 , and d0 to construct the observable canonical-form matrices in MATLAB. Then, create the system with the ss command.
[1] Baillieul, John, "Observability Canonical Form and the Theory of Observers," lecture notes, November 15, 2012, accessed June 10, 2022, https://people.bu.edu/johnb/501Lecture19.pdf.
[2] Gillis, James T., "State Space." In Control System Fundamentals., edited by William S. Levine, 2d ed. The Electrical Engineering Handbook Series. Boca Raton: CRC Press, 2011.
modalreal | compreal | ss | ssest (System Identification Toolbox) | n4sid (System Identification Toolbox)