MATLAB Examples

Propagating Variant Conditions to Subsystems

A Subsystem can be virtual or atomic. Simulink propagates variant conditions differently to such Subsystems. This example shows the propagation of variant conditions from Inline variants to Subsystem blocks. Consider a model as shown:

Contents

Click Simulation > Run to simulate this model and see the variant conditions being propagated from the Variant Source blocks to the blocks connected to it.

The variant condition annotation helps you visualize the propagated conditions. To be able to view the variant condition annotation, click Display > Blocks > Variant Condition Legend.

The model contains three Variant Source blocks: Variant Source1 , Variant Source2 , and Variant Source3 , respectively.

Variant Source1 contains conditions V = 1 and V = 2 at inport. The variant condition V = 1 propagates to GainA1 while V = 2 propagates to Sine2 . The Sine1 block does not get any propagated variant conditions because it is connected to an unconditional block To Workspace1 . If the To Workspace block1 did not exist or was commented-out before simulating the model, variant condition V = 1 propagates to Sine1 .

Variant Source2 is connected to virtual subsystems Subsystem1 and Subsystem2 that have identical contents, a Sine Wave block connected to a To Workspace and an Output blocks. Subsystem1 is a grouped virtual subsystem ( Treat as grouped when propagating variant conditions is selected) while Subsystem2 ( Treat as grouped when propagating variant conditions is clear) is an ungrouped virtual subsystem.

A Subsystem block becomes a grouped virtual subsystem when you select the Treat as grouped when propagating variant conditions checkbox in the block parameters dialog box. When the Treat as grouped when propagating variant conditions checkbox is clear, the Subsystem is an ungrouped virtual subsystem.

A grouped subsystem represents a system of equation and hence the propagated conditions also apply to the blocks within this system. A grouped subsystem has a continuous boundary line. An ungrouped subsystem does not represent a system of equation and the blocks within it have ungrouped semantics. An ungrouped subsystem has a dotted boundary line and the conditions are propagated into the subsystem.

The variant condition V = 1 propagates to Subsystem1 and further to the blocks within it as Subsystem1 is a grouped virtual subsystem (represents a system of equation).

Subsystem2 that is an ungrouped virtual subsystem (does not represent a system of equation) also receives V = 1 as the propagated condition, and the propagated variant condition V = 1 propagates into Subsystem 2 as if the subsystem were expanded.

Variant Source3 is connected to a nonvirtual (atomic) subsystem with V = 1 as the propagated variant condition. A nonvirtual (atomic) subsystem always represents a system of equations. An atomic subsystem has a continuous solid boundary line. The variant condition does not propagate inside of a nonvirtual subsystem. Instead, it stays on the boundary. The nonvirtual subsystem behaves as an entity.