Main Content

Refine Highlighted Model

After you highlight a model using Model Slicer, you can refine the dependency paths in the highlighted portion of the model. Using Model Slicer, you can refine a highlighted model by including only those blocks used in a portion of a simulation time window, or by excluding blocks or certain inputs of switch blocks. By refining the highlighted portion of your model, you can include only the relevant parts of your model.

Define a Simulation Time Window

You can refine a highlighted model to include only those blocks used in a portion of a simulation time window. Defining the simulation time window holds some switch blocks constant, and as a result removes inactive inputs.

  1. Add the example folder to the search path.

    addpath(fullfile(docroot,'toolbox','simulink','examples'))
  2. Open the sldvSliceClimateControlExample model.

    sldvSliceClimateControlExample
  3. On the Apps tab, under Model Verification, Validation, and Test gallery, click Model Slicer.

    When you open the Model Slice Manager, Model Slicer compiles the model. You then configure the model slice properties.

  4. In the Model Slice Manager, click the arrow to expand the Slice configuration list.

  5. Set the slice properties:

    • Name: Out1Simulation

    • Color: (cyan)

    • Signal propagation: upstream

  6. In the top level of the model, select the Out1 block as the slice starting point. Right-click the Out1 block and select Model Slicer > Add as Starting Point.

    The model is highlighted.

  7. In the Model Slice Manager, select Simulation time window.

  8. To specify the stop time of the simulation time window, click the run simulation button in the Model Slice Manager.

  9. Set the Stop time to 10.

  10. Click OK to start the simulation.

    The path is restricted to only those blocks that are active until the stop time that you entered.

  11. To highlight the model for a defined simulation time window, set the Stop time to 5. Click Highlight.

  12. To see how this constraint affects the highlighted portion of the model, open the Refrigeration subsystem.

    The highlighted portion of the model includes only the input ports of switches that are active in the simulation time window that you specified.

After you refine your highlighted model to include only those blocks used in a portion of a simulation time window, you can then Create a Simplified Standalone Model incorporating the highlighted portion of your model.

Exclude Blocks

You can refine a highlighted model to exclude blocks from the analysis. Excluding a block halts the propagation of dependencies, so that signals and model items beyond the excluded block in the analysis direction are ignored.

Exclusion points are useful for viewing a simplified set of model dependencies. For example, control feedback paths create wide dependencies and extensive model highlighting. You can use an exclusion point to restrict the analysis, particularly if your model has feedback paths.

Note

Simplified standalone model creation is not supported for highlighted models with exclusion points.

  1. In the Model Slice Manager, click the arrow to expand the Slice configuration list.

  2. To add a new slice configuration, click the add new button .

  3. Set the slice properties:

    • Name: Out1Excluded

    • Color: (red)

    • Signal Propagation: upstream

  4. In the top level of the model, select the Out1 block as the slice starting point. Right-click the Out1 block and select Model Slicer > Add as Starting Point.

    The model is highlighted.

  5. To open the subsystem, double-click Refrigeration.

  6. Right-click the Fan switch block, and then select Model Slicer > Add as Exclusion Point.

    The blocks that are exclusively upstream of the Fan switch block are no longer highlighted. The DT Fan Data Store Read block is no longer highlighted.

  7. To see how this constraint affects the highlighted portion of the model, view the parent system.

    The DSM fan temp Data Store Memory block and the Write2 Data Store Write block are no longer highlighted, because the DT Fan Data Store Read in the Refrigeration subsystem no longer accesses them.

Exclude Inputs of a Switch Block

For complex signal routing, you can constrain the dependency analysis paths to a subset of the available paths through switch blocks. Constraints appear in the Model Slice Manager.

Note

Simplified standalone model creation is not supported for highlighted models with constrained switch blocks.

  1. Double-click Refrigeration to open the subsystem.

  2. Constrain the On switch block:

    • Right-click the switch block and select Model Slicer > Add Constraint.

    • In the Constraints dialog box, select Port 3.

    • Click OK.

    The path is restricted to the Constant1 port on the switch. The blocks that are upstream of Port 1 and Port 2 of the constrained switch are no longer highlighted. Only the blocks upstream of Port 3 are highlighted.

  3. To see how this constraint affects the highlighted portion of the model, view the parent system.

Related Topics