Model-based control with FMI and a C++ runtime for Modelica

Rüdiger Franke, Marcus Walther, Niklas Worschech, Willi Braun, Bernhard Bachmann · Linköping electronic conference proceedings · 2015

Modelica describes physical systems on a high level, using model objects, multi-dimensional arrays and other data structures as well as graphical representations.Modelica models are translated to differential-algebraic equation systems and compiled to executable code prior to their execution in numerical solvers.The translation gives a lot of possibilities for code optimization.This is particularly important for model-based control applications.This paper investigates the exploitation of C++ for Modelica code optimization.C++ supports advanced programming concepts and at the same time aims to "leave no room for a lower-level language … (except for assembly code in rare cases)" (B.Stroustrup: The C++ Programming Language, 2014).The features exploited here include polymorphism, templates, built-in exception handling and object destructors.The ideas have been implemented in the OpenModelica C++ runtime.The paper describes its enhancement with new array features and with an FMI 2.0 interface.FMI serves as interface between modeling tools and control applications.In particular the new FMI 2.0 meets requirements of numerical optimization solvers in modelbased control.A publically available application example demonstrates the achievements.CPU times obtained with the OpenModelica C++ runtime are significantly faster than CPU times obtained with the C runtime or with Dymola.

Read the paper · More papers on PaperTik