Conference article

Profiling of Modelica Real-Time Models

Christian Schulze
Technische Universität Clausthal, Institut für Informatik, Germany

Michaela Huhn
Technische Universität Clausthal, Institut für Informatik, Germany

Martin Schüler
TLK-Thermo GmbH, Deutschland

Download article

Published in: 3rd International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools; Oslo; Norway; October 3

Linköping Electronic Conference Proceedings 47:3, p. 23-31

Show more +

Published: 2010-09-21

ISBN: 978-91-7519-824-8

ISSN: 1650-3686 (print), 1650-3740 (online)


Modeling and simulation of physical systems have become a substantial part in the development of mechatronic systems. A number of usage scenarios for such models like Rapid Control Prototyping and Hardware-in-the-Loop testing require simulation in real-time. To enable model execution on a hard real-time target; a number of adaptations are usually performed on the model and the solver. However; a profiling facility is needed to direct the developer to performance bottlenecks.

We present the concepts and a prototypical implementation of a profiler for the specific analysis of Modelica models running on Scale-RT; a Linux-based real-time kernel. The profiler measures the number of calls and execution times of simulation specific functions calls. Interpreting these results; the developer can directly deduce which components of a simulation model are most promising for optimization. Profiling results and their impact on model optimization are discussed on two case studies from the area of thermodynamic automotive systems.


Real-Time; Modelica; Profiling; Optimization; SimulationX; Scale-RT


[1] MODELISAR (ITEA 2 07006). Functional mock-up interface for model exchange; January 26 2010.

[2] Tim Bird. Measuring function duration with ftrace. In Proceedings of the Linux Symposium; 2009.

[3] L. Dozio and P. Mantegazza. Linux real time application interface (rtai) in low cost high performance motion control. Motion Control 2003; 2003. Milano; Italy.

[4] S. Graham; P. Kessler; and M. McKusick. gprof: A call graph execution profiler. In Proceedings of SIGPLAN ´ S82 Symposium on Compiler Construction; volume 17; number 6; pages 120–126; June 1982. SIGPLAN Notices.

[5] S. Graham; P. Kessler; and M. McKusick. An execution profiler for modular programs. In Software - Practice and Experience; volume 13; pages 671–685; 1991.

[6] M. Gräber; K. Kosowski; C. Richter; and W. Tegethoff. Modeling of heat pumps with an object-oriented model library for thermodynamic systems. In 6th Vienna International Conference on Mathematical Modelling; Vienna; 2009. ISBN 978-3-901608-35-3.

[7] K. Hoffmann; F. Heßeler; and D. Abel. Rapid control prototyping with dymola and matlab for a model predictive control for the air path of a boosted diesel engine. In ECOSM - Rencontres Scientifiques de l’IFP; pages 25–33. Institut Francais du Petrole; 2006.

[8] Brian Kernighan and Rob Pike. Finding performance improvements: Excerpt from the practice of programming. IEEE Software; 16(2):61–65; 1999.

[9] Cosateq GmbH & Co. KG. Scale-RT; 2010.

[10] Christoph C. Richter. Proposal of New Object-Oriented Equation-Based Model Libraries for Thermodynamic Systems. PhD thesis; Technische Universität Carolo- Wilhelmina zu Braunschweig; 2008.

[11] S. Shende; A. D. Malony; J. Cuny; K. Lindlan; P. Beckman; and S. Karmesin. Portable profiling and tracing for parallel scientific applications using c++. In Proceedings of the SIGMETRICS Symposium on Parallel and Distributed Tools; pages 134–145. ACM; August 1998.

[12] Sameer Shende. Profiling and tracing in linux. In Proceedings of Extreme Linux Workshop; 1999.

[13] Karl Johan Åström; Hilding Elmqvist; and Sven Erik Mattsson. Evolution of continuous-time modeling and simulation. In The 12th European Simulation Multiconference; Manchester; UK; June 16 - 19 1998.

[14] Inc. The Mathworks. Execution and real-time implementation of a temporary overrun scheduler; 2006.

[15] VDI. Thermodynamische Stoffwerte von feuchter Luft und Verbrennungsgasen. VDI-Handbuch Energietechnik; 2000. VDI Richtlinie 4670.

Citations in Crossref