(Not recommended) Model reduction from normalized coprime factorization
ncfmr computes a reduced-order approximation of a model by
truncating modes in a coprime factorization of the full-order model. This method is related to
the balanced truncation method, but it is particularly well-suited to controller order
reduction. For a stabilizing controller, the reduced controller is also stabilizing as long as
the approximation error is smaller than the robustness margin computed by
computes a reduced-order approximation of the dynamic system model
info] = ncfmr(
Specify the desired reduction order as
is a vector, then
Gred is an array of approximations of the
corresponding order. The structure
info contains information about the
computation such as bounds on the approximation error.
computes the coprime factorization of
info] = ncfmr(
G given by
[M,N] such that
G = M\N (see
Hankel singular values of the factorization, and the error bounds. You can use this
information to determine the target reduction order programmatically based on desired
fidelity or robust stability considerations. Then, use the syntax
ncfmr(G,ord,info) to compute the reduced-order model.
computes the reduced-order approximation using the normalized coprime factorization and
Hankel singular values that you provide in
Gred = ncfmr(
info using the previous syntax,
ncfmr(G). Providing a previously computed
ncfmr allows you to perform model reduction without having to
recompute the factorization and Hankel singular values. This syntax is therefore
particularly useful when performance is a concern.
ncfmr(G) plots the Hankel singular values and bounds on the
approximation error corresponding to each order. Examine the plot to determine a reduced
order based on desired fidelity or robust stability considerations. You can then use
Gred = ncfmr(G,ord) to compute the reduced-order model.
Reduce Model Order
ncfmr computes Hankel singular values and
approximation errors to help you select a suitable target reduction order. One way to do
so is to examine a plot of these values. Suppose that you have a data file
ncfmrModel.mat containing the 30-state plant model
State-space model with 2 outputs, 3 inputs, and 30 states.
ncfmr without an output argument. The function generates a
Hankel singular value plot, which shows the relative energy contributions of each state
in the coprime factorization of
G, arranged in decreasing order by
energy. The plot also shows the upper bound on the error between the original and
reduced-order models that you obtain by truncating the states at that point. Examine
this plot to choose the target order. For instance, for a maximum error of 0.01, you can
reduce the model to 13th order.
ncfmr again with an output argument and using
order = 13. Doing so computes the reduced model
Gred. Examine the singular values of
G and of
the difference between
Gred. The difference
is very small across all frequencies, showing that the reduced-order model is a good
approximation of the full-order model.
Gred = ncfmr(G,13); sigma(G,G-Gred) legend("G","G-Gred")
G — Model to reduce
dynamic system model
Model to reduce, specified as a dynamic system model such as a state-space
G can be stable or unstable. If
G is a generalized state-space model with uncertain or tunable
control design blocks, then the function uses the nominal or current value of those
sys cannot be an
frd model or a
model with time delays.
ord — Reduction order
positive integer | vector of positive integers
Reduction order, specified as a positive integer or a vector of positive integers.
ord is a scalar,
ncfmr returns the model
Gred of that order. If
ord is a vector, then
Gred is an array of models reduced to the corresponding
ord, you can use one of two methods:
Use the syntax
ncfmr(G)to obtain a plot of Hankel singular values and bounds on approximation errors at each order. Examine the plot to choose a reduction order with a tolerable approximation error. For an example, see Reduce Model Order.
Use the syntax
[~,info] = ncfmr(G)to obtain the
infostructure. Programmatically examine the approximation error bounds in
info.ErrorBoundsto choose a reduction order.
G has unstable states, then
ord must be
at least the number of unstable states.
Gred — Reduced-order model
Reduced-order model, returned as a state-space (
ss) model. If
ord is a scalar, then
Gred is a single model
ord is a vector, then
Gred is an array of
ss models of corresponding
info — Information about model-reduction calculation
Information about model-reduction calculation, returned as a structure with the following fields.
HSV— Hankel singular values of
GL, returned as a vector whose length is the number of states in
G. These values indicate the relative energy contribution of each state. You can choose a target reduction order by examining these values and choosing a number of states after which the energy contribution drops off significantly.
ErrorBound— Upper bound on approximation errors, returned as a vector. The approximation error is given by , where [M,N] =
lncf(G)and [Mr,Nr] =
lncf(Gred). (For more information about these expressions, see
lncf.) Each entry
info.ErrorBound(j)is the maximum approximation error associated with reducing to
jstates. Thus, for instance, if you want an approximation error of no more than 0.01, examine
info.ErrorBoundto find the index of the first entry that is less than 0.01. Use that index as
You can use
ncfmrto reduce the plant G or controller K while preserving closed-loop stability of the following SISO or MIMO feedback loop.
Stability of this loop is preserved as long as the approximation error of the reduced plant is smaller than the robustness margin for this loop given by
For controllers computed with
ncfsyn, reducing the controller Ks that
ncfsyncomputes for the shaped controller Gs is preferable. Both Ks and Gs are returned by
infooutput argument. You can then compute Kr, the reduced controller for the original plant G, from Kr = W1KsrW2, where W1 and W2 are the shaping weights used with
For controllers obtained by other techniques, reduction with
ncfmralso preserves stability if the error does not exceed the
ncfmarginmargin. However, such reduction can partially remove integral action and introduce steady-state tracking errors. Therefore, removing any integrator terms from the controller before reduction with
ncfmrand replacing them in the reduced controller is recommended.
ncfmr performs the following steps to reduce the input model
G to the desired order k.
Version HistoryIntroduced before R2006a
R2023b: Not recommended
R2021b: Syntax and output change
The behavior of
ncfmr changed in R2021b to bring it in line with
balred and to allow fully programmatic selection of the reduced-model
order. As a result, some syntaxes and output arguments have changed, and some options are no
Prior to R2021b, calling
ncfmr(G) without a specified reduction order
invoked an interactive workflow that prompted you to enter the desired order. As of R2021b,
this syntax displays a plot but no longer prompts for the desired order. Instead, call
ncfmr again using the
ord input argument to specify
the desired order. The following table further describes this change in the interactive
|Interactive Workflow Before R2021b||Interactive Workflow in R2021b|
The fields of the
info output argument have also changed in R2021b.
The following table summarizes these changes.
are not recommended. Instead:
To display a plot of the Hankel singular values of a dynamic system model
nfcmr(G)without an output argument. This command generates a singular-value plot that also displays the approximation error of truncation at each mode.
To select a model order based on the approximation error, examine the plot. Or, call
[~,info] = ncfmr(G)and use the information in