Wolfram Computation Meets Knowledge

Functional Mock-up Interface (FMI) Import in Wolfram SystemModeler

Explore the contents of this article with a free Wolfram SystemModeler trial. An important emerging standard has been rapidly adopted by industry: the Functional Mock-up Interface (FMI). It’s an independent standard allowing model exchange between different tools. We introduced FMI export with Version 4.0 of SystemModeler. Exporting your model as a Functional Mock-up Unit (FMU) serves many purposes. First and foremost, it can be used in other tools and programming languages. It also protects your intellectual property by compiling the model code to a binary, which is useful when exchanging models with customers and collaborators. Now with Version 4.1 of SystemModeler, we are happy to announce that we also support FMI import.

Use subsystems from other tools in FMI import

FMI import allows you to use subsystems from other tools in your modeling and simulation workflow with SystemModeler and the Wolfram Language. Explore imported models within SystemModeler by changing parameters and observing the outcomes. Post-process and visualize simulation data from imported models with the Wolfram Language. With automated reports and cloud features, sharing the results and the insight gained from the simulations is a straightforward task.

Let’s take a look at what importing and using a Functional Mock-up Unit can look like. Drag and drop the unit into SystemModeler and follow the dialogs to import the model into the class browser. This is what it looks like when we import a model exported from Simulink using the FMI Toolbox from Modelon:

Imported model exported from Simulink, with the FMI Toolbox from Modelon

The unit is now available inside SystemModeler, and we can connect it to other components. In this case it’s a model of a cruise control. We connect it to a model of a car to see how well it can control the speed of the car.

Functional Mock-up Unit inside SystemModeler connected to cruise control in a car

Next we can perform a parameter sweep in the Wolfram Language to analyze the speed deviations when trying the controller at different speeds. These plots show speed deviations for a car going downhill:

Speed deviations in car going downhill

Another way to view the data is to create a DensityPlot showing the relative speed deviation from the reference speed.

DensityPlot showing the relative speed deviation from the reference speed

The plot shows that the cruise control performs best on flat or slightly uphill grades. This region is colored green, the color for less than 1% speed deviation. If you drive at 40 km/h on a 2-degree incline, you would be in this region. The worst performance can be found in the red region, with more than 5% speed deviation. If you drive at 30 km/h on a 3-degree decline, you would be in this region.

FMI import and export are included in SystemModeler and do not require any extra purchases or special add-ons. With FMI, simulations from modeling and simulation experts can be deployed to a large number of consumers who can use the models in their analysis and design tasks. Look here for an example of how to export a model from SystemModeler and use it in another tool.


Join the discussion

!Please enter your comment (at least 5 characters).

!Please enter your name.

!Please enter a valid email address.