# balreal

Balanced state-space realization

## Description

`[`

computes a balanced state-space realization of the LTI model `sysb`

,`g`

] = balreal(`sys`

)`sys`

. For
stable models, `sys`

is an equivalent realization for which the
controllability and observability Gramians are equal and diagonal, their diagonal entries
forming the vector `g`

of Hankel singular values. This balances the
input-to-state and state-to-output energy transfers, and small entries of
`g`

indicate states that you can remove with `xelim`

.

If `sys`

has unstable poles, the function isolates the stable part,
balances it, and adds back to the unstable part to form `sysb`

. The
entries of `g`

corresponding to unstable modes are set to
`Inf`

.

`[`

computes the balanced realization using options specified as one or more name-value
arguments.`sysb`

,`g`

] = balreal(`sys`

,`Name=Value`

)* (since R2023b)*

## Examples

## Input Arguments

## Output Arguments

## Tips

For model order reduction purposes, use `reducespec`

.

## Algorithms

Consider the stable state-space model

$$\begin{array}{l}E\dot{x}=Ax+Bu\\ y=Cx+Du\end{array}$$

with controllability and observability Gramians
*W _{c}* and

*W*.

_{o}The state coordinate transformation $$x={T}_{R}\overline{x}$$ produces the equivalent model

$$\begin{array}{l}{T}_{L}E{T}_{R}\dot{\overline{x}}={T}_{L}A{T}_{R}\overline{x}+{T}_{L}Bu\\ y=C{T}_{R}\overline{x}+Du\end{array}$$

`balreal`

transforms the Gramians to

$$\begin{array}{cc}{\overline{W}}_{c}={T}_{L}{W}_{c}{T}_{L}^{T},& {\overline{W}}_{o}={T}_{R}^{T}{W}_{o}\end{array}{T}_{R}$$

such that

$${\overline{W}}_{c}={\overline{W}}_{o}=diag(g)$$

If the model has unstable poles, the function isolates the stable part, balances it, and
adds back to the unstable part to form the realization. The entries of `g`

corresponding to unstable modes are set to `Inf`

.

See [1] and [2] for details on the algorithm.

If you use the `TimeIntervals`

or `FreqIntervals`

options, then `balreal`

bases the balanced realization on time-limited or
frequency-limited controllability and observability Gramians. For information about
calculating time-limited and frequency-limited Gramians, see `gram`

and [4].

## References

[1] Laub, A., M. Heath, C. Paige, and
R. Ward. “Computation of System Balancing Transformations and Other Applications of
Simultaneous Diagonalization Algorithms.” *IEEE Transactions on Automatic
Control* 32, no. 2 (February 1987): 115–22.
https://doi.org/10.1109/TAC.1987.1104549.

[2] Moore, B. “Principal Component
Analysis in Linear Systems: Controllability, Observability, and Model Reduction.”
*IEEE Transactions on Automatic Control* 26, no. 1 (February 1981):
17–32. https://doi.org/10.1109/TAC.1981.1102568.

[3] Laub, Alan J. “Computation of
‘Balancing’ Transformations.” *Joint Automatic Control Conference*, no. 17
(1980): 84. https://doi.org/10.1109/JACC.1980.4232165.

[4] Gawronski, Wodek, and Jer-Nan
Juang. “Model Reduction in Limited Time and Frequency Intervals.” *International
Journal of Systems Science* 21, no. 2 (February 1990): 349–76.
https://doi.org/10.1080/00207729008910366.

## Version History

**Introduced before R2006a**

## See Also

`reducespec`

| `gram`

| `xelim`

| `ssequiv`