With the release of Dymola 2012 it is now possible to compile models to the FMI standard for co-simulation. This means that a model built in Dymola can be compiled with an open standard interface and coupled to other simulation and integration tools. Dymola uses the SUNDIALS suite of numerical solvers for co-simulation and these have to be installed separately.
To configure the FMI export for co-simulation with Dymola 2012 you need to complete the following steps:
- Download the SUNDIALS suite of solvers from https://computation.llnl.gov/casc/sundials/download/download.html make sure this is version 2.4.0
- Extract the archive and move the sundials-2.4.0 directory in to the Program FilesDymola 2012SourceFMI directory
- Then create a file called sundials_config.h within the sundials-2.4.0includesundials directory with the following contents:
/* SUNDIALS configuration header file */
#define SUNDIALS_PACKAGE_VERSION "2.4.0"
#define F77_FUNC(name ,NAME) name ## _
#define F77_FUNC_(name ,NAME) name ## _
#define SUNDIALS_DOUBLE_PRECISION 1
#define SUNDIALS_USE_GENERIC_MATH 1
#define SUNDIALS_MPI_COMM_F2C 1
#define SUNDIALS_EXPORT
- Now when you run the translateModelFMU command the FMU generated will support both the FMI for Model Exchange specification and the FMI for co-simulation slave interface.
Please note that you do not have to build the SUNDIALS numerical solvers separately. The source code for these solvers will be detected once the sundials_config.h file is placed in the correct directory and Dymola will then use the source code directly to generate the FMU.