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.
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.
Add the example folder to the search path.
addpath(fullfile(docroot,'toolbox','simulink','examples'))
Open the sldvSliceClimateControlExample
model.
sldvSliceClimateControlExample
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.
In the Model Slice Manager, click the arrow to expand the Slice configuration list.
Set the slice properties:
Name:
Out1Simulation
Color:
(cyan)
Signal propagation:
upstream
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.
In the Model Slice Manager, select Simulation time window.
To specify the stop time of the simulation time window, click the run
simulation button in the Model Slice Manager.
Set the Stop time to 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.
To highlight the model for a defined simulation time window, set the
Stop time to 5
. Click
Highlight.
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.
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.
In the Model Slice Manager, click the arrow to expand the Slice configuration list.
To add a new slice configuration, click the add new button
.
Set the slice properties:
Name: Out1Excluded
Color: (red)
Signal Propagation:
upstream
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.
To open the subsystem, double-click
Refrigeration
.
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.
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.
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.
Double-click Refrigeration
to open the
subsystem.
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.
To see how this constraint affects the highlighted portion of the model, view the parent system.