Limitations

About SimMechanics and Simulink Limitations

Some Simulink® features and tools either do not work with models containing SimMechanics™ blocks or work only with restrictions. Others work with SimMechanics models but only on the normal Simulink blocks in those models.

Continuous Sample Times Required

The sample times of all SimMechanics blocks are always continuous, and you cannot use them with discrete solvers. You also cannot override the sample time of a nonvirtual subsystem containing SimMechanics blocks.

Restricted Simulink Tools

Certain Simulink tools are restricted in use with SimMechanics software.

  • A SimMechanics model with closed loops cannot be linearized with the Simulink linmod2 command.

  • Enabled subsystems can contain SimMechanics blocks. But you should always set the States when enabling parameter in the Enable dialog to held for the subsystem's Enable port.

    Setting States when enabling to reset is not supported and can lead to simulation errors.

  • Simulink configurable subsystems work with SimMechanics blocks only if all of the block choices have consistent port signatures.

  • For Iterator, Function-Call, Triggered, and While Iterator nonvirtual subsystems cannot contain SimMechanics blocks.

  • An atomic subsystem with a user-specified (noninherited) sample time cannot contain SimMechanics blocks.

  • SimMechanics software supports external mode, but without visualization.

  • SimMechanics software supports Simulink model referencing, with the following restrictions. For more information on model referencing, see Overview of Model Referencing in the Simulink documentation.

    • A SimMechanics model can be referenced only once by another model.

    • SimMechanics software does not support reparameterization in a referencing block.

    • A SimMechanics model cannot be visualized if it is referenced in Model Reference Accelerated Mode.

      You can both reference and visualize a SimMechanics model in Model Reference Normal Mode.

  • The Simulink Profiler is not optimized for SimMechanics. The Profiler cannot list SimMechanics functions block by block, as it does with Simulink models. Function names do not correspond to well-defined SimMechanics blocks.

Simulink Tools Not Compatible with SimMechanics Blocks

Some Simulink tools and features do not work with SimMechanics blocks:

  • SimMechanics block dialogs do not accept Simulink.Parameter objects as parameter values.

  • Execution order tags do not appear on SimMechanics blocks.

  • SimMechanics blocks do not invoke optional callbacks that you define.

  • You cannot set breakpoints on SimMechanics blocks.

  • Reusable subsystems cannot contain SimMechanics blocks.

  • You cannot use the Simulink Fixed-Point Tool with SimMechanics blocks.

  • The Report Generator reports SimMechanics block properties incompletely.

  • SimState is not supported with SimMechanics blocks and supports only regular Simulink states, not the mechanical ones.

    Use mech_stateVectorMgr and related SimMechanics functions to work with the mechanical states.

Most Tunable Parameters Not Supported by SimMechanics Software

You cannot tune most SimMechanics block parameters during simulation.

The exceptions that you can tune are:

Restrictions on Two-Dimensional Simulation

Certain blocks are not supported in two-dimensional simulation mode. These include disassembled joints, massless connectors, and joints that can move in three dimensions. See Choosing Your Machine's Dimensionality in this chapter.

Restrictions with Generated Code

Code generated from models containing SimMechanics blocks has certain limitations.

Stiction-Related Algebraic Loops Disabled

Stiction implemented with Joint Stiction Actuator blocks requires algebraic loops iterated at a single time step to detect discrete events. In generated code versions of models with stiction, the mode iteration to determine joint locking and unlocking instead occurs over multiple time steps, possibly reducing simulation accuracy.

Closed-Loop Limitations

Closed-loop models in certain analysis mode configurations use nonlinear solvers with no upper limit on iterations. Code generated from such models is valid but, in general, not truly "real time." These configurations include:

  • Forward Dynamics mode when Constraint solver type in the Machine Environment block is set to Machine Precision or Tolerancing

  • Kinematics mode

Restrictions on Code Generated from Two-Dimensional Machines

If you generate code from a model containing one or more machines simulated in two dimensions, the generated code is also restricted to two-dimensional motion. Thus, if you change run-time parameters in the generated code, you must ensure that the new values do not violate the two-dimensional motion restriction.

The choice of machine dimensionality is either automatic or manual, but this restriction on generated code applies in either case. See Choosing Your Machine's Dimensionality in this chapter.

Restriction on S-Functions Generated from SimMechanics

You cannot generate code from a SimMechanics model that itself contains one or more S-functions generated from other SimMechanics models.

Was this topic helpful?