
The Functional Mock-up Interface (FMI) standard is an open standard for the exchange of models between simulation tools. It is developed and maintained by the Modelica Association. Claytex have been working with the FMI standard since 2012 and we have used FMI to integrate simulation models into Simulink, Excel and to provide web based simulation tools.
These are no longer available as off-the-shelf software tools as our experience has shown that our customers can gain the most when the tools are customised to suit their specific purpose. If you would like to take advantage of our experience and available code library to build a simulation workflow based on FMI please contact us to discuss your requirements.
The FMI Blockset for Simulink® provides support for the Functional Mock-up Interface (“FMI”) open standard in Simulink. This means that models that are compiled by third party tools such as Dymola, CATIA DBM and many more can be imported and used in Simulink. Models that are compiled to be compatible with this standard are known as Functional Mock-up Units (“FMU”).
The FMI standard defines two interfaces: one for model exchange; and one for co-simulation. The FMI Blockset currently supports the FMI 1.0 Co-simulation interface and the FMI 2.0 Model Exchange and Co-simulation interfaces.
When using the Co-simulation interface, this means that the solver built in to the FMU is used to simulate that model and the Simulink solver is used to simulate the Simulink part of the system with the two systems exchanging data at discrete times. The advantage of this is that appropriate solvers can be used for both parts of the model improving the overall simulation performance.
When using the Model Exchange interface, the Simulink solver is used to handle the complete model i.e. the FMU equations and the Simulink model. This allows variable step solvers to be used and has the advantage that a single solver is used for the entire model.
The FMI Blockset for Excel allows FMU’s that are compliant with the FMI 2.0 Co-simulation interface to be simulated from within Microsoft Excel®. Using this add-in enables an FMU to be selected and configured within Excel using the FMI Blockset interface. After making a number of parameters available in Excel, multiple cases can be configured and simulated to run parameter sweeps, sensitivity studies, etc. For each simulation case, a new spreadsheet is added to the Excel workbook to capture the results from that simulation.
Where structured naming is used within the FMU, this is used by the editor in to generate the parameter structure as shown above. Each group of parameters is denoted by a folder and each parameter is shown by name with an icon representing its base data type (Real, Integer, Boolean, Enumeration and String).
Clicking on a parameter name shows the details contained in the FMU and allows the value to be modified. If unit conversions are defined in the FMU these are also available. For vector and matrix parameters an Edit button is shown that gives access to an appropriate editor with a plot of the data. Through this editor new maps can be loaded from csv and Matlab binary files provided the dimensions of the vector or matrix are not changed as these are fixed in the FMU.
Load and Save Parameter Sets
The configuration and current parameter settings can be saved from the editor in XML format. This format is defined in the FMI standard. When saving the current configuration as a setup, a new XML file is created outside the FMU rather than modifying the model descripton file provided in the FMU. These saved setups can include additional notes documenting the changes that have been made from the original FMU parametisation.
You can also load setup’s from these XML files with the editor performing checks to make sure that the setup you are loading matches the FMU you have currently loaded.
The FMI Blockset for Cloud allows co-simulation FMUs to be simulated in the cloud using a REST API. By deploying this as an Amazon Lambda Function we can build powerful and flexible simulation applications that provide a browser based user interface. The goal is to provide a simulation platform where experts can create simulation models and provide access to them to a wider audience of non-simulation experts. As the models are provided as FMUs and the platform allows the simulation expert to control the parameters that can be accessed it is possible to setup models for specific analysis tasks in a well controlled manner and enable non-experts to run their own “what-if” studies.
The FMI Blockset for Cloud essentially consists of two parts:
- The user interface which could be any application that can interact with a REST API. We are creating web browser based interfaces using Angular JS.
- The simulation platform that runs in the Amazon Cloud and is accessed through a REST API provided by the Amazon API Gateway.
Whenever a simulation is run a standard report consisting of multiple plots and a table of metrics is generated. This provides quick access to the results that the model developer thinks are the most interesting. Users also have access to all the model variables to be able to create their own custom plots.