Functional Mock-up Interface support in

One of strongest impressions from the 8th International Modelica Conference in Dresden was the overwhelming interest in the Functional Mock-up Interface (FMI). Several presentations and many discussions around the coffee tables centered around FMI-based applications and future extensions of FMI. 

As of version 1.5, import and export of Functional Mock-up Units (FMUs) is supported in The import feature can be used also with large scale FMUs from other FMI compliant tools such as Dymola and SimulationX, with simulation performance on par with what can be achieved natively with such tools. See the paper "Import and Export of Functional Mock-up Units in" for additional details.

The FMU import and export functionality in is easily accessible in the form of well tested and documented Python classes and functions. Simulation results are retrieved as Numpy arrays and can be analyzed, processed and visualized using standard Python functions. 

Compilation, loading and simulation of an FMU is performed by a few simple but powerful Python commands: 

# Import the function for compilation of models and the FMUModel class
from pymodelica import compile_fmu
from pyfmi import FMUModel

# Compile model
fmu_name = compile_fmu("VDP","")

# Load model
vdp = FMUModel(fmu_name)

# Simulate
res = vdp.simulate(final_time=10)

# Get the results
x1 = res['x1']
x2 = res['x2']
t  = res['time']

To try out the FMI features of by downloading the latest version from the Downloads page.