| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simscape |
| Contents | Index |
| Learn more about Simscape |
| On this page… |
|---|
Sample Time and Solver Restrictions |
The default sample times of Simscape blocks are continuous. You cannot simulate Simscape blocks with discrete solvers using the default sample times.
If you switch to a local solver in the Solver Configuration block, the associated states become discrete. If there are no continuous Simulink or Simscape states elsewhere in the model, you should use a discrete solver to simulate such a model.
You cannot override the sample time of a nonvirtual subsystem containing Simscape blocks.
A Simscape physical network should not exist within a Simulink algebraic loop. This means that you should not directly connect an output of a PS-Simulink Converter block to an input of a Simulink-PS Converter block of the same physical network.
For example, the following model contains a direct feedthrough between the PS-Simulink Converter block and the Simulink-PS Converter block (highlighted in magenta). To avoid the algebraic loop, you can insert a Transfer Function block anywhere along the highlighted loop.

A better way to avoid an algebraic loop without introducing additional dynamics is shown in the modified model below.

Certain Simulink tools are restricted for use with Simscape software:
You can use the Simulink set_param and get_param commands to set or get Simscape block parameters. The MathWorks™ does not recommend that you use these commands for this purpose.
If you make changes to block parameters at the command line, run your model first before saving it. Otherwise, you might save invalid block parameters. Any block parameter changes that you make with set_param are not validated unless you run the model.
Enabled subsystems can contain Simscape blocks. 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 fatal simulation errors.
Simulink configurable subsystems work with Simscape blocks only if all of the block choices have consistent port signatures.
For Iterator, Function-Call, Triggered, and While Iterator nonvirtual subsystems cannot contain Simscape blocks.
An atomic subsystem with a user-specified (noninherited) sample time cannot contain Simscape blocks.
You can use the Simulink Save As command only to rename Simscape models within the current version. Saving in a previous version format is not supported for models containing Simscape blocks.
Model referencing is supported, with some restrictions:
All Physical connection lines must be contained within the referenced model. Such lines cannot cross the boundary of the referenced model subsystem in the referencing model.
The referencing model and the referenced model must use the same solver.
For further information, consult the Simulink documentation on referencing models.
The Simulink Profiler tool does not work with Simscape models.
Some Simulink tools and features do not work with Simscape blocks:
Execution order tags do not appear on Simscape blocks.
Simscape blocks do not invoke user-defined callbacks.
You cannot set breakpoints on Simscape blocks.
Reusable subsystems cannot contain Simscape blocks.
You cannot use the Simulink Fixed-Point Tool with Simscape blocks.
The Report Generator reports Simscape block properties incompletely.
Code generation is supported for Simscape physical modeling software and its family of vertical products. However, there are restrictions on code generated from Simscape models.
Code reuse is not supported.
Tunable parameters are not supported.
Run-time parameter inlining ignores global exceptions.
Simulation of Simscape models on fixed-point processors is not supported.
Block diagnostics in error messages are not supported. This means that if you get an error message from simulating generated code, it does not contain a list of blocks involved.
Conversion of models or subsystems containing Simscape blocks to S-functions is not supported.
Code generation respects the Linear Algebra setting in the Solver Configuration block, but only when you choose the local solver option. Otherwise, code generation uses full linear algebra.
Generating Code describes code generation features in Simscape. Restricted Simulink Tools describes limitations on model referencing.
There are variations and exceptions as well in the code generation features of the vertical products based on Simscape platform. For details, see the User's Guides for individual vertical products.
Most code generation options for Simscape models require the use of fixed-step Simulink solvers. This table summarizes the available solver choices, depending on how you generate code.
| Code Generation Option | Solver Choices |
|---|---|
| Accelerator mode Rapid Accelerator mode | Variable-step or fixed-step |
| Real-Time Workshop software: RSim Target* | Variable-step or fixed-step |
| Real-Time Workshop software: Targets other than RSim | Fixed-step only |
* For the RSim Target, Simscape software supports only the Simulink solver module. In the model Configuration Parameters dialog box, see the Real-Time Workshop: RSim Target: Solver selection menu. The default is automatic selection, which might fail to choose the Simulink solver module.
![]() | Generating Code | Working with Physical Units | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |