Skip to Main Content Skip to Search
Product Documentation

Synchronize Simulink Model Changes With Operating Point Specifications

Synchronize Simulink Model Changes With Linear Analysis Tool

This example shows how to update the operating point specifications in the Linear Analysis Tool to reflect changes to the Simulink model.

Modifying your Simulink model can change, add, or remove states, inputs, or outputs, which changes the operating point. If you change your model while the Linear Analysis Tool is open, you must sync the operating point specifications in the Linear Analysis Tool to reflect the changes in the model.

  1. Open Simulink model.

    sys = ('scdspeedctrl');
    open_system(sys)
  2. In the Simulink model window, select Tools > Control Design > Linear Analysis.

    The Linear Analysis Tool for the model opens, with the default operating point being set to the model initial condition.

  3. Select Trim Model > Specifications in the Linear Analysis tab.

    The Reference Filter block contains just one state.

  4. In the Simulink model window, double-click the Reference Filter block. Change the Numerator of the transfer function to 100, and change the Denominator to [1 20 100]. Click OK.

    This change adds a state to the Simulink model.

  5. Click Sync with Model in the Specifications for trim dialog to synchronize the operating point specifications in the Linear Analysis Tool with the model.

    The dialog now shows two states for the Reference Filter block.

  6. Click Trim to compute the operating point.

Synchronize Simulink Model Changes With Existing Operating Point Specification Object

This example shows how to use update to update the operating point specification object after you update the Simulink model.

  1. Open Simulink model.

    sys = 'scdspeedctrl';
    open_system(sys);
  2. Create operating point specification object.

    By default, all model states are specified to be at steady state.

    opspec = operspec(sys);
  3. In the Simulink model window, double-click the Reference Filter block. Change the Numerator of the transfer function to [100] and the Denominator to [1 20 100]. Click OK.

  4. Find the steady state operating point that meets these specifications.

    op = findop(sys,opspec)

    This command results in an error because the changes to your model are not reflected in your operating point specification object:

    ??? The model scdspeedctrl has been modified and the operating point
    object is out of date.  Update the object by calling the function
    update on your operating point object.
  5. Update the operating point specification object with changes to the model. Repeat the operating point search.

    opspec = update(opspec);
    op = findop(sys,opspec)
    bdclose(sys);

    After updating the operating point specifications object, the optimization algorithm successfully finds the operating point.

  


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