Advanced

Implementation of the Functional Mock-up Interface in Matlab and Simulink

Andersson, Bengt-Arne (2010) In MSc Theses
Department of Automatic Control
Abstract
New products on the market are likely to be simulated in a computer sometime during the development process. The environment for which the physical model of the product is developed may not always be the optimal for control simulations of the model. To be able to export models from one environment to another a common model definition must be defined. The Functional Mock-up Interface, FMI, provides such a model definition and makes it possible to incorporate models from different environments together. In this thesis we will witness a successful implementation of the interface for model exchange, FMI, into the well known MATLAB and Simulink environment. Simulink is widely used in industry to develop control systems but not that used for... (More)
New products on the market are likely to be simulated in a computer sometime during the development process. The environment for which the physical model of the product is developed may not always be the optimal for control simulations of the model. To be able to export models from one environment to another a common model definition must be defined. The Functional Mock-up Interface, FMI, provides such a model definition and makes it possible to incorporate models from different environments together. In this thesis we will witness a successful implementation of the interface for model exchange, FMI, into the well known MATLAB and Simulink environment. Simulink is widely used in industry to develop control systems but not that used for physical modelling. It is therefore of great interest to be able to simulate models created from other physical modelling environments in to Simulink. A block is developed in Simulink and a user interface in MATLAB such that models created according to the FMI standard can be simulated. The FMI is a standard for solving ODEs with events. The thesis discusses the most essential parts of the FMI standard. Events may be discontinuities that the ODE solver needs to take special care of and is therefore discussed in more detail. In Simulink an S-function block is used with a GUI developed for the user to easily configure the model. The MATLAB interface is developed using MEX functions and is discussed based on how MATLAB's ODE solvers can be used to simulate a model. MEX functions are MATLAB's way to incorporate C, C++ and Fortran code. The FMI standard models consists of DLL functions that enforce the use of MEX functions.The implementations are verified to be correct by comparison of simulation results from different environments such as Dymola and JModelica.org. A comparison of simulation times and the number of function evaluations are also done where we can see that the S-function and the MEX interface performs on a similar level as the other simulation environments. (Less)
Please use this url to cite or link to this publication:
author
Andersson, Bengt-Arne
supervisor
organization
year
type
H3 - Professional qualifications (4 Years - )
subject
publication/series
MSc Theses
report number
TFRT-5869
ISSN
0280-5316
language
English
id
8847501
date added to LUP
2016-03-16 12:25:49
date last changed
2016-03-16 12:25:49
@misc{8847501,
  abstract     = {New products on the market are likely to be simulated in a computer sometime during the development process. The environment for which the physical model of the product is developed may not always be the optimal for control simulations of the model. To be able to export models from one environment to another a common model definition must be defined. The Functional Mock-up Interface, FMI, provides such a model definition and makes it possible to incorporate models from different environments together. In this thesis we will witness a successful implementation of the interface for model exchange, FMI, into the well known MATLAB and Simulink environment. Simulink is widely used in industry to develop control systems but not that used for physical modelling. It is therefore of great interest to be able to simulate models created from other physical modelling environments in to Simulink. A block is developed in Simulink and a user interface in MATLAB such that models created according to the FMI standard can be simulated. The FMI is a standard for solving ODEs with events. The thesis discusses the most essential parts of the FMI standard. Events may be discontinuities that the ODE solver needs to take special care of and is therefore discussed in more detail. In Simulink an S-function block is used with a GUI developed for the user to easily configure the model. The MATLAB interface is developed using MEX functions and is discussed based on how MATLAB's ODE solvers can be used to simulate a model. MEX functions are MATLAB's way to incorporate C, C++ and Fortran code. The FMI standard models consists of DLL functions that enforce the use of MEX functions.The implementations are verified to be correct by comparison of simulation results from different environments such as Dymola and JModelica.org. A comparison of simulation times and the number of function evaluations are also done where we can see that the S-function and the MEX interface performs on a similar level as the other simulation environments.},
  author       = {Andersson, Bengt-Arne},
  issn         = {0280-5316},
  language     = {eng},
  note         = {Student Paper},
  series       = {MSc Theses},
  title        = {Implementation of the Functional Mock-up Interface in Matlab and Simulink},
  year         = {2010},
}