Use local solver when referencing model
Option to use local solver to solve referenced model as separate system of equations
Since R2022a
Model Configuration Pane: Model Referencing
Description
The Use local solver when referencing model configuration parameter specifies how the software solves the system implemented by a referenced model. When you select this parameter, the software solves the referenced model as a separate set of differential equations using the solver that the current referenced model specifies for the Solver configuration parameter.
While the top solver can be a fixed-step or variable-step solver, the local solver must be a fixed-step solver. Specify the fixed step size for the local solver using the Fixed-step size (fundamental sample time) configuration parameter of the referenced model.
Using a local solver can facilitate system composition and integration. When you use local solvers, you can solve referenced models in system-level simulations using the same solver and step size used to design and test each model in isolation. Using local solvers can also reduce the amount of configuration adjustments you need to make to configuration parameters in referenced models while integrating the model into a larger system.
For some systems, using a local solver can improve simulation performance by allowing you to choose a solver that is more appropriate to solve the system in the referenced model or by reducing the number of redundant calculations in systems that have a wide range of dynamics among components.
For an example, see Improve Simulation Performance by Using Local Solvers.
For more information about local solvers, see Use Local Solvers in Referenced Models.
Set Configuration Parameter for Referenced Model
In a model reference hierarchy, how you open the Configuration Parameters dialog box determines whether you edit the configuration parameter for the top model in the current model hierarchy or the current referenced model.
Top model in the current model hierarchy — In the Simulink® Toolstrip, on the Modeling tab, click Model Settings.
Current referenced model — In the Simulink Toolstrip, on the Modeling tab, click the Model Settings button arrow. Then, in the Referenced Model section, select Model Settings.
Alternatively, open the referenced model as a top model. Then, in the Simulink Toolstrip, on the Modeling tab, click Model Settings.
Settings
off
(default) | on
on
The software uses a local solver to solve the referenced model as a separate set of differential equations. Specify the local solver using the Solver configuration parameter of the referenced model.
off
The software solves the referenced model as part of the parent system using the parent solver.
Examples
Tips
You can use Model block parameters to specify:
The communication step size, which specifies the rate at which the local and parent solvers exchange data
How the local solver extrapolates inputs from the parent solver
How the local solver interpolates state or output values to provide output signal values to the parent solver
Before R2024a: When the top solver is a fixed-step solver, the step size for the local solver must be an integer multiple of the parent solver step size.
Recommended Settings
Application | Setting |
---|---|
Debugging | off |
Traceability | No impact |
Efficiency | No recommendation |
Safety precaution | No impact |
Programmatic Use
Parameter:
UseModelRefSolver |
Value:
"on" | "off" |
Default:
"off" |