Main Content

Variant Leaf Region in Mechanical System

This example shows how to simulate the displacement of velocity sources and mass by using the leaf type of the Variant Connector block. The leaf Variant Connector block forms a leaf region that allows you to vary the displacement during simulation.

During simulation, Simulink® computes the variant conditions associated with each leaf Variant Connector block in the model. If the variant condition of a leaf Variant Connector block evaluates to true, all the physical components that are connected to the Condition port of the connector block become active. In this example, when A==1 evaluates to true, the components of Leaf Region_1 become active and the components of Leaf Region_2 remain inactive.

Model

Simulation Results from Simscape Logging

Case 1: Leaf Region_1 Is Active and Leaf Region_2 Is Inactive

Case 2: Leaf Region_1 Is Inactive and Leaf Region_2 is Active