Importing FMU Co-Simulation component
We show how to use FMU Import
blocks to add external FMU-formatted models to the Engee canvas.
Model description
Co-Simulation mode in FMU (Functional Mock-up Unit) components is designed to combine several models developed in different modelling tools into a single time-synchronised system.
This mode allows you to combine models created in different environments (MATLAB/Simulink, Dymola, OpenModelica, etc.) without having to rewrite their code.
Each FMU works as a "black box" with its own solver.
In this example, our "external" model is in the file fmuVanDerPol.fmu
, which we will place in the FMU Import block, and after setting it up, we will get the graphics from the model it contains.

We propose to study the FMU file. To do this, let's put some libraries and call the command info(fmu)
.
Pkg.add( ["FMI"] )
using FMI
fmu = loadFMU( "fmuVanDerPol.fmu" )
info(fmu)
Setting up the block
In this information, we need to find the input port names, output port names and parameter names to properly create the block interface and configure the block.
This model has no inputs, there are two outputs (Out1
and Out2
) and there is a parameter mu
. Also we don't see the time step settings that the solver of this model is waiting for.
We found out empirically that the computational step size of this FMU model should not be lower than
0.1 с
. The global step size of the entire simulation can be anything.

Let's run the model at runtime and plot the graphs:
model_name = "fmu_co_simulation";
model_name in [m.name for m in engee.get_all_models()] ? engee.open(model_name) : engee.load( "$(@__DIR__)/$(model_name).engee");
res = engee.run( model_name );
plot( res["x"].time, [res["x"].value res["dx"].value], label=["x" "dx"],
lw=3, size=(600,300) )
When choosing Co-Simulation over Model Exchange?
Model Exchange (ME) requires a single solver for the whole system and is suitable if all models can work with a single solver.
Co-Simulation (CS) is chosen when:
- models use different solvers,
- legacy code or proprietary simulators are available,
- distributed execution is required (e.g., HIL testing).
Conclusion
Co-Simulation FMU is a powerful tool for integrating heterogeneous models without having to completely rewrite them, but with the trade-off of controlled synchronisation and potential sampling errors.