Skip to content

Repository files navigation

ModelicaCC 5.0

ModelicaCC is a Modelica C Compiler implemented in C++, the main goal of this project is to provide an environment to develop and test novel algorithms involved in the different compilation stages of large scale Modelica models. The different stages of the compilation pipeline follows the usual order:

  • Parsing
  • Flattening
  • Index Reduction
  • Sorting
  • Code Generation
  • Model Simulation

The input/output of each stage are valid Modelica models (except for the very last stage which produce C code). Each stage converts the Modelica model fed as input into a “simpler” equivalent one. As the compiler uses the QSS Solver for the C code generation and simulation, the goal of the previous stages is to obtain a valid μ–Modelica model.

The following tools are generated:

  • parser
  • antialias
  • flatter
  • causalize
  • mmo

Related Publications

[1] Federico Bergero, Mariano Botta, Esteban Campostrini, Ernesto Kofman. Efficient Compilation of Large Scale Dynamical Systems Proceedings of the 11th International Modelica Conference 2015

[2] Pablo Zimmermann, Joaquin Fernandez, Ernesto Kofman. Set-based graph methods for fast equation sorting in large DAE systems EOOLT '19: Proceedings of the 9th International Workshop on Equation-based Object-oriented Modeling Languages and Tools 2019

[3] Denise Marzorati, Joaquín Fernández, and Ernesto Kofman. 2024. Efficient Matching in Large DAE Models. ACM Trans. Math. Softw. Just Accepted (June 2024). https://doi.org/10.1145/3674831

[4] Denise Marzorati, Joaquin Fernández, Ernesto Kofman. Connected Components in Undirected Set--Based Graphs. Applications in Object--Oriented Model Manipulation Applied Mathematics and Computation, Volume 418, 2022, 126842,ISSN 0096-3003, https://doi.org/10.1016/j.amc.2021.126842.

[5] Ernesto Kofman, Joaquín Fernández, Denise Marzorati. Compact sparse symbolic Jacobian computation in large systems of ODEs Applied Mathematics and Computation, Volume 403, 2021, 126181, ISSN 0096-3003, https://doi.org/10.1016/j.amc.2021.126181.

Installation

These are generic installation instructions.

Dependences

In order to be able to install and compile ModelicaCC, the following dependencies must be installed:

* autoconf 2.69 (avoid 2.71)
* boost1.81
* cmake
* doxygen
* g++
* libginac-dev 
* make     

Basic Installation

The simplest way to compile this package is to run the following commands from the library root directory (${MODELICACC_ROOT_DIR}):

  1. mkdir build

  2. cd build

  3. cmake ..

    Note that by default the biuld type is set to Release, to make a debug build, add -DCMAKE_BUILD_TYPE=Debug

  4. make

  5. You can remove the generated library and object files from the source code directory by typing make clean-all.

Makefile targets

The makefile script accepts the following targets:

  • update_sbg: updates the SBG library.

  • main_test: builds and run integration and unit tests.

  • doc: builds the documentation.

To list all the available targets run make help.

Changelog

[5.0] - 2026-07-13

Added

  • Integrate SCC SBG library algorithm for causalization.
  • Generate Modelica code to solve algebraic loops.

[4.0] - 2022-05-04

Added

  • Implemented SBGraphs as an independent library. As such, new algorithms for causalization will be listed in its corresponding repository.

[3.0] - 2021-08-20

Added

  • Implemented SBGraphs data structures and helper classes.
  • Implemented new flatter algorithm based on SBGraphs.

Licensing

Please see the file called LICENSE.

Bug Reporting

Report bugs to: fernandez@cifasis-conicet.gov.ar

About

Modelica C Compiler implemented in C++ to develop and test novel algorithms for large scale models.

Topics

Resources

Stars

20 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages