Main Content

Simulate Simulink Model at Specific Operating Point

This example shows how to initialize a model at a specific operating point for simulation. For more information on computing operating points, see Compute Steady-State Operating Points and Find Operating Points at Simulation Snapshots.

To simulate your model at your computed operating point, you must set the model initial conditions to match the states and inputs in the operating point.

If you already have an operating point, op, in your MATLAB® or model workspace, you can set the initial conditions in the Configuration Parameters dialog box, in the Data Import/Export pane. To do so:

  • Set the Input parameter to getinputstruct(op).

  • Set the Initial state parameter to getstatestruct(op).

You can also set the model initial conditions programmatically. For more information, see getstatestruct and getinputstruct.

Alternatively, if you computed your operating point using the Steady State Manager or Model Linearizer, you can interactively set the model initial conditions form within these tools.

Once you have set your model initial condition, simulate your model at the specified operating point.

Set Model Operating Point Using Steady State Manager

In Steady State Manager, in the data browser, in the Operating Point section, right-click the operating point at which you want to simulate the model, and select Open Selection.

If you computed multiple operating points using a simulation snapshot, in the operating point document, select an operating point from the Select Operating Point drop-down list.

On the Operating Point tab, click Set Initial Conditions.

The software sets the initial conditions of the model to match the inputs and states in the selected operating point.

Similarly, using Steady State Manager, you can also set the model initial conditions based on an operating point specification or an operating point search report.

Set Model Operating Point Using Model Linearizer

In Model Linearizer, in the data browser, in the Linear Analysis Workspace, double-click the computed operating point or simulation snapshot.

If you computed multiple operating points using a simulation snapshot, select an operating point from the Select Operating Point drop-down list.

In the Edit dialog box, click Initialize model.

In the Initialize Model dialog box, specify a Variable Name for the operating point object. Alternatively, you can use the default variable name.

To export the operating point to the MATLAB workspace and set the model initial condition to this operating point, click OK.

Tip

If you want to store this operating point with the model, export the operating point to the Model Workspace instead.

See Also

|

Related Topics