Main Content

Co-Simulation Execution

Simulink® supports co-simulation between components with local solvers or involves external simulation tools. For example, co-simulation can involve an S-function implemented as a co-simulation gateway between Simulink and third-party tools or custom code. A co-simulation component can be a Functional Mockup Unit (FMU) in co-simulation mode imported to Simulink.

Execution Timing

In Simulink simulation, the solver step size must be an integer divisor of each periodic, discrete block sample time. In other words, if a co-simulation component defines its own sample time, Simulink must communicate with the component at those time steps. Co-simulation can involve components whose time steps are determined internally and are not known to Simulink. The only information available to Simulink is the block sample time, either through the communication step size parameter of an FMU block, or the sample time definition in an S-function implementation. The block sample time determines the time steps Simulink must communicate with the co-simulation component. If the solver step size is not automatic, the communication step size must be an integer multiple of the solver step size.

If the co-simulation component internally uses a local solver, then this local solver should also be taken into account when determining the communication step size of the block. The step size of the local solver is not exposed to Simulink, and knowledge of the implementation is necessary to set the communication step size correctly. The behavior of co-simulation in case of a potential incompatibility also depends on this internal solver implementation.


[1] Runge, Carl. "Uber empirische Funktionen und die Interpolation zwischen aquidistanten Ordinaten", Zeitschrift für Mathematik und Physik. Vol. 46, 1901, pp. 224–243.

See Also

| | | | |

Related Topics