Co-Simulation using FMI


Go to our GitHub Profile

Follow @IntoCps


OpenModelica is an open-source Modelica-based modeling and simulation environment intended for industrial and academic usage. Its short-term and long-term goals are:


The OpenModelica users guide as pdf or epub or as html. The OpenModelica API documentation. More documentation can be found here.

Export an FMU from OpenModelica

To export an FMU from a Modelica model one can use a exportFMU.mos script:

// start exportFMU.mos script
loadModel(Modelica); getErrorString();
// loadModel(AnotherLibraryIfNeeded); getErrorString();
// loadFile(""); getErrorString();
translateModelFMU(ModelName, "2.0", "cs"); getErrorString();
// end exportFMU.mos

One can run the exportFMU.mos script via the omc[.exe] executable. On Windows:

%OPENMODELICAHOME%\bin\omc exportFMU.mos

On Linux (if OpenModelica is installed via apt-get):

omc exportFMU.mos

On MacOS X:

omc exportFMU.mos

Documentation of the function translateModelFMU.

The latest release binaries for Windows can be found here. The latest nightly-builds binaries for Windows can be found here.

We also support Linux and Mac OS installations.