| Contents | Index |
| On this page… |
|---|
Control State Order of Linearized Model using Linear Analysis Tool |
This example shows how to control the order of the states in your linearized model. This state order appears in linearization results.
Open and configure the model for linearization.
sys = 'magball';
open_system(sys)
sys_io(1)=linio('magball/Controller',1,'in');
sys_io(2)=linio('magball/Magnetic Ball Plant',1,'out','on');
setlinio(sys,sys_io);
opspec = operspec(sys);
op = findop(sys,opspec);These commands specify the plant linearization and compute the steady-state operating point.
In the Simulink model window, select Tools > Control Design > Linear Analysis.
This action starts the Linear Analysis Tool for the model.
In the Exact Linearization tab, click Options.

In the State Ordering tab, select the Enable state ordering check box.
Specify the desired state order using the Move Up and Move Down buttons.
Note If you change the model while its Linear Analysis Tool is open, click Sync with Model to update the list of states. |

In the Linear Analysis Tool, click
to linearize the model.
A new linearized model, linsys1, appears in the Linear Analysis Workspace.
In the Linear Analysis tab, choose Show result details... in the Select Report list.
This action opens the Linearization result details dialog box.

The linear model states appear in the specified order.
This example shows how to control the order of the states in your linearized model. This state order appears in linearization results.
Load and configure the model for linearization.
sys = 'magball';
load_system(sys);
sys_io(1)=linio('magball/Controller',1,'in');
sys_io(2)=linio('magball/Magnetic Ball Plant',1,'out','on');
opspec = operspec(sys);
op = findop(sys,opspec);These commands specify the plant linearization and compute the steady-state operating point.
Linearize the model, and show the linear model states.
linsys = linearize(sys,sys_io); linsys.StateName
The linear model states are in default order. The linear model includes only the states in the linearized blocks, and not the states of the full model.
ans =
'height'
'Current'
'dhdt'
Define a different state order.
stateorder = {'magball/Magnetic Ball Plant/height';...
'magball/Magnetic Ball Plant/dhdt';...
'magball/Magnetic Ball Plant/Current'};Linearize the model again and show the linear model states.
linsys = linearize(sys,sys_io,'StateOrder',stateorder); linsys.StateName
The linear model states are now in the specified order.
ans =
'height'
'dhdt'
'Current'![]() | Linearize at Simulation Snapshots and Triggered Events | Linearization Range of Accuracy | ![]() |

Learn more about resources for designing, testing, and implementing control systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |