Model order reduction
rsys = balred(sys,ORDERS)
rsys = balred(sys,ORDERS,BALDATA)
rsys = balred(___,opts)
rsys = balred(sys,ORDERS) computes a reduced-order approximation rsys of the LTI model sys. The desired order (number of states) for rsys is specified by ORDERS. You can try multiple orders at once by setting ORDERS to a vector of integers, in which case rsys is a vector of reduced-order models. balred uses implicit balancing techniques to compute the reduced- order approximation rsys. Use hsvd to plot the Hankel singular values and pick an adequate approximation order. States with relatively small Hankel singular values can be safely discarded.
When sys has unstable poles, it is first decomposed into its stable and unstable parts using stabsep, and only the stable part is approximated. Use balredOptions to specify additional options for the stable/unstable decomposition.
When you have System Identification Toolbox™ software installed, sys can only be an identified state-space model (idss). The reduced-order model is also an idss model.
rsys = balred(sys,ORDERS,BALDATA) uses balancing data returned by hsvd. Because hsvd does most of the work needed to compute rsys, this syntax is more efficient when using hsvd and balred jointly.
rsys = balred(___,opts) computes the model reduction using the specified options for the stable/unstable decomposition and state elimination method. Use the balredOptions command to create the option setopts.
 Varga, A., "Balancing-Free Square-Root Algorithm for Computing Singular Perturbation Approximations," Proc. of 30th IEEE CDC, Brighton, UK (1991), pp. 1062-1065.