Main Content

Enable decoupled continuous integration

Option to speed up simulation by decoupling continuous state integration from periodic sample times

Model Configuration Pane: Solver

Description

The Enable decoupled continuous integration configuration parameter specifies whether the smallest periodic sample time in the model affects continuous state integration. By default, the smallest periodic sample time, the maximum step size of the solver, and solver tolerance values all affect continuous state integration.

In some systems, the solver can integrate the continuous states less frequently without decreasing the accuracy of the simulation results. When you enable this parameter, the smallest periodic sample time in the model does not affect when the solver integrates continuous states. The solver integrates continuous states based on the specified maximum step size, absolute tolerance, and relative tolerance values. Enabling this parameter can improve simulation performance in hybrid systems, such as cyber-physical systems, that contain both continuous and discrete states and both continuous and periodic sample times.

Whether this parameter affects continuous state integration depends on the characteristics of the model and the configuration of the model and simulation. This parameter can affect continuous state integration and improve simulation performance when:

  • You simulate the model using a variable-step solver.

  • The smallest periodic sample time in the model is smaller than the value of the Max step size parameter.

    To check the maximum step size the solver chooses when the value of the Max step size parameter is auto, get the value of the CompiledStepSize parameter using the get_param function.

    maxstep = get_param(mdl,"CompiledStepSize");

This parameter does not affect continuous state integration when:

  • The model contains one or more blocks that have continuous states and compute continuous state derivatives using inputs that have periodic sample times.

  • The model references one or more models configured to use a local solver.

Settings

off (default) | on
on

Allow the solver to decouple integration of continuous states from periodic sample times in the model.

off

Preserve coupling between integration of continuous states and periodic sample times in the model.

Tips

To determine whether the software is able to decouple continuous integration in a simulation, check the value of the CompiledDecoupledContinuousIntegration parameter after compiling the model for simulation.

  • "on" — Continuous integration is decoupled from the smallest periodic sample time in the model for this simulation.

  • "off" — The software is unable to apply decoupled continuous integration for this model or simulation.

To compile a model for simulation without running the simulation, initialize a simulation using the Simulation object. For example, this code:

  1. Creates a Simulation object for a model named MyModel.

  2. Compiles the model for simulation by initializing a simulation using the Simulation object.

  3. Gets the value of the CompiledDecoupledContinuousIntegration parameter.

  4. Stops the simulation.

mdl = "MyModel";
sm = simulation(mdl);
initialize(sm)
f = get_param(mdl,"CompiledDecoupledContinuousIntegration");
stop(sm)

Programmatic Use

Parameter: DecoupledContinuousIntegration
Type: string | character vector
Values: "on" | "off"
Default: "off"

Version History

Introduced in R2017b