Set Priority and Initial Target for Block Variables - MATLAB & Simulink (original) (raw)
Main Content
When you open the Initial Targets section of the block dialog box, it lists all the public variables specified in the underlying component file, along with priority, beginning (target) value, and unit. For example, if you add a Translational Spring block to your model, double-click it to open its dialog box, and then expand theInitial Targets section, it looks like this:
Expanding the widget for each of these variables shows the variable initialization priority, initial target value, and unit.
For details on these variables and their usage in the block equations, click theSource code link on the Description tab of the block dialog box to view the underlying Simscape™ source file.
Note
The Source code link is available for all the Foundation library blocks that have Initial Targets settings. Blocks from the add-on products, like Simscape Electrical™ or Simscape Fluids™, do not have a Source code link in the block dialog box. See the block reference page for information on relevant equations and specific initialization considerations.
To specify the initial deformation of the spring, select the check box next to theDeformation variable, to indicate that you are overriding the default values. Select the initialization priority for the variable, by setting itsPriority drop-down to High
,Low
, or None
. Type a new number into theValue field and change the unit, if desired. The unit drop-down lists contains all the units defined in the unit registry that are commensurate with the one specified in the variable declaration. In the following dialog box, Deformation is specified as a high-priority variable with the initial target of 20 mm.
If you clear the check box next to a variable name, its Priority andValue fields switch back to defaults specified in the component file. However, if you select the check box again, these fields will retain their last specified value for when they were overridden.