Main Content

Simscape Language Support

The Simscape™ language extends the Simscape modeling environment by enabling you to create new components that do not exist in the Foundation library or in any of the add-on products. It is a dedicated textual language for modeling physical systems. The Simscape language lets you define custom components as textual files, complete with parameterization, physical connections, and underlying equations. The components you create can reuse the physical domain definitions provided with Simscape to ensure that your components are compatible with the standard Simscape components. You can also add your own physical domains and provide complete component libraries for these domains. You can deploy the textual component files in block diagrams by converting them into custom Simscape blocks. For more information, see What Is the Simscape Language? (Simscape).

The tables list the Simscape Hardware-in-the-Loop (HIL) Workflow support for the Simscape language for different solvers.

Domain and Component Declarations

KeywordDescriptionBackward Euler/Trapezoidal Rule SolverPartitioning Solver
annotations (Simscape)Control appearance of Simscape block based on the component
branches (Simscape)Establish relationship between component Through variables and nodes
component (Simscape)Keyword to define component model classes
domain (Simscape)Keyword to define domain model classes
inputs (Simscape)Define component inputs, that is, Physical Signal input ports of block
nodes (Simscape)Define component nodes, that is, conserving ports of block
outputs (Simscape)Define component outputs, that is, Physical Signal output ports of block
parameters (Simscape)Declare domain or component parameters
variables (Simscape)Declare domain or component variables

Equations

KeywordDescriptionBackward Euler/Trapezoidal Rule SolverPartitioning Solver
assert (Simscape)Program customized run-time errors and warnings
delay (Simscape)Return past value of operand
der (Simscape)Return time derivative of operand
equations (Simscape)Define component or domain equations
function (Simscape)Reuse expressions in component equations and in member declarations of domains and components
integ (Simscape)Perform time integration of expression
intermediates (Simscape)Define intermediate terms for use in equations
scatteredlookup (Simscape)Return value based on interpolating unstructured set of data points
tablelookup (Simscape)Return value based on interpolating set of data points
time (Simscape)Access global simulation time
value (Simscape)Convert variable or parameter to unitless value with specified unit conversion

Discrete Events and Mode Charts

Discrete Variables and Events

KeywordDescriptionBackward Euler/Trapezoidal Rule SolverPartitioning Solver
events (Simscape)Model discrete events
edge (Simscape)Trigger event
initialevent (Simscape)Initialize event variables

Mode Charts

KeywordsDescriptionBackward Euler/Trapezoidal Rule SolverPartitioning Solver
modecharts (Simscape)Declare mode charts that include operating modes and transitions
modes (Simscape)Declare operating modes in mode chart
transitions (Simscape)Define transitions between modes in mode chart
initial (Simscape)Specify initial mode in mode chart
entry (Simscape)Specify actions to be performed upon entering a mode

Composite Components

Language Syntax

KeywordsDescriptionBackward Euler/Trapezoidal Rule SolverPartitioning Solver
components (Simscape)Declare member components included in composite component
connect (Simscape)Connect two or more component ports of the same type
connections (Simscape)Define connections for member component ports in composite component
import (Simscape)Import model classes

See Also

(Simscape) | (Simscape) | (Simscape) | (Simscape)

Related Topics