Balancing is an important approach for model reduction of controlled systems. The balancing procedure usually consists of two steps: determining a transformation that balances the controllability and observability gramians to determine which states have the greatest contribution to the input-output behavior and performing a Galerkin projection onto the states corresponding to the largest singular values of the balanced gramians for the region of interest in state-space. The controllability gramian, the observability gramian, and a transformation matrix that balances the system are required for many of the balanced model reduction algorithms. While MATLAB routines exist for linear systems for the computation of these matrices, there is a lack of generally available codes for computing empirical gramians and performing nonlinear balancing.
The MATLAB code presented on this web page includes routines for computing empirical gramians or covariance matrices and a routine for computing the transformation matrix that balances the system. Detailed descriptions of these routines are presented along with the code. Additionally, several examples are given as a detailed demonstration on how the routines are used.