Main Content

Simulink.op.ModelBlockOperatingPoint

Operating point of model reference in simulation

Since R2026a

    Description

    A Simulink.op.ModelBlockOperatingPoint object contains data that represents the operating point of a Model block in simulation. A Model block operating point contains the values of states in the referenced model, including states of hidden blocks.

    Use Model block operating points to specify the initial operating point of a model reference in simulation.

    • To save the operating point of a model reference, configure the Model block to save its final operating point.

    • To initialize a model reference for simulation, specify the initial operating point of the Model block as a Simulink.op.ModelBlockOperatingPoint object.

    You can configure multiple Model blocks in the same model hierarchy to save the final operating point or simulate from an initial operating point.

    Model block operating points are not interchangeable with model operating points.

    • To initialize a top model, you must use a Simulink.op.ModelOperatingPoint object.

    • To initialize a Model block, you must use a Simulink.op.ModelBlockOperatingPoint object.

    A Model block operating point overrides operating point information for the block specified as:

    • The initial state or operating point of the top model

    • The initial operating point of another Model block at a higher level of the model hierarchy

    Model block operating points do not contain operating point information for the solver or the simulator. Specifying the initial operating point of a Model block does not affect the operating point of the solver or simulator.

    Saving and loading Model block operating points is not supported for Model blocks that:

    • Simulate in a mode other than normal mode

    • Reference a model that is referenced by another Model block in the hierarchy

    • Are part of a variant subsystem or variant assembly subsystem

    Creation

    To create a Model block operating point, configure the Model block to save its final states. The final operating point of the block is returned with the simulation results.

    • By default, each Model block operating point is saved as a Simulink.op.ModelBlockOperatingPoint object in a property of the Simulink.SimulationOutput object returned by the simulation.

    • If you disable the Single simulation output configuration parameter, each Model block operating point is saved in a workspace variable when you run the simulation from a user interface, such as the Simulink Editor.

    Properties

    expand all

    States of built-in blocks, specified as a structure. The structure contains a field for each state in the model referenced by the Model block that created the operating point. For each state, the structure includes the state value and the path to the block in the referenced model. You can modify the state values in the structure. All other fields of the structure are read only.

    The Save format configuration parameter does not affect the loggedStates property of Simulink.op.ModelBlockOperatingPoint objects.

    Data Types: struct

    Operating point description, specified as a string or a character vector. The default description includes:

    • The path to the Model block within the parent model

    • The name of the model referenced by the Model block

    • The simulation time at which the operating point was saved

    For example, suppose you save the operating point of a Model block named ModelBlock at a simulation time of 3 seconds. If the Model block is in a model named ParentModel and references a model named RefModel, the default description is Operating point of the model block 'ParentModel/ModelBlock' for the referenced model 'RefModel' at simulation time 3.

    Tips

    Use the snapshotTime property to get the simulation time at which the operating point was created.

    This property is read-only.

    Start time of simulation that created operating point, returned as a scalar number.

    Data Types: double

    This property is read-only.

    Simulation time at which operating point was created, returned as a scalar number.

    Data Types: double

    This property is read-only.

    Path to Model block that created operating point, returned as a character vector.

    Examples

    collapse all

    Suppose you want to save the operating point of a Model block named ModelBlock in a model named MyModel.

    Enable the SaveFinalState parameter of the Model block.

    set_param("MyModel/ModelBlock",SaveFinalState="on")

    Optionally, specify a custom name for the SimulationOutput property or workspace variable to contain the final operating point of the Model block.

    set_param("MyModel/ModelBlock",FinalStateName="modelblockop")

    Simulate the model. Then, get the Model block operating point returned in the Simulink.SimulationOutput object.

    out = sim("MyModel");
    op = out.modelblockop;

    Suppose you want to specify the initial operating point of a Model block named ModelBlock in a model named MyModel.

    Enable the LoadInitialState parameter of the Model block.

    set_param("MyModel/ModelBlock",LoadInitialState="on")

    Specify the InitialState parameter of the Model block as the ModelBlockOperatingPoint object op.

    set_param("MyModel/ModelBlock",InitialState="op")

    Version History

    Introduced in R2026a