getrom
Obtain reducedorder models when using balanced truncation of normalized coprime factors method
Since R2023b
Description
Use getrom
to obtain reducedorder models from a
NCFBalancedTruncation
model order reduction task created using reducespec
. For
the full workflow, see TaskBased Model Order Reduction Workflow.
This method requires Robust Control Toolbox™ software.
returns a reducedorder model rsys
= getrom(R
,Name=Value
)rsys
based on the options specified by
namevalue arguments.
getrom(
returns help specific to
the model order specification object R
,'help')R
. The returned help shows the
namevalue arguments and syntaxes applicable to R
.
Examples
Balanced Truncation of Normalized Coprime Factors
This example shows how to obtain a reducedorder model using the balanced truncation of normalized coprime factors method.
Load a 30state plant model G
.
load ncfModel.mat G size(G)
Statespace model with 2 outputs, 3 inputs, and 30 states.
Create a model order reduction task.
R = reducespec(G,"ncf");
To help you select a suitable target reduction order, examine the plot of Hankel singular values and approximation errors.
Create the plot.
view(R)
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 reducedorder 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.
Examine the singular values of G
and of the difference between G
and Gred
.
Gred = getrom(R,MaxError=0.01); sigma(G,GGred) legend("G","GGred")
The difference is small across all frequencies, showing that the reducedorder model is a good approximation of the fullorder model.
Reduce Controller Order While Preserving Stability and Robustness
This example show how to reduce controller order while preserving stability and robustness. This example requires Robust Control Toolbox™ software.
When you use normalized coprime factorization (NCF) balanced truncation with getrom
to reduce a plant G
or controller K
for which the closedloop response feedback(G*K,eye(n))
is stable, the resulting closedloop response is also stable as long as the approximation error of the reduced model does not exceed the robustness margin computed by ncfmargin
. To see this benefit of NCF balanced truncation, load a plant G
and design a controller for it. For this example, use ncfsyn
(Robust Control Toolbox) to design the controller.
load ncfStability.mat G size(G)
Statespace model with 1 outputs, 1 inputs, and 3 states.
% shaping weights s = tf('s'); W1 = 3.35*tf([1 20.89],[1 0]); W2 = 1; % controller [K,~,~,Kinfo] = ncfsyn(G,W1,W2); size(K)
Statespace model with 1 outputs, 1 inputs, and 5 states.
ncfsyn
designs a controller by optimizing the ncfmargin
robustness margin using a plant shaped by weighting functions W1
and W2
(see ncfsyn
(Robust Control Toolbox)). To analyze margins with ncfmargin
and reduce controller order, work with the shaped plant Gs
and the controller Ks
designed for it.
Gs = Kinfo.Gs; Ks = Kinfo.Ks;
Use ncfmargin
(Robust Control Toolbox) to find the robustness margin of the system with the fullorder controller. ncfsyn
assumes a positive feedback loop while ncfmargin
assumes negative feedback, so reverse the sign of the controller for this computation.
emax = ncfmargin(Gs,Ks)
emax = 0.1956
As long as the approximation error of the reducedorder controller does not exceed emax
, stability of the closedloop system is preserved.
Create a model order reduction task using reducespec
.
R = reducespec(Ks,"ncf");
R = process(R);
To select the reduced order, visualize the errors associated with each target order.
view(R)
Suppose that you can tolerate up to a 50% reduction in this margin in exchange for the computational benefit of a lower order controller.
Obtain the reducedorder model such that the target error does not exceed emax/2
.
Ksr = getrom(R,MaxError=emax/2); size(Ksr)
Statespace model with 1 outputs, 1 inputs, and 3 states.
The reducedorder controller yields a very similar stability margin to the original controller.
ncfmargin(Gs,Ksr)
ans = 0.1949
Reducing the controller order further leads to additional reduction in the stability margin. Reducing too far can lead to loss of closedloop stability. For instance, try reducing to first order.
Ksru = getrom(R,Order=1); ncfmargin(Gs,Ksru)
ans = 0
Thus, for further analysis or implementation, use the thirdorder controller. To do so, convert Ksr
, the reduced controller for Gs
, into Kr
, the reduced controller for G
.
Kr = W1*Ksr*W2;
To confirm that this controller is satisfactory, compare the closedloop response to the response with the fullorder controller. Again, reverse the sign of the controller to account for ncfsyn
assuming positive feedback.
CL = feedback(G*K,1); CLr = feedback(G*Kr,1); step(CL,CLr) legend
The large overshoot in this case is due to instability of the original plant G
.
Input Arguments
R
— Model order reduction specification object
NCFBalancedTruncation
object
Model order reduction specification object, specified as an NCFBalancedTruncation
object created using reducespec
.
NameValue Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Namevalue arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: rsys = getrom(R,Order=[10,14])
Order
— Desired order
nonnegative scalar  vector
Desired order of the reducedorder model, specified as a nonnegative scalar or vector.
To obtain a single reducedorder model
rsys
, use a scalar.To obtain an array of reduced models
rsys
, use a vector.For example, if you specify
rsys = getrom(R,Order=[5,8,11])
,rsys
is a 3by1 model array containing reducedorder models with orders of 5, 8, and 11.
The arguments Order
, MaxError
, and
MinEnergy
are mutually exclusive. You can specify only one of
these arguments at a time.
MaxError
— Maximum approximation error
nonnegative scalar  vector
Maximum approximation error, specified as a nonnegative scalar or vector.
To obtain a single reducedorder model
rsys
, use a scalar.To obtain an array of reduced models
rsys
, use a vector.For example, if you specify
rsys = getrom(R,MaxError=[1e3,1e5,1e7])
,rsys
is a 3by1 model array containing reducedorder models with the specified error bounds.
The function selects the lowest order for which the error does not exceed the value you specify for this argument.
The arguments Order
, MaxError
, and
MinEnergy
are mutually exclusive. You can specify only one of
these arguments at a time.
MinEnergy
— Minimum energy bound
nonnegative scalar  vector
Minimum bound on the normalized energy, specified as a nonnegative scalar or vector.
To obtain a single reducedorder model
rsys
, use a scalar.To obtain an array of reduced models
rsys
, use a vector.For example, if you specify
rsys = getrom(R,MinEnergy=[1e3,1e5])
,rsys
is a 2by1 model array containing reducedorder models with the specified minimum normalized energies of the states.
The function discards all the states that have normalized energies lower than the value you specify for this argument.
The arguments Order
, MaxError
, and
MinEnergy
are mutually exclusive. You can specify only one of
these arguments at a time.
Output Arguments
rsys
— Reducedorder model
statespace model  array of statespace models
Reducedorder model, returned as a statespace model or an array of statespace models.
info
— Additional information
structure  structure array
Additional information about the reducedorder model, returned as a structure or structure array.
If
rsys
is a single statespace model, theninfo
is a structure.If
rsys
is an array of statespace models, theninfo
is a structure array with the same dimensions asrsys
.
Each info
structure has this field:
Field  Description 

RLNCF  Left normalized coprime factorization of the reducedorder statespace model, returned as a statestate space model. If

Version History
Introduced in R2023b
See Also
Functions
reducespec
process
view (ncf)
view (balanced)
getrom (balanced)
view (modal)
getrom (modal)
Objects
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
 América Latina (Español)
 Canada (English)
 United States (English)
Europe
 Belgium (English)
 Denmark (English)
 Deutschland (Deutsch)
 España (Español)
 Finland (English)
 France (Français)
 Ireland (English)
 Italia (Italiano)
 Luxembourg (English)
 Netherlands (English)
 Norway (English)
 Österreich (Deutsch)
 Portugal (English)
 Sweden (English)
 Switzerland
 United Kingdom (English)