Skip to Main Content Skip to Search
Product Documentation

State Order in Linearized Model

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.

  1. 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.

  2. In the Simulink model window, select Tools > Control Design > Linear Analysis.

    This action starts the Linear Analysis Tool for the model.

  3. In the Exact Linearization tab, click Options.

  4. In the State Ordering tab, select the Enable state ordering check box.

  5. 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.

  6. In the Linear Analysis Tool, click to linearize the model.

    A new linearized model, linsys1, appears in the Linear Analysis Workspace.

  7. 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.

Control State Order of Linearized Model using MATLAB Code

This example shows how to control the order of the states in your linearized model. This state order appears in linearization results.

  1. 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.

  2. 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'
    
  3. Define a different state order.

    stateorder = {'magball/Magnetic Ball Plant/height';...
                  'magball/Magnetic Ball Plant/dhdt';...
                  'magball/Magnetic Ball Plant/Current'};
  4. 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'

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS