Contents

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 Editor, select Analysis > 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. In the Linear Analysis tab, click Trim Model. Then click Specifications.

    The Specifications for trim dialog box appears.

    The Reference Filter block contains just one state.

  4. In the Simulink Editor, 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. In the Specifications for trim dialog, click Sync with Model 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 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 Editor, 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.

Was this topic helpful?