(Not recommended) Model order reduction
computes a reduced-order approximation
info] = balred(
rsys of the LTI model
sys. The desired order (number of states) is specified by
order. You can try multiple orders at once by setting
order to a vector of integers, in which case
rsys is an array of reduced models.
returns a structure
info with additional information like the Hankel
singular values (HSV), error bound, regularization level and the Cholesky factors of the
When performance is a concern, avoid computing the Hankel singular values twice by
using the information obtained from the above syntax to select the desired model order
and then use
rsys = balred(sys,order,info) to compute the
[___] = balred(___,
computes the reduced model using the options set
opts that you
balredOptions. You can specify additional options for
eliminating states, using absolute vs. relative error control, emphasizing certain time or
frequency bands, and separating the stable and unstable modes. See
balredOptions to create and configure the option set
Reduced-Order Approximation with Offset Option
Compute a reduced-order approximation of the system given by:
Create the model.
sys = zpk([-0.5 -1.1 -2.9],[-1e-6 -2 -1 -3],1);
Exclude the pole at from the stable term of the stable/unstable decomposition. To do so,
Offset option of
balredOptions to a value
larger than the pole you want to exclude.
opts = balredOptions('Offset',0.001,'StateProjection','Truncate');
Visualize the Hankel singular values (HSV) and the approximation error.
The red HSV indicates that it is associated with an unstable mode.
Now, compute a second-order approximation with the specified options.
[rsys,info] = balred(sys,2,opts); rsys
rsys = 0.99113 (s+0.5235) ------------------- (s+1e-06) (s+1.952) Continuous-time zero/pole/gain model.
Notice that the pole at
-1e-6 appears unchanged in the reduced
Compare the responses of the original and reduced-order models.
Observe that the bode response of the original model and the reduced-order model nearly match.
sys — Dynamic system
dynamic system model
sys has unstable poles,
sys to its stable and unstable parts and only the stable part is
balredOptions to specify additional
options for the stable/unstable decomposition.
balred does not support frequency response data models, uncertain
and generalized state-space models, PID models or sparse model objects.
order — Desired number of states
integer | vector of integers
Desired number of states, specified as an integer or a vector of integers. You can
try multiple orders at once by setting
order to a vector of
integers, in which case
rys is returned as an array of reduced
You can also use the Hankel singular values and error bound information to select the reduced-model order based on the desired model fidelity.
opts — Additional options for model reduction
Additional options for model reduction, specified as an options set. You can specify additional options for eliminating states, using absolute vs. relative error control, emphasizing certain time or frequency bands, and separating the stable and unstable modes.
balredOptions to create and configure
the option set
rsys — Reduced-order model
dynamic system model | array of dynamic system models
Reduced-order model, returned as a dynamic system model or an array of dynamic system models.
info — Additional information about the LTI model
Additional information about the LTI model, returned as a structure with the following fields:
HSV— Hankel singular values (state contributions to the input/output behavior). In state coordinates that equalize the input-to-state and state-to-output energy transfers, the Hankel singular values measure the contribution of each state to the input/output behavior. Hankel singular values are to model order what singular values are to matrix rank. In particular, small Hankel singular values signal states that can be discarded to simplify the model.
ErrorBound— Bound on absolute or relative approximation error.
info.ErrorBound(J+1)bounds the error for order J.
Regularization— Regularization level ⍴ (for relative error only). Here,
sysis replaced by
[sys;⍴*I]that ensures a well-defined relative error at all frequencies.
Ro— Cholesky factors of gramians.
balredfirst decomposes G into its stable and unstable parts:
When you specify
balreduses the balanced truncation method of  to reduce Gs. This computes the Hankel singular values (HSV) σj based on the controllability and observability gramians. For order r, the absolute error is bounded by . Here, n is the number of states in Gs.
When you specify
balreduses the balanced stochastic truncation method of  to reduce Gs. For square Gs, this computes the HSV σj of the phase matrix where W(s) is a stable, minimum-phase spectral factor of GG’:
For order r, the relative error is bounded by:
 Varga, A., "Balancing-Free Square-Root Algorithm for Computing Singular Perturbation Approximations," Proc. of 30th IEEE CDC, Brighton, UK (1991), pp. 1062-1065.
 Green, M., "A Relative Error Bound for Balanced Stochastic Truncation", IEEE Transactions on Automatic Control, Vol. 33, No. 10, 1988
Version HistoryIntroduced before R2006a
R2023b: Not recommended
MatchDC option honored when specified frequency or time intervals exclude DC
When you use
balred for model reduction, you can use
balredOptions to restrict the computation to specified frequency or time
intervals. If the
StateProjection option of
balredOptions is set to
'MatchDC' (the default
balred attempts to match the DC gain of the original and
reduced models, even if the specified intervals exclude DC (frequency = 0 or time =
Prior to R2017b, if you specified time or frequency intervals that excluded DC,
balred did not attempt to match the DC gain of the original and
reduced models, even if
StateProjection = 'MatchDC'.