Expert Insights

Exporting models for co-simulation in other tools - Claytex

Written by Admin | Jul 13, 2011 11:30:00 PM

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.