Approximate Model with Unstable or Near-Unstable Pole
This example shows how to compute a reduced-order approximation of a system when the system has unstable or near-unstable poles.
When computing a reduced-order approximation, the reducespec
command (or the Model Reducer app) does not eliminate unstable poles because doing so would fundamentally change the system dynamics. Instead, the software decomposes the model into stable and unstable parts and reduces the stable part of the model.
If your model has near-unstable poles, you might want to ensure that the reduced-order approximation preserves these dynamics. This example shows how to use the Offset
option to preserve poles that are close to the stable-unstable boundary.
Load a model with unstable and near-unstable poles.
load('reduce.mat','gasf35unst')
gasf35unst
is a 25-state SISO model with two unstable poles (Re(s) > 0). Examine the system poles to find the near-unstable poles.
pzplot(gasf35unst) axis([-0.0015 0.0015 -0.0005 0.0005])
ans = 1×4
-0.0015 0.0015 -0.0005 0.0005
The pole-zero plot shows several poles (marked by x
) that fall in the left half-plane, but relatively close to the imaginary axis. These are the near-unstable poles. Two of these fall within 0.0005 of instability. Three more fall within 0.001 of instability.
Create a model order reduction (MOR) task and examine a Hankel singular-value plot of the model.
R = reducespec(gasf35unst,"balanced");
view(R)
The plot shows the two unstable modes, but you cannot easily determine the energy contribution of the near-unstable poles. In your application, you might want to reduce the model without discarding those poles nearest to instability, even if they are of relatively low energy. Use the R.Options.Offset
option of the MOR task to calculate a reduced-order system that preserves the two stable poles that are closest to the imaginary axis. The Offset
option sets the boundary between poles that getrom
can discard, and poles that getrom
must preserve (treat as unstable).
R.Options.Offset = 0.0005; gasf_arr = getrom(R,Order=[10,15]);
Providing getrom
an array of target approximation orders [10,15]
causes getrom
to return an array of approximated models. The array gasf_arr
contains two models, a 10th-order and a 15th-order approximation of gasf35unst
. In both approximations, getrom
does not discard the two unstable poles or the two nearly-unstable poles.
Compare the reduced-order approximations to the original model.
bodeplot(gasf35unst,gasf_arr(:,:,1),'r--',gasf_arr(:,:,2),'g-.') legend("Original","10th order","15th order")
ans = Legend (Original, 10th order, 15th order) with properties: String: {'Original' '10th order' '15th order'} Location: 'northeast' Orientation: 'vertical' FontSize: 8.1000 Position: [0.7417 0.8188 0.2128 0.1278] Units: 'normalized' Use GET to show all properties
The 15th order approximation is a good frequency-domain match to the original model. However, the 10th-order approximation shows changes in high-frequency dynamics, which might be too large to be acceptable. The 15th-order approximation is likely a better choice.