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

University essay from Lunds universitet/Institutionen för reglerteknik

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 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.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)