main content

reduce model order using the model reducer app -凯发k8网页登录

this example shows how to reduce model order while preserving important dynamics using the model reducer app. this example illustrates the balanced truncation method, which eliminates states based on their energy contributions to the system response.

open model reducer with a building model

this example uses a model of the los angeles university hospital building. the building has eight floors, each with three degrees of freedom: two displacements and one rotation. the input-output relationship for any one of these displacements is represented as a 48-state model, where each state represents a displacement or its rate of change (velocity). load the building model and open model reducer with that model.

load building.mat
modelreducer(g)

select the model in the data browser to display some information about the model in the preview section. double-click the model to see more detailed information.

open the balanced truncation tab

model reducer has three model reduction methods: balanced truncation, mode selection, and pole/zero simplification. for this example, click balanced truncation.

model reducer opens the balanced truncation tab and automatically generates a reduced-order model. the top plot compares the original and reduced model in the frequency domain. the bottom plot shows the energy contribution of each state, where the states are sorted from high energy to low energy. the order of the reduced model, 14, is highlighted in the bar chart. in the reduced model, all states with lower energy contribution than this one are discarded.

compute multiple approximations

suppose that you want to preserve the first, second, and third peaks of the model response, around 5.2 rad/s, 13 rad/s, and 25 rad/s. try other model orders to see whether you can achieve this goal with a lower model order. compute a 5th-order and a 10th-order approximation in one of the following ways:

  • in the reduced model orders text box, enter [5 10].

  • in the state-contribution plot, ctrl-click the bars for state 5 and state 10.

model reducer computes two new reduced-order models and displays them on the response plot with the original model g. to examine the three peaks more closely, zoom in on the relevant frequency range. the 10th-order model captures the three peaks successfully, while the 5th-order model only approximates the first two peaks. (for information about zooming and other interactions with the analysis plots, see .)

compare reduced models with different visualizations

in addition to the frequency response plot of all three models, model reducer lets you examine the absolute and relative error between the original and reduced models. select absolute error plot to see the difference between the building and reduced models.

the 5th-order reduced model has at most -60db error in the frequency region of the first two peaks, below about 30 rad/s. the error increases at higher frequencies. the 10th-order reduced model has smaller error over all frequencies.

create reduced models in data browser

store the reduced models in the data browser by clicking create reduced model. the 5th-order and 10th-order reduced models appear in the data browser with names greduced5 and greduced10.

you can continue to change the model-reduction parameters and generate additional reduced models. as you do so, greduced5 and greduced10 remain unchanged in the data browser.

focus on dynamics at particular frequencies

by default, balanced truncation in model reducer preserves dc gain, matching the steady-state response of the original and reduced models. clear the preserve dc gain checkbox to better approximate high-frequency dynamics. model reducer computes new reduced models. the error in the high-frequency region is decreased at the cost of a slight increase in error at low frequencies.

you can also focus the balanced truncation on the model dynamics in a particular frequency interval. for example, approximate only the second peak of the building model around 13 rad/s. first, select the model response plot to see the bode plots of models. then check focus on range checkbox. model reducer analyzes state contributions in the highlighted frequency interval only.

you can drag the boundaries to change the frequency range interactively. as you change the frequency interval, the hankel singular value plot reflects the changes in the energy contributions of the states.

enter the frequency limits [10 22] into the text box next to focus on range. the 5th-order reduced model captures the essential dynamics. the 10th-order model has almost the same dynamics as the original building model within this frequency range.

optionally, store these additional models in the data browser by clicking create reduced model.

compare models in time domain

you can compare time-domain responses of the stored reduced models and the original in the plots tab. in the data browser, control-click to select the models you want to compare, g, greduced5, and greduced10. then, click step. model reducer creates a step plot with all three models.

zooming on the transient behavior of this plot shows that greduced10 captures the time domain behavior of the original model well. however, the response of greduced5 deviates from the original model after about 3 seconds.

export model for further analysis

comparison of the reduced and original models in the time and frequency domains shows that greduced10 adequately captures the dynamics of interest. export that model to the matlab® workspace for further analysis and design. in the model reducer tab, click export model. clear the check boxes for g and greduced5, and click export to export greduced10.

greduced10 appears in the matlab workspace as a state-space (ss) model.

see also

apps

live editor tasks

related topics

网站地图